summaryrefslogtreecommitdiff
path: root/libpam/include
diff options
context:
space:
mode:
authorTomas Mraz <tm@t8m.info>2005-09-19 15:58:28 +0000
committerTomas Mraz <tm@t8m.info>2005-09-19 15:58:28 +0000
commit37d83de50414fdaaa6214a997d2ffa27c687d371 (patch)
tree0c20b3892d643f607305ec3195c92872bd271318 /libpam/include
parent437861460715738407cb012e2a415db86394a530 (diff)
Relevant BUGIDs:
Purpose of commit: cleanup Commit summary: --------------- Added PAM_NONNULL attributes to some public API (by ldv) Removed const qualifiers from pam_get_item, pam_get_data to comply with spec
Diffstat (limited to 'libpam/include')
-rw-r--r--libpam/include/security/_pam_types.h65
-rw-r--r--libpam/include/security/pam_appl.h31
-rw-r--r--libpam/include/security/pam_ext.h4
-rw-r--r--libpam/include/security/pam_modules.h20
4 files changed, 71 insertions, 49 deletions
diff --git a/libpam/include/security/_pam_types.h b/libpam/include/security/_pam_types.h
index b701fec2..c866eb62 100644
--- a/libpam/include/security/_pam_types.h
+++ b/libpam/include/security/_pam_types.h
@@ -145,16 +145,46 @@ typedef struct pam_handle pam_handle_t;
#define PAM_FAIL_DELAY 10 /* app supplied function to override failure
delays */
+/* -------------- Special defines used by Linux-PAM -------------- */
+
+#if defined(__GNUC__) && defined(__GNUC_MINOR__)
+# define PAM_GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+# define PAM_GNUC_PREREQ(maj, min) 0
+#endif
+
+#if PAM_GNUC_PREREQ(2,5)
+# define PAM_FORMAT(params) __attribute__((__format__ params))
+#else
+# define PAM_FORMAT(params)
+#endif
+
+#if PAM_GNUC_PREREQ(3,3)
+# define PAM_NONNULL(params) __attribute__((__nonnull__ params))
+#else
+# define PAM_NONNULL(params)
+#endif
+
/* ---------- Common Linux-PAM application/module PI ----------- */
-extern int pam_set_item(pam_handle_t *pamh, int item_type, const void *item);
-extern int pam_get_item(const pam_handle_t *pamh, int item_type,
- const void **item);
-extern const char *pam_strerror(pam_handle_t *pamh, int errnum);
+extern int PAM_NONNULL((1))
+pam_set_item(pam_handle_t *pamh, int item_type, const void *item);
+
+extern int PAM_NONNULL((1,3))
+pam_get_item(pam_handle_t *pamh, int item_type, const void **item);
+
+extern const char *
+pam_strerror(pam_handle_t *pamh, int errnum);
-extern int pam_putenv(pam_handle_t *pamh, const char *name_value);
-extern const char *pam_getenv(pam_handle_t *pamh, const char *name);
-extern char **pam_getenvlist(pam_handle_t *pamh);
+extern int PAM_NONNULL((1,2))
+pam_putenv(pam_handle_t *pamh, const char *name_value);
+
+extern const char * PAM_NONNULL((1,2))
+pam_getenv(pam_handle_t *pamh, const char *name);
+
+extern char ** PAM_NONNULL((1))
+pam_getenvlist(pam_handle_t *pamh);
/* ---------- Common Linux-PAM application/module PI ----------- */
@@ -262,27 +292,6 @@ struct pam_conv {
void *appdata_ptr;
};
-/* -------------- Special defines used by Linux-PAM -------------- */
-
-#if defined(__GNUC__) && defined(__GNUC_MINOR__)
-# define PAM_GNUC_PREREQ(maj, min) \
- ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-#else
-# define PAM_GNUC_PREREQ(maj, min) 0
-#endif
-
-#if PAM_GNUC_PREREQ(2,5)
-# define PAM_FORMAT(params) __attribute__((__format__ params))
-#else
-# define PAM_FORMAT(params)
-#endif
-
-#if PAM_GNUC_PREREQ(3,3)
-# define PAM_NONNULL(params) __attribute__((__nonnull__ params))
-#else
-# define PAM_NONNULL(params)
-#endif
-
/* ... adapted from the pam_appl.h file created by Theodore Ts'o and
*
* Copyright Theodore Ts'o, 1996. All rights reserved.
diff --git a/libpam/include/security/pam_appl.h b/libpam/include/security/pam_appl.h
index b2eeb9f0..59e369b8 100644
--- a/libpam/include/security/pam_appl.h
+++ b/libpam/include/security/pam_appl.h
@@ -24,28 +24,39 @@ extern "C" {
/* -------------- The Linux-PAM Framework layer API ------------- */
-extern int pam_start(const char *service_name, const char *user,
- const struct pam_conv *pam_conversation,
- pam_handle_t **pamh);
-extern int pam_end(pam_handle_t *pamh, int pam_status);
+extern int PAM_NONNULL((1,3,4))
+pam_start(const char *service_name, const char *user,
+ const struct pam_conv *pam_conversation,
+ pam_handle_t **pamh);
+
+extern int PAM_NONNULL((1))
+pam_end(pam_handle_t *pamh, int pam_status);
/* Authentication API's */
-extern int pam_authenticate(pam_handle_t *pamh, int flags);
-extern int pam_setcred(pam_handle_t *pamh, int flags);
+extern int PAM_NONNULL((1))
+pam_authenticate(pam_handle_t *pamh, int flags);
+
+extern int PAM_NONNULL((1))
+pam_setcred(pam_handle_t *pamh, int flags);
/* Account Management API's */
-extern int pam_acct_mgmt(pam_handle_t *pamh, int flags);
+extern int PAM_NONNULL((1))
+pam_acct_mgmt(pam_handle_t *pamh, int flags);
/* Session Management API's */
-extern int pam_open_session(pam_handle_t *pamh, int flags);
-extern int pam_close_session(pam_handle_t *pamh, int flags);
+extern int PAM_NONNULL((1))
+pam_open_session(pam_handle_t *pamh, int flags);
+
+extern int PAM_NONNULL((1))
+pam_close_session(pam_handle_t *pamh, int flags);
/* Password Management API's */
-extern int pam_chauthtok(pam_handle_t *pamh, int flags);
+extern int PAM_NONNULL((1))
+pam_chauthtok(pam_handle_t *pamh, int flags);
#ifdef __cplusplus
}
diff --git a/libpam/include/security/pam_ext.h b/libpam/include/security/pam_ext.h
index 1d0c1985..f6148545 100644
--- a/libpam/include/security/pam_ext.h
+++ b/libpam/include/security/pam_ext.h
@@ -45,11 +45,11 @@ extern void PAM_FORMAT((printf, 3, 4)) PAM_NONNULL((3))
pam_syslog (const pam_handle_t *pamh, int priority, const char *fmt, ...);
extern int PAM_FORMAT((printf, 4, 0)) PAM_NONNULL((1,4))
-pam_vprompt (const pam_handle_t *pamh, int style, char **response,
+pam_vprompt (pam_handle_t *pamh, int style, char **response,
const char *fmt, va_list args);
extern int PAM_FORMAT((printf, 4, 5)) PAM_NONNULL((1,4))
-pam_prompt (const pam_handle_t *pamh, int style, char **response,
+pam_prompt (pam_handle_t *pamh, int style, char **response,
const char *fmt, ...);
#define pam_error(pamh, fmt...) \
diff --git a/libpam/include/security/pam_modules.h b/libpam/include/security/pam_modules.h
index f174e316..7f75f9dc 100644
--- a/libpam/include/security/pam_modules.h
+++ b/libpam/include/security/pam_modules.h
@@ -12,15 +12,17 @@
/* -------------- The Linux-PAM Module PI ------------- */
-extern int pam_set_data(pam_handle_t *pamh, const char *module_data_name,
- void *data,
- void (*cleanup)(pam_handle_t *pamh, void *data,
- int error_status));
-extern int pam_get_data(const pam_handle_t *pamh,
- const char *module_data_name, const void **data);
-
-extern int pam_get_user(pam_handle_t *pamh, const char **user
- , const char *prompt);
+extern int PAM_NONNULL((1,2))
+pam_set_data(pam_handle_t *pamh, const char *module_data_name, void *data,
+ void (*cleanup)(pam_handle_t *pamh, void *data,
+ int error_status));
+
+extern int PAM_NONNULL((1,2,3))
+pam_get_data(pam_handle_t *pamh, const char *module_data_name,
+ const void **data);
+
+extern int PAM_NONNULL((1,2))
+pam_get_user(pam_handle_t *pamh, const char **user, const char *prompt);
#ifdef PAM_STATIC