From: Jeff Trawick Date: Wed, 1 Aug 2001 11:59:55 +0000 (+0000) Subject: fix some warnings in resolve_symlink(), one of which seems to be for X-Git-Tag: 2.0.23~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78b3feb4cee108ebd72e6e8753e87aacb292baf1;p=thirdparty%2Fapache%2Fhttpd.git fix some warnings in resolve_symlink(), one of which seems to be for 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 --- diff --git a/server/request.c b/server/request.c index 10969ee77bb..afdf79e1f7f 100644 --- a/server/request.c +++ b/server/request.c @@ -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)