Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 May 2002 16:02:51 -0700 (PDT)
From:      Adam Migus <amigus@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 10858 for review
Message-ID:  <200205052302.g45N2pK18837@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=10858

Change 10858 by amigus@amigus_vmganyopa on 2002/05/05 16:02:07

	getty now sets a ttylabel whether "me" exists in ~/.login_conf or
	not.  The label is root's label in /etc/login.conf.  The man page
	says that login_getuserclass() defaults to root or default
	depending on who calls it.  The source code says not to default
	if the user calls login_getuserclass().  As such this is more of
	a workaround than a fix.

Affected files ...

... //depot/projects/trustedbsd/mac/libexec/getty/main.c#6 edit

Differences ...

==== //depot/projects/trustedbsd/mac/libexec/getty/main.c#6 (text+ko) ====

@@ -237,6 +237,20 @@
 			login_cap_t *lc;
 
 			lc = login_getuserclass(rootpw);
+			/*
+			 * login_getuserclass() searches for "me" 
+			 * (LOGIN_MECLASS) in ~/.login_conf.  If it fails,
+			 * it doesn't fallback to "root" (LOGIN_ROOTDEFCLASS)
+			 * or "default" (LOGIN_DEFCLASS).  Thus it will return
+			 * NULL if root doesn't have a "me" entry defined in 
+			 * ~/.login_conf.
+			 * login_getpwclass() will default, so if
+			 * login_getuserclass() fails here we call it to
+			 * ensure that a label gets set on the tty.
+			 * /
+			if(lc == NULL)
+				lc = login_getpwclass(rootpw);
+
 			if (lc != NULL) {
 				char *rootmacstr;
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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