*/
void cleanup_unlock_passwd (MAYBE_UNUSED void *arg)
{
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (log_get_logfd(),
_("%s: failed to unlock %s\n"),
log_get_progname(), pw_dbname ());
*/
if (i == 15) {
- pw_unlock ();
+ pw_unlock (true);
return -1;
}
* Unlock both files.
*/
- return (pw_unlock () && spw_unlock ())? 0 : -1;
+ return (pw_unlock (true) && spw_unlock ())? 0 : -1;
}
#else
extern int ISO_C_forbids_an_empty_translation_unit;
return commonio_close (&passwd_db, process_selinux);
}
-int pw_unlock (void)
+int pw_unlock (bool process_selinux)
{
- return commonio_unlock (&passwd_db, true);
+ return commonio_unlock (&passwd_db, process_selinux);
}
/*@null@*/struct commonio_entry *__pw_get_head (void)
extern int pw_open (int mode);
extern int pw_remove (const char *name);
extern int pw_rewind (void);
-extern int pw_unlock (void);
+extern int pw_unlock (bool process_selinux);
extern int pw_update (const struct passwd *pw);
extern int pw_sort (void);
}
}
if (pw_locked) {
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
/* continue */
}
spw_locked = false;
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
static void fail_exit (int code)
{
if (pw_locked) {
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
fail_exit (E_NOPERM);
}
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
static void fail_exit (int code)
{
if (pw_locked) {
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
fail_exit (1);
}
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
fail_exit (int code)
{
if (pw_locked) {
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
fail_exit (1);
}
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
}
}
if (pw_locked) {
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
fail_exit (EXIT_FAILURE);
}
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
fail_exit (int status)
{
if (pw_locked) {
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
(void) fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
fail_exit (E_FAILURE);
}
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
(void) fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, pw_dbname ());
}
if (pw_locked) {
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
if (use_system_pw_file) {
SYSLOG ((LOG_ERR, "failed to unlock %s",
}
spw_locked = false;
if (pw_locked) {
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, pw_dbname ());
static void fail_exit (int status)
{
if (pw_locked) {
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
/* continue */
}
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
}
}
if (pw_locked) {
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
/* continue */
}
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
SYSLOG((LOG_ERR, "failed to unlock %s", spw_dbname()));
/* continue */
}
- if (pw_locked && pw_unlock() == 0) {
+ if (pw_locked && pw_unlock(true) == 0) {
fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname());
SYSLOG((LOG_ERR, "failed to unlock %s", pw_dbname()));
/* continue */
}
spw_locked = false;
}
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
#ifdef WITH_AUDIT
SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
fail_exit (E_PW_UPDATE);
}
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
static void fail_exit (int code)
{
if (pw_locked) {
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
}
}
if (pw_locked) {
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
/* continue */
/* continue */
}
}
- if (pw_unlock () == 0) {
+ if (pw_unlock (true) == 0) {
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, pw_dbname ());