Commit e1b230fb authored by Ruediger Pluem's avatar Ruediger Pluem
Browse files

* Move code to a more conveniant place


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@711227 13f79535-47bb-0310-9956-ffa450edef68
parent 9a69193c
Loading
Loading
Loading
Loading
+29 −29
Original line number Diff line number Diff line
@@ -297,35 +297,6 @@ unixd_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
    return OK;
}

static void unixd_hooks(apr_pool_t *pool)
{
    ap_hook_pre_config(unixd_pre_config,
                       NULL, NULL, APR_HOOK_FIRST);

    ap_hook_drop_privileges(unixd_drop_privileges,
                            NULL, NULL, APR_HOOK_FIRST);
}

static const command_rec unixd_cmds[] = {
    AP_INIT_TAKE1("User", unixd_set_user, NULL, RSRC_CONF,
                  "Effective user id for this server"),
    AP_INIT_TAKE1("Group", unixd_set_group, NULL, RSRC_CONF,
                  "Effective group id for this server"),
    AP_INIT_TAKE1("ChrootDir", unixd_set_chroot_dir, NULL, RSRC_CONF,
                  "The directory to chroot(2) into"),
    {NULL}
};

module AP_MODULE_DECLARE_DATA unixd_module = {
    STANDARD20_MODULE_STUFF,
    NULL,
    NULL,
    NULL,
    NULL,
    unixd_cmds,
    unixd_hooks
};

AP_DECLARE(int) unixd_setup_child(void)
{
    if (set_group_privs()) {
@@ -396,3 +367,32 @@ AP_DECLARE(int) unixd_setup_child(void)
    return 0;
}

static void unixd_hooks(apr_pool_t *pool)
{
    ap_hook_pre_config(unixd_pre_config,
                       NULL, NULL, APR_HOOK_FIRST);

    ap_hook_drop_privileges(unixd_drop_privileges,
                            NULL, NULL, APR_HOOK_FIRST);
}

static const command_rec unixd_cmds[] = {
    AP_INIT_TAKE1("User", unixd_set_user, NULL, RSRC_CONF,
                  "Effective user id for this server"),
    AP_INIT_TAKE1("Group", unixd_set_group, NULL, RSRC_CONF,
                  "Effective group id for this server"),
    AP_INIT_TAKE1("ChrootDir", unixd_set_chroot_dir, NULL, RSRC_CONF,
                  "The directory to chroot(2) into"),
    {NULL}
};

module AP_MODULE_DECLARE_DATA unixd_module = {
    STANDARD20_MODULE_STUFF,
    NULL,
    NULL,
    NULL,
    NULL,
    unixd_cmds,
    unixd_hooks
};