Merge commit 'master/master' into wspp-schema
[kai/samba-autobuild/.git] / source3 / auth / auth_builtin.c
index 5a9b5534ab61b4e80db115f7911d9445420f2149..3741f29779b361ac9a666f4d535aa12516e537d8 100644 (file)
@@ -6,7 +6,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -15,8 +15,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
@@ -38,11 +37,12 @@ static NTSTATUS check_guest_security(const struct auth_context *auth_context,
                                     const auth_usersupplied_info *user_info, 
                                     auth_serversupplied_info **server_info)
 {
-       NTSTATUS nt_status = NT_STATUS_LOGON_FAILURE;
+       /* mark this as 'not for me' */
+       NTSTATUS nt_status = NT_STATUS_NOT_IMPLEMENTED;
 
-       if (!(user_info->internal_username.str 
-             && *user_info->internal_username.str)) {
-               nt_status = make_server_info_guest(server_info);
+       if (!(user_info->internal_username 
+             && *user_info->internal_username)) {
+               nt_status = make_server_info_guest(NULL, server_info);
        }
 
        return nt_status;
@@ -83,14 +83,14 @@ static NTSTATUS check_name_to_ntstatus_security(const struct auth_context *auth_
        NTSTATUS nt_status;
        fstring user;
        long error_num;
-       fstrcpy(user, user_info->smb_name.str);
+       fstrcpy(user, user_info->smb_name);
        
-       if (strncasecmp("NT_STATUS", user, strlen("NT_STATUS")) == 0) {
-               strupper(user);
+       if (strnequal("NT_STATUS", user, strlen("NT_STATUS"))) {
+               strupper_m(user);
                return nt_status_string_to_code(user);
        }
 
-       strlower(user);
+       strlower_m(user);
        error_num = strtoul(user, NULL, 16);
        
        DEBUG(5,("check_name_to_ntstatus_security: Error for user %s was %lx\n", user, error_num));
@@ -133,7 +133,7 @@ static NTSTATUS check_fixed_challenge_security(const struct auth_context *auth_c
                                               const auth_usersupplied_info *user_info, 
                                               auth_serversupplied_info **server_info)
 {
-       return NT_STATUS_UNSUCCESSFUL;
+       return NT_STATUS_NOT_IMPLEMENTED;
 }
 
 /****************************************************************************