public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John M Collins <jmc@xisl.com>
To: linux-kernel@vger.kernel.org
Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>
Subject: Re: Fchown on unix domain sockets?
Date: Mon, 1 Nov 2004 15:43:04 +0000	[thread overview]
Message-ID: <200411011543.04881.jmc@xisl.com> (raw)
In-Reply-To: <Pine.LNX.4.53.0411011546050.30106@yvahk01.tjqt.qr>

On Monday 01 Nov 2004 14:49, you wrote:
> >> As some manpage might say, the socket thing you see in "ls -l" is just a
> >> reference thing. When you connect to it, ls -l /proc/pidofprogram/fd/
> >> does not show the path, but [socket:xxxx] which shows that the
> >> filesystem object is not used anymore.
> >
> >When I connect to it is the point. I want to set the permissions etc so
> > that only the progams that are supposed to be talking to it talk to it.
>
> How about setting the permissions beforehand?

We're talking about fchown not fchmod. Obviously you can set "umask" so that 
the appropriate permissions are on or off.

As I've said, I don't mind the answer "no" but I think it's wrong to silently 
do nothing.

What I'm trying to do is have a server process, which for various reasons has 
to run as root, create a socket for clients which belong to same package and 
are all set-user to "packageusername" to send requests and receive replies. I 
don't want all and sundry connecting and sending lumps of data and possibly 
making the server process do inappropriate things.

I don't have a problem - the server process creates the socket and then uses 
"chown" on the path name before clients start to get at it. Or I can invoke 
"seteuid" before creating the socket.

I just thought it would be worth drawing attention to the fact that "fchown" 
silently does nothing and the whole thing is not documented anywhere (even on 
OSes which give an error code). It just seemed a gap worth plugging.

-- 
John Collins Xi Software Ltd www.xisl.com

  reply	other threads:[~2004-11-01 15:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-31 22:55 Fchown on unix domain sockets? John M Collins
2004-11-01 14:20 ` Jan Engelhardt
2004-11-01 14:41   ` John M Collins
2004-11-01 14:49     ` Jan Engelhardt
2004-11-01 15:43       ` John M Collins [this message]
2004-11-01 17:27         ` Jan Engelhardt
2004-11-01 22:27       ` David Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200411011543.04881.jmc@xisl.com \
    --to=jmc@xisl.com \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox