fix "-g" and "-G" option.
This commit is contained in:
parent
967e600d2f
commit
a786dc2b51
2 changed files with 38 additions and 1 deletions
32
shadow-4.0.18.1-gid.patch
Normal file
32
shadow-4.0.18.1-gid.patch
Normal file
|
@ -0,0 +1,32 @@
|
|||
--- shadow-4.0.18.1/src/useradd.c.gid 2006-11-04 14:09:53.000000000 +0100
|
||||
+++ shadow-4.0.18.1/src/useradd.c 2006-11-04 14:15:09.000000000 +0100
|
||||
@@ -207,11 +207,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);
|
||||
}
|
||||
|
||||
--- shadow-4.0.18.1/src/usermod.c.gid 2006-11-04 14:15:23.000000000 +0100
|
||||
+++ shadow-4.0.18.1/src/usermod.c 2006-11-04 14:16:42.000000000 +0100
|
||||
@@ -166,11 +166,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);
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
Summary: Utilities for managing accounts and shadow password files.
|
||||
Name: shadow-utils
|
||||
Version: 4.0.18.1
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
Epoch: 2
|
||||
URL: http://shadow.pld.org.pl/
|
||||
Source0: ftp://ftp.pld.org.pl/software/shadow/shadow-%{version}.tar.bz2
|
||||
|
@ -21,6 +21,7 @@ Patch5: shadow-4.0.16-lOption.patch
|
|||
Patch6: shadow-4.0.17-notInheritFd.patch
|
||||
Patch7: shadow-4.0.17-exitValues.patch
|
||||
Patch8: shadow-4.0.17-auditLogging.patch
|
||||
Patch9: shadow-4.0.18.1-gid.patch
|
||||
|
||||
License: BSD
|
||||
Group: System Environment/Base
|
||||
|
@ -59,6 +60,7 @@ cp %{SOURCE3} lib/nscd.c
|
|||
|
||||
%patch7 -p1 -b .exitValues
|
||||
%patch8 -p1 -b .auditLogging
|
||||
%patch9 -p1 -b .gid
|
||||
|
||||
rm po/*.gmo
|
||||
rm po/stamp-po
|
||||
|
@ -213,6 +215,9 @@ rm -rf $RPM_BUILD_ROOT
|
|||
%{_mandir}/*/man8/faillog.8*
|
||||
|
||||
%changelog
|
||||
* Sat Nov 04 2006 Peter Vrabec <pvrabec@redhat.com> 2:4.0.18.1-3
|
||||
- fix "-g" and "-G" option.
|
||||
|
||||
* Fri Nov 03 2006 Peter Vrabec <pvrabec@redhat.com> 2:4.0.18.1-2
|
||||
- improve audit logging (#211659)
|
||||
- improve "-l" option. Do not reset faillog if it's used (#213450).
|
||||
|
|
Loading…
Reference in a new issue