Suppress pwconv passwd- chmod failure message

Prevent chmod failure message from displaying if the failure
was due to the backup file not existing.

If there is no backup file present and if no changes have been
made, then this error would always appear since the backup
file isn't created in this situation.

Signed-off-by: Duncan Eastoe <deastoe@Brocade.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
Duncan Eastoe authored and Serge Hallyn committed 2015-02-17 10:15:02 -06:00
1 parent 6b65c6aeae
commit 17887b216d
1 file changed
+2 -1
+2 -1
View File
@@ -305,7 +305,8 @@ int main (int argc, char **argv)
}
/* /etc/passwd- (backup file) */
if (chmod (PASSWD_FILE "-", 0600) != 0) {
errno = 0;
if ((chmod (PASSWD_FILE "-", 0600) != 0) && (errno != ENOENT)) {
fprintf (stderr,
_("%s: failed to change the mode of %s to 0600\n"),
Prog, PASSWD_FILE "-");