[Pkg-shadow-commits] r405 - in branches/experimental/debian: . patches

Nicolas FRANCOIS nekral-guest at costa.debian.org
Sun Jul 24 21:40:45 UTC 2005


Author: nekral-guest
Date: 2005-07-24 21:40:44 +0000 (Sun, 24 Jul 2005)
New Revision: 405

Added:
   branches/experimental/debian/patches/362_warning_messages
Modified:
   branches/experimental/debian/login.defs
Log:
Temporarily fix warnings.

A better patch should be done (Debian uses some login.defs variables that
upstream doesn't (not all tools are compiled with PAM)).
We should check all "getdef*" in the compiled versions of the shadow tools.
(Note: we can now compile with debugging symbols;)


Modified: branches/experimental/debian/login.defs
===================================================================
--- branches/experimental/debian/login.defs	2005-07-24 20:46:00 UTC (rev 404)
+++ branches/experimental/debian/login.defs	2005-07-24 21:40:44 UTC (rev 405)
@@ -1,7 +1,7 @@
 #
 # /etc/login.defs - Configuration control definitions for the login package.
 #
-# Three items must be defined:  MAIL_DIR, ENV_SUPATH, and ENV_PATH.
+# This item must be defined:  MAIL_DIR.
 # If unspecified, some arbitrary (and possibly incorrect) value will
 # be assumed.  All other items are optional - if not specified then
 # the described action or option will be inhibited.
@@ -66,11 +66,6 @@
 LOG_OK_LOGINS		no
 
 #
-# Enable setting of ulimit, umask, and niceness from passwd gecos field.
-#
-QUOTAS_ENAB		yes
-
-#
 # Enable "syslog" logging of su activity - in addition to sulog file logging.
 # SYSLOG_SG_ENAB does the same for newgrp and sg.
 #
@@ -112,36 +107,6 @@
 #HUSHLOGIN_FILE	/etc/hushlogins
 
 #
-# If defined, the presence of this value in an /etc/passwd "shell" field will
-# disable logins for that user, although "su" will still be allowed.
-#
-# XXX this does not seem to be implemented yet...  --marekm
-# no, it was implemented but I ripped it out ;-) -- jfh
-NOLOGIN_STR	NOLOGIN
-
-#
-# If defined, either a TZ environment parameter spec or the
-# fully-rooted pathname of a file containing such a spec.
-#
-#ENV_TZ		TZ=CST6CDT
-#ENV_TZ		/etc/tzname
-
-#
-# If defined, an HZ environment parameter spec.
-#
-# for Linux/x86
-ENV_HZ		HZ=100
-# For Linux/Alpha...
-#ENV_HZ		HZ=1024
-
-#
-# *REQUIRED*  The default PATH settings, for superuser and normal users.
-#
-# (they are minimal, add the rest in the shell startup files)
-ENV_SUPATH	PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
-ENV_PATH	PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
-
-#
 # Terminal permissions
 #
 #	TTYGROUP	Login tty will be assigned this group ownership.
@@ -240,11 +205,6 @@
 LOGIN_TIMEOUT		60
 
 #
-# Require password before chfn/chsh can make any changes.
-#
-CHFN_AUTH		yes
-
-#
 # Which fields may be changed by regular users using chfn - use
 # any combination of letters "frwh" (full name, room number, work
 # phone, home phone).  If not defined, no changes are allowed.

Added: branches/experimental/debian/patches/362_warning_messages
===================================================================
--- branches/experimental/debian/patches/362_warning_messages	2005-07-24 20:46:00 UTC (rev 404)
+++ branches/experimental/debian/patches/362_warning_messages	2005-07-24 21:40:44 UTC (rev 405)
@@ -0,0 +1,179 @@
+Goal: remove warnings when the codetries to access unsupported variables
+      in login.defs, or when login.defs contains unsupported variables.
+
+Status wrt to upstream: applied for 4.0.11
+
+Note: upstream and Debian login.defs and lib/getdef.c will have to be
+      different if some utilities are not built with their PAM support.
+
+Index: shadow-4.0.10/lib/getdef.c
+===================================================================
+--- shadow-4.0.10.orig/lib/getdef.c	2005-07-15 13:16:03.000000000 +0300
++++ shadow-4.0.10/lib/getdef.c	2005-07-15 13:17:00.000000000 +0300
+@@ -52,6 +52,7 @@
+ 	{"FAIL_DELAY", NULL},
+ 	{"FAILLOG_ENAB", NULL},
+ 	{"FTMP_FILE", NULL},
++	{"MAIL_DIR", NULL},
+ 	{"PASS_MAX_DAYS", NULL},
+ 	{"PASS_MIN_DAYS", NULL},
+ 	{"PASS_WARN_AGE", NULL},
+@@ -72,7 +73,6 @@
+ 	{"LASTLOG_ENAB", NULL},
+ 	{"LOGIN_STRING", NULL},
+ 	{"MAIL_CHECK_ENAB", NULL},
+-	{"MAIL_DIR", NULL},
+ 	{"MAIL_FILE", NULL},
+ 	{"MD5_CRYPT_ENAB", NULL},
+ 	{"MOTD_FILE", NULL},
+Index: shadow-4.0.10/libmisc/setupenv.c
+===================================================================
+--- shadow-4.0.10.orig/libmisc/setupenv.c	2005-07-15 13:16:03.000000000 +0300
++++ shadow-4.0.10/libmisc/setupenv.c	2005-07-15 13:17:00.000000000 +0300
+@@ -235,10 +235,20 @@
+ 	addenv ("SHELL", info->pw_shell);
+ 
+ 	/*
++	 * Export the user name.  For BSD derived systems, it's "USER", for
++	 * all others it's "LOGNAME".  We set both of them.
++	 */
++
++	addenv ("USER", info->pw_name);
++	addenv ("LOGNAME", info->pw_name);
++
++#ifndef USE_PAM
++	/*
+ 	 * Create the PATH environmental variable and export it.
+ 	 */
+ 
+ 	cp = getdef_str ((info->pw_uid == 0) ? "ENV_SUPATH" : "ENV_PATH");
++
+ 	if (!cp) {
+ 		/* not specified, use a minimal default */
+ 		addenv ("PATH=/bin:/usr/bin", NULL);
+@@ -251,14 +261,6 @@
+ 	}
+ 
+ 	/*
+-	 * Export the user name.  For BSD derived systems, it's "USER", for
+-	 * all others it's "LOGNAME".  We set both of them.
+-	 */
+-
+-	addenv ("USER", info->pw_name);
+-	addenv ("LOGNAME", info->pw_name);
+-
+-	/*
+ 	 * MAILDIR environment variable for Qmail
+ 	 */
+ 	if ((cp = getdef_str ("QMAIL_DIR")))
+@@ -281,11 +283,10 @@
+ #endif
+ 	}
+ 
+-#ifndef USE_PAM
+ 	/*
+ 	 * Read environment from optional config file.  --marekm
+ 	 */
+ 	if ((envf = getdef_str ("ENVIRON_FILE")))
+ 		read_env_file (envf);
+-#endif
++#endif				/* ! USE_PAM */
+ }
+Index: shadow-4.0.10/src/login.c
+===================================================================
+--- shadow-4.0.10.orig/src/login.c	2005-07-15 13:16:03.000000000 +0300
++++ shadow-4.0.10/src/login.c	2005-07-15 13:17:00.000000000 +0300
+@@ -279,9 +279,11 @@
+ 
+ 	if ((tmp = getenv ("TZ"))) {
+ 		addenv ("TZ", tmp);
+-	} else if ((cp = getdef_str ("ENV_TZ")))
++	}
++#ifndef USE_PAM
++		else if ((cp = getdef_str ("ENV_TZ")))
+ 		addenv (*cp == '/' ? tz (cp) : cp, NULL);
+-
++#endif /* !USE_PAM */
+ 	/* 
+ 	 * Add the clock frequency so that profiling commands work
+ 	 * correctly.
+@@ -289,8 +291,11 @@
+ 
+ 	if ((tmp = getenv ("HZ"))) {
+ 		addenv ("HZ", tmp);
+-	} else if ((cp = getdef_str ("ENV_HZ")))
++	}
++#ifndef USE_PAM
++		else if ((cp = getdef_str ("ENV_HZ")))
+ 		addenv (cp, NULL);
++#endif
+ }
+ 
+ 
+@@ -349,8 +354,7 @@
+ 	int retcode;
+ 	pid_t child;
+ 	char *pam_user;
+-#endif				/* USE_PAM */
+-#ifndef USE_PAM
++#else
+ 	struct spwd *spwd = NULL;
+ #endif
+ 	/*
+@@ -505,6 +509,7 @@
+ 
+ 		setup_tty ();
+ 
++#ifndef USE_PAM
+ 		umask (getdef_num ("UMASK", 077));
+ 
+ 		{
+@@ -521,6 +526,7 @@
+ 				set_filesize_limit (limit);
+ 		}
+ 
++#endif
+ 		/*
+ 		 * The entire environment will be preserved if the -p flag
+ 		 * is used.
+Index: shadow-4.0.10/src/su.c
+===================================================================
+--- shadow-4.0.10.orig/src/su.c	2005-07-15 13:16:03.000000000 +0300
++++ shadow-4.0.10/src/su.c	2005-07-15 13:17:00.000000000 +0300
+@@ -374,6 +374,7 @@
+ 	 */
+ 
+ 	if (fakelogin && (change_environment || restricted_shell(pwent.pw_shell))) {
++#ifndef USE_PAM
+ 		if ((cp = getdef_str ("ENV_TZ")))
+ 			addenv (*cp == '/' ? tz (cp) : cp, NULL);
+ 		/*
+@@ -381,6 +382,7 @@
+ 		 */
+ 		if ((cp = getdef_str ("ENV_HZ")))
+ 			addenv (cp, NULL);	/* set the default $HZ, if one */
++#endif				/* !USE_PAM */
+ 		/*
+ 		 * The terminal type will be left alone if it is present in
+ 		 * the environment already.
+@@ -617,6 +619,7 @@
+ 
+ 	signal (SIGINT, SIG_DFL);
+ 	signal (SIGQUIT, SIG_DFL);
++#ifndef USE_PAM
+ 	cp = getdef_str ((pwent.pw_uid == 0) ? "ENV_SUPATH" : "ENV_PATH");
+ 
+ 	/* XXX very similar code duplicated in libmisc/setupenv.c */
+@@ -629,9 +632,8 @@
+ 	}
+ 
+ /* setup the environment for pam later on, else we run into auth problems */
+-#ifndef USE_PAM
+ 	if (change_environment || restricted_shell(pwent.pw_shell)) {
+ 		environ = newenvp;	/* make new environment active */
+ 	}
+-#endif
++#endif					/* !USE_PAM */
+ 
+ 	if (getenv ("IFS"))	/* don't export user IFS ... */
+ 		addenv ("IFS= \t\n", NULL);	/* ... instead, set a safe IFS */




More information about the Pkg-shadow-commits mailing list