Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

gnuserv-question

1 view
Skip to first unread message

Jens Schneider

unread,
Aug 20, 1999, 3:00:00 AM8/20/99
to
Hi everybody,

I just installed a linux SuSE-6.2 distribution with xemacs-20.4.

Starting gnuserv with M-x gnuserv-start doesn't work for a normal

user, only for root. It's the same with xemacs-21.1.

If I start <xemacs-directory>/i686-pc-linux/gnuserv from the

commandline, I get the message

/usr/local/lib/xemacs-21.1.6/i686-pc-linux/gnuserv: Permission denied
/usr/local/lib/xemacs-21.1.6/i686-pc-linux/gnuserv: unable to bind socket

My question now is: is it possible that either unix or internet

domain sockets are not available to normal users due to some

wrong configuration? I have figured out, that root creates a directory

/tmp/gsrvdirNN during the gnuserv-startup, normal users don't even do

that.

Any answer would be appreciated,

thanks

Jens

--
-------------------------------------------
| |
| Jens Schneider |
| Max-Planck-Institut fuer Quantenoptik |
| Hans-Kopfermann-Str. 1 |
| 85748 Garching |
| Tel.: +49 (0) 89 / 3 29 05 - 733 (MPQ) |
| 2394 - 4557 (Uni) |
| E-Mail: jens.sc...@mpq.mpg.de |
| |
-------------------------------------------


Jan Vroonhof

unread,
Aug 20, 1999, 3:00:00 AM8/20/99
to
Jens Schneider <jens.sc...@mpq.mpg.de> writes:

> /usr/local/lib/xemacs-21.1.6/i686-pc-linux/gnuserv: Permission denied
> /usr/local/lib/xemacs-21.1.6/i686-pc-linux/gnuserv: unable to bind socket

Can you try running gnuserv under strace, so we can see what is going
wrong? Do you have fairly high uid numbers for normal users?

Jan

Jens Schneider

unread,
Aug 23, 1999, 3:00:00 AM8/23/99
to
Indeed, we have very high userids, mine is 44376 (due to the silly uids
in our NFS-environment).
I ran strace on gnuserv, I think the most important line is the bind
command at the end :

(... lots of lines deleted here)
open("/lib/libnss_db.so.2", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=202226, ...}) = 0
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\23"...,
4096) = 4096
mmap(NULL, 22288, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40303000
mprotect(0x40308000, 1808, PROT_NONE) = 0
mmap(0x40308000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x4000) = 0x40308000
close(3) = 0
munmap(0x40015000, 49480) = 0
open("/var/db/services.db", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/etc/services", O_RDONLY) = 3
fcntl(3, F_GETFD) = 0
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=7671, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x40015000
read(3, "#\n# Network services, Internet s"..., 4096) = 4096
read(3, " emergency broadcasts\nuucp\t\t540/"..., 4096) = 3575
read(3, "", 4096) = 0
close(3) = 0
munmap(0x40015000, 4096) = 0
getuid() = 44376
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
bind(3, {sin_family=AF_INET, sin_port=htons(330),
sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EACCES (Permission denied)
write(2, "/usr/local/lib/xemacs-21.1.6/i68"...,
70/usr/local/lib/xemacs-21.1.6/i686-pc-linux/gnuserv: Permission denied
) = 70
write(2, "/usr/local/lib/xemacs-21.1.6/i68"...,
74/usr/local/lib/xemacs-21.1.6/i686-pc-linux/gnuserv: unable to bind
socket
) = 74
_exit(1)

Thanks for your help,

Jens Schneider

unread,
Aug 23, 1999, 3:00:00 AM8/23/99
to
Hi,

it's me again. I tried gnuserv with a test user (userid = 500) and
gnuserv-start worked perfectly well!!!!
So, large uids don't work small ones do. Could somebody explain this.
Can the behaviour be patched or is this a feature?

Jan Vroonhof

unread,
Aug 23, 1999, 3:00:00 AM8/23/99
to
Jens Schneider <jens.sc...@mpq.mpg.de> writes:

> Indeed, we have very high userids, mine is 44376 (due to the silly uids
> in our NFS-environment).
> I ran strace on gnuserv, I think the most important line is the bind
> command at the end :

I think so too. That is why I asked the question:

The default port used is

21490+uid

> bind(3, {sin_family=AF_INET, sin_port=htons(330),

21490+44376 == 330 (mod 2^16).

I really don't know a good solution for this. You need to set the port
explicitly, by setting the GNU_PORT environment variable.

Jan

Jens Schneider

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to

Jan Vroonhof <vroo...@frege.math.ethz.ch> writes:


> > bind(3, {sin_family=AF_INET, sin_port=htons(330),
>
> 21490+44376 == 330 (mod 2^16).
>
> I really don't know a good solution for this. You need to set the port
> explicitly, by setting the GNU_PORT environment variable.
>
> Jan

Hi Jan,

thanks for your help. I first considered to change all the UIDs to low
numbers (it a new machine with only a few local users) and to map the
local UIDs to the ones in the NFS directories via the nfsd. Hm, was a
nice idea, but the NFS server is an AIX machine where UID-mapping
seems not to be possible (anyway the sysad there is no very
cooperative).
The second idea that we use now is simply setting GNU_PORT in
/etc/profile to reasonable values by something like
GNU_PORT=$UID-43000+21490 (if $UID > 44000). This leaves space for the
usual low number UIDs (like e.g. root).

Thanks again,

Jens


Paul L. Lussier

unread,
Sep 3, 1999, 3:00:00 AM9/3/99
to
Jens Schneider <jens.sc...@mpq.mpg.de> writes:

> Hi,
>
> it's me again. I tried gnuserv with a test user (userid = 500) and
> gnuserv-start worked perfectly well!!!!
> So, large uids don't work small ones do. Could somebody explain this.
> Can the behaviour be patched or is this a feature?

I seem to have the same problem, or at least I think I do, since my
uid is 24400. However, I tried to get this working under a test UID of 500,
and it still didn't work. The error I'm getting is:

$ gnuclient trash/foo
gnuclient: No such file or directory
gnuclient: unable to connect to local

This is with Xemacs-20.3 on Sun Solaris 2.5.1.

Does anyone have any ideas? Interestingly everything works just fine
with GNU emacs-20.4 and the old server-start/emacsclient pair (why did
they have to fix what wasn't broken :(

TIA for any help :)

--
Seeya,
Paul

Jan Vroonhof

unread,
Sep 4, 1999, 3:00:00 AM9/4/99
to
plus...@baynetworks.com (Paul L. Lussier) writes:

> I seem to have the same problem, or at least I think I do, since my
> uid is 24400. However, I tried to get this working under a test UID of 500,
> and it still didn't work. The error I'm getting is:
>
> $ gnuclient trash/foo
> gnuclient: No such file or directory
> gnuclient: unable to connect to local
>
> This is with Xemacs-20.3 on Sun Solaris 2.5.1.

Is the server (the gnuserv program)_really_ running (make sure it
didn't exit because of some error)?

Try running gnuclient under truss to see where the problem is.

> Does anyone have any ideas? Interestingly everything works just fine
> with GNU emacs-20.4 and the old server-start/emacsclient pair (why did
> they have to fix what wasn't broken :(

Because it was (and in some ways still is).

Jan

0 new messages