Re: Getting peer credentials on a unix domain socket

2001-05-08 Thread Terry Lambert
Alfred Perlstein wrote: Someone had some patches for a getpeercreds() syscall, but I wasn't happy with it considering we already have the sendmsg() stuff to pass credentials along with the fact that the initial creator of a socket may be long gone before it's used to connect to something.

Re: Getting peer credentials on a unix domain socket

2001-05-08 Thread Dima Dorfman
Terry Lambert [EMAIL PROTECTED] writes: I think adding a new system call is _not_ the way to go; there are perfectly good fcntl() commands, which fail to work under FreeBSD, but work just fine under Solaris, SunOS, Linux, and most other UNIX systems (we are back to struct fileops being major

Re: Getting peer credentials on a unix domain socket

2001-05-07 Thread Mike Silbersack
On 7 May 2001, Dag-Erling Smorgrav wrote: Alfred Perlstein [EMAIL PROTECTED] writes: The silly part of it is that the socket's initial credentials might be different than the holder's credentials. That's a feature, just like you can open /dev/io as root, then drop root privs and do

Re: Getting peer credentials on a unix domain socket

2001-05-06 Thread Dag-Erling Smorgrav
Alfred Perlstein [EMAIL PROTECTED] writes: The silly part of it is that the socket's initial credentials might be different than the holder's credentials. That's a feature, just like you can open /dev/io as root, then drop root privs and do direct I/O to your heart's content even if you're no

Re: Getting peer credentials on a unix domain socket

2001-05-06 Thread Robert Watson
On 7 May 2001, Dag-Erling Smorgrav wrote: Alfred Perlstein [EMAIL PROTECTED] writes: The silly part of it is that the socket's initial credentials might be different than the holder's credentials. That's a feature, just like you can open /dev/io as root, then drop root privs and do

Getting peer credentials on a unix domain socket

2001-05-04 Thread Dima Dorfman
Is there a reliable method of obtaining the credentials (uid/gid) of a peer (SOCK_STREAM sockets only, obviously) on a unix domain socket? All the Stevens books I have suggest that there isn't, but I'm wondering if something has been developed since those books were published. Note that a

Re: Getting peer credentials on a unix domain socket

2001-05-04 Thread Alfred Perlstein
* Dima Dorfman [EMAIL PROTECTED] [010504 16:06] wrote: Is there a reliable method of obtaining the credentials (uid/gid) of a peer (SOCK_STREAM sockets only, obviously) on a unix domain socket? All the Stevens books I have suggest that there isn't, but I'm wondering if something has been

Re: Getting peer credentials on a unix domain socket

2001-05-04 Thread William E. Baxter
On Fri, May 04, 2001 at 05:07:38PM -0700, Alfred Perlstein wrote: * Dima Dorfman [EMAIL PROTECTED] [010504 16:06] wrote: Is there a reliable method of obtaining the credentials (uid/gid) of a peer (SOCK_STREAM sockets only, obviously) on a unix domain socket? All the Stevens books I have

Re: Getting peer credentials on a unix domain socket

2001-05-04 Thread Dima Dorfman
William E. Baxter [EMAIL PROTECTED] writes: On Fri, May 04, 2001 at 05:07:38PM -0700, Alfred Perlstein wrote: * Dima Dorfman [EMAIL PROTECTED] [010504 16:06] wrote: Is there a reliable method of obtaining the credentials (uid/gid) of a peer (SOCK_STREAM sockets only, obviously) on a unix

Re: Getting peer credentials on a unix domain socket

2001-05-04 Thread Alfred Perlstein
* Dima Dorfman [EMAIL PROTECTED] [010504 20:22] wrote: Just to expand on that a little more (for others on the list), consider crontab(1). It's setuid root right now. Obviously that's not good. One way of getting rid of that setuid bit is to have cron(8) (or another daemon) listen on a

Re: Getting peer credentials on a unix domain socket

2001-05-04 Thread Dima Dorfman
Alfred Perlstein [EMAIL PROTECTED] writes: * Dima Dorfman [EMAIL PROTECTED] [010504 20:22] wrote: Just to expand on that a little more (for others on the list), consider crontab(1). It's setuid root right now. Obviously that's not good. One way of getting rid of that setuid bit is to

Re: Getting peer credentials on a unix domain socket

2001-05-04 Thread William E. Baxter
On Fri, May 04, 2001 at 08:34:57PM -0700, Alfred Perlstein wrote: The silly part of it is that the socket's initial credentials might be different than the holder's credentials. A user calls connect() with one set of credentials, subsequently changes credentials, and writes to the socket.