diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-03-19 12:20:11 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-04-14 12:53:56 +1000 |
commit | 3b3e21bd9ba701a97e752205263a7903619541c7 (patch) | |
tree | 3f0cdf8e4d5a550a323e73d229083d6329b3f236 /source3/smbd | |
parent | 4786a493f70070dce6de4cbe488c9de1bdbb75ad (diff) | |
download | samba-3b3e21bd9ba701a97e752205263a7903619541c7.tar.gz samba-3b3e21bd9ba701a97e752205263a7903619541c7.tar.bz2 samba-3b3e21bd9ba701a97e752205263a7903619541c7.zip |
Convert Samba3 to use the common lib/util/charset API
This removes calls to push_*_allocate() and pull_*_allocate(), as well
as convert_string_allocate, as they are not in the common API
To allow transition to a common charcnv in future, provide Samba4-like
strupper functions in source3/lib/charcnv.c
(the actual implementation remains distinct, but the API is now shared)
Andrew Bartlett
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/mangle_hash.c | 20 | ||||
-rw-r--r-- | source3/smbd/statcache.c | 2 |
2 files changed, 11 insertions, 11 deletions
diff --git a/source3/smbd/mangle_hash.c b/source3/smbd/mangle_hash.c index 96fe4d2cab..94bb184b0f 100644 --- a/source3/smbd/mangle_hash.c +++ b/source3/smbd/mangle_hash.c @@ -290,15 +290,15 @@ static bool is_8_3(const char *fname, bool check_case, bool allow_wildcards, if (strlen(f) > 12) return False; - if (!push_ucs2_allocate(&ucs2name, f, &size)) { - DEBUG(0,("is_8_3: internal error push_ucs2_allocate() failed!\n")); + if (!push_ucs2_talloc(NULL, &ucs2name, f, &size)) { + DEBUG(0,("is_8_3: internal error push_ucs2_talloc() failed!\n")); goto done; } ret = is_8_3_w(ucs2name, allow_wildcards); done: - SAFE_FREE(ucs2name); + TALLOC_FREE(ucs2name); if (!NT_STATUS_IS_OK(ret)) { return False; @@ -606,12 +606,12 @@ static bool must_mangle(const char *name, magic_char = lp_magicchar(p); - if (!push_ucs2_allocate(&name_ucs2, name, &converted_size)) { - DEBUG(0, ("push_ucs2_allocate failed!\n")); + if (!push_ucs2_talloc(NULL, &name_ucs2, name, &converted_size)) { + DEBUG(0, ("push_ucs2_talloc failed!\n")); return False; } status = is_valid_name(name_ucs2, False, False); - SAFE_FREE(name_ucs2); + TALLOC_FREE(name_ucs2); return NT_STATUS_IS_OK(status); } @@ -645,20 +645,20 @@ static bool hash_name_to_8_3(const char *in, DEBUG(5,("hash_name_to_8_3( %s, cache83 = %s)\n", in, cache83 ? "True" : "False")); - if (!push_ucs2_allocate(&in_ucs2, in, &converted_size)) { - DEBUG(0, ("push_ucs2_allocate failed!\n")); + if (!push_ucs2_talloc(NULL, &in_ucs2, in, &converted_size)) { + DEBUG(0, ("push_ucs2_talloc failed!\n")); return False; } /* If it's already 8.3, just copy. */ if (NT_STATUS_IS_OK(is_valid_name(in_ucs2, False, False)) && NT_STATUS_IS_OK(is_8_3_w(in_ucs2, False))) { - SAFE_FREE(in_ucs2); + TALLOC_FREE(in_ucs2); safe_strcpy(out, in, 12); return True; } - SAFE_FREE(in_ucs2); + TALLOC_FREE(in_ucs2); if (!to_8_3(magic_char, in, out, default_case)) { return False; } diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c index 72fed008a2..2f7d16790d 100644 --- a/source3/smbd/statcache.c +++ b/source3/smbd/statcache.c @@ -205,7 +205,7 @@ bool stat_cache_lookup(connection_struct *conn, } else { chk_name = talloc_strdup_upper(ctx,name); if (!chk_name) { - DEBUG(0, ("stat_cache_lookup: strdup_upper failed!\n")); + DEBUG(0, ("stat_cache_lookup: talloc_strdup_upper failed!\n")); return False; } |