FreeBSD/contrib/subversion/subversion/svnserve/serve.c
/* Load the authz database for the listening server through AUTHZ_POOL
   based on the entries in the SERVER struct.

   SERVER and CONN must not be NULL. The real errors will be logged with
   SERVER and CONN but return generic errors to the client. */
Load the authz database for the listening server through AUTHZ_POOL
based on the entries in the SERVER struct.

SERVER and CONN must not be NULL. The real errors will be logged with
SERVER and CONN but return generic errors to the client.
Load the authz database for the listening server through AUTHZ_POOL based on the entries in the SERVER struct . SERVER and CONN must not be NULL . The real errors will be logged with SERVER and CONN but return generic errors to the client .
static svn_error_t *
load_authz_config(repository_t *repository,
                  const char *repos_root,
                  svn_config_t *cfg,
                  svn_repos__authz_pool_t *authz_pool,
                  apr_pool_t *pool)
{
  const char *authzdb_path;
  const char *groupsdb_path;
  svn_error_t *err;
  svn_config_get(cfg, &authzdb_path, SVN_CONFIG_SECTION_GENERAL,
                 SVN_CONFIG_OPTION_AUTHZ_DB, NULL);
  svn_config_get(cfg, &groupsdb_path, SVN_CONFIG_SECTION_GENERAL,
                 SVN_CONFIG_OPTION_GROUPS_DB, NULL);
  if (authzdb_path)
    {
      const char *case_force_val;
      err = canonicalize_access_file(&authzdb_path, repository,
                                     repos_root, pool);
      if (groupsdb_path && !err)
        err = canonicalize_access_file(&groupsdb_path, repository,
                                       repos_root, pool);
      if (!err)
        err = svn_repos__authz_pool_get(&repository->authzdb, authz_pool,
                                        authzdb_path, groupsdb_path, TRUE,
                                        repository->repos, pool);
      if (err)
        return svn_error_create(SVN_ERR_AUTHZ_INVALID_CONFIG, err, NULL);
      svn_config_get(cfg, &case_force_val,
                     SVN_CONFIG_SECTION_GENERAL,
                     SVN_CONFIG_OPTION_FORCE_USERNAME_CASE, NULL);
      if (case_force_val)
        {
          if (strcmp(case_force_val, "upper") == 0)
            repository->username_case = CASE_FORCE_UPPER;
          else if (strcmp(case_force_val, "lower") == 0)
            repository->username_case = CASE_FORCE_LOWER;
          else
            repository->username_case = CASE_ASIS;
        }
    }
  else
    {
      repository->authzdb = NULL;
      repository->username_case = CASE_ASIS;
    }
  return SVN_NO_ERROR;
}
static svn_error_t * load_authz_config ( repository_t * repository , const char * repos_root , svn_config_t * cfg , svn_repos__authz_pool_t * authz_pool , apr_pool_t * pool ) { const char * authzdb_path ; const char * groupsdb_path ; svn_error_t * err ; svn_config_get ( cfg , & authzdb_path , SVN_CONFIG_SECTION_GENERAL , SVN_CONFIG_OPTION_AUTHZ_DB , NULL ) ; svn_config_get ( cfg , & groupsdb_path , SVN_CONFIG_SECTION_GENERAL , SVN_CONFIG_OPTION_GROUPS_DB , NULL ) ; if ( authzdb_path ) { const char * case_force_val ; err = canonicalize_access_file ( & authzdb_path , repository , repos_root , pool ) ; if ( groupsdb_path && ! err ) err = canonicalize_access_file ( & groupsdb_path , repository , repos_root , pool ) ; if ( ! err ) err = svn_repos__authz_pool_get ( & repository -> authzdb , authz_pool , authzdb_path , groupsdb_path , TRUE , repository -> repos , pool ) ; if ( err ) return svn_error_create ( SVN_ERR_AUTHZ_INVALID_CONFIG , err , NULL ) ; svn_config_get ( cfg , & case_force_val , SVN_CONFIG_SECTION_GENERAL , SVN_CONFIG_OPTION_FORCE_USERNAME_CASE , NULL ) ; if ( case_force_val ) { if ( strcmp ( case_force_val , " " ) == 0 ) repository -> username_case = CASE_FORCE_UPPER ; else if ( strcmp ( case_force_val , " " ) == 0 ) repository -> username_case = CASE_FORCE_LOWER ; else repository -> username_case = CASE_ASIS ; } } else { repository -> authzdb = NULL ; repository -> username_case = CASE_ASIS ; } return SVN_NO_ERROR ; }
Load the authz database for the listening server through AUTHZ_POOL
based on the entries in the SERVER struct.
Load the authz database for the listening server through AUTHZ_POOL based on the entries in the SERVER struct .
/* Read authz configuration. */ /* Canonicalize and add the base onto the authzdb_path (if needed). */ /* Same for the groupsdb_path if it is present. */ /* Are we going to be case-normalizing usernames when we consult
       * this authz file? */