int commonio_unlock(struct commonio_db *db) { char lock[1024]; if (db->isopen) { db->readonly = 1; if (!commonio_close(db)) { if (db->locked) dec_lock_count(); return 0; } } if (db->locked) { /* * Unlock in reverse order: remove the lock file, * then call ulckpwdf() (if used) on last unlock. */ db->locked = 0; snprintf(lock, sizeof lock, "%s.lock", db->filename); unlink(lock); dec_lock_count(); return 1; } return 0; }
int spw_close (void) { int retval = 0; #ifdef WITH_TCB bool use_tcb = getdef_bool ("USE_TCB"); if (use_tcb && (shadowtcb_drop_priv () == SHADOWTCB_FAILURE)) { return 0; } #endif /* WITH_TCB */ retval = commonio_close (&shadow_db); #ifdef WITH_TCB if (use_tcb && (shadowtcb_gain_priv () == SHADOWTCB_FAILURE)) { return 0; } #endif /* WITH_TCB */ return retval; }
int spw_close(void) { return commonio_close(&shadow_db); }
int gr_close (void) { return commonio_close (&group_db); }
int sub_gid_close (void) { return commonio_close (&subordinate_gid_db); }
int pw_close (void) { return commonio_close (&passwd_db); }
int sgr_close (void) { return commonio_close (&gshadow_db); }