File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -389,8 +389,11 @@ struct
389389 let authenticate_username_password username password =
390390 (* first, we try to authenticated user against our external user database *)
391391 (* pbis_common will raise an Auth_failure if external authentication fails *)
392- let user = List. hd (List. rev (String. split_f (fun c -> c = '\\' ) username)) in
393- let domain = get_joined_domain_name () in
392+ let (domain, user) = match (String. split_f (fun c -> c = '\\' ) username) with
393+ | [domain; user] -> (domain, user)
394+ | [user] -> (get_joined_domain_name() , user)
395+ | _ -> raise (Auth_signature. Auth_service_error (Auth_signature. E_GENERIC ," Invalid username " ^ username))
396+ in
394397 let (_: (string * string) list ) = pbis_common " /opt/pbis/bin/lsa" [" authenticate-user" ;" --user" ;user;" --domain" ;domain;" --password" ;password] in
395398 (* no exception raised, then authentication succeeded, *)
396399 (* now we return the authenticated user's id *)
You can’t perform that action at this time.
0 commit comments