Re: [PATCH] make automounter runnable in foreground and add stderr logging

From: Denis Vlasenko
Date: Sat Oct 09 2004 - 14:47:09 EST


> > > PS: is there a reason why automount does this?
> > >
> > > /* include/config.h. Generated by configure. */
> > > #define PATH_MOUNT "/usr/bin/mount"
> > > #define PATH_UMOUNT "/usr/bin/umount"
> > > #define PATH_E2FSCK "/usr/bin/fsck.ext2"
> > > #define PATH_E3FSCK "/usr/bin/fsck.ext3"
> > >
> > > We have $PATH for ages...
> >
> > Yes, and sometimes you specifically want to make sure you pick up the
> > right official binary, and not some other one that happens to be in $PATH.
> > If somebody manages to get automount launched with an insecure $PATH, you
> > could end up invoking a trojaned mount command (remember why "." in $PATH
> > is a security issue....)
>
> And that would be the point of using configure to find this path info.
> rather than using $PATH.

I copied automount binary to another box, which has mount in /bin while old
one had mount also in /usr/bin (and automount had /usr/bin/mount hardcoded),
I was puzzled how come it does not find mount?! I heeded to to do weird things
to compile in correct paths.

Can we stick to standard method of using $PATH? Please, pretty please.

> if (geteuid() != 0) {
> fprintf(stderr, "%s: This program must be run by root\n", program);
> exit(1);
> }
>
> If root starts automount with bogus $PATH, well, he gets what he deserves.
--
vda

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/