summaryrefslogtreecommitdiffstats
path: root/abs/core/shadow/shadow-UID_GID.patch
blob: 759b73e519d9e3006a7edbab6e0ba2750482923b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- shadow-4.0.18.1.orig/src/useradd.c	2006-08-25 11:57:00.202525241 +0200
+++ shadow-4.0.18.1/src/useradd.c	2006-08-25 11:57:26.106735752 +0200
@@ -206,11 +206,8 @@
 	char *errptr;
 
 	gid = strtol (grname, &errptr, 10);
-	if (*errptr || errno == ERANGE || gid < 0) {
-		fprintf (stderr,
-			 _("%s: invalid numeric argument '%s'\n"), Prog, grname);
-		exit (E_BAD_ARG);
-	}
+	if (*grname != '\0' && *errptr == '\0' && errno != ERANGE && gid >= 0)
+		return getgrgid (gid);
 	return getgrnam (grname);
 }
 
Index: shadow-4.0.18.1/src/usermod.c
===================================================================
--- shadow-4.0.18.1.orig/src/usermod.c	2006-08-25 11:57:18.938677504 +0200
+++ shadow-4.0.18.1/src/usermod.c	2006-08-25 11:57:26.114735817 +0200
@@ -167,11 +167,8 @@
 	char *errptr;
 
 	val = strtol (grname, &errptr, 10);
-	if (*errptr || errno == ERANGE || val < 0) {
-		fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog,
-			 grname);
-		exit (E_BAD_ARG);
-	}
+	if (*grname != '\0' && *errptr == '\0' && errno != ERANGE && val >= 0)
+		return getgrgid (val);
 	return getgrnam (grname);
 }