Alistair Riddoch wrote:

> On Wed, Feb 09, 2000 at 09:11:08PM +0100, Mario Frasca wrote:
>
> > By the way, I tried to modify exec.c in order to have it look at the suid
> > bit (I don't want to become root to run mount), but my modifications didn't
> > cause any change.  There is surely  a mistake, but where? :-[
> >
> > here is the diff.
>
> [...] I think the correct behavoir is to set the euid and egid
> fields of the task structure.

YES, I missed that!  I tried again with your e-change and it works: I can now
mount without the need for the root's password.
Maybe I should add something like refusing to umount something which was mounted
by an other user, but that seems too sofisticated to me.  we can set the suid
flag to those programs which do need it.

the new diff is very short:
cvs diff: Diffing fs
Index: fs/exec.c
===================================================================
RCS file: /usr/local/cvsroot/elks/fs/exec.c,v
retrieving revision 1.2
diff -U3 -b -B -r1.2 exec.c
--- fs/exec.c   2000/02/13 13:44:21     1.2
+++ fs/exec.c   2000/02/13 13:44:29
@@ -339,9 +339,9 @@
   */

   if(suidfile)
-        current->uid = effuid;
+        current->euid = effuid;
   if(sgidfile)
-        current->gid = effgid;
+        current->egid = effgid;
  /* MFr-2000-01-28 END
   */
        retval = 0;

Reply via email to