diff options
author | Jeremy Allison <jra@samba.org> | 2007-07-13 01:22:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:28:35 -0500 |
commit | e8dc2ea03d212bc4b4facc2a900f6a443365c390 (patch) | |
tree | c418222494cb9cd05250f30b8f6671e0b3046fa3 /source3/include | |
parent | 79a9f6dcb86703fd48d1321e50ff2b678ce39664 (diff) | |
download | samba-e8dc2ea03d212bc4b4facc2a900f6a443365c390.tar.gz samba-e8dc2ea03d212bc4b4facc2a900f6a443365c390.tar.bz2 samba-e8dc2ea03d212bc4b4facc2a900f6a443365c390.zip |
r23858: Added srvstr_pull_buf_talloc() and srvstr_pull_talloc()
calls and converted reply_tcon and reply_tconX to use
them - to show the boilerplate usage (valgrind tested).
In conjunction with Volker's srvstr_get_path_talloc()
work this should allow us to start eliminating all
pstrings/fstrings out of the main path processing
code.
I'll watch the build farm tonight...
Jeremy.
(This used to be commit b4eff3f68089f082781afcf90d43faa317949566)
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) |