]> git.saurik.com Git - apt.git/commitdiff
DropPrivs: Do not use an invalid return check for setgroups()
authorJulian Andres Klode <jak@debian.org>
Wed, 24 Sep 2014 18:02:54 +0000 (20:02 +0200)
committerJulian Andres Klode <jak@debian.org>
Wed, 24 Sep 2014 18:02:54 +0000 (20:02 +0200)
setgroups() returns 0 on success

Git-Dch: ignore

apt-pkg/contrib/fileutl.cc

index 8e7313e8fcca69d3557d2b1cfc975a976cfc05af..98544b60ce99853bdcb776cb87930629dce17742 100644 (file)
@@ -2196,7 +2196,7 @@ bool DropPrivs()
       _error->Warning("PR_SET_NO_NEW_PRIVS failed with %i", ret);
 #endif
 
-   if (setgroups(1, &pw->pw_gid) != 1)
+   if (setgroups(1, &pw->pw_gid))
       return _error->Errno("setgroups", "Failed to setgroups");
 
    if (setegid(pw->pw_gid) != 0)