]> granicus.if.org Git - sudo/commitdiff
getcwd() returns NULL on failure, not 0 on success
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 24 Jun 2007 13:19:29 +0000 (13:19 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 24 Jun 2007 13:19:29 +0000 (13:19 +0000)
mon_systrace.c

index 051df6a6382468fb534683dfc0c736e62f05ed56..8f338a2dc877a4e8f887f5d9e8f09c3d47193fce 100644 (file)
@@ -862,7 +862,7 @@ check_execv(fd, pid, seqnr, askp, policyp, errorp)
 
     /* Get processes's cwd. */
     rval = ioctl(fd, STRIOCGETCWD, &pid);
-    if (rval == -1 || getcwd(user_cwd, sizeof(user_cwd)) != 0) {
+    if (rval == -1 || getcwd(user_cwd, sizeof(user_cwd)) == NULL) {
        if (rval == -1 && errno == EBUSY)
            return(-1);
        warningx("cannot get working directory");