FreeBSD/contrib/subversion/subversion/svnserve/serve.c
/* Ensure that the client has the REQUIRED access by checking the
 * access directives (both blanket and per-directory) in BATON.  If
 * PATH is NULL, then only the blanket access configuration will
 * impact the result.
 *
 * If NEEDS_USERNAME is TRUE, then a lookup is only successful if the
 * user described in BATON is authenticated and, well, has a username
 * assigned to him.
 *
 * Use POOL for temporary allocations only.
 */
Ensure that the client has the REQUIRED access by checking the
access directives (both blanket and per-directory) in BATON.  If
PATH is NULL, then only the blanket access configuration will
impact the result.

If NEEDS_USERNAME is TRUE, then a lookup is only successful if the
user described in BATON is authenticated and, well, has a username
assigned to him.

Use POOL for temporary allocations only.
Ensure that the client has the REQUIRED access by checking the access directives ( both blanket and per - directory ) in BATON . If PATH is NULL then only the blanket access configuration will impact the result . If NEEDS_USERNAME is TRUE then a lookup is only successful if the user described in BATON is authenticated and well has a username assigned to him . Use POOL for temporary allocations only .
static svn_boolean_t lookup_access(apr_pool_t *pool,
                                   server_baton_t *baton,
                                   svn_repos_authz_access_t required,
                                   const char *path,
                                   svn_boolean_t needs_username)
{
  enum access_type req = (required & svn_authz_write) ?
    WRITE_ACCESS : READ_ACCESS;
  svn_boolean_t authorized;
  svn_error_t *err;
  err = authz_check_access(&authorized, path, required, baton, pool);
  if (err)
    {
      log_error(err, baton);
      svn_error_clear(err);
      return FALSE;
    }
  if (current_access(baton) >= req
      && authorized
      && (! needs_username || baton->client_info->user))
    return TRUE;
  return FALSE;
}
static svn_boolean_t lookup_access ( apr_pool_t * pool , server_baton_t * baton , svn_repos_authz_access_t required , const char * path , svn_boolean_t needs_username ) { enum access_type req = ( required & svn_authz_write ) ? WRITE_ACCESS : READ_ACCESS ; svn_boolean_t authorized ; svn_error_t * err ; err = authz_check_access ( & authorized , path , required , baton , pool ) ; if ( err ) { log_error ( err , baton ) ; svn_error_clear ( err ) ; return FALSE ; } if ( current_access ( baton ) >= req && authorized && ( ! needs_username || baton -> client_info -> user ) ) return TRUE ; return FALSE ; }
Ensure that the client has the REQUIRED access by checking the
 access directives (both blanket and per-directory) in BATON.
Ensure that the client has the REQUIRED access by checking the access directives ( both blanket and per - directory ) in BATON .
/* Get authz's opinion on the access. */ /* If an error made lookup fail, deny access. */ /* If the required access is blanket-granted AND granted by authz
     AND we already have a username if one is required, then the
     lookup has succeeded. */