*/
void cleanup_unlock_gshadow (MAYBE_UNUSED void *arg)
{
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (log_get_logfd(),
_("%s: failed to unlock %s\n"),
log_get_progname(), sgr_dbname ());
return commonio_close (&gshadow_db, process_selinux);
}
-int sgr_unlock (void)
+int sgr_unlock (bool process_selinux)
{
- return commonio_unlock (&gshadow_db, true);
+ return commonio_unlock (&gshadow_db, process_selinux);
}
void __sgr_set_changed (void)
extern int sgr_open (int mode);
extern int sgr_remove (const char *name);
extern int sgr_rewind (void);
-extern int sgr_unlock (void);
+extern int sgr_unlock (bool process_selinux);
extern int sgr_update (const struct sgrp *sg);
extern int sgr_sort (void);
#ifdef SHADOWGRP
if (sgr_locked) {
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
SYSLOG ((LOG_ERR, "failure while writing changes to %s", sgr_dbname ()));
fail_exit (1);
}
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
#ifdef SHADOWGRP
if (sgr_locked) {
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, sgr_dbname ());
fail_exit (EXIT_GROUP_FILE);
}
if (sgr_locked) {
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
#ifdef SHADOWGRP
if (sgr_locked) {
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
*/
#ifdef SHADOWGRP
if (sgr_locked) {
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
}
if (sgr_locked) {
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
SYSLOG ((LOG_ERR, "failure while writing changes to %s", gr_dbname ()));
fail_exit (3);
}
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
}
if (sgr_locked) {
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
/* continue */
}
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
}
#ifdef SHADOWGRP
if (sgr_locked) {
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
SYSLOG ((LOG_ERR, "failure while writing changes to %s", sgr_dbname ()));
fail_exit (EXIT_FAILURE);
}
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, sgr_dbname ());
/* continue */
}
#ifdef SHADOWGRP
- if (sgr_locked && sgr_unlock() == 0) {
+ if (sgr_locked && sgr_unlock(true) == 0) {
fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname());
SYSLOG((LOG_ERR, "failed to unlock %s", sgr_dbname()));
/* continue */
gr_locked = false;
#ifdef SHADOWGRP
if (is_shadow_grp) {
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
#ifdef WITH_AUDIT
fail_exit (E_GRP_UPDATE);
}
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
}
#ifdef SHADOWGRP
if (sgr_locked) {
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
}
#ifdef SHADOWGRP
if (sgr_locked) {
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
/* continue */
#endif
#ifdef SHADOWGRP
if (is_shadow_grp) {
- if (sgr_unlock () == 0) {
+ if (sgr_unlock (true) == 0) {
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, sgr_dbname ());