Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S267327AbUJITqO (ORCPT ); Sat, 9 Oct 2004 15:46:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S267333AbUJITqO (ORCPT ); Sat, 9 Oct 2004 15:46:14 -0400 Received: from 168.imtp.Ilyichevsk.Odessa.UA ([195.66.192.168]:50180 "HELO port.imtp.ilyichevsk.odessa.ua") by vger.kernel.org with SMTP id S267327AbUJITqM (ORCPT ); Sat, 9 Oct 2004 15:46:12 -0400 From: Denis Vlasenko To: raven@themaw.net, Valdis.Kletnieks@vt.edu Subject: Re: [PATCH] make automounter runnable in foreground and add stderr logging Date: Sat, 9 Oct 2004 22:46:01 +0300 User-Agent: KMail/1.5.4 Cc: LKML References: <200410072049.18059.vda@port.imtp.ilyichevsk.odessa.ua> <200410071817.i97IHnPZ017247@turing-police.cc.vt.edu> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410092246.01429.vda@port.imtp.ilyichevsk.odessa.ua> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1606 Lines: 40 > > > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/