summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/smb.h1
-rw-r--r--source3/smbd/lanman.c14
-rw-r--r--source3/smbd/password.c6
3 files changed, 12 insertions, 9 deletions
diff --git a/source3/include/smb.h b/source3/include/smb.h
index f3295e12bd..cb36b9bebb 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -1781,7 +1781,6 @@ typedef struct user_struct {
gid_t gid; /* gid of a validated user */
userdom_struct user;
- const char *homedir;
const char *unix_homedir;
const char *logon_script;
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 6fa4f9698d..be8aa58e7f 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -3420,12 +3420,17 @@ static bool api_RNetUserGetInfo(connection_struct *conn, uint16 vuid,
}
if (uLevel == 11) {
+ const char *homedir = "";
+ if (vuser != NULL) {
+ homedir = pdb_get_homedir(
+ vuser->server_info->sam_account);
+ }
/* modelled after NTAS 3.51 reply */
SSVAL(p,usri11_priv,conn->admin_user?USER_PRIV_ADMIN:USER_PRIV_USER);
SIVAL(p,usri11_auth_flags,AF_OP_PRINT); /* auth flags */
SIVALS(p,usri11_password_age,-1); /* password age */
SIVAL(p,usri11_homedir,PTR_DIFF(p2,p)); /* home dir */
- strlcpy(p2, vuser && vuser->homedir ? vuser->homedir : "",PTR_DIFF(endp,p2));
+ strlcpy(p2, homedir, PTR_DIFF(endp,p2));
p2 = skip_string(*rdata,*rdata_len,p2);
if (!p2) {
return False;
@@ -3471,12 +3476,17 @@ static bool api_RNetUserGetInfo(connection_struct *conn, uint16 vuid,
}
if (uLevel == 1 || uLevel == 2) {
+ const char *homedir = "";
+ if (vuser != NULL) {
+ homedir = pdb_get_homedir(
+ vuser->server_info->sam_account);
+ }
memset(p+22,' ',16); /* password */
SIVALS(p,38,-1); /* password age */
SSVAL(p,42,
conn->admin_user?USER_PRIV_ADMIN:USER_PRIV_USER);
SIVAL(p,44,PTR_DIFF(p2,*rdata)); /* home dir */
- strlcpy(p2, vuser && vuser->homedir ? vuser->homedir : "",PTR_DIFF(endp,p2));
+ strlcpy(p2, homedir, PTR_DIFF(endp,p2));
p2 = skip_string(*rdata,*rdata_len,p2);
if (!p2) {
return False;
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 80eba562c5..a7e462a0ca 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -268,9 +268,6 @@ int register_existing_vuid(uint16 vuid,
pdb_get_fullname(server_info->sam_account));
{
- /* Keep the homedir handy */
- const char *homedir =
- pdb_get_homedir(server_info->sam_account);
const char *logon_script =
pdb_get_logon_script(server_info->sam_account);
@@ -294,9 +291,6 @@ int register_existing_vuid(uint16 vuid,
}
}
- if (homedir) {
- vuser->homedir = homedir;
- }
if (logon_script) {
vuser->logon_script = logon_script;
}