summaryrefslogtreecommitdiff
blob: 8fe14329f1c1f4145e11ab7eeb743501ac8a76eb (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
35
36
37
38
39
40
41
42
--- shadow-4.0.18.1.orig/src/useradd.c	2006-07-28 19:42:48.000000000 +0200
+++ shadow-4.0.18.1/src/useradd.c	2006-08-04 09:24:34.000000000 +0200
@@ -203,13 +203,17 @@
 	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,
 			 _("%s: invalid numeric argument '%s'\n"), Prog, grname);
 		exit (E_BAD_ARG);
 	}
-	return getgrnam (grname);
+	return getgrgid (gid);
 }
 
 static long get_number (const char *numstr)
--- shadow-4.0.18.1.orig/src/usermod.c	2006-07-28 19:42:48.000000000 +0200
+++ shadow-4.0.18.1/src/usermod.c	2006-08-04 09:24:21.000000000 +0200
@@ -165,13 +165,17 @@
 	long val;
 	char *errptr;
 
+	struct group* grp = getgrnam (grname);
+	if (grp)
+		return grp;
+
 	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);
 	}
-	return getgrnam (grname);
+	return getgrgid (val);
 }
 
 /*