]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - login-utils/setpwnam.c
Imported from util-linux-2.11x tarball.
[thirdparty/util-linux.git] / login-utils / setpwnam.c
index 62d47a51c7af36e5023f1e4113929c40bc887b53..5a46863a8098947f61b59bece9384d5d4e3cba1f 100644 (file)
@@ -98,7 +98,7 @@ setpwnam (struct passwd *pwd)
     /* sanity check */
     for (x = 0; x < 3; x++) {
        if (x > 0) sleep(1);
-       fd = open(PTMPTMP_FILE, O_WRONLY|O_CREAT, 0644);
+       fd = open(PTMPTMP_FILE, O_WRONLY|O_CREAT|O_EXCL, 0644);
        if (fd == -1) {
            umask(oldumask);
            return -1;