Fix parsing set-to-nothing options in ldap section
If the user wants to "unset" the ldap.accountFullName property we need to allow them to set it to the empty string, because no entry in the configuration file implies the default. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
		@@ -153,15 +153,15 @@ class LdapRealm implements Realm {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private static String optdef(final Config c, final String n, final String d) {
 | 
			
		||||
    final String v = c.getString("ldap", null, n);
 | 
			
		||||
    if (v == null) {
 | 
			
		||||
    final String[] v = c.getStringList("ldap", null, n);
 | 
			
		||||
    if (v == null || v.length == 0) {
 | 
			
		||||
      return d;
 | 
			
		||||
 | 
			
		||||
    } else if ("".equals(v)) {
 | 
			
		||||
    } else if (v[0] == null || "".equals(v[0])) {
 | 
			
		||||
      return null;
 | 
			
		||||
 | 
			
		||||
    } else {
 | 
			
		||||
      return v;
 | 
			
		||||
      return v[0];
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user