summaryrefslogtreecommitdiff
path: root/source3/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
commit6b91ecb417ab4dccbd3c0582588f17d24c580e92 (patch)
tree5495017d661da44cbb8f4e6d67125b1d3b1c28a4 /source3/rpc_parse/parse_misc.c
parent14713d00b515af95288e9b92d9dfbf8a82eed1f2 (diff)
downloadsamba-6b91ecb417ab4dccbd3c0582588f17d24c580e92.tar.gz
samba-6b91ecb417ab4dccbd3c0582588f17d24c580e92.tar.bz2
samba-6b91ecb417ab4dccbd3c0582588f17d24c580e92.zip
attempted a svcset command. password is encrypted / messed up, therefore
command fails. (This used to be commit 9193f0eff56399e9bc09787dbe785b603886eaa3)
Diffstat (limited to 'source3/rpc_parse/parse_misc.c')
-rw-r--r--source3/rpc_parse/parse_misc.c37
1 files changed, 29 insertions, 8 deletions
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index 2f2c68648a..fe65aaf4d4 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/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;
}