summaryrefslogtreecommitdiff
path: root/source3/libsmb/clifile.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-07-07 10:02:36 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-07 19:16:27 +0200
commiteaeeb5ce0e7282cf0d4db3dd9f39848b0afcb1fa (patch)
tree152149e5c53befbb2f63138ae8b2112544805a1d /source3/libsmb/clifile.c
parented99caded241925dbd8beee5bb57ba2d4a3b1c5e (diff)
downloadsamba-eaeeb5ce0e7282cf0d4db3dd9f39848b0afcb1fa.tar.gz
samba-eaeeb5ce0e7282cf0d4db3dd9f39848b0afcb1fa.tar.bz2
samba-eaeeb5ce0e7282cf0d4db3dd9f39848b0afcb1fa.zip
s3:libsmb: add trans2_bytes_push_bytes()
metze
Diffstat (limited to 'source3/libsmb/clifile.c')
-rw-r--r--source3/libsmb/clifile.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 9bb83ec9c6..3fa124e6f1 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -136,6 +136,25 @@ uint8_t *trans2_bytes_push_str(uint8_t *buf, bool ucs2,
false, pconverted_size);
}
+uint8_t *trans2_bytes_push_bytes(uint8_t *buf,
+ const uint8_t *bytes, size_t num_bytes)
+{
+ size_t buflen;
+
+ if (buf == NULL) {
+ return NULL;
+ }
+ buflen = talloc_get_size(buf);
+
+ buf = talloc_realloc(NULL, buf, uint8_t,
+ buflen + num_bytes);
+ if (buf == NULL) {
+ return NULL;
+ }
+ memcpy(&buf[buflen], bytes, num_bytes);
+ return buf;
+}
+
struct cli_setpathinfo_state {
uint16_t setup;
uint8_t *param;