本文整理汇总了C++中RETURNC函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURNC函数的具体用法?C++ RETURNC怎么用?C++ RETURNC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RETURNC函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pam_get_user
int
pam_get_user(pam_handle_t *pamh,
const char **user,
const char *prompt)
{
const void *promptp;
char *resp;
int r;
ENTER();
if (pamh == NULL || user == NULL)
RETURNC(PAM_SYSTEM_ERR);
r = pam_get_item(pamh, PAM_USER, (const void **)user);
if (r == PAM_SUCCESS && *user != NULL)
RETURNC(PAM_SUCCESS);
if (prompt == NULL) {
r = pam_get_item(pamh, PAM_USER_PROMPT, &promptp);
if (r != PAM_SUCCESS || promptp == NULL)
prompt = user_prompt;
else
prompt = promptp;
}
r = pam_prompt(pamh, PAM_PROMPT_ECHO_ON, &resp, "%s", prompt);
if (r != PAM_SUCCESS)
RETURNC(r);
r = pam_set_item(pamh, PAM_USER, resp);
FREE(resp);
if (r != PAM_SUCCESS)
RETURNC(r);
r = pam_get_item(pamh, PAM_USER, (const void **)user);
RETURNC(r);
}
开发者ID:2014-class,项目名称:freerouter,代码行数:32,代码来源:pam_get_user.c
示例2: openpam_configure
int
openpam_configure(pam_handle_t *pamh,
const char *service)
{
pam_facility_t fclt;
int serrno;
ENTERS(service);
if (!valid_service_name(service)) {
openpam_log(PAM_LOG_ERROR, "invalid service name");
RETURNC(PAM_SYSTEM_ERR);
}
if (openpam_load_chain(pamh, service, PAM_FACILITY_ANY) < 0) {
if (errno != ENOENT)
goto load_err;
}
for (fclt = 0; fclt < PAM_NUM_FACILITIES; ++fclt) {
if (pamh->chains[fclt] != NULL)
continue;
if (openpam_load_chain(pamh, PAM_OTHER, fclt) < 0)
goto load_err;
}
RETURNC(PAM_SUCCESS);
load_err:
serrno = errno;
openpam_clear_chains(pamh->chains);
errno = serrno;
RETURNC(PAM_SYSTEM_ERR);
}
开发者ID:AsherBond,项目名称:freebsd,代码行数:29,代码来源:openpam_configure.c
示例3: pam_get_item
int
pam_get_item(const pam_handle_t *pamh,
int item_type,
const void **item)
{
ENTERI(item_type);
if (pamh == NULL)
RETURNC(PAM_SYSTEM_ERR);
switch (item_type) {
case PAM_SERVICE:
case PAM_USER:
case PAM_AUTHTOK:
case PAM_OLDAUTHTOK:
case PAM_TTY:
case PAM_RHOST:
case PAM_RUSER:
case PAM_CONV:
case PAM_USER_PROMPT:
case PAM_REPOSITORY:
case PAM_AUTHTOK_PROMPT:
case PAM_OLDAUTHTOK_PROMPT:
case PAM_HOST:
*item = pamh->item[item_type];
RETURNC(PAM_SUCCESS);
default:
RETURNC(PAM_SYMBOL_ERR);
}
}
开发者ID:2asoft,项目名称:freebsd,代码行数:29,代码来源:pam_get_item.c
示例4: pam_start
int
pam_start(const char *service,
const char *user,
const struct pam_conv *pam_conv,
pam_handle_t **pamh)
{
char hostname[HOST_NAME_MAX + 1];
struct pam_handle *ph;
int r;
ENTER();
if ((ph = calloc(1, sizeof *ph)) == NULL)
RETURNC(PAM_BUF_ERR);
if ((r = pam_set_item(ph, PAM_SERVICE, service)) != PAM_SUCCESS)
goto fail;
if (gethostname(hostname, sizeof hostname) != 0)
strlcpy(hostname, "localhost", sizeof hostname);
if ((r = pam_set_item(ph, PAM_HOST, hostname)) != PAM_SUCCESS)
goto fail;
if ((r = pam_set_item(ph, PAM_USER, user)) != PAM_SUCCESS)
goto fail;
if ((r = pam_set_item(ph, PAM_CONV, pam_conv)) != PAM_SUCCESS)
goto fail;
if ((r = openpam_configure(ph, service)) != PAM_SUCCESS)
goto fail;
*pamh = ph;
openpam_log(PAM_LOG_DEBUG, "pam_start(\"%s\") succeeded", service);
RETURNC(PAM_SUCCESS);
fail:
pam_end(ph, r);
RETURNC(r);
}
开发者ID:shankerwangmiao,项目名称:OpenPAM,代码行数:32,代码来源:pam_start.c
示例5: pam_set_data
int
pam_set_data(pam_handle_t *pamh,
const char *module_data_name,
void *data,
void (*cleanup)(pam_handle_t *pamh,
void *data,
int pam_end_status))
{
pam_data_t *dp;
ENTERS(module_data_name);
if (pamh == NULL)
RETURNC(PAM_SYSTEM_ERR);
for (dp = pamh->module_data; dp != NULL; dp = dp->next) {
if (strcmp(dp->name, module_data_name) == 0) {
if (dp->cleanup)
(dp->cleanup)(pamh, dp->data, PAM_SUCCESS);
dp->data = data;
dp->cleanup = cleanup;
RETURNC(PAM_SUCCESS);
}
}
if ((dp = malloc(sizeof *dp)) == NULL)
RETURNC(PAM_BUF_ERR);
if ((dp->name = strdup(module_data_name)) == NULL) {
FREE(dp);
RETURNC(PAM_BUF_ERR);
}
dp->data = data;
dp->cleanup = cleanup;
dp->next = pamh->module_data;
pamh->module_data = dp;
RETURNC(PAM_SUCCESS);
}
开发者ID:execunix,项目名称:vinos,代码行数:34,代码来源:pam_set_data.c
示例6: pam_set_item
int
pam_set_item(pam_handle_t *pamh,
int item_type,
const void *item)
{
void **slot, *tmp;
size_t nsize, osize;
ENTERI(item_type);
if (pamh == NULL)
RETURNC(PAM_SYSTEM_ERR);
slot = &pamh->item[item_type];
osize = nsize = 0;
switch (item_type) {
case PAM_SERVICE:
/* set once only, by pam_start() */
if (*slot != NULL)
RETURNC(PAM_SYSTEM_ERR);
/* fall through */
case PAM_USER:
case PAM_AUTHTOK:
case PAM_OLDAUTHTOK:
case PAM_TTY:
case PAM_RHOST:
case PAM_RUSER:
case PAM_USER_PROMPT:
case PAM_AUTHTOK_PROMPT:
case PAM_OLDAUTHTOK_PROMPT:
case PAM_HOST:
if (*slot != NULL)
osize = strlen(*slot) + 1;
if (item != NULL)
nsize = strlen(item) + 1;
break;
case PAM_REPOSITORY:
osize = nsize = sizeof(struct pam_repository);
break;
case PAM_CONV:
osize = nsize = sizeof(struct pam_conv);
break;
default:
RETURNC(PAM_SYMBOL_ERR);
}
if (*slot != NULL) {
memset(*slot, 0xd0, osize);
FREE(*slot);
}
if (item != NULL) {
if ((tmp = malloc(nsize)) == NULL)
RETURNC(PAM_BUF_ERR);
memcpy(tmp, item, nsize);
} else {
tmp = NULL;
}
*slot = tmp;
RETURNC(PAM_SUCCESS);
}
开发者ID:2asoft,项目名称:freebsd,代码行数:57,代码来源:pam_set_item.c
示例7: openpam_get_feature
int
openpam_get_feature(int feature, int *onoff)
{
ENTERF(feature);
if (feature < 0 || feature >= OPENPAM_NUM_FEATURES)
RETURNC(PAM_SYMBOL_ERR);
*onoff = openpam_features[feature].onoff;
RETURNC(PAM_SUCCESS);
}
开发者ID:enukane,项目名称:netbsd-src,代码行数:10,代码来源:openpam_get_feature.c
示例8: pam_open_session
int
pam_open_session(pam_handle_t *pamh,
int flags)
{
int r;
ENTER();
if (flags & ~(PAM_SILENT))
RETURNC(PAM_SYMBOL_ERR);
r = openpam_dispatch(pamh, PAM_SM_OPEN_SESSION, flags);
RETURNC(r);
}
开发者ID:2asoft,项目名称:freebsd,代码行数:12,代码来源:pam_open_session.c
示例9: pam_authenticate
int
pam_authenticate(pam_handle_t *pamh,
int flags)
{
int r;
ENTER();
if (flags & ~(PAM_SILENT|PAM_DISALLOW_NULL_AUTHTOK))
RETURNC(PAM_SYMBOL_ERR);
r = openpam_dispatch(pamh, PAM_SM_AUTHENTICATE, flags);
pam_set_item(pamh, PAM_AUTHTOK, NULL);
RETURNC(r);
}
开发者ID:execunix,项目名称:vinos,代码行数:13,代码来源:pam_authenticate.c
示例10: pam_setcred
int
pam_setcred(pam_handle_t *pamh,
int flags)
{
int r;
ENTER();
if (flags & ~(PAM_SILENT|PAM_ESTABLISH_CRED|PAM_DELETE_CRED|
PAM_REINITIALIZE_CRED|PAM_REFRESH_CRED))
RETURNC(PAM_SYMBOL_ERR);
/* XXX enforce exclusivity */
r = openpam_dispatch(pamh, PAM_SM_SETCRED, flags);
RETURNC(r);
/*NOTREACHED*/
}
开发者ID:gosudream,项目名称:netbsd-src,代码行数:15,代码来源:pam_setcred.c
示例11: pam_start
int
pam_start(const char *service,
const char *user,
const struct pam_conv *pam_conv,
pam_handle_t **pamh)
{
char *hostname = NULL;
struct pam_handle *ph;
int r;
size_t hostname_size;
long h;
#ifdef _SC_HOST_NAME_MAX
h = sysconf(_SC_HOST_NAME_MAX);
#else
h = -1;
#endif
hostname_size = (size_t)(h < 10 ? 1024 : h) + 1;
ENTER();
if ((ph = calloc((size_t)1, sizeof *ph)) == NULL)
RETURNC(PAM_BUF_ERR);
if ((r = pam_set_item(ph, PAM_SERVICE, service)) != PAM_SUCCESS)
goto fail;
if ((hostname = malloc(hostname_size)) == NULL)
goto fail;
if (gethostname(hostname, hostname_size) != 0)
strlcpy(hostname, "localhost", hostname_size);
if ((r = pam_set_item(ph, PAM_HOST, hostname)) != PAM_SUCCESS)
goto fail;
if ((r = pam_set_item(ph, PAM_USER, user)) != PAM_SUCCESS)
goto fail;
if ((r = pam_set_item(ph, PAM_CONV, pam_conv)) != PAM_SUCCESS)
goto fail;
if ((r = openpam_configure(ph, service)) != PAM_SUCCESS)
goto fail;
free(hostname);
*pamh = ph;
openpam_log(PAM_LOG_DEBUG, "pam_start(\"%s\") succeeded", service);
RETURNC(PAM_SUCCESS);
fail:
free(hostname);
pam_end(ph, r);
RETURNC(r);
}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:45,代码来源:pam_start.c
示例12: pam_chauthtok
int
pam_chauthtok(pam_handle_t *pamh,
int flags)
{
int r;
ENTER();
if (flags & ~(PAM_SILENT|PAM_CHANGE_EXPIRED_AUTHTOK))
RETURNC(PAM_SYMBOL_ERR);
r = openpam_dispatch(pamh, PAM_SM_CHAUTHTOK,
flags | PAM_PRELIM_CHECK);
if (r == PAM_SUCCESS)
r = openpam_dispatch(pamh, PAM_SM_CHAUTHTOK,
flags | PAM_UPDATE_AUTHTOK);
pam_set_item(pamh, PAM_OLDAUTHTOK, NULL);
pam_set_item(pamh, PAM_AUTHTOK, NULL);
RETURNC(r);
}
开发者ID:execunix,项目名称:vinos,代码行数:18,代码来源:pam_chauthtok.c
示例13: pam_get_data
int
pam_get_data(const pam_handle_t *pamh,
const char *module_data_name,
const void **data)
{
pam_data_t *dp;
ENTERS(module_data_name);
if (pamh == NULL)
RETURNC(PAM_SYSTEM_ERR);
for (dp = pamh->module_data; dp != NULL; dp = dp->next) {
if (strcmp(dp->name, module_data_name) == 0) {
*data = (void *)dp->data;
RETURNC(PAM_SUCCESS);
}
}
RETURNC(PAM_NO_MODULE_DATA);
}
开发者ID:2014-class,项目名称:freerouter,代码行数:18,代码来源:pam_get_data.c
示例14: pam_sm_authenticate
int
pam_sm_authenticate(pam_handle_t *pamh,
int flags,
int argc,
const char **argv)
{
ENTER();
RETURNC(PAM_SYSTEM_ERR);
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:10,代码来源:pam_sm_authenticate.c
示例15: pam_sm_open_session
int
pam_sm_open_session(pam_handle_t *pamh,
int flags,
int argc,
const char **argv)
{
ENTER();
RETURNC(PAM_SYSTEM_ERR);
}
开发者ID:enukane,项目名称:netbsd-src,代码行数:10,代码来源:pam_sm_open_session.c
示例16: pam_acct_mgmt
int
pam_acct_mgmt(pam_handle_t *pamh,
int flags)
{
int r;
ENTER();
r = openpam_dispatch(pamh, PAM_SM_ACCT_MGMT, flags);
RETURNC(r);
}
开发者ID:execunix,项目名称:vinos,代码行数:10,代码来源:pam_acct_mgmt.c
示例17: pam_sm_acct_mgmt
int
pam_sm_acct_mgmt(pam_handle_t *pamh,
int flags,
int argc,
const char **argv)
{
ENTER();
RETURNC(PAM_SYSTEM_ERR);
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:10,代码来源:pam_sm_acct_mgmt.c
示例18: pam_set_mapped_authtok
int
pam_set_mapped_authtok(pam_handle_t *pamh,
const char *target_module_username,
size_t target_authtok_len,
unsigned char *target_module_authtok,
const char *target_module_type,
const char *target_authn_domain)
{
ENTER();
RETURNC(PAM_SYSTEM_ERR);
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:12,代码来源:pam_set_mapped_authtok.c
示例19: pam_authenticate_secondary
int
pam_authenticate_secondary(pam_handle_t *pamh,
char *target_username,
char *target_module_type,
char *target_authn_domain,
char *target_supp_data,
char *target_module_authtok,
int flags)
{
ENTER();
RETURNC(PAM_SYSTEM_ERR);
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:13,代码来源:pam_authenticate_secondary.c
示例20: pam_set_mapped_username
int
pam_set_mapped_username(pam_handle_t *pamh,
char *src_username,
char *src_module_type,
char *src_authn_domain,
char *target_module_username,
char *target_module_type,
char *target_authn_domain)
{
ENTER();
RETURNC(PAM_SYSTEM_ERR);
}
开发者ID:2asoft,项目名称:freebsd,代码行数:13,代码来源:pam_set_mapped_username.c
注:本文中的RETURNC函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论