From de9f932bb2568cf749fe324c28e282ead3f334d5 Mon Sep 17 00:00:00 2001 From: "Thierry bordaz (tbordaz)" Date: Thu, 24 Jan 2013 16:17:32 +0100 Subject: [PATCH] Ticket #487 - Possible to add invalid attribute values to PAM PTA plugin configuration Bug Description: Original issue was discovered in 1.2.10 and was fixed in 1.2.11(and after) as a side effect of ticket 181. A minor issue was introduced by ticket181. When changing pamIDMapMethod with an invalid value, the returned text is: additional info: Error: valid values for pamMissingSuffix are PAMPT_MISSING_SUFFIX_ERROR, PAMPT_MISSING_SUFFIX_ALLOW, PAMPT_MISSING_SUFFIX_IGNORE where it should be additional info: Error: valid values for pamMissingSuffix are ERROR, ALLOW, IGNORE Ticket 487 is used to fix this minor issue Fix Description: The fix is to let the macro to be preprocessed The fix could be verified with the following test case: Create an instance, enable pam-plugin, restart the instance, ldapmodify ... < --- ldap/servers/plugins/pam_passthru/pam_ptconfig.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ldap/servers/plugins/pam_passthru/pam_ptconfig.c b/ldap/servers/plugins/pam_passthru/pam_ptconfig.c index fce8000..fb2dc2b 100644 --- a/ldap/servers/plugins/pam_passthru/pam_ptconfig.c +++ b/ldap/servers/plugins/pam_passthru/pam_ptconfig.c @@ -244,11 +244,10 @@ check_missing_suffix_flag(int val) { return PR_FALSE; } -#define MAKE_STR(x) #x static char *get_missing_suffix_values() { - return MAKE_STR(PAMPT_MISSING_SUFFIX_ERROR) ", " MAKE_STR(PAMPT_MISSING_SUFFIX_ALLOW) ", " - MAKE_STR(PAMPT_MISSING_SUFFIX_IGNORE); + return PAMPT_MISSING_SUFFIX_ERROR_STRING ", " PAMPT_MISSING_SUFFIX_ALLOW_STRING ", " + PAMPT_MISSING_SUFFIX_IGNORE_STRING; } static char *get_map_method_values() -- 1.7.11.7