Re: [PATCH] root-uid: new module

2012-06-27 Thread Charles Wilson
On 6/27/2012 9:58 AM, Charles Wilson wrote: > Those three files are under slightly > different licenses, but are MIT/X-ish. Oops, I should have scrolled down farther. Looks like winpriv.c was further modified by Jari Aalto, and actually sports a GPLv2+ license (and re-reading the license of the co

Re: [PATCH] root-uid: new module

2012-06-27 Thread Charles Wilson
On 6/26/2012 8:18 PM, Eric Blake wrote: > Broadening the question, does the cygwin community have advice on the > best implementation of a function that returns true if the argument is a > uid with full privileges (for example, if the uid is a member of the > Administrator group, and can therefore

Re: [PATCH] root-uid: new module

2012-06-27 Thread Paul Eggert
On 06/27/2012 12:48 AM, Corinna Vinschen wrote: > I guess, the most platform-independent approach would be to encapsulate > the whole problem into a function requesting a specific capability along > the lines of the POSIX 1.e definitions, Some Gnulib code (e.g., unlinkdir.c) relies on the Solaris-

Re: [PATCH] root-uid: new module

2012-06-27 Thread Corinna Vinschen
On Jun 26 18:18, Eric Blake wrote: > [adding cygwin] > > On 06/26/2012 06:12 PM, Paul Eggert wrote: > > On 06/26/2012 05:01 PM, Eric Blake wrote: > >> Rather than forcing comparison to a single value, would it be better to > >> have a function is_privileged_uid(euid)? Do you really need this func

Re: [PATCH] root-uid: new module

2012-06-26 Thread Eric Blake
[adding cygwin] On 06/26/2012 06:12 PM, Paul Eggert wrote: > On 06/26/2012 05:01 PM, Eric Blake wrote: >> Rather than forcing comparison to a single value, would it be better to >> have a function is_privileged_uid(euid)? > > Yes, that sounds better. I don't use Cygwin, though, so > I'm not qual

Re: [PATCH] root-uid: new module

2012-06-26 Thread Paul Eggert
On 06/26/2012 05:01 PM, Eric Blake wrote: > Rather than forcing comparison to a single value, would it be better to > have a function is_privileged_uid(euid)? Yes, that sounds better. I don't use Cygwin, though, so I'm not qualified to write that.

Re: [PATCH] root-uid: new module

2012-06-26 Thread Eric Blake
On 06/26/2012 05:49 PM, Paul Eggert wrote: >/* The super-user can read and write any file, and execute any file > that anyone can execute. */ > - if (euid == 0 && ((mode & X_OK) == 0 > -|| (stats.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH > + if (euid == ROOT_UID >

[PATCH] root-uid: new module

2012-06-26 Thread Paul Eggert
--- ChangeLog | 20 lib/euidaccess.c |7 +-- lib/pt_chown.c|6 -- lib/root-uid.h| 30 ++ lib/unlinkdir.c |3 ++- lib/write-any-file.c |3 ++- m4/mknod.m4