diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-07-27 08:58:37 +0400 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-07-27 08:58:37 +0400 |
commit | ea839a52aebd6a29a8dde70412b0e7b8d68568b4 (patch) | |
tree | 10026e84c8b73d4e5ad6704ab1cb78ea7c63c305 /src/useradd.c | |
parent | 6c1662a897fd34b5b0b0174ab83552b016d05e8d (diff) | |
download | shadow-upstream.tar.gz |
Imported Upstream version 4.1.5.1upstream/4.1.5.1upstream
Diffstat (limited to 'src/useradd.c')
-rw-r--r-- | src/useradd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/useradd.c b/src/useradd.c index 4fdb29c..bfddfc6 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -2,7 +2,7 @@ * Copyright (c) 1991 - 1994, Julianne Frances Haugh * Copyright (c) 1996 - 2000, Marek Michałkiewicz * Copyright (c) 2000 - 2006, Tomasz Kłoczko - * Copyright (c) 2007 - 2011, Nicolas François + * Copyright (c) 2007 - 2012, Nicolas François * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,7 @@ #include <config.h> -#ident "$Id: useradd.c 3650 2011-11-21 22:02:15Z nekral-guest $" +#ident "$Id: useradd.c 3743 2012-05-25 11:51:53Z nekral-guest $" #include <assert.h> #include <ctype.h> @@ -167,8 +167,7 @@ static bool home_added = false; #define E_NAME_IN_USE 9 /* username already in use */ #define E_GRP_UPDATE 10 /* can't update group file */ #define E_HOMEDIR 12 /* can't create home directory */ -#define E_MAIL_SPOOL 13 /* can't create mail spool */ -#define E_SE_UPDATE 14 /* can't update SELinux user mapping */ +#define E_SE_UPDATE 14 /* can't update SELinux user mapping */ #define DGROUP "GROUP=" #define DHOME "HOME=" @@ -557,11 +556,12 @@ static int set_defaults (void) */ wlen = snprintf (buf, sizeof buf, "%s-", USER_DEFAULTS_FILE); assert (wlen < (int) sizeof buf); - if ((rename (USER_DEFAULTS_FILE, buf) != 0) && (ENOENT != errno)) { + unlink (buf); + if ((link (USER_DEFAULTS_FILE, buf) != 0) && (ENOENT != errno)) { int err = errno; fprintf (stderr, - _("%s: rename: %s: %s\n"), - Prog, USER_DEFAULTS_FILE, strerror (err)); + _("%s: Cannot create backup file (%s): %s\n"), + Prog, buf, strerror (err)); unlink (new_file); return -1; } |