return commonio_close (&subordinate_uid_db, process_selinux);
}
-int sub_uid_unlock (void)
+int sub_uid_unlock (bool process_selinux)
{
- return commonio_unlock (&subordinate_uid_db, true);
+ return commonio_unlock (&subordinate_uid_db, process_selinux);
}
uid_t sub_uid_find_free_range(uid_t min, uid_t max, unsigned long count)
}
if (!sub_uid_open(O_CREAT | O_RDWR)) {
printf("Failed opening subuids (errno %d)\n", errno);
- sub_uid_unlock();
+ sub_uid_unlock(true);
return false;
}
db = &subordinate_uid_db;
out:
if (id_type == ID_TYPE_UID) {
sub_uid_close(true);
- sub_uid_unlock();
+ sub_uid_unlock(true);
} else {
sub_gid_close(true);
sub_gid_unlock();
}
if (!sub_uid_open(O_CREAT | O_RDWR)) {
printf("Failed opening subuids (errno %d)\n", errno);
- sub_uid_unlock();
+ sub_uid_unlock(true);
return false;
}
db = &subordinate_uid_db;
if (id_type == ID_TYPE_UID) {
sub_uid_close(true);
- sub_uid_unlock();
+ sub_uid_unlock(true);
} else {
sub_gid_close(true);
sub_gid_unlock();
extern int sub_uid_setdbname (const char *filename);
extern /*@observer@*/const char *sub_uid_dbname (void);
extern int sub_uid_open (int mode);
-extern int sub_uid_unlock (void);
+extern int sub_uid_unlock (bool process_selinux);
extern int sub_uid_add (const char *owner, uid_t start, unsigned long count);
extern int sub_uid_remove (const char *owner, uid_t start, unsigned long count);
extern uid_t sub_uid_find_free_range(uid_t min, uid_t max, unsigned long count);
#endif
#ifdef ENABLE_SUBIDS
if (sub_uid_locked) {
- if (sub_uid_unlock () == 0) {
+ if (sub_uid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
/* continue */
#endif
#ifdef ENABLE_SUBIDS
if (is_sub_uid) {
- if (sub_uid_unlock () == 0) {
+ if (sub_uid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
/* continue */
}
#endif
#ifdef ENABLE_SUBIDS
- if (sub_uid_locked && sub_uid_unlock() == 0) {
+ if (sub_uid_locked && sub_uid_unlock(true) == 0) {
fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname());
SYSLOG((LOG_ERR, "failed to unlock %s", sub_uid_dbname()));
/* continue */
#ifdef ENABLE_SUBIDS
if (is_sub_uid) {
- if (sub_uid_unlock () == 0) {
+ if (sub_uid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
#ifdef WITH_AUDIT
SYSLOG ((LOG_ERR, "failure while writing changes to %s", sub_uid_dbname ()));
fail_exit (E_SUB_UID_UPDATE);
}
- if (sub_uid_unlock () == 0) {
+ if (sub_uid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
/* continue */
#endif /* SHADOWGRP */
#ifdef ENABLE_SUBIDS
if (sub_uid_locked) {
- if (sub_uid_unlock () == 0) {
+ if (sub_uid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
/* continue */
}
#ifdef ENABLE_SUBIDS
if (sub_uid_locked) {
- if (sub_uid_unlock () == 0) {
+ if (sub_uid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
/* continue */
SYSLOG ((LOG_ERR, "failure while writing changes to %s", sub_uid_dbname ()));
fail_exit (E_SUB_UID_UPDATE);
}
- if (sub_uid_unlock () == 0) {
+ if (sub_uid_unlock (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
/* continue */