From 1b1b8e39b2ce4bf32517e7178ca18b3fd8fecd03 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 25 Nov 2001 03:01:14 +0000 Subject: Add the PDC end of the smbtorture test for creating an NT_STATUS -> DOS error map. This little authentication module is #ifdef DEVELOPER, becouse it really is of no use execept as a development tool invoke by setting: auth methods = guest sam name_to_ntstatus in the smb.conf file (the SAM and guest elements are required for the member server to authenticate itself). Andrew Bartlett (This used to be commit 9807e66f34c1088399657060977e384c5a7f0664) --- source3/auth/auth_builtin.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'source3/auth/auth_builtin.c') diff --git a/source3/auth/auth_builtin.c b/source3/auth/auth_builtin.c index 6ea6d0bbe0..482ae6dee1 100644 --- a/source3/auth/auth_builtin.c +++ b/source3/auth/auth_builtin.c @@ -85,3 +85,36 @@ BOOL auth_init_local(auth_methods **auth_method) return True; } +/**************************************************************************** + Return an error based on username +****************************************************************************/ + +static NTSTATUS check_name_to_ntstatus_security(void *my_private_data, + const auth_usersupplied_info *user_info, + const auth_authsupplied_info *auth_info, + auth_serversupplied_info **server_info) +{ + NTSTATUS nt_status; + fstring user; + long error_num; + fstrcpy(user, user_info->smb_name.str); + strlower(user); + error_num = strtoul(user, NULL, 16); + + DEBUG(5,("Error for user %s was %lx\n", user, error_num)); + + nt_status = NT_STATUS(error_num); + + return nt_status; +} + +BOOL auth_init_name_to_ntstatus(auth_methods **auth_method) +{ + if (!make_auth_methods(auth_method)) { + return False; + } + + (*auth_method)->auth = check_name_to_ntstatus_security; + return True; +} + -- cgit