Remove fstring from map_username. Create a more sane interface than the called-parame...
[kai/samba.git] / source3 / auth / auth_server.c
index 4ce0336ccc5bfc147e7548cef8acd6cd83ec8788..ac757d5a3522386a0abc0a704e74b546b34b0b24 100644 (file)
@@ -429,14 +429,15 @@ use this machine as the password server.\n"));
        cli_ulogoff(cli);
 
        if (NT_STATUS_IS_OK(nt_status)) {
-               fstring real_username;
-               struct passwd *pass;
+               char *real_username = NULL;
+               struct passwd *pass = NULL;
 
-               if ( (pass = smb_getpwnam( NULL, user_info->mapped.account_name,
-                       real_username, True )) != NULL ) 
+               if ( (pass = smb_getpwnam(talloc_tos(), user_info->mapped.account_name,
+                       &real_username, True )) != NULL )
                {
                        nt_status = make_server_info_pw(server_info, pass->pw_name, pass);
                        TALLOC_FREE(pass);
+                       TALLOC_FREE(real_username);
                }
                else
                {