[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH] CA-34859: use subject_username as fallback for subject_displayname when subject_gecos is empty



1 file changed, 5 insertions(+), 3 deletions(-)
ocaml/auth/extauth_plugin_ADlikewise.ml |    8 +++++---


# HG changeset patch
# User Marcus Granado <marcus.granado@xxxxxxxxxx>
# Date 1258033812 0
# Node ID 0d664aa678e6852959401a65346d1b328d808d65
# Parent  c0bad448cefcd8c14b2a344de0c379958645abe5
CA-34859: use subject_username as fallback for subject_displayname when 
subject_gecos is empty

Signed-off-by: Marcus Granado <marcus.granado@xxxxxxxxxxxxx>

diff -r c0bad448cefc -r 0d664aa678e6 ocaml/auth/extauth_plugin_ADlikewise.ml
--- a/ocaml/auth/extauth_plugin_ADlikewise.ml   Thu Nov 12 13:32:16 2009 +0000
+++ b/ocaml/auth/extauth_plugin_ADlikewise.ml   Thu Nov 12 13:50:12 2009 +0000
@@ -406,13 +406,15 @@
                        ("contains-byname", List.fold_left (fun (n,v) m 
->m^","^v) "" (List.filter (fun (n,v)->n="Member") infolist));*)
                ]
        else (* subject is user *)
-               [       ("subject-name", unmap_lw_space_chars (get_value "Name" 
infolist));
+               let subject_name = unmap_lw_space_chars (get_value "Name" 
infolist) in
+               let subject_gecos = get_value "Gecos" infolist in
+               [       ("subject-name", subject_name);
                        ("subject-upn", get_value "UPN" infolist);
                        ("subject-uid", get_value "Uid" infolist);
                        ("subject-gid", get_value "Gid" infolist);
                        ("subject-sid", get_value "SID" infolist);
-                       ("subject-gecos", get_value "Gecos" infolist);
-                       ("subject-displayname", get_value "Gecos" infolist);
+                       ("subject-gecos", subject_gecos);
+                       ("subject-displayname", if subject_gecos="" then 
subject_name else subject_gecos);
                        (*("subject-homedir", get_value "Home dir" infolist);*)
                        (*("subject-shell", get_value "Shell" infolist);*)
                        ("subject-is-group", "false");

Attachment: xen-api.hg.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.