return commonio_next (&shadow_db);
}
-int spw_close (void)
+int spw_close (bool process_selinux)
{
int retval = 0;
#ifdef WITH_TCB
return 0;
}
#endif /* WITH_TCB */
- retval = commonio_close (&shadow_db, true);
+ retval = commonio_close (&shadow_db, process_selinux);
#ifdef WITH_TCB
if (use_tcb && (shadowtcb_gain_priv () == SHADOWTCB_FAILURE)) {
return 0;
#include "defines.h"
-extern int spw_close (void);
+extern int spw_close (bool process_selinux);
extern bool spw_file_present (void);
extern /*@observer@*/ /*@null@*/const struct spwd *spw_locate (const char *name);
extern int spw_lock (void);
* Now close the shadow password file, which will cause all of the
* entries to be re-written.
*/
- if (spw_close () == 0) {
+ if (spw_close (true) == 0) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"), Prog, spw_dbname ());
SYSLOG ((LOG_ERR, "failure while writing changes to %s", spw_dbname ()));
static void close_files (void)
{
if (is_shadow_pwd) {
- if (spw_close () == 0) {
+ if (spw_close (true) == 0) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
pw_locked = false;
if (is_shadow) {
- if (spw_close () == 0) {
+ if (spw_close (true) == 0) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
sp = spw_locate (name);
if (NULL == sp) {
/* Try to update the password in /etc/passwd instead. */
- (void) spw_close ();
+ (void) spw_close (true);
update_noshadow ();
if (spw_unlock () == 0) {
(void) fprintf (stderr,
Prog, spw_dbname (), nsp->sp_namp);
fail_exit (E_FAILURE);
}
- if (spw_close () == 0) {
+ if (spw_close (true) == 0) {
(void) fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
}
fail_exit (E_CANTUPDATE);
}
- if (spw_opened && (spw_close () == 0)) {
+ if (spw_opened && (spw_close (true) == 0)) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
}
#ifdef WITH_TCB
if (getdef_bool ("USE_TCB") && spw_locked) {
- if (spw_opened && (spw_close () == 0)) {
+ if (spw_opened && (spw_close (true) == 0)) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
}
}
- if (spw_close () == 0) {
+ if (spw_close (true) == 0) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
}
}
- (void) spw_close (); /* was only open O_RDONLY */
+ (void) spw_close (true); /* was only open O_RDONLY */
if (pw_close (true) == 0) {
fprintf (stderr,
SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
fail_exit (E_PW_UPDATE);
}
- if (is_shadow_pwd && (spw_close () == 0)) {
+ if (is_shadow_pwd && (spw_close (true) == 0)) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"), Prog, spw_dbname ());
SYSLOG ((LOG_ERR, "failure while writing changes to %s", spw_dbname ()));
pw_locked = false;
if (is_shadow_pwd) {
- if (spw_close () == 0) {
+ if (spw_close (true) == 0) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"), Prog, spw_dbname ());
SYSLOG ((LOG_ERR, "failure while writing changes to %s", spw_dbname ()));
SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
fail_exit (E_PW_UPDATE);
}
- if (is_shadow_pwd && (spw_close () == 0)) {
+ if (is_shadow_pwd && (spw_close (true) == 0)) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());