diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-06-05 05:01:38 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:56:30 -0500 |
commit | 5341ad20e1b8953c9256cd8e04a7e55ba9ef84b5 (patch) | |
tree | 9d2c21766becd650905c32b1195d6a0203f93110 /source4/librpc/ndr | |
parent | 4c6f04d83f20ecfe62cd87dadf9b48a898502ea7 (diff) | |
download | samba-5341ad20e1b8953c9256cd8e04a7e55ba9ef84b5.tar.gz samba-5341ad20e1b8953c9256cd8e04a7e55ba9ef84b5.tar.bz2 samba-5341ad20e1b8953c9256cd8e04a7e55ba9ef84b5.zip |
r1030: added server side schannel support
(This used to be commit 2ac79dfba0e64056a680f21d7dd0c007f79d4a70)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r-- | source4/librpc/ndr/ndr_basic.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index f8315b3af0..ea58a77c47 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -497,6 +497,17 @@ NTSTATUS ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, const char **s) (*s) = as; break; + case LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM: + len1 = strnlen(ndr->data+ndr->offset, (ndr->data_size - ndr->offset)); + if (len1+1 <= ndr->data_size - ndr->offset) { + len1++; + } + NDR_ALLOC_N(ndr, as, (len1+1)); + NDR_CHECK(ndr_pull_bytes(ndr, as, len1)); + as[len1] = 0; + (*s) = as; + break; + default: return ndr_pull_error(ndr, NDR_ERR_STRING, "Bad string flags 0x%x\n", ndr->flags & LIBNDR_STRING_FLAGS); @@ -639,6 +650,18 @@ NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s) ndr->offset += c_len + 1; break; + case LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM: + NDR_PUSH_NEED_BYTES(ndr, c_len + 1); + ret = convert_string(CH_UNIX, CH_DOS, + s, s_len+1, + ndr->data+ndr->offset, c_len + 1); + if (ret == -1) { + return ndr_push_error(ndr, NDR_ERR_CHARCNV, + "Bad character conversion"); + } + ndr->offset += c_len + 1; + break; + default: return ndr_push_error(ndr, NDR_ERR_STRING, "Bad string flags 0x%x\n", ndr->flags & LIBNDR_STRING_FLAGS); |