httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/server request.c
Date Wed, 01 Aug 2001 11:59:55 GMT
trawick     01/08/01 04:59:55

  Modified:    server   request.c
  Log:
  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.
  
  Revision  Changes    Path
  1.18      +4 -4      httpd-2.0/server/request.c
  
  Index: request.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/request.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- request.c	2001/08/01 06:12:37	1.17
  +++ request.c	2001/08/01 11:59:55	1.18
  @@ -171,11 +171,11 @@
       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 @@
        * 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) 
  
  
  

Mime
View raw message