当前位置: 首页>>代码示例>>C++>>正文


C++ osi_auditU函数代码示例

本文整理汇总了C++中osi_auditU函数的典型用法代码示例。如果您正苦于以下问题:C++ osi_auditU函数的具体用法?C++ osi_auditU怎么用?C++ osi_auditU使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了osi_auditU函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SBOZO_ListKeys

afs_int32
SBOZO_ListKeys(struct rx_call *acall, afs_int32 an, afs_int32 *akvno,
	       struct bozo_key *akey, struct bozo_keyInfo *akeyinfo)
{
    struct afsconf_keys tkeys;
    afs_int32 code;
    struct stat tstat;
    int noauth = 0;
    char caller[MAXKTCNAMELEN];
    rxkad_level enc_level = rxkad_clear;

    if (!afsconf_SuperUser(bozo_confdir, acall, caller)) {
	code = BZACCESS;
	goto fail;
    }
    if (DoLogging)
	bozo_Log("%s is executing ListKeys\n", caller);

    code = afsconf_GetKeys(bozo_confdir, &tkeys);
    if (code)
	goto fail;

    if (tkeys.nkeys <= an) {
	code = BZDOM;
	goto fail;
    }
    *akvno = tkeys.key[an].kvno;
    memset(akeyinfo, 0, sizeof(struct bozo_keyInfo));

    noauth = afsconf_GetNoAuthFlag(bozo_confdir);
    rxkad_GetServerInfo(rx_ConnectionOf(acall), &enc_level, 0, 0, 0, 0, 0);
    /*
     * only return actual keys in noauth or if this is an encrypted connection
     */

    if ((noauth) || (enc_level == rxkad_crypt)) {
	memcpy(akey, tkeys.key[an].key, 8);
    } else
	memset(akey, 0, 8);

    code = stat(AFSDIR_SERVER_KEY_FILEPATH, &tstat);
    if (code == 0) {
	akeyinfo->mod_sec = tstat.st_mtime;
    }

    /* This will return an error if the key is 'bad' (bad checksum, weak DES
     * key, etc). But we don't care, since we can still return the other
     * information about the key, so ignore the result. */
    (void)ka_KeyCheckSum(tkeys.key[an].key, &akeyinfo->keyCheckSum);

  fail:
    if (noauth)
	osi_auditU(acall, BOS_UnAuthListKeysEvent, code, AUD_END);
    osi_auditU(acall, BOS_ListKeysEvent, code, AUD_END);
    return code;
}
开发者ID:hwr,项目名称:openafs,代码行数:56,代码来源:bosoprocs.c

示例2: SBOZO_ListKeys

afs_int32
SBOZO_ListKeys(struct rx_call *acall, afs_int32 an, afs_int32 *akvno,
	       struct bozo_key *akey, struct bozo_keyInfo *akeyinfo)
{
    struct afsconf_keys tkeys;
    afs_int32 code;
    struct stat tstat;
    int noauth = 0;
    char caller[MAXKTCNAMELEN];
    rxkad_level enc_level = rxkad_clear;

    if (!afsconf_SuperUser(bozo_confdir, acall, caller)) {
	code = BZACCESS;
	goto fail;
    }
    if (DoLogging)
	bozo_Log("%s is executing ListKeys\n", caller);

    code = afsconf_GetKeys(bozo_confdir, &tkeys);
    if (code)
	goto fail;

    if (tkeys.nkeys <= an) {
	code = BZDOM;
	goto fail;
    }
    *akvno = tkeys.key[an].kvno;
    memset(akeyinfo, 0, sizeof(struct bozo_keyInfo));

    noauth = afsconf_GetNoAuthFlag(bozo_confdir);
    rxkad_GetServerInfo(acall->conn, &enc_level, 0, 0, 0, 0, 0);
    /*
     * only return actual keys in noauth or if this is an encrypted connection
     */

    if ((noauth) || (enc_level == rxkad_crypt)) {
	memcpy(akey, tkeys.key[an].key, 8);
    } else
	memset(akey, 0, 8);

    code = stat(AFSDIR_SERVER_KEY_FILEPATH, &tstat);
    if (code == 0) {
	akeyinfo->mod_sec = tstat.st_mtime;
    }
    ka_KeyCheckSum(tkeys.key[an].key, &akeyinfo->keyCheckSum);
    /* only errors is bad key parity */

  fail:
    if (noauth)
	osi_auditU(acall, BOS_UnAuthListKeysEvent, code, AUD_END);
    osi_auditU(acall, BOS_ListKeysEvent, code, AUD_END);
    return code;
}
开发者ID:SimonWilkinson,项目名称:openafs,代码行数:53,代码来源:bosoprocs.c

示例3: SBOZO_UnInstall

afs_int32
SBOZO_UnInstall(struct rx_call *acall, char *aname)
{
    char *filepath;
    char fpOld[AFSDIR_PATH_MAX], fpBak[AFSDIR_PATH_MAX];
    afs_int32 code;
    char caller[MAXKTCNAMELEN];
    struct stat tstat;

    if (!afsconf_SuperUser(bozo_confdir, acall, caller)) {
	code = BZACCESS;
	osi_auditU(acall, BOS_UnInstallEvent, code, AUD_STR, aname, AUD_END);
	return code;
    }
    if (bozo_isrestricted) {
	code = BZACCESS;
	osi_auditU(acall, BOS_UnInstallEvent, code, AUD_STR, aname, AUD_END);
	return code;
    }

    /* construct local path from canonical (wire-format) path */
    if (ConstructLocalBinPath(aname, &filepath)) {
	return BZNOENT;
    }

    if (DoLogging)
	bozo_Log("%s is executing UnInstall '%s'\n", caller, filepath);

    strcpy(fpBak, filepath);
    strcat(fpBak, ".BAK");
    strcpy(fpOld, filepath);
    strcat(fpOld, ".OLD");

    code = rk_rename(fpBak, filepath);
    if (code) {
	/* can't find .BAK, try .OLD */
	code = rk_rename(fpOld, filepath);
	if (code && errno == ENOENT)	/* If doesn't exist don't fail */
	    code = 0;
    } else {
	/* now rename .OLD to .BAK */
	if (stat(fpOld, &tstat) == 0)
	    code = rk_rename(fpOld, fpBak);
    }
    if (code)
	code = errno;

    osi_auditU(acall, BOS_UnInstallEvent, code, AUD_STR, filepath, AUD_END);
    free(filepath);

    return code;
}
开发者ID:hwr,项目名称:openafs,代码行数:52,代码来源:bosoprocs.c

示例4: SBOZO_RestartAll

/* shutdown and restart */
afs_int32
SBOZO_RestartAll(struct rx_call *acall)
{
    afs_int32 code;
    char caller[MAXKTCNAMELEN];

    if (!afsconf_SuperUser(bozo_confdir, acall, caller)) {
	code = BZACCESS;
	goto fail;
    }
    if (DoLogging)
	bozo_Log("%s is executing RestartAll\n", caller);

    /* start shutdown of all processes */
    code = bnode_ApplyInstance(sdproc, NULL);
    if (code)
	goto fail;

    /* wait for all done */
    code = bnode_ApplyInstance(swproc, NULL);
    if (code)
	goto fail;

    /* start them up again */
    code = bnode_ApplyInstance(stproc, NULL);

  fail:
    osi_auditU(acall, BOS_RestartAllEvent, code, AUD_END);
    return code;
}
开发者ID:hwr,项目名称:openafs,代码行数:31,代码来源:bosoprocs.c

示例5: SBOZO_Restart

afs_int32
SBOZO_Restart(struct rx_call *acall, char *ainstance)
{
    struct bnode *tb;
    afs_int32 code;
    char caller[MAXKTCNAMELEN];

    if (!afsconf_SuperUser(bozo_confdir, acall, caller)) {
	code = BZACCESS;
	goto fail;
    }
    if (DoLogging)
	bozo_Log("%s is executing Restart '%s'\n", caller, ainstance);

    tb = bnode_FindInstance(ainstance);
    if (!tb) {
	code = BZNOENT;
	goto fail;
    }

    bnode_Hold(tb);
    bnode_SetStat(tb, BSTAT_SHUTDOWN);
    code = bnode_WaitStatus(tb, BSTAT_SHUTDOWN);	/* this can fail */
    bnode_ResetErrorCount(tb);
    bnode_SetStat(tb, BSTAT_NORMAL);
    bnode_Release(tb);

  fail:
    osi_auditU(acall, BOS_RestartEvent, code, AUD_STR, ainstance, AUD_END);
    return code;
}
开发者ID:hwr,项目名称:openafs,代码行数:31,代码来源:bosoprocs.c

示例6: SBOZO_AddKey

afs_int32
SBOZO_AddKey(struct rx_call *acall, afs_int32 an, struct bozo_key *akey)
{
    afs_int32 code;
    char caller[MAXKTCNAMELEN];
    rxkad_level enc_level = rxkad_clear;
    int noauth;

    if (!afsconf_SuperUser(bozo_confdir, acall, caller)) {
	code = BZACCESS;
	goto fail;
    }
    noauth = afsconf_GetNoAuthFlag(bozo_confdir);
    rxkad_GetServerInfo(rx_ConnectionOf(acall), &enc_level, 0, 0, 0, 0, 0);
    if ((!noauth) && (enc_level != rxkad_crypt)) {
	code = BZENCREQ;
	goto fail;
    }
    if (DoLogging)
	bozo_Log("%s is executing AddKey\n", caller);

    code = afsconf_AddKey(bozo_confdir, an, akey->data, 0);
    if (code == AFSCONF_KEYINUSE)
	code = BZKEYINUSE;	/* Unique code for afs rpc calls */
  fail:
    osi_auditU(acall, BOS_AddKeyEvent, code, AUD_END);
    return code;
}
开发者ID:hwr,项目名称:openafs,代码行数:28,代码来源:bosoprocs.c

示例7: SBOZO_SetStatus

afs_int32
SBOZO_SetStatus(struct rx_call *acall, char *ainstance, afs_int32 astatus)
{
    struct bnode *tb;
    afs_int32 code;
    char caller[MAXKTCNAMELEN];

    if (!afsconf_SuperUser(bozo_confdir, acall, caller)) {
	code = BZACCESS;
	goto fail;
    }
    if (DoLogging)
	bozo_Log("%s is executing SetStatus '%s' (status = %d)\n", caller,
		 ainstance, astatus);

    tb = bnode_FindInstance(ainstance);
    if (!tb) {
	code = BZNOENT;
	goto fail;
    }
    bnode_Hold(tb);
    bnode_SetFileGoal(tb, astatus);
    code = bnode_SetStat(tb, astatus);
    bnode_Release(tb);

  fail:
    osi_auditU(acall, BOS_SetStatusEvent, code, AUD_STR, ainstance, AUD_END);
    return code;
}
开发者ID:hwr,项目名称:openafs,代码行数:29,代码来源:bosoprocs.c

示例8: SBOZO_Exec

afs_int32
SBOZO_Exec(struct rx_call *acall, char *acmd)
{

    char caller[MAXKTCNAMELEN];
    int code;

    if (!afsconf_SuperUser(bozo_confdir, acall, caller)) {
	code = BZACCESS;
	goto fail;
    }
    if (bozo_isrestricted) {
	code = BZACCESS;
	goto fail;
    }
    if (DoLogging)
	bozo_Log("%s is executing the shell command '%s'\n", caller, acmd);

    /* should copy output to acall, but don't yet cause its hard */
    /*  hard... NOT!  Nnow _at least_ return the exit status */
    code = system(acmd);
    osi_auditU(acall, BOS_ExecEvent, code, AUD_STR, acmd, AUD_END);

  fail:
    return code;
}
开发者ID:hwr,项目名称:openafs,代码行数:26,代码来源:bosoprocs.c

示例9: SBUDB_GetInstanceId

afs_int32
SBUDB_GetInstanceId(struct rx_call *call, afs_uint32 *instanceId)
{
    afs_int32 code;

    code = GetInstanceId(call, instanceId);
    osi_auditU(call, BUDB_GetIIdEvent, code, AUD_END);
    return code;
}
开发者ID:bagdxk,项目名称:openafs,代码行数:9,代码来源:db_lock.c

示例10: SBUDB_FreeAllLocks

afs_int32
SBUDB_FreeAllLocks(struct rx_call *call, afs_uint32 instanceId)
{
    afs_int32 code;

    code = FreeAllLocks(call, instanceId);
    osi_auditU(call, BUDB_FrALckEvent, code, AUD_END);
    return code;
}
开发者ID:bagdxk,项目名称:openafs,代码行数:9,代码来源:db_lock.c

示例11: SBUDB_FreeLock

afs_int32
SBUDB_FreeLock(struct rx_call *call, afs_uint32 lockHandle)
{
    afs_int32 code;

    code = FreeLock(call, lockHandle);
    osi_auditU(call, BUDB_FreLckEvent, code, AUD_END);
    return code;
}
开发者ID:bagdxk,项目名称:openafs,代码行数:9,代码来源:db_lock.c

示例12: SBUDB_RestoreDbHeader

afs_int32
SBUDB_RestoreDbHeader(struct rx_call *call, struct DbHeader *header)
{
    afs_int32 code;

    code = RestoreDbHeader(call, header);
    osi_auditU(call, BUDB_RstDBHEvent, code, AUD_END);
    return code;
}
开发者ID:stevenjenkins,项目名称:openafs,代码行数:9,代码来源:dbs_dump.c

示例13: SBUDB_DumpDB

afs_int32
SBUDB_DumpDB(struct rx_call *call, int firstcall, afs_int32 maxLength,
             charListT *charListPtr, afs_int32 *done)
{
    afs_int32 code;

    code = DumpDB(call, firstcall, maxLength, charListPtr, done);
    osi_auditU(call, BUDB_DmpDBEvent, code, AUD_END);
    return code;
}
开发者ID:stevenjenkins,项目名称:openafs,代码行数:10,代码来源:dbs_dump.c

示例14: SBUDB_GetLock

afs_int32
SBUDB_GetLock(struct rx_call *call, afs_uint32 instanceId, afs_int32 lockName,
	      afs_int32 expiration, afs_uint32 *lockHandle)
{
    afs_int32 code;

    code = GetLock(call, instanceId, lockName, expiration, lockHandle);
    osi_auditU(call, BUDB_GetLckEvent, code, AUD_END);
    return code;
}
开发者ID:bagdxk,项目名称:openafs,代码行数:10,代码来源:db_lock.c

示例15: SBUDB_GetTextVersion

afs_int32
SBUDB_GetTextVersion(struct rx_call *call, afs_int32 textType, 
		     afs_uint32 *tversion)
{
    afs_int32 code;

    code = GetTextVersion(call, textType, tversion);
    osi_auditU(call, BUDB_GetTxVEvent, code, AUD_LONG, textType, AUD_END);
    return code;
}
开发者ID:snktagarwal,项目名称:openafs,代码行数:10,代码来源:db_text.c


注:本文中的osi_auditU函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。