X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2Flibadacl.c;h=a1923601669b66efb0ffa45e62a9b73695354ddb;hb=0b4ff086871b13edb9da3bda67ac4b6f710e73dd;hp=21b8141cbbc0158a3c6cfce3e985838bed1e20ce;hpb=aaf323d45b5c2043acd64b7e6b8b1fea1664dd0b;p=apply-default-acl.git diff --git a/src/libadacl.c b/src/libadacl.c index 21b8141..a192360 100644 --- a/src/libadacl.c +++ b/src/libadacl.c @@ -40,6 +40,9 @@ * open a file descriptor in a symlink-safe way when combined with * the @c O_NOFOLLOW flag. * + * The @c O_PATH flag is not used because we want to fail upon + * encountering any symlinks. + * * @param at_fd * A file descriptor relative to which @c pathname will be opened. * @@ -53,7 +56,9 @@ * and @c OPEN_ERROR if not. */ int safe_open_ex(int at_fd, char* pathname, int flags) { - if (pathname != NULL && strlen(pathname) == 0) { + /* We're only called by safe_open(), so pathname is guaranteed to be + non-NULL */ + if (strlen(pathname) == 0) { /* Oops, went one level to deep with nothing to do. */ return at_fd; }