diff --git a/shadow-4.1.5.1-backup-mode.patch b/shadow-4.1.5.1-backup-mode.patch new file mode 100644 index 0000000..a8a5fa9 --- /dev/null +++ b/shadow-4.1.5.1-backup-mode.patch @@ -0,0 +1,20 @@ +diff -up shadow-4.1.5.1/lib/commonio.c.backup-mode shadow-4.1.5.1/lib/commonio.c +--- shadow-4.1.5.1/lib/commonio.c.backup-mode 2012-05-18 21:44:54.000000000 +0200 ++++ shadow-4.1.5.1/lib/commonio.c 2012-09-19 20:27:16.089444234 +0200 +@@ -301,15 +301,12 @@ static int create_backup (const char *ba + struct utimbuf ub; + FILE *bkfp; + int c; +- mode_t mask; + + if (fstat (fileno (fp), &sb) != 0) { + return -1; + } + +- mask = umask (077); +- bkfp = fopen (backup, "w"); +- (void) umask (mask); ++ bkfp = fopen_set_perms (backup, "w", &sb); + if (NULL == bkfp) { + return -1; + } diff --git a/shadow-4.1.5.1-errmsg.patch b/shadow-4.1.5.1-errmsg.patch new file mode 100644 index 0000000..bebfab4 --- /dev/null +++ b/shadow-4.1.5.1-errmsg.patch @@ -0,0 +1,22 @@ +--- src/useradd.c ++++ src/useradd.c 2013/09/17 12:30:31 +@@ -1759,6 +1759,9 @@ + if (access (user_home, F_OK) != 0) { + #ifdef WITH_SELINUX + if (set_selinux_file_context (user_home) != 0) { ++ fprintf (stderr, ++ _("%s: cannot set SELinux context for home directory %s\n"), ++ Prog, user_home); + fail_exit (E_HOMEDIR); + } + #endif +@@ -1788,6 +1791,9 @@ + #ifdef WITH_SELINUX + /* Reset SELinux to create files with default contexts */ + if (reset_selinux_file_context () != 0) { ++ fprintf (stderr, ++ _("%s: cannot reset SELinux file creation context\n"), ++ Prog); + fail_exit (E_HOMEDIR); + } + #endif diff --git a/shadow-4.1.5.1-logmsg.patch b/shadow-4.1.5.1-logmsg.patch new file mode 100644 index 0000000..e737839 --- /dev/null +++ b/shadow-4.1.5.1-logmsg.patch @@ -0,0 +1,12 @@ +diff -up shadow-4.1.5.1/src/useradd.c.logmsg shadow-4.1.5.1/src/useradd.c +--- shadow-4.1.5.1/src/useradd.c.logmsg 2013-02-20 15:41:44.000000000 +0100 ++++ shadow-4.1.5.1/src/useradd.c 2013-03-19 18:40:04.908292810 +0100 +@@ -275,7 +275,7 @@ static void fail_exit (int code) + user_name, AUDIT_NO_ID, + SHADOW_AUDIT_FAILURE); + #endif +- SYSLOG ((LOG_INFO, "failed adding user '%s', data deleted", user_name)); ++ SYSLOG ((LOG_INFO, "failed adding user '%s', exit code: %d", user_name, code)); + exit (code); + } + diff --git a/shadow-4.1.5.1-manfix.patch b/shadow-4.1.5.1-manfix.patch new file mode 100644 index 0000000..46dbfc1 --- /dev/null +++ b/shadow-4.1.5.1-manfix.patch @@ -0,0 +1,21 @@ +diff -up shadow-4.1.5.1/man/useradd.8.xml.manfix shadow-4.1.5.1/man/useradd.8.xml +--- shadow-4.1.5.1/man/useradd.8.xml.manfix 2013-06-14 15:25:44.000000000 +0200 ++++ shadow-4.1.5.1/man/useradd.8.xml 2013-07-19 07:33:53.768619759 +0200 +@@ -161,7 +161,7 @@ + + + +- , ++ , + HOME_DIR + + +@@ -362,7 +362,7 @@ + + + +- ++ , + + + diff --git a/shadow.changes b/shadow.changes index 9eaad3d..55215ba 100644 --- a/shadow.changes +++ b/shadow.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue Sep 17 14:56:44 CEST 2013 - kukuk@suse.de + +- Add some fixes from Fedora: + - shadow-4.1.5.1-backup-mode.patch: open backup file with correct + permissions. + - shadow-4.1.5.1-logmsg.patch: fix error message + - shadow-4.1.5.1-errmsg.patch: print error reason + - shadow-4.1.5.1-manfix.patch: fix manual page + ------------------------------------------------------------------- Tue Feb 5 13:19:46 CET 2013 - kukuk@suse.de diff --git a/shadow.spec b/shadow.spec index 7b0d034..00e92e6 100644 --- a/shadow.spec +++ b/shadow.spec @@ -35,6 +35,10 @@ Patch2: useradd-script.diff Patch3: chkname-regex.diff Patch4: useradd-default.diff Patch5: getdef-new-defs.diff +Patch6: shadow-4.1.5.1-manfix.patch +Patch7: shadow-4.1.5.1-logmsg.patch +Patch8: shadow-4.1.5.1-errmsg.patch +Patch9: shadow-4.1.5.1-backup-mode.patch BuildRequires: audit-devel BuildRequires: libacl-devel BuildRequires: libattr-devel @@ -59,6 +63,10 @@ group accounts. %patch3 -p0 %patch4 -p0 %patch5 -p0 +%patch6 -p1 +%patch7 -p1 +%patch8 -p0 +%patch9 -p1 iconv -f ISO88591 -t utf-8 doc/HOWTO > doc/HOWTO.utf8 mv -v doc/HOWTO.utf8 doc/HOWTO