Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Feb 1997 17:42:37 +1100 (EST)
From:      "Daniel O'Callaghan" <danny@panda.hilink.com.au>
To:        Andreas Klemm <andreas@klemm.gtn.com>, hackers@freebsd.org
Subject:   Re: should permissions of /usr/bin/login be changed to 0100 ???
Message-ID:  <Pine.BSF.3.91.970209174043.427H-100000@panda.hilink.com.au>
In-Reply-To: <Pine.BSF.3.91.970209165445.427E-100000@panda.hilink.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help


On Sun, 9 Feb 1997, Daniel O'Callaghan wrote:

> > 
> > Our /usr/bin/login program has the following permissions:
> > -r-sr-xr-x  1 root  bin  24576  6 Feb 01:28 /usr/bin/login
> > 
> > Would it be useful to change permissions to 0100 ?
> 
> Perhaps better would be to include the following code: 
> 
> if ( !geteuid() ) {
> 	fprintf(stderr, "You must be root to use 'login' on this system.\n");
> 	exit(-1);
> }
> 
> Install /bin/login as mode 555 by default, and if a sysadmin wants to, 
> s/he can make it 4555 and get the original behaviour.

Arrgh!  What a braino!  Below is *much* better.

 if ( geteuid() != 0 ) {
 	fprintf(stderr, "You must be root to use 'login' on this system.\n");
 	exit(-1);
 }

Danny



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.970209174043.427H-100000>