summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-03-01 22:24:34 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-03-01 22:24:34 +0100
commit7ab8f373c84c328b197f923287163e83371e7ccb (patch)
tree8a009647735ccc1cf181d98b01c1084f45e0d711 /source4/auth
parent94069bd2747a8397308c0b0b384f7bb4edd8f68b (diff)
downloadsamba-7ab8f373c84c328b197f923287163e83371e7ccb.tar.gz
samba-7ab8f373c84c328b197f923287163e83371e7ccb.tar.bz2
samba-7ab8f373c84c328b197f923287163e83371e7ccb.zip
Use common header file for character set handling in Samba 3 and Samba 4.
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/ntlmssp/ntlmssp_parse.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp_parse.c b/source4/auth/ntlmssp/ntlmssp_parse.c
index d606b8d563..969845d6c5 100644
--- a/source4/auth/ntlmssp/ntlmssp_parse.c
+++ b/source4/auth/ntlmssp/ntlmssp_parse.c
@@ -44,14 +44,15 @@ bool msrpc_gen(TALLOC_CTX *mem_ctx,
DATA_BLOB *blob,
const char *format, ...)
{
- int i;
- ssize_t n;
+ int i, j;
+ bool ret;
va_list ap;
char *s;
uint8_t *b;
int head_size=0, data_size=0;
int head_ofs, data_ofs;
int *intargs;
+ size_t n;
DATA_BLOB *pointers;
@@ -65,8 +66,9 @@ bool msrpc_gen(TALLOC_CTX *mem_ctx,
case 'U':
s = va_arg(ap, char *);
head_size += 8;
- n = push_ucs2_talloc(pointers, (void **)&pointers[i].data, s);
- if (n == -1) {
+ ret = push_ucs2_talloc(pointers, (smb_ucs2_t **)&pointers[i].data,
+ s, &n);
+ if (!ret) {
return false;
}
pointers[i].length = n;
@@ -76,8 +78,9 @@ bool msrpc_gen(TALLOC_CTX *mem_ctx,
case 'A':
s = va_arg(ap, char *);
head_size += 8;
- n = push_ascii_talloc(pointers, (char **)&pointers[i].data, s);
- if (n == -1) {
+ ret = push_ascii_talloc(pointers, (char **)&pointers[i].data, s,
+ &n);
+ if (!ret) {
return false;
}
pointers[i].length = n;
@@ -85,11 +88,12 @@ bool msrpc_gen(TALLOC_CTX *mem_ctx,
data_size += pointers[i].length;
break;
case 'a':
- n = va_arg(ap, int);
- intargs[i] = n;
+ j = va_arg(ap, int);
+ intargs[i] = j;
s = va_arg(ap, char *);
- n = push_ucs2_talloc(pointers, (void **)&pointers[i].data, s);
- if (n == -1) {
+ ret = push_ucs2_talloc(pointers, (smb_ucs2_t **)&pointers[i].data,
+ s, &n);
+ if (!ret) {
return false;
}
pointers[i].length = n;
@@ -110,8 +114,8 @@ bool msrpc_gen(TALLOC_CTX *mem_ctx,
head_size += pointers[i].length;
break;
case 'd':
- n = va_arg(ap, int);
- intargs[i] = n;
+ j = va_arg(ap, int);
+ intargs[i] = j;
head_size += 4;
break;
case 'C':
@@ -145,8 +149,8 @@ bool msrpc_gen(TALLOC_CTX *mem_ctx,
data_ofs += n;
break;
case 'a':
- n = intargs[i];
- SSVAL(blob->data, data_ofs, n); data_ofs += 2;
+ j = intargs[i];
+ SSVAL(blob->data, data_ofs, j); data_ofs += 2;
n = pointers[i].length;
SSVAL(blob->data, data_ofs, n); data_ofs += 2;
@@ -156,8 +160,8 @@ bool msrpc_gen(TALLOC_CTX *mem_ctx,
data_ofs += n;
break;
case 'd':
- n = intargs[i];
- SIVAL(blob->data, head_ofs, n);
+ j = intargs[i];
+ SIVAL(blob->data, head_ofs, j);
head_ofs += 4;
break;
case 'b':