The name /etc/passwd- is used as backup file by shadow and systemd.
Let's join the group and use /etc/passwd- instead of /etc/passwd.OLD as
well. One backup file on a system is enough.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
}
/* we don't care if we can't remove the backup file */
- unlink(PASSWD_FILE ".OLD");
+ unlink(PASSWD_FILE "-");
/* we don't care if we can't create the backup file */
- ignore_result(link(PASSWD_FILE, PASSWD_FILE ".OLD"));
+ ignore_result(link(PASSWD_FILE, PASSWD_FILE "-"));
/* we DO care if we can't rename to the passwd file */
if (rename(tmpname, PASSWD_FILE) < 0)
goto fail;
{
char tmp[FILENAMELEN + 4];
- snprintf(tmp, sizeof(tmp), "%s%s", orig_file, ".OLD");
+ snprintf(tmp, sizeof(tmp), "%s%s", orig_file, "-");
unlink(tmp);
if (link(orig_file, tmp))