]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
vipw: remove unused set{uid,gid} calls
authorKarel Zak <kzak@redhat.com>
Tue, 4 Dec 2012 13:32:15 +0000 (14:32 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 4 Dec 2012 13:32:15 +0000 (14:32 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/vipw.c

index 1eeeb0dd7c6c182ea50647de10696d93c6e5ab19..152c9f5aa3279eb18b5fd9c1f9f58b196f4d5dbb 100644 (file)
@@ -192,7 +192,7 @@ static void pw_write(void)
        free(tmp_file);
 }
 
-static void pw_edit(int notsetuid)
+static void pw_edit(void)
 {
        int pstat;
        pid_t pid;
@@ -212,10 +212,6 @@ static void pw_edit(int notsetuid)
                err(EXIT_FAILURE, _("fork failed"));
 
        if (!pid) {
-               if (notsetuid) {
-                       (void)setgid(getgid());
-                       (void)setuid(getuid());
-               }
                execlp(editor, p, tmp_file, NULL);
                /* Shouldn't get here */
                _exit(EXIT_FAILURE);
@@ -271,7 +267,7 @@ static void edit_file(int is_shadow)
        if (fstat(fileno(tmp_fd), &begin))
                pw_error(tmp_file, 1, 1);
 
-       pw_edit(0);
+       pw_edit();
 
        if (fstat(fileno(tmp_fd), &end))
                pw_error(tmp_file, 1, 1);