summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/ipc.c4
-rw-r--r--source3/smbd/password.c3
-rw-r--r--source3/smbd/pipes.c4
-rw-r--r--source3/smbd/reply.c14
-rw-r--r--source3/smbd/server.c6
5 files changed, 24 insertions, 7 deletions
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 1943129ba6..ce14ccd9bc 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -144,7 +144,7 @@ static void send_trans_reply(char *outbuf,char *data,char *param,uint16 *setup,
this_lparam = MIN(lparam,max_send - (500+lsetup*SIZEOFWORD)); /* hack */
this_ldata = MIN(ldata,max_send - (500+lsetup*SIZEOFWORD+this_lparam));
- align = (this_lparam%4);
+ align = (this_lparam%4)+1;
set_message(outbuf,10+lsetup,align+this_ldata+this_lparam,True);
if (this_lparam)
@@ -2872,7 +2872,9 @@ struct
{
#ifdef NTDOMAIN
{ "TransactNmPipe", "lsarpc", "lsass", 0x26, api_ntLsarpcTNP },
+ { "TransactNmPipe", "samr", "lsass", 0x26, api_samrTNP },
{ "TransactNmPipe", "srvsvc", "lsass", 0x26, api_srvsvcTNP },
+ { "TransactNmPipe", "wkssvc", "ntsvcs", 0x26, api_wkssvcTNP },
{ "TransactNmPipe", "NETLOGON", "NETLOGON", 0x26, api_netlogrpcTNP },
{ NULL, NULL, NULL, -1, (BOOL (*)())api_Unsupported }
#else
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index b759f68430..185fc68f5a 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -887,7 +887,8 @@ BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd)
return(False);
}
- smb_pass = get_smbpwnam(user);
+ /* non-null username indicates search by username not smb userid */
+ smb_pass = get_smbpwd_entry(user, 0);
if (!smb_pass)
{
DEBUG(3,("Couldn't find user %s in smb_passwd file.\n", user));
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index 4a2e185cb4..e2f704e6af 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -57,6 +57,8 @@ char * known_pipes [] =
#if NTDOMAIN
"NETLOGON",
"srvsvc",
+ "wkssvc",
+ "samr",
#endif
NULL
};
@@ -139,6 +141,8 @@ int reply_pipe_close(char *inbuf,char *outbuf)
int cnum = SVAL(inbuf,smb_tid);
int outsize = set_message(outbuf,0,0,True);
+ DEBUG(5,("reply_pipe_close: pnum:%x cnum:%x\n", pnum, cnum));
+
if (!close_rpc_pipe_hnd(pnum, cnum)) return(ERROR(ERRDOS,ERRbadfid));
return(outsize);
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 46425861d4..e8d79b098c 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -498,7 +498,8 @@ int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize)
/* If name ends in $ then I think it's asking about whether a */
/* computer with that name (minus the $) has access. For now */
/* say yes to everything ending in $. */
- if (user[strlen(user) - 1] == '$') {
+ if (user[strlen(user) - 1] == '$')
+ {
#ifdef NTDOMAIN
struct smb_passwd *smb_pass; /* To check if machine account exists */
/*
@@ -511,15 +512,18 @@ int reply_sesssetup_and_X(char *inbuf,char *outbuf,int length,int bufsize)
a domain. This may be the source of future bugs if we cannot
be sure whether to reject this or not.
*/
- smb_pass = get_smbpwnam(user);
- if(smb_pass)
+ /* non-null user name indicates search by username not by smb userid */
+ smb_pass = get_smbpwd_entry(user, 0);
+
+ if (!smb_pass)
{
/* PAXX: This is the NO LOGON workstation trust account stuff */
- DEBUG(4,("Rejecting workstation trust account %s",user));
+ DEBUG(4,("No Workstation trust account %s",user));
SSVAL(outbuf, smb_flg2, 0xc003); /* PAXX: Someone please unhack this */
CVAL(outbuf, smb_reh) = 1; /* PAXX: Someone please unhack this */
- return(ERROR(NT_STATUS_ALLOTTED_SPACE_EXCEEDED, 0xc000)); /* 0x99 NT error, 0xc00 */
+ return(ERROR(NT_STATUS_LOGON_FAILURE, 0xc000)); /* 0x109 NT error, 0xc000 */
}
+
computer_id = True;
#else /* not NTDOMAIN, leave this in. PAXX: Someone get rid of this */
user[strlen(user) - 1] = '\0';
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 3c128872e6..e4e5872035 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -4732,6 +4732,7 @@ int construct_reply(char *inbuf,char *outbuf,int size,int bufsize)
chain_size = 0;
chain_fnum = -1;
+ reset_chain_pnum();
bzero(outbuf,smb_size);
@@ -4943,6 +4944,11 @@ static void init_structs(void )
/* for RPC pipes */
init_rpc_pipe_hnd();
+#ifdef NTDOMAIN
+ /* for LSA handles */
+ init_lsa_policy_hnd();
+#endif
+
init_dptrs();
}