diff options
author | Tomas Mraz <tm@t8m.info> | 2005-09-21 10:00:58 +0000 |
---|---|---|
committer | Tomas Mraz <tm@t8m.info> | 2005-09-21 10:00:58 +0000 |
commit | be09d6354efcb2571731bdffc47da86f22621ac8 (patch) | |
tree | 82117bfbaadb46495a545ba4f567dc9bddd97c33 /libpam/include | |
parent | 627a0401899af257f0fb711ad54194e14a75c530 (diff) | |
download | pam-be09d6354efcb2571731bdffc47da86f22621ac8.tar.gz pam-be09d6354efcb2571731bdffc47da86f22621ac8.tar.bz2 pam-be09d6354efcb2571731bdffc47da86f22621ac8.zip |
Relevant BUGIDs:
Purpose of commit: new feature
Commit summary:
---------------
Moved functions from pammodutil to libpam.
Diffstat (limited to 'libpam/include')
-rw-r--r-- | libpam/include/security/pam_modutil.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/libpam/include/security/pam_modutil.h b/libpam/include/security/pam_modutil.h new file mode 100644 index 00000000..5d03f58f --- /dev/null +++ b/libpam/include/security/pam_modutil.h @@ -0,0 +1,65 @@ +#ifndef _SECURITY__PAM_MODUTIL_H +#define _SECURITY__PAM_MODUTIL_H + +/* + * $Id$ + * + * This file is a list of handy libc wrappers that attempt to provide some + * thread-safe and other convenient functionality to modules in a common form. + * + * A number of these functions reserve space in a pam_[sg]et_data item. + * In all cases, the name of the item is prefixed with "_pammodutil_*". + * + * On systems that simply can't support thread safe programming, these + * functions don't support it either - sorry. + * + * Copyright (c) 2001-2002 Andrew Morgan <morgan@kernel.org> + */ + +#include <security/_pam_types.h> + +extern struct passwd * PAM_NONNULL((1,2)) +pam_modutil_getpwnam(pam_handle_t *pamh, const char *user); + +extern struct passwd * PAM_NONNULL((1)) +pam_modutil_getpwuid(pam_handle_t *pamh, uid_t uid); + +extern struct group * PAM_NONNULL((1,2)) +pam_modutil_getgrnam(pam_handle_t *pamh, const char *group); + +extern struct group * PAM_NONNULL((1)) +pam_modutil_getgrgid(pam_handle_t *pamh, gid_t gid); + +extern struct spwd * PAM_NONNULL((1,2)) +pam_modutil_getspnam(pam_handle_t *pamh, const char *user); + +extern int PAM_NONNULL((1,2,3)) +pam_modutil_user_in_group_nam_nam(pam_handle_t *pamh, + const char *user, + const char *group); + +extern int PAM_NONNULL((1,2)) +pam_modutil_user_in_group_nam_gid(pam_handle_t *pamh, + const char *user, + gid_t group); + +extern int PAM_NONNULL((1,3)) +pam_modutil_user_in_group_uid_nam(pam_handle_t *pamh, + uid_t user, + const char *group); + +extern int PAM_NONNULL((1)) +pam_modutil_user_in_group_uid_gid(pam_handle_t *pamh, + uid_t user, + gid_t group); + +extern const char * PAM_NONNULL((1)) +pam_modutil_getlogin(pam_handle_t *pamh); + +extern int +pam_modutil_read(int fd, char *buffer, int count); + +extern int +pam_modutil_write(int fd, const char *buffer, int count); + +#endif /* _SECURITY__PAM_MODUTIL_H */ |