FreeBSD/contrib/subversion/subversion/svnserve/serve.c
/* Set *ALLOWED to TRUE if PATH is accessible in the REQUIRED mode to
   the user described in BATON according to the authz rules in BATON.
   Use POOL for temporary allocations only.  If no authz rules are
   present in BATON, grant access by default. */
Set *ALLOWED to TRUE if PATH is accessible in the REQUIRED mode to
the user described in BATON according to the authz rules in BATON.
Use POOL for temporary allocations only.  If no authz rules are
present in BATON, grant access by default.
Set * ALLOWED to TRUE if PATH is accessible in the REQUIRED mode to the user described in BATON according to the authz rules in BATON . Use POOL for temporary allocations only . If no authz rules are present in BATON grant access by default .
static svn_error_t *authz_check_access(svn_boolean_t *allowed,
                                       const char *path,
                                       svn_repos_authz_access_t required,
                                       server_baton_t *b,
                                       apr_pool_t *pool)
{
  repository_t *repository = b->repository;
  client_info_t *client_info = b->client_info;
  if (!repository->authzdb)
    {
      *allowed = TRUE;
      return SVN_NO_ERROR;
    }
  if (path)
    path = svn_fspath__canonicalize(path, pool);
  if (client_info->user && (! client_info->authz_user))
    {
      char *authz_user = apr_pstrdup(b->pool, client_info->user);
      if (repository->username_case == CASE_FORCE_UPPER)
        convert_case(authz_user, TRUE);
      else if (repository->username_case == CASE_FORCE_LOWER)
        convert_case(authz_user, FALSE);
      client_info->authz_user = authz_user;
    }
  SVN_ERR(svn_repos_authz_check_access(repository->authzdb,
                                       repository->authz_repos_name,
                                       path, client_info->authz_user,
                                       required, allowed, pool));
  if (!*allowed)
    SVN_ERR(log_authz_denied(path, required, b, pool));
  return SVN_NO_ERROR;
}
static svn_error_t * authz_check_access ( svn_boolean_t * allowed , const char * path , svn_repos_authz_access_t required , server_baton_t * b , apr_pool_t * pool ) { repository_t * repository = b -> repository ; client_info_t * client_info = b -> client_info ; if ( ! repository -> authzdb ) { * allowed = TRUE ; return SVN_NO_ERROR ; } if ( path ) path = svn_fspath__canonicalize ( path , pool ) ; if ( client_info -> user && ( ! client_info -> authz_user ) ) { char * authz_user = apr_pstrdup ( b -> pool , client_info -> user ) ; if ( repository -> username_case == CASE_FORCE_UPPER ) convert_case ( authz_user , TRUE ) ; else if ( repository -> username_case == CASE_FORCE_LOWER ) convert_case ( authz_user , FALSE ) ; client_info -> authz_user = authz_user ; } SVN_ERR ( svn_repos_authz_check_access ( repository -> authzdb , repository -> authz_repos_name , path , client_info -> authz_user , required , allowed , pool ) ) ; if ( ! * allowed ) SVN_ERR ( log_authz_denied ( path , required , b , pool ) ) ; return SVN_NO_ERROR ; }
Set *ALLOWED to TRUE if PATH is accessible in the REQUIRED mode to
the user described in BATON according to the authz rules in BATON.
Set * ALLOWED to TRUE if PATH is accessible in the REQUIRED mode to the user described in BATON according to the authz rules in BATON .
/* If authz cannot be performed, grant access.  This is NOT the same
     as the default policy when authz is performed on a path with no
     rules.  In the latter case, the default is to deny access, and is
     set by svn_repos_authz_check_access. */ /* If the authz request is for the empty path (ie. ""), replace it
     with the root path.  This happens because of stripping done at
     various levels in svnserve that remove the leading / on an
     absolute path. Passing such a malformed path to the authz
     routines throws them into an infinite loop and makes them miss
     ACLs. */ /* If we have a username, and we've not yet used it + any username
     case normalization that might be requested to determine "the
     username we used for authz purposes", do so now. */