[Pkg-shadow-commits] r2433 - in upstream/trunk: . man src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sat Sep 20 20:20:21 UTC 2008


Author: nekral-guest
Date: 2008-09-20 20:20:19 +0000 (Sat, 20 Sep 2008)
New Revision: 2433

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/man/login.1.xml
   upstream/trunk/src/login.c
Log:
	* src/login.c, man/login.1.xml: the username is not an optional
	parameter of -f. Fix the getopt optstring, remove the parsing of
	username in the -f processing block, and remove unnecessary checks
	(username cannot be parsed twice anymore), better documentation of
	the synopsis.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-09-20 20:05:22 UTC (rev 2432)
+++ upstream/trunk/ChangeLog	2008-09-20 20:20:19 UTC (rev 2433)
@@ -10,6 +10,11 @@
 	sections.
 	* src/login.c: Erase the username later since it it used for the
 	fake password check (in case of empty password).
+	* src/login.c, man/login.1.xml: the username is not an optional
+	parameter of -f. Fix the getopt optstring, remove the parsing of
+	username in the -f processing block, and remove unnecessary checks
+	(username cannot be parsed twice anymore), better documentation of
+	the synopsis.
 
 2008-09-20  Nicolas François  <nicolas.francois at centraliens.net>
 

Modified: upstream/trunk/man/login.1.xml
===================================================================
--- upstream/trunk/man/login.1.xml	2008-09-20 20:05:22 UTC (rev 2432)
+++ upstream/trunk/man/login.1.xml	2008-09-20 20:20:19 UTC (rev 2433)
@@ -50,20 +50,22 @@
   <refsynopsisdiv id='synopsis'>
     <cmdsynopsis>
       <command>login</command>
-      <arg choice='opt'>-p </arg>
+      <arg choice='opt'>-p</arg>
+      <arg choice='opt'>-h <replaceable>host</replaceable></arg>
       <arg choice='opt'>
       <replaceable>username</replaceable></arg>
       <arg choice='opt' rep='repeat'> <replaceable>ENV=VAR</replaceable></arg>
     </cmdsynopsis>
     <cmdsynopsis>
       <command>login</command>
-      <arg choice='opt'>-p </arg>
+      <arg choice='opt'>-p</arg>
       <arg choice='opt'>-h <replaceable>host</replaceable></arg>
-      <arg choice='opt'>-f <replaceable>username</replaceable></arg>
+      <arg choice='plain'>-f</arg>
+      <arg choice='plain'><replaceable>username</replaceable></arg>
     </cmdsynopsis>
     <cmdsynopsis>
       <command>login</command>
-      <arg choice='opt'>-p </arg>
+      <arg choice='opt'>-p</arg>
       <arg choice='plain'>-r <replaceable>host</replaceable></arg>
     </cmdsynopsis>
   </refsynopsisdiv>
@@ -161,8 +163,13 @@
 	  <option>-f</option>
 	</term>
 	<listitem>
-	  <para>Do not perform authentication, user is preauthenticated.
+	  <para>
+	    Do not perform authentication, user is preauthenticated.
 	  </para>
+	  <para>
+	    Note: In that case, <replaceable>username</replaceable> is
+	    mandatory.
+	  </para>
 	</listitem>
       </varlistentry>
       <varlistentry>

Modified: upstream/trunk/src/login.c
===================================================================
--- upstream/trunk/src/login.c	2008-09-20 20:05:22 UTC (rev 2432)
+++ upstream/trunk/src/login.c	2008-09-20 20:20:19 UTC (rev 2433)
@@ -265,27 +265,13 @@
 	/*
 	 * Process options.
 	 */
-	while ((flag = getopt (argc, argv, "d:f::h:pr:")) != EOF) {
+	while ((flag = getopt (argc, argv, "d:fh:pr:")) != EOF) {
 		switch (flag) {
 		case 'd':
 			/* "-d device" ignored for compatibility */
 			break;
 		case 'f':
-			/*
-			 * username must be a separate token
-			 * (-f root, *not* -froot).  --marekm
-			 *
-			 * if -f has an arg, use that, else use the
-			 * normal user name passed after all options
-			 * --benc
-			 */
-			if (optarg != NULL && optarg != argv[optind - 1]) {
-				usage ();
-			}
 			fflg = true;
-			if (optarg) {
-				username = xstrdup (optarg);
-			}
 			break;
 		case 'h':
 			hflg = true;
@@ -330,10 +316,6 @@
 	 *  Get the user name.
 	 */
 	if (optind < argc) {
-		if (rflg || (fflg && (NULL != username))) {
-			usage ();
-		}
-
 		username = xstrdup (argv[optind]);
 		strzero (argv[optind]);
 		++optind;




More information about the Pkg-shadow-commits mailing list