summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-05-31 10:52:06 -0400
committerAndreas Schneider <asn@samba.org>2010-05-31 18:21:29 +0200
commit471ed70c497f4eeaca27594d609f41f2b2c689cd (patch)
tree18a3246eeb729a1439cd7cfa42b061a4d251b20b /source3
parent6a25668e55929a8111ac0fc5e34b5a83ae936349 (diff)
downloadsamba-471ed70c497f4eeaca27594d609f41f2b2c689cd.tar.gz
samba-471ed70c497f4eeaca27594d609f41f2b2c689cd.tar.bz2
samba-471ed70c497f4eeaca27594d609f41f2b2c689cd.zip
s3:smbd map_username() doesn't need sconn anymore
Signed-off-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/auth/auth_util.c6
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/rpc_server/srv_samr_nt.c9
-rw-r--r--source3/smbd/map_username.c2
-rw-r--r--source3/smbd/service.c5
-rw-r--r--source3/smbd/sesssetup.c4
-rw-r--r--source3/smbd/smb2_sesssetup.c3
7 files changed, 12 insertions, 19 deletions
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 74d8873f5c..3a63a3bee3 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -119,13 +119,12 @@ NTSTATUS make_user_info_map(struct auth_usersupplied_info **user_info,
DATA_BLOB *plaintext,
bool encrypted)
{
- struct smbd_server_connection *sconn = smbd_server_conn;
const char *domain;
NTSTATUS result;
bool was_mapped;
fstring internal_username;
fstrcpy(internal_username, smb_name);
- was_mapped = map_username(sconn, internal_username);
+ was_mapped = map_username(internal_username);
DEBUG(5, ("Mapping user [%s]\\[%s] from workstation [%s]\n",
client_domain, smb_name, wksta_name));
@@ -972,7 +971,6 @@ static NTSTATUS check_account(TALLOC_CTX *mem_ctx, const char *domain,
uid_t *uid, gid_t *gid,
bool *username_was_mapped)
{
- struct smbd_server_connection *sconn = smbd_server_conn;
fstring dom_user, lower_username;
fstring real_username;
struct passwd *passwd;
@@ -985,7 +983,7 @@ static NTSTATUS check_account(TALLOC_CTX *mem_ctx, const char *domain,
/* Get the passwd struct. Try to create the account if necessary. */
- *username_was_mapped = map_username(sconn, dom_user);
+ *username_was_mapped = map_username(dom_user);
passwd = smb_getpwnam( NULL, dom_user, real_username, True );
if (!passwd) {
diff --git a/source3/include/proto.h b/source3/include/proto.h
index e28bfd3aae..237772e9bd 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5689,7 +5689,7 @@ const struct mangle_fns *posix_mangle_init(void);
/* The following definitions come from smbd/map_username.c */
-bool map_username(struct smbd_server_connection *sconn, fstring user);
+bool map_username(fstring user);
/* The following definitions come from smbd/message.c */
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 5b8a79fd87..30c5c5e839 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -1922,7 +1922,6 @@ NTSTATUS _samr_ChangePasswordUser(pipes_struct *p,
NTSTATUS _samr_ChangePasswordUser2(pipes_struct *p,
struct samr_ChangePasswordUser2 *r)
{
- struct smbd_server_connection *sconn = smbd_server_conn;
NTSTATUS status;
fstring user_name;
fstring wks;
@@ -1939,7 +1938,7 @@ NTSTATUS _samr_ChangePasswordUser2(pipes_struct *p,
* function.
*/
- (void)map_username(sconn, user_name);
+ (void)map_username(user_name);
/*
* UNIX username case mangling not required, pass_oem_change
@@ -1969,7 +1968,6 @@ NTSTATUS _samr_ChangePasswordUser2(pipes_struct *p,
NTSTATUS _samr_OemChangePasswordUser2(pipes_struct *p,
struct samr_OemChangePasswordUser2 *r)
{
- struct smbd_server_connection *sconn = smbd_server_conn;
NTSTATUS status;
fstring user_name;
const char *wks = NULL;
@@ -1988,7 +1986,7 @@ NTSTATUS _samr_OemChangePasswordUser2(pipes_struct *p,
* function.
*/
- (void)map_username(sconn, user_name);
+ (void)map_username(user_name);
/*
* UNIX username case mangling not required, pass_oem_change
@@ -2022,7 +2020,6 @@ NTSTATUS _samr_OemChangePasswordUser2(pipes_struct *p,
NTSTATUS _samr_ChangePasswordUser3(pipes_struct *p,
struct samr_ChangePasswordUser3 *r)
{
- struct smbd_server_connection *sconn = smbd_server_conn;
NTSTATUS status;
fstring user_name;
const char *wks = NULL;
@@ -2045,7 +2042,7 @@ NTSTATUS _samr_ChangePasswordUser3(pipes_struct *p,
* function.
*/
- (void)map_username(sconn, user_name);
+ (void)map_username(user_name);
/*
* UNIX username case mangling not required, pass_oem_change
diff --git a/source3/smbd/map_username.c b/source3/smbd/map_username.c
index 4d2a9db307..9b24d8fa4e 100644
--- a/source3/smbd/map_username.c
+++ b/source3/smbd/map_username.c
@@ -118,7 +118,7 @@ static void store_map_in_gencache(const char *from, const char *to)
TALLOC_FREE(key);
}
-bool map_username(struct smbd_server_connection *sconn, fstring user)
+bool map_username(fstring user)
{
XFILE *f;
char *mapfile = lp_username_map();
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index afd9cad27d..8642544c4f 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -306,7 +306,6 @@ int add_home_service(const char *service, const char *username, const char *home
int find_service(fstring service)
{
int iService;
- struct smbd_server_connection *sconn = smbd_server_conn;
all_string_sub(service,"\\","/",0);
@@ -321,7 +320,7 @@ int find_service(fstring service)
* Try mapping the servicename, it may
* be a Windows to unix mapped user name.
*/
- if(map_username(sconn, service))
+ if(map_username(service))
phome_dir = get_user_home_dir(
talloc_tos(), service);
}
@@ -1158,7 +1157,7 @@ connection_struct *make_connection(struct smbd_server_connection *sconn,
fstring unix_username;
fstrcpy(unix_username,
current_user_info.smb_name);
- map_username(sconn, unix_username);
+ map_username(unix_username);
snum = find_service(unix_username);
}
if (snum != -1) {
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index 7f99d6283c..dba6dabd26 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -413,7 +413,7 @@ static void reply_spnego_kerberos(struct smb_request *req,
/* lookup the passwd struct, create a new user if necessary */
- username_was_mapped = map_username(sconn, user);
+ username_was_mapped = map_username(user);
pw = smb_getpwnam( mem_ctx, user, real_username, True );
@@ -1676,7 +1676,7 @@ void reply_sesssetup_and_X(struct smb_request *req)
data_blob_free(&nt_resp);
data_blob_clear_free(&plaintext_password);
- map_username(sconn, sub_user);
+ map_username(sub_user);
add_session_user(sconn, sub_user);
add_session_workgroup(sconn, domain);
/* Then force it to null for the benfit of the code below */
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index d91d0fe510..88454c1222 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -170,7 +170,6 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session,
fstring tmp;
bool username_was_mapped = false;
bool map_domainuser_to_guest = false;
- struct smbd_server_connection *sconn = smbd_server_conn;
if (!spnego_parse_krb5_wrap(*secblob, &ticket, tok_id)) {
status = NT_STATUS_LOGON_FAILURE;
@@ -265,7 +264,7 @@ static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session,
/* lookup the passwd struct, create a new user if necessary */
- username_was_mapped = map_username(sconn, user);
+ username_was_mapped = map_username(user);
pw = smb_getpwnam(talloc_tos(), user, real_username, true );
if (pw) {