コード例 #1
0
ファイル: dgslive.c プロジェクト: Brainiarc7/pbis
PRIVATE void rpc__dg_monitor_init(void)
{               

    /*
     * Initialize the count of handles currently being monitored.
     */

    active_monitors = 0;
    monitor_running = false;
    monitor_was_running = false;
    stop_monitor = false;
    RPC_MUTEX_INIT(monitor_mutex);
    RPC_COND_INIT(monitor_cond, monitor_mutex);
}
コード例 #2
0
ファイル: noauthdg.c プロジェクト: HumbleRepose/dcerpc
PRIVATE rpc_auth_info_p_t rpc__noauth_dg_create
(
        unsigned32 *stp
)
{
    rpc_noauth_info_p_t noauth_info;

    RPC_MEM_ALLOC (noauth_info, rpc_noauth_info_p_t, sizeof (*noauth_info), RPC_C_MEM_UTIL, RPC_C_MEM_WAITOK);

    rpc_g_noauth_alloc_count++;
    RPC_DBG_PRINTF(rpc_e_dbg_auth, 1,
        ("(rpc__noauth_dg_create) %x created (now %d active)\n", noauth_info,
            rpc_g_noauth_alloc_count - rpc_g_noauth_free_count));

    memset (noauth_info, '\0', sizeof(*noauth_info));

    RPC_MUTEX_INIT(noauth_info->lock);

    noauth_info->creds_valid = 0;
    noauth_info->level_valid = 0;
    noauth_info->client_valid = 0;

    /*
     * fill in the common auth_info stuff.
     */

    noauth_info->auth_info.refcount = 1;
    noauth_info->auth_info.server_princ_name = 0;
    noauth_info->auth_info.authn_level = -1;
    noauth_info->auth_info.authn_protocol = rpc_c_authn_dce_dummy;
    noauth_info->auth_info.authz_protocol = rpc_c_authz_name;
    noauth_info->auth_info.is_server = 1;
    noauth_info->auth_info.u.s.privs = 0;
    { /* FAKE-EPAC */
	noauth_info->auth_info.u.s.creds = 0;
    }

    /* XXX do other initialization here. */
    *stp = 0;
    return (rpc_auth_info_p_t) noauth_info;
}
コード例 #3
0
ファイル: dgfwd.c プロジェクト: FarazShaikh/likewise-open
/*
 * I N I T _ F W D _ L I S T _ M U T E X
 *
 * Routine to init the fwd_list mutex
 */
PRIVATE void rpc__dg_fwd_init(void)
{

   RPC_MUTEX_INIT(fwd_list_mutex);

}
コード例 #4
0
ファイル: ntlmauth.c プロジェクト: kanzure/freedce
PRIVATE void rpc__ntlmauth_bnd_set_auth 
(
        unsigned_char_p_t server_name,
        rpc_authn_level_t level,
        rpc_auth_identity_handle_t auth_ident,
        rpc_authz_protocol_id_t authz_prot,
        rpc_binding_handle_t binding_h,
        rpc_auth_info_p_t *infop,
        unsigned32 *stp
)
{
    int st;
    rpc_ntlmauth_info_p_t ntlmauth_info;

    rpc_g_ntlmauth_alloc_count++;
    RPC_MEM_ALLOC (ntlmauth_info, rpc_ntlmauth_info_p_t, sizeof (*ntlmauth_info), RPC_C_MEM_UTIL, RPC_C_MEM_WAITOK);

    if (authz_prot != rpc_c_authz_none) 
    {
        st = rpc_s_authn_authz_mismatch;
        goto poison;
    }

    if (level != rpc_c_authn_level_none)
    {
        st = rpc_s_unsupported_authn_level;
        goto poison;
    }

    /*
     * If no server principal name was specified, go ask for it.
     */
    if (server_name == NULL)
    {
        rpc_mgmt_inq_server_princ_name
            (binding_h, 
             dce_c_rpc_authn_protocol_krb5,
             &server_name,
             stp);
        if (*stp != rpc_s_ok)
            return;
    } else {
        server_name = rpc_stralloc(server_name);
    }
    RPC_DBG_PRINTF(rpc_e_dbg_auth, 1, (
            "(rpc__ntlmauth_bnd_set_auth) %x created (now %d active)\n", 
            ntlmauth_info, rpc_g_ntlmauth_alloc_count - rpc_g_ntlmauth_free_count));
    
    memset (ntlmauth_info, 0, sizeof(*ntlmauth_info));
    
    RPC_MUTEX_INIT(ntlmauth_info->lock);
    
    ntlmauth_info->auth_info.server_princ_name = server_name;
    ntlmauth_info->auth_info.authn_level = level;
    ntlmauth_info->auth_info.authn_protocol = rpc_c_authn_dce_dummy;
    ntlmauth_info->auth_info.authz_protocol = authz_prot;
    ntlmauth_info->auth_info.is_server = 0;
    ntlmauth_info->auth_info.u.auth_identity = auth_ident;
    
    ntlmauth_info->auth_info.refcount = 1;

    *infop = &ntlmauth_info->auth_info;
    ntlmauth_info->status = rpc_s_ok;
    *stp = rpc_s_ok;
    return;
poison:
    *infop = (rpc_auth_info_p_t) &ntlmauth_info->auth_info;
    ntlmauth_info->status = st;
    *stp = st;
    return;
}