]> granicus.if.org Git - sudo/commitdiff
Add missing sudo_setpwent() and sudo_setgrent() calls. Also
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 21 Nov 2007 16:02:30 +0000 (16:02 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 21 Nov 2007 16:02:30 +0000 (16:02 +0000)
use sudo_getpwuid() instead of getpwuid().

visudo.c

index 70522c4cd847523575efcaafe10fe36db499565d..d67a4aec9a5ef140f5b3373f0dd466a4e7ca44a6 100644 (file)
--- a/visudo.c
+++ b/visudo.c
@@ -186,9 +186,12 @@ main(argc, argv)
     if (argc)
        usage();
 
+    sudo_setpwent();
+    sudo_setgrent();
+
     /* Mock up a fake sudo_user struct. */
     user_host = user_shost = user_cmnd = "";
-    if ((sudo_user.pw = getpwuid(getuid())) == NULL)
+    if ((sudo_user.pw = sudo_getpwuid(getuid())) == NULL)
        errorx(1, "you don't exist in the passwd database");
 
     /* Setup defaults data structures. */