Author: robert
Date: 2007-11-28 01:56:31 -0700 (Wed, 28 Nov 2007)
New Revision: 1879

Added:
   trunk/shadow/shadow-4.0.18.2-useradd_fix-2.patch
Log:
Added shadow-4.0.18.2-useradd_fix-2.patch

Added: trunk/shadow/shadow-4.0.18.2-useradd_fix-2.patch
===================================================================
--- trunk/shadow/shadow-4.0.18.2-useradd_fix-2.patch                            
(rev 0)
+++ trunk/shadow/shadow-4.0.18.2-useradd_fix-2.patch    2007-11-28 08:56:31 UTC 
(rev 1879)
@@ -0,0 +1,49 @@
+Submitted By: Jim Gifford (patches at jg555 dot com)
+Date: 2007-10-29
+Initial Package Version: 4.0.18.2
+Origin: Jim Gifford
+Upstream Status: Submitted
+Description: Fixes usersadd issue
+ 
+diff -Naur shadow-4.0.18.2.orig/src/useradd.c shadow-4.0.18.2/src/useradd.c
+--- shadow-4.0.18.2.orig/src/useradd.c 2007-10-07 07:36:51.000000000 -0700
++++ shadow-4.0.18.2/src/useradd.c      2007-10-30 02:32:55.000000000 -0700
+@@ -203,6 +203,10 @@
+       long gid;
+       char *errptr;
+ 
++      struct group* grp = getgrnam (grname);
++      if (grp)
++              return grp;
++
+       gid = strtol (grname, &errptr, 10);
+       if (*errptr || errno == ERANGE || gid < 0) {
+               fprintf (stderr,
+@@ -210,7 +214,7 @@
+                        grname);
+               exit (E_BAD_ARG);
+       }
+-      return getgrnam (grname);
++      return getgrgid (gid);
+ }
+ 
+ static long get_number (const char *numstr)
+diff -Naur shadow-4.0.18.2.orig/src/usermod.c shadow-4.0.18.2/src/usermod.c
+--- shadow-4.0.18.2.orig/src/usermod.c 2007-10-27 06:01:19.000000000 -0700
++++ shadow-4.0.18.2/src/usermod.c      2007-10-30 02:32:14.000000000 -0700
+@@ -165,10 +165,14 @@
+       long val;
+       char *errptr;
+ 
++      struct group* grp = getgrnam (grname);
++      if (grp)
++              return grp;
++
+       val = strtol (grname, &errptr, 10);
+       if (*grname != '\0' && *errptr == '\0' && errno != ERANGE && val >= 0)
+               return getgrgid (val);
+-      return getgrnam (grname);
++      return getgrgid (val);
+ }
+ 
+ /*

-- 
http://linuxfromscratch.org/mailman/listinfo/patches
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to