summaryrefslogtreecommitdiffstats
path: root/source/smbd/sesssetup.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-10 15:36:47 -0800
committerJeremy Allison <jra@samba.org>2007-11-10 15:36:47 -0800
commit9ed12bfc48fe7f9b1863a9dd88e881974083053c (patch)
treec0c859b1c594c6df6e6538800891f3ecd84893da /source/smbd/sesssetup.c
parent63125225383f512f43002b9a92569d4b8f1b63bd (diff)
downloadsamba-9ed12bfc48fe7f9b1863a9dd88e881974083053c.tar.gz
samba-9ed12bfc48fe7f9b1863a9dd88e881974083053c.tar.xz
samba-9ed12bfc48fe7f9b1863a9dd88e881974083053c.zip
Remove last pstring from sesssetup.c
Jeremy.
Diffstat (limited to 'source/smbd/sesssetup.c')
-rw-r--r--source/smbd/sesssetup.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/source/smbd/sesssetup.c b/source/smbd/sesssetup.c
index 0e8483c81ef..8ca012ff248 100644
--- a/source/smbd/sesssetup.c
+++ b/source/smbd/sesssetup.c
@@ -1491,30 +1491,32 @@ void reply_sesssetup_and_X(connection_struct *conn, struct smb_request *req)
lm_resp = data_blob(p, passlen1);
nt_resp = data_blob(p+passlen1, passlen2);
} else {
- pstring pass;
+ char *pass = NULL;
bool unic= smb_flag2 & FLAGS2_UNICODE_STRINGS;
-#if 0
- /* This was the previous fix. Not sure if it's still
- * valid. JRA. */
- if ((ra_type == RA_WINNT) && (passlen2 == 0)
- && unic && passlen1) {
- /* NT4.0 stuffs up plaintext unicode password
- * lengths... */
- srvstr_pull(inbuf, pass, smb_buf(inbuf) + 1,
- sizeof(pass), passlen1, STR_TERMINATE);
-#endif
-
if (unic && (passlen2 == 0) && passlen1) {
/* Only a ascii plaintext password was sent. */
- srvstr_pull(req->inbuf, req->flags2, pass,
- smb_buf(req->inbuf), sizeof(pass),
- passlen1, STR_TERMINATE|STR_ASCII);
+ (void)srvstr_pull_talloc(talloc_tos(),
+ req->inbuf,
+ req->flags2,
+ &pass,
+ smb_buf(req->inbuf),
+ passlen1,
+ STR_TERMINATE|STR_ASCII);
} else {
- srvstr_pull(req->inbuf, req->flags2, pass,
- smb_buf(req->inbuf), sizeof(pass),
- unic ? passlen2 : passlen1,
- STR_TERMINATE);
+ (void)srvstr_pull_talloc(talloc_tos(),
+ req->inbuf,
+ req->flags2,
+ &pass,
+ smb_buf(req->inbuf),
+ unic ? passlen2 : passlen1,
+ STR_TERMINATE);
+ }
+ if (!pass) {
+ reply_nterror(req, nt_status_squash(
+ NT_STATUS_INVALID_PARAMETER));
+ END_PROFILE(SMBsesssetupX);
+ return;
}
plaintext_password = data_blob(pass, strlen(pass)+1);
}