diff options
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/safe_string.h | 5 | ||||
-rw-r--r-- | source3/include/srvstr.h | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/source3/include/safe_string.h b/source3/include/safe_string.h index 68be38df75..8c4d90c44a 100644 --- a/source3/include/safe_string.h +++ b/source3/include/safe_string.h @@ -164,6 +164,7 @@ size_t __unsafe_string_function_usage_here_char__(void); #define safe_strcat(dest,src,maxlength) safe_strcat_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE,dest,src,maxlength) #define push_string(base_ptr, dest, src, dest_len, flags) push_string_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, dest, src, dest_len, flags) #define pull_string(base_ptr, smb_flags2, dest, src, dest_len, src_len, flags) pull_string_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, smb_flags2, dest, src, dest_len, src_len, flags) +#define pull_string_talloc(ctx, base_ptr, smb_flags2, dest, src, src_len, flags) pull_string_talloc_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, ctx, base_ptr, smb_flags2, dest, src, src_len, flags) #define clistr_push(cli, dest, src, dest_len, flags) clistr_push_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, cli, dest, src, dest_len, flags) #define clistr_pull(cli, dest, src, dest_len, src_len, flags) clistr_pull_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, cli, dest, src, dest_len, src_len, flags) #define srvstr_push(base_ptr, dest, src, dest_len, flags) srvstr_push_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, dest, src, dest_len, flags) @@ -197,6 +198,9 @@ size_t __unsafe_string_function_usage_here_char__(void); ? __unsafe_string_function_usage_here_size_t__() \ : pull_string_fn(fn_name, fn_line, base_ptr, smb_flags2, dest, src, dest_len, src_len, flags)) +#define pull_string_talloc_fn2(fn_name, fn_line, ctx, base_ptr, smb_flags2, dest, src, src_len, flags) \ + pull_string_talloc_fn(fn_name, fn_line, ctx, base_ptr, smb_flags2, dest, src, src_len, flags) + #define clistr_push_fn2(fn_name, fn_line, cli, dest, src, dest_len, flags) \ (CHECK_STRING_SIZE(dest, dest_len) \ ? __unsafe_string_function_usage_here_size_t__() \ @@ -218,6 +222,7 @@ size_t __unsafe_string_function_usage_here_char__(void); #define safe_strcat_fn2 safe_strcat_fn #define push_string_fn2 push_string_fn #define pull_string_fn2 pull_string_fn +#define pull_string_talloc_fn2 pull_string_talloc_fn #define clistr_push_fn2 clistr_push_fn #define clistr_pull_fn2 clistr_pull_fn #define srvstr_push_fn2 srvstr_push_fn diff --git a/source3/include/srvstr.h b/source3/include/srvstr.h index c1bb5226e5..588a807f64 100644 --- a/source3/include/srvstr.h +++ b/source3/include/srvstr.h @@ -20,6 +20,10 @@ #define srvstr_pull(base_ptr, smb_flags2, dest, src, dest_len, src_len, flags) \ pull_string(base_ptr, smb_flags2, dest, src, dest_len, src_len, flags) +/* talloc version of above. */ +#define srvstr_pull_talloc(ctx, base_ptr, smb_flags2, dest, src, src_len, flags) \ + pull_string_talloc(ctx, base_ptr, smb_flags2, dest, src, src_len, flags) + /* pull a string from the smb_buf part of a packet. In this case the string can either be null terminated or it can be terminated by the end of the smbbuf area @@ -28,3 +32,6 @@ #define srvstr_pull_buf(inbuf, smb_flags2, dest, src, dest_len, flags) \ pull_string(inbuf, smb_flags2, dest, src, dest_len, smb_bufrem(inbuf, src), flags) +/* talloc version of above. */ +#define srvstr_pull_buf_talloc(ctx, inbuf, smb_flags2, dest, src, flags) \ + pull_string_talloc(ctx, inbuf, smb_flags2, dest, src, smb_bufrem(inbuf, src), flags) |