Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Feb 1996 14:59:09 +0000 ()
From:      Daniel Leeds <cosmos@sponsor.octet.com>
To:        hackers@freebsd.org
Subject:   login code 
Message-ID:  <199602011459.OAA00435@sponsor.octet.com>

index | next in thread | raw e-mail

hey,

this is not for freebsd per se, but i was looking at the freebsd login.c 
code as a ref, but got a little confused.

basically, im wondering how login executes the shell, ie if i made a 
simple c program is it basically just an exec of whatever shell it reads 
in from /etc/passwd?

im basically learning how to code c here, and without all the logging and 
kerberos of the standard login.c, would a basic login.c (not to be used 
of course) be something like

if [certain user id]  (like root)
	do (setuid 0)
	   execute login shell
else
	do (setuid users_id)
	    execute login shell

??

very crude and simple, but im trying to follow the logic and reconstruct 
a simple program similar to that.  i wanna know if thats the right step 
to thinking or if im wrong first tho.

thanks


-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Daniel Leeds							Unix Admin
 Octet Media							Beatnik	
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199602011459.OAA00435>