aboutsummaryrefslogtreecommitdiff
path: root/libpam
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2024-02-22 17:04:00 +0100
committerDmitry V. Levin <ldv@strace.io>2024-02-22 16:04:00 +0000
commit5bd5ab8b167115104c361b3d417ed16059493a9c (patch)
tree0ced2bbf5abe7c3b396d5f8bcf49c8ee5e37edd5 /libpam
parente559de0cdd6134a4b87a79aab6928fb1e8c7194c (diff)
downloadpam-5bd5ab8b167115104c361b3d417ed16059493a9c.tar.gz
pam-5bd5ab8b167115104c361b3d417ed16059493a9c.tar.bz2
pam-5bd5ab8b167115104c361b3d417ed16059493a9c.zip
libpam: enclose macro parameters
Diffstat (limited to 'libpam')
-rw-r--r--libpam/include/security/_pam_macros.h24
-rw-r--r--libpam/pam_dispatch.c4
-rw-r--r--libpam/pam_private.h14
3 files changed, 21 insertions, 21 deletions
diff --git a/libpam/include/security/_pam_macros.h b/libpam/include/security/_pam_macros.h
index cd42bf72..d01f51f5 100644
--- a/libpam/include/security/_pam_macros.h
+++ b/libpam/include/security/_pam_macros.h
@@ -34,7 +34,7 @@ do { \
PAM_DEPRECATED register char *xx_; \
register unsigned int i_ = 0; \
if ((xx_=(x))) \
- for (;i_<n; i_++) \
+ for (;i_<(n); i_++) \
xx_[i_] = 0; \
} while (0)
@@ -45,7 +45,7 @@ do { \
#define _pam_drop(X) \
do { \
free(X); \
- X=NULL; \
+ (X)=NULL; \
} while (0)
/*
@@ -53,16 +53,16 @@ do { \
*/
#define _pam_drop_reply(/* struct pam_response * */ reply, /* int */ replies) \
-do { \
- PAM_DEPRECATED int reply_i; \
- \
- for (reply_i=0; reply_i<replies; ++reply_i) { \
- if (reply[reply_i].resp) { \
- _pam_overwrite(reply[reply_i].resp); \
- free(reply[reply_i].resp); \
- } \
- } \
- free(reply); \
+do { \
+ PAM_DEPRECATED int reply_i; \
+ \
+ for (reply_i=0; reply_i<(replies); ++reply_i) { \
+ if ((reply)[reply_i].resp) { \
+ _pam_overwrite((reply)[reply_i].resp); \
+ free((reply)[reply_i].resp); \
+ } \
+ } \
+ free(reply); \
} while (0)
/* some debugging code */
diff --git a/libpam/pam_dispatch.c b/libpam/pam_dispatch.c
index 60ec85bd..3a1d59e8 100644
--- a/libpam/pam_dispatch.c
+++ b/libpam/pam_dispatch.c
@@ -18,8 +18,8 @@
/* impression codes - this gives some sense to the logical choices */
#define _PAM_UNDEF 0
-#define _PAM_POSITIVE +1
-#define _PAM_NEGATIVE -1
+#define _PAM_POSITIVE (+1)
+#define _PAM_NEGATIVE (-1)
/* frozen chain required codes */
#define _PAM_PLEASE_FREEZE 0
diff --git a/libpam/pam_private.h b/libpam/pam_private.h
index f9dd6223..77dc5a69 100644
--- a/libpam/pam_private.h
+++ b/libpam/pam_private.h
@@ -48,7 +48,7 @@
/* components of the pam_handle structure */
-#define _PAM_INVALID_RETVAL -1 /* default value for cached_retval */
+#define _PAM_INVALID_RETVAL (-1) /* default value for cached_retval */
struct handler {
int handler_type;
@@ -193,14 +193,14 @@ struct pam_handle {
#define _PAM_ACTION_IS_JUMP(x) ((x) > 0)
#define _PAM_ACTION_IGNORE 0
-#define _PAM_ACTION_OK -1
-#define _PAM_ACTION_DONE -2
-#define _PAM_ACTION_BAD -3
-#define _PAM_ACTION_DIE -4
-#define _PAM_ACTION_RESET -5
+#define _PAM_ACTION_OK (-1)
+#define _PAM_ACTION_DONE (-2)
+#define _PAM_ACTION_BAD (-3)
+#define _PAM_ACTION_DIE (-4)
+#define _PAM_ACTION_RESET (-5)
/* Add any new entries here. Will need to change ..._UNDEF and then
* need to change pam_tokens.h */
-#define _PAM_ACTION_UNDEF -6 /* this is treated as an error
+#define _PAM_ACTION_UNDEF (-6) /* this is treated as an error
( = _PAM_ACTION_BAD) */
#define PAM_SUBSTACK_MAX_LEVEL 16 /* maximum level of substacks */