Explorar o código

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 ... <<EOF
		dn: cn=PAM Pass Through Auth,cn=plugins,cn=config
		changetype: modify
		replace: pamMissingSuffix
		pamMissingSuffix: invalid
		EOF

https://fedorahosted.org/389/ticket/487

Reviewed by: Mark Reynolds ([email protected])
Thierry bordaz (tbordaz) %!s(int64=13) %!d(string=hai) anos
pai
achega
ca065479af
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      ldap/servers/plugins/pam_passthru/pam_ptconfig.c

+ 2 - 3
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()