& has lower precedence than ==, so this seems to be not what was
intended (the condition is always false):

===================================================================
RCS file: /cvs/src/bin/mkdir/mkdir.c,v
retrieving revision 1.28
diff -u -p -r1.28 mkdir.c
--- mkdir.c     10 Oct 2015 20:18:30 -0000      1.28
+++ mkdir.c     23 Oct 2015 00:03:31 -0000
@@ -82,7 +82,7 @@ main(int argc, char *argv[])
        argc -= optind;
        argv += optind;

-       if (mode & (S_ISUID | S_ISGID | S_ISTXT) == 0) {
+       if ((mode & (S_ISUID | S_ISGID | S_ISTXT)) == 0) {
                if (pledge("stdio rpath cpath fattr", NULL) == -1)
                        err(1, "pledge");
        }

Reply via email to