Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libcasper/services/cap_pwd/cap_pwd.h
Show All 26 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _CAP_PWD_H_ | #ifndef _CAP_PWD_H_ | ||||
#define _CAP_PWD_H_ | #define _CAP_PWD_H_ | ||||
#ifdef HAVE_CASPER | |||||
#define WITH_CASPER | |||||
#endif | |||||
#ifdef WITH_CASPER | |||||
struct passwd *cap_getpwent(cap_channel_t *chan); | struct passwd *cap_getpwent(cap_channel_t *chan); | ||||
struct passwd *cap_getpwnam(cap_channel_t *chan, const char *login); | struct passwd *cap_getpwnam(cap_channel_t *chan, const char *login); | ||||
struct passwd *cap_getpwuid(cap_channel_t *chan, uid_t uid); | struct passwd *cap_getpwuid(cap_channel_t *chan, uid_t uid); | ||||
int cap_getpwent_r(cap_channel_t *chan, struct passwd *pwd, char *buffer, | int cap_getpwent_r(cap_channel_t *chan, struct passwd *pwd, char *buffer, | ||||
size_t bufsize, struct passwd **result); | size_t bufsize, struct passwd **result); | ||||
int cap_getpwnam_r(cap_channel_t *chan, const char *name, struct passwd *pwd, | int cap_getpwnam_r(cap_channel_t *chan, const char *name, struct passwd *pwd, | ||||
char *buffer, size_t bufsize, struct passwd **result); | char *buffer, size_t bufsize, struct passwd **result); | ||||
int cap_getpwuid_r(cap_channel_t *chan, uid_t uid, struct passwd *pwd, | int cap_getpwuid_r(cap_channel_t *chan, uid_t uid, struct passwd *pwd, | ||||
char *buffer, size_t bufsize, struct passwd **result); | char *buffer, size_t bufsize, struct passwd **result); | ||||
int cap_setpassent(cap_channel_t *chan, int stayopen); | int cap_setpassent(cap_channel_t *chan, int stayopen); | ||||
void cap_setpwent(cap_channel_t *chan); | void cap_setpwent(cap_channel_t *chan); | ||||
void cap_endpwent(cap_channel_t *chan); | void cap_endpwent(cap_channel_t *chan); | ||||
int cap_pwd_limit_cmds(cap_channel_t *chan, const char * const *cmds, | int cap_pwd_limit_cmds(cap_channel_t *chan, const char * const *cmds, | ||||
size_t ncmds); | size_t ncmds); | ||||
int cap_pwd_limit_fields(cap_channel_t *chan, const char * const *fields, | int cap_pwd_limit_fields(cap_channel_t *chan, const char * const *fields, | ||||
size_t nfields); | size_t nfields); | ||||
int cap_pwd_limit_users(cap_channel_t *chan, const char * const *names, | int cap_pwd_limit_users(cap_channel_t *chan, const char * const *names, | ||||
size_t nnames, uid_t *uids, size_t nuids); | size_t nnames, uid_t *uids, size_t nuids); | ||||
#else | |||||
#define cap_getpwent(chan) getpwent() | |||||
#define cap_getpwnam(chan, login) getpwnam(login) | |||||
#define cap_getpwuid(chan, uid) getpwuid(uid) | |||||
#define cap_getpwent_r(chan, pwd, buffer, bufsize, result) \ | |||||
getpwent_r(pwd, buffer, bufsize, result) | |||||
#define cap_getpwnam_r(chan, name, pwd, buffer, bufsize, result) \ | |||||
getpwnam_r(name, pwd, buffer, bufsize, result) | |||||
#define cap_getpwuid_r(chan, uid, pwd, buffer, bufsize, result) \ | |||||
getpwuid_r(uid, pwd, buffer, bufsize, result) | |||||
#define cap_setpassent(chan, stayopen) setpassent(stayopen) | |||||
#define cap_setpwent(chan) setpwent() | |||||
#define cap_endpwent(chan) endpwent() | |||||
#define cap_pwd_limit_cmds(chan, cmds, ncmds) (0) | |||||
#define cap_pwd_limit_fields(chan, fields, nfields) (0) | |||||
#define cap_pwd_limit_users(chan, names, nnames, uids, nuids) (0) | |||||
#endif | |||||
#endif /* !_CAP_PWD_H_ */ | #endif /* !_CAP_PWD_H_ */ |