* Copyright (c) 1996 - 2000, Marek Michałkiewicz
* Copyright (c) 2001 , Michał Moskal
* Copyright (c) 2001 - 2006, Tomasz Kłoczko
- * Copyright (c) 2007 - 2009, Nicolas François
+ * Copyright (c) 2007 - 2010, Nicolas François
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
if (spw_locked) {
if (spw_unlock () == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ if (use_system_spw_file) {
+ SYSLOG ((LOG_ERR, "failed to unlock %s",
+ spw_dbname ()));
+ }
/* continue */
}
}
if (pw_locked) {
if (pw_unlock () == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ if (use_system_pw_file) {
+ SYSLOG ((LOG_ERR, "failed to unlock %s",
+ pw_dbname ()));
+ }
/* continue */
}
}
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, pw_dbname ());
- SYSLOG ((LOG_ERR,
- "failure while writing changes to %s",
- pw_dbname ()));
+ if (use_system_pw_file) {
+ SYSLOG ((LOG_ERR,
+ "failure while writing changes to %s",
+ pw_dbname ()));
+ }
fail_exit (E_CANTUPDATE);
}
pw_opened = false;
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_ERR,
- "failure while writing changes to %s",
- spw_dbname ()));
+ if (use_system_spw_file) {
+ SYSLOG ((LOG_ERR,
+ "failure while writing changes to %s",
+ spw_dbname ()));
+ }
fail_exit (E_CANTUPDATE);
}
spw_opened = false;
*/
if (spw_locked) {
if (spw_unlock () == 0) {
- fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ fprintf (stderr,
+ _("%s: failed to unlock %s\n"),
+ Prog, spw_dbname ());
+ if (use_system_spw_file) {
+ SYSLOG ((LOG_ERR, "failed to unlock %s",
+ spw_dbname ()));
+ }
/* continue */
}
}
spw_locked = false;
if (pw_locked) {
if (pw_unlock () == 0) {
- fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ fprintf (stderr,
+ _("%s: failed to unlock %s\n"),
+ Prog, pw_dbname ());
+ if (use_system_pw_file) {
+ SYSLOG ((LOG_ERR, "failed to unlock %s",
+ pw_dbname ()));
+ }
/* continue */
}
}
* loop to try out the next list element.
*/
delete_pw:
- SYSLOG ((LOG_INFO, "delete passwd line '%s'",
- pfe->line));
+ if (use_system_pw_file) {
+ SYSLOG ((LOG_INFO, "delete passwd line '%s'",
+ pfe->line));
+ }
*changed = true;
__pw_del_entry (pfe);
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_ERR,
- "failed to unlock %s",
- spw_dbname ()));
+ if (use_system_spw_file) {
+ SYSLOG ((LOG_ERR,
+ "failed to unlock %s",
+ spw_dbname ()));
+ }
}
continue;
}
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_ERR,
- "failure while writing changes to %s",
- spw_dbname ()));
+ if (use_system_spw_file) {
+ SYSLOG ((LOG_ERR,
+ "failure while writing changes to %s",
+ spw_dbname ()));
+ }
} else {
spw_opened = false;
}
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_ERR,
- "failed to unlock %s",
- spw_dbname ()));
+ if (use_system_spw_file) {
+ SYSLOG ((LOG_ERR, "failed to unlock %s",
+ spw_dbname ()));
+ }
} else {
spw_locked = false;
}
* to try out the next list element.
*/
delete_spw:
- SYSLOG ((LOG_INFO, "delete shadow line '%s'",
- spe->line));
+ if (use_system_spw_file) {
+ SYSLOG ((LOG_INFO, "delete shadow line '%s'",
+ spe->line));
+ }
*changed = true;
__spw_del_entry (spe);