Alistair Riddoch wrote:

> On Fri, Jan 14, 2000 at 08:53:45PM +0100, Mario Frasca wrote:
> > I'm working on a version of mount/umount that makes
> > use of /etc/fstab and /etc/mtab.  I already have some sort of prototypes, but I do
> > need a few more hours.
> >
> mtab functionality is cool, but may not be required on all systems. Do you
> think you could make it optional?

Yes, I think so.
I've done the following (but not yet tested on Linux/Elks): if you
compile (u)mount with -DMINIMALMOUNT, then you get more or less the same
(u)mount as you have now.
otherwise, once compiled with mtab support, you can still supply the
option -n and (u)mount will more or less ignore the content of the mtab
file.
After some positive checks I'll post the sources.

one more thing: I still didn't make my own comb image, so I can't do
much useful on the kernel, but I was wondering: could you have a look at
the following modifications in exec.c.  they are intended for having the
suid/guid bits used.  they look too simple to be good!

ciao,
Mario.


@@ -104,6 +106,13 @@
        tregs = &current->t_regs;
        tregs->ds=get_ds();
        filp->f_pos=0; /* FIXME - should call lseek */
+ /* can I trust the following fields?
+  * declaration of following variables is missing
+       suidfile = inode->i_mode & S_ISUID;
+       sgidfile = inode->i_mode & S_ISGID;
+       effuid = inode->i_uid;
+       effgid = inode->i_gid;
+  */
        result=filp->f_op->read(inode, &file, &mh, sizeof(mh));
        tregs->ds=ds;
 

@@ -320,7 +314,17 @@
        current->t_inode=inode;
        arch_setup_kernel_stack(current);
 
+ /* this could be a good place to set the effective user identifier
+  * in case the suid bit of the executable had been set
+
+  if(suidfile)
+    current->uid = effuid;
+  if(sgidfile)
+    current->gid = effgid;
+  */
+
        retval = 0;
+
        wake_up(&current->p_parent->child_wait);
 
        /*

Reply via email to