return commonio_close (&subordinate_gid_db, process_selinux);
}
-int sub_gid_unlock (void)
+int sub_gid_unlock (bool process_selinux)
{
- return commonio_unlock (&subordinate_gid_db, true);
+ return commonio_unlock (&subordinate_gid_db, process_selinux);
}
gid_t sub_gid_find_free_range(gid_t min, gid_t max, unsigned long count)
}
if (!sub_gid_open(O_CREAT | O_RDWR)) {
printf("Failed opening subgids (errno %d)\n", errno);
- sub_gid_unlock();
+ sub_gid_unlock(true);
return false;
}
db = &subordinate_gid_db;
sub_uid_unlock(true);
} else {
sub_gid_close(true);
- sub_gid_unlock();
+ sub_gid_unlock(true);
}
return ret;
}
if (!sub_gid_open(O_CREAT | O_RDWR)) {
printf("Failed opening subgids (errno %d)\n", errno);
- sub_gid_unlock();
+ sub_gid_unlock(true);
return false;
}
db = &subordinate_gid_db;
sub_uid_unlock(true);
} else {
sub_gid_close(true);
- sub_gid_unlock();
+ sub_gid_unlock(true);
}
return ret;
extern int sub_gid_setdbname (const char *filename);
extern /*@observer@*/const char *sub_gid_dbname (void);
extern int sub_gid_open (int mode);
-extern int sub_gid_unlock (void);
+extern int sub_gid_unlock (bool process_selinux);
extern int sub_gid_add (const char *owner, gid_t start, unsigned long count);
extern int sub_gid_remove (const char *owner, gid_t start, unsigned long count);
extern uid_t sub_gid_find_free_range(gid_t min, gid_t max, unsigned long count);
}
}
if (sub_gid_locked) {
- if (sub_gid_unlock () == 0) {
+ if (sub_gid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
/* continue */
sub_uid_locked = false;
}
if (is_sub_gid) {
- if (sub_gid_unlock () == 0) {
+ if (sub_gid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
/* continue */
SYSLOG((LOG_ERR, "failed to unlock %s", sub_uid_dbname()));
/* continue */
}
- if (sub_gid_locked && sub_gid_unlock() == 0) {
+ if (sub_gid_locked && sub_gid_unlock(true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname()));
/* continue */
sub_uid_locked = false;
}
if (is_sub_gid) {
- if (sub_gid_unlock () == 0) {
+ if (sub_gid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
#ifdef WITH_AUDIT
SYSLOG ((LOG_ERR, "failure while writing changes to %s", sub_gid_dbname ()));
fail_exit (E_SUB_GID_UPDATE);
}
- if (sub_gid_unlock () == 0) {
+ if (sub_gid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
/* continue */
}
}
if (sub_gid_locked) {
- if (sub_gid_unlock () == 0) {
+ if (sub_gid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
/* continue */
}
}
if (sub_gid_locked) {
- if (sub_gid_unlock () == 0) {
+ if (sub_gid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
/* continue */
SYSLOG ((LOG_ERR, "failure while writing changes to %s", sub_gid_dbname ()));
fail_exit (E_SUB_GID_UPDATE);
}
- if (sub_gid_unlock () == 0) {
+ if (sub_gid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
/* continue */