summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-03-17 14:04:43 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-04-14 12:11:00 +1000
commit4786a493f70070dce6de4cbe488c9de1bdbb75ad (patch)
treea568260a9cf5d255674d0e31dddf4f5e3644e0da /source3/libsmb
parent41e4f12c482082d6e622d1fdc830e38853cdbd8b (diff)
downloadsamba-4786a493f70070dce6de4cbe488c9de1bdbb75ad.tar.gz
samba-4786a493f70070dce6de4cbe488c9de1bdbb75ad.tar.bz2
samba-4786a493f70070dce6de4cbe488c9de1bdbb75ad.zip
Solve some of the conflict between Samba3 and Samba4 push_string
This renames push_string in Samba3 into push_string_base and push_string_check for the two different use cases. This should allow push_string to be imported from Samba4, using it's calling conventions.
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clistr.c24
-rw-r--r--source3/libsmb/ntlmssp_parse.c14
-rw-r--r--source3/libsmb/smbencrypt.c6
3 files changed, 23 insertions, 21 deletions
diff --git a/source3/libsmb/clistr.c b/source3/libsmb/clistr.c
index 8685781404..1f296ebd09 100644
--- a/source3/libsmb/clistr.c
+++ b/source3/libsmb/clistr.c
@@ -32,21 +32,23 @@ size_t clistr_push_fn(const char *function,
if (dest_len == -1) {
if (((ptrdiff_t)dest < (ptrdiff_t)cli->outbuf) || (buf_used > cli->bufsize)) {
DEBUG(0, ("Pushing string of 'unlimited' length into non-SMB buffer!\n"));
- return push_string_fn(function, line,
- cli->outbuf,
- SVAL(cli->outbuf, smb_flg2),
- dest, src, -1, flags);
+ return push_string_base(function, line,
+ cli->outbuf,
+ SVAL(cli->outbuf, smb_flg2),
+ dest, src, -1, flags);
}
- return push_string_fn(function, line, cli->outbuf,
- SVAL(cli->outbuf, smb_flg2),
- dest, src, cli->bufsize - buf_used,
- flags);
+ return push_string_base(function, line,
+ cli->outbuf,
+ SVAL(cli->outbuf, smb_flg2),
+ dest, src, cli->bufsize - buf_used,
+ flags);
}
/* 'normal' push into size-specified buffer */
- return push_string_fn(function, line, cli->outbuf,
- SVAL(cli->outbuf, smb_flg2),
- dest, src, dest_len, flags);
+ return push_string_base(function, line,
+ cli->outbuf,
+ SVAL(cli->outbuf, smb_flg2),
+ dest, src, dest_len, flags);
}
size_t clistr_pull_fn(const char *function,
diff --git a/source3/libsmb/ntlmssp_parse.c b/source3/libsmb/ntlmssp_parse.c
index 70377cba7d..98c50596be 100644
--- a/source3/libsmb/ntlmssp_parse.c
+++ b/source3/libsmb/ntlmssp_parse.c
@@ -106,8 +106,8 @@ bool msrpc_gen(DATA_BLOB *blob,
SSVAL(blob->data, head_ofs, n*2); head_ofs += 2;
SSVAL(blob->data, head_ofs, n*2); head_ofs += 2;
SIVAL(blob->data, head_ofs, data_ofs); head_ofs += 4;
- push_string(NULL, blob->data+data_ofs,
- s, n*2, STR_UNICODE|STR_NOALIGN);
+ push_string_check(blob->data+data_ofs,
+ s, n*2, STR_UNICODE|STR_NOALIGN);
data_ofs += n*2;
break;
case 'A':
@@ -116,8 +116,8 @@ bool msrpc_gen(DATA_BLOB *blob,
SSVAL(blob->data, head_ofs, n); head_ofs += 2;
SSVAL(blob->data, head_ofs, n); head_ofs += 2;
SIVAL(blob->data, head_ofs, data_ofs); head_ofs += 4;
- push_string(NULL, blob->data+data_ofs,
- s, n, STR_ASCII|STR_NOALIGN);
+ push_string_check(blob->data+data_ofs,
+ s, n, STR_ASCII|STR_NOALIGN);
data_ofs += n;
break;
case 'a':
@@ -127,7 +127,7 @@ bool msrpc_gen(DATA_BLOB *blob,
n = str_charnum(s);
SSVAL(blob->data, data_ofs, n*2); data_ofs += 2;
if (0 < n) {
- push_string(NULL, blob->data+data_ofs, s, n*2,
+ push_string_check(blob->data+data_ofs, s, n*2,
STR_UNICODE|STR_NOALIGN);
}
data_ofs += n*2;
@@ -156,8 +156,8 @@ bool msrpc_gen(DATA_BLOB *blob,
case 'C':
s = va_arg(ap, char *);
n = str_charnum(s) + 1;
- head_ofs += push_string(NULL, blob->data+head_ofs, s, n,
- STR_ASCII|STR_TERMINATE);
+ head_ofs += push_string_check(blob->data+head_ofs, s, n,
+ STR_ASCII|STR_TERMINATE);
break;
}
}
diff --git a/source3/libsmb/smbencrypt.c b/source3/libsmb/smbencrypt.c
index ee162b1b2d..a76be3cc1a 100644
--- a/source3/libsmb/smbencrypt.c
+++ b/source3/libsmb/smbencrypt.c
@@ -499,9 +499,9 @@ bool encode_pw_buffer(uint8 buffer[516], const char *password, int string_flags)
/* the incoming buffer can be any alignment. */
string_flags |= STR_NOALIGN;
- new_pw_len = push_string(NULL, new_pw,
- password,
- sizeof(new_pw), string_flags);
+ new_pw_len = push_string_check(new_pw,
+ password,
+ sizeof(new_pw), string_flags);
memcpy(&buffer[512 - new_pw_len], new_pw, new_pw_len);