summaryrefslogtreecommitdiff
path: root/source/rpc_parse/parse_misc.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-23 23:05:47 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-23 23:05:47 +0000
commit9193f0eff56399e9bc09787dbe785b603886eaa3 (patch)
tree6ad69f7fe2500369d2319d488d6f72104efbb6f7 /source/rpc_parse/parse_misc.c
parentcbbfef6d2a5335a6daa4fe09ea2d73197417894f (diff)
downloadsamba-9193f0eff56399e9bc09787dbe785b603886eaa3.tar.gz
attempted a svcset command. password is encrypted / messed up, therefore
command fails.
Diffstat (limited to 'source/rpc_parse/parse_misc.c')
-rw-r--r--source/rpc_parse/parse_misc.c37
1 files changed, 29 insertions, 8 deletions
diff --git a/source/rpc_parse/parse_misc.c b/source/rpc_parse/parse_misc.c
index 2f2c68648ab..fe65aaf4d4e 100644
--- a/source/rpc_parse/parse_misc.c
+++ b/source/rpc_parse/parse_misc.c
@@ -777,16 +777,37 @@ BOOL make_buf_unistr2(UNISTR2 *str, uint32 *ptr, const char *buf)
/*******************************************************************
creates a STRING2 structure.
********************************************************************/
-BOOL make_string2(STRING2 *str, char *buf, int len)
+BOOL make_string2(STRING2 *str, const char *buf, int len)
{
- /* set up string lengths. */
- str->str_max_len = len;
- str->undoc = 0;
- str->str_str_len = len;
+ /* set up string lengths. */
+ str->str_max_len = len;
+ str->undoc = 0;
+ str->str_str_len = len;
+
+ /* store the string */
+ if(len != 0)
+ {
+ memcpy(str->buffer, buf, len);
+ }
- /* store the string */
- if(len != 0)
- memcpy(str->buffer, buf, len);
+ return True;
+}
+
+/*******************************************************************
+creates a STRING2 structure: sets up the buffer, too
+********************************************************************/
+BOOL make_buf_string2(STRING2 *str, uint32 *ptr, const char *buf)
+{
+ if (buf != NULL)
+ {
+ *ptr = 1;
+ make_string2(str, buf, strlen(buf)+1);
+ }
+ else
+ {
+ *ptr = 0;
+ make_string2(str, "", 0);
+ }
return True;
}