summaryrefslogtreecommitdiff
path: root/libpam/include/security
diff options
context:
space:
mode:
authorSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 21:06:32 -0800
committerSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 21:06:32 -0800
commitf3c0273b7bd2d7fdcac3fe3604cedd82afc57f49 (patch)
treeead579aab3f7345280205fa43570f2c033b1f6ce /libpam/include/security
parentb70316c593cbc8e5c9155e5c6597497090c6eb88 (diff)
parent46cdce51ed99e5b86c613fb19dafa973c219d255 (diff)
New upstream version 1.1.3
Diffstat (limited to 'libpam/include/security')
-rw-r--r--libpam/include/security/pam_modutil.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/libpam/include/security/pam_modutil.h b/libpam/include/security/pam_modutil.h
index ffdf5ad0..317202de 100644
--- a/libpam/include/security/pam_modutil.h
+++ b/libpam/include/security/pam_modutil.h
@@ -100,6 +100,30 @@ pam_modutil_write(int fd, const char *buffer, int count);
extern int PAM_NONNULL((1,3))
pam_modutil_audit_write(pam_handle_t *pamh, int type,
const char *message, int retval);
+
+struct pam_modutil_privs {
+ gid_t *grplist;
+ int number_of_groups;
+ int allocated;
+ gid_t old_gid;
+ uid_t old_uid;
+ int is_dropped;
+};
+
+#define PAM_MODUTIL_NGROUPS 64
+#define PAM_MODUTIL_DEF_PRIVS(n) \
+ gid_t n##_grplist[PAM_MODUTIL_NGROUPS]; \
+ struct pam_modutil_privs n = { n##_grplist, PAM_MODUTIL_NGROUPS, 0, -1, -1, 0 }
+
+extern int PAM_NONNULL((1,2,3))
+pam_modutil_drop_priv(pam_handle_t *pamh,
+ struct pam_modutil_privs *p,
+ const struct passwd *pw);
+
+extern int PAM_NONNULL((1,2))
+pam_modutil_regain_priv(pam_handle_t *pamh,
+ struct pam_modutil_privs *p);
+
#ifdef __cplusplus
}
#endif