]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
fix some warnings in resolve_symlink(), one of which seems to be for
authorJeff Trawick <trawick@apache.org>
Wed, 1 Aug 2001 11:59:55 +0000 (11:59 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 1 Aug 2001 11:59:55 +0000 (11:59 +0000)
a genuine bug...

The old logic

  if (!(opts & OPT_SYM_OWNER | OPT_SYM_LINKS))

wouldn't seem to work properly.  I think it would act like

  if (!((opts & OPT_SYM_OWNER) | OPT_SYM_LINKS))

This clearly isn't intended since OPT_SYM_LINKS is a constant non-zero, such
that we never really fail invalid parameters.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89860 13f79535-47bb-0310-9956-ffa450edef68

server/request.c

index 10969ee77bbcb3f75e7b2f3c30257400b28a4c9e..afdf79e1f7f90fc396755e0050a8542187a9bbe0 100644 (file)
@@ -171,11 +171,11 @@ static int resolve_symlink(char *d, apr_finfo_t *lfi, int opts, apr_pool_t *p)
     apr_finfo_t fi;
     int res;
 
-    if (!(opts & OPT_SYM_OWNER | OPT_SYM_LINKS))
+    if (!(opts & (OPT_SYM_OWNER | OPT_SYM_LINKS)))
         return HTTP_FORBIDDEN;
 
     if (opts & OPT_SYM_LINKS) {
-        if (res = apr_stat(&fi, d, lfi->valid, p) != APR_SUCCESS)
+        if ((res = apr_stat(&fi, d, lfi->valid, p)) != APR_SUCCESS)
             return HTTP_FORBIDDEN;
         return OK;
     }
@@ -185,11 +185,11 @@ static int resolve_symlink(char *d, apr_finfo_t *lfi, int opts, apr_pool_t *p)
      * owner of the symlink, then get the info of the target.
      */
     if (!(lfi->valid & APR_FINFO_OWNER))
-        if (res = apr_lstat(&fi, d, lfi->valid | APR_FINFO_OWNER, p)
+        if ((res = apr_lstat(&fi, d, lfi->valid | APR_FINFO_OWNER, p))
                 != APR_SUCCESS)
             return HTTP_FORBIDDEN;
 
-    if (res = apr_stat(&fi, d, lfi->valid, p) != APR_SUCCESS)
+    if ((res = apr_stat(&fi, d, lfi->valid, p)) != APR_SUCCESS)
         return HTTP_FORBIDDEN;
 
     if (apr_compare_users(fi.user, lfi->user) != APR_SUCCESS)