diff options
Diffstat (limited to 'source4/ntvfs/posix')
-rw-r--r-- | source4/ntvfs/posix/pvfs_rename.c | 16 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_resolve.c | 18 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_shortname.c | 6 | ||||
-rw-r--r-- | source4/ntvfs/posix/pvfs_xattr.c | 6 |
4 files changed, 18 insertions, 28 deletions
diff --git a/source4/ntvfs/posix/pvfs_rename.c b/source4/ntvfs/posix/pvfs_rename.c index e4448d3442..5296811f02 100644 --- a/source4/ntvfs/posix/pvfs_rename.c +++ b/source4/ntvfs/posix/pvfs_rename.c @@ -95,7 +95,6 @@ NTSTATUS pvfs_do_rename(struct pvfs_state *pvfs, resolve a wildcard rename pattern. This works on one component of the name */ static const char *pvfs_resolve_wildcard_component(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, const char *fname, const char *pattern) { @@ -115,16 +114,16 @@ static const char *pvfs_resolve_wildcard_component(TALLOC_CTX *mem_ctx, while (*p2) { codepoint_t c1, c2; size_t c_size1, c_size2; - c1 = next_codepoint_convenience(iconv_convenience, p1, &c_size1); - c2 = next_codepoint_convenience(iconv_convenience, p2, &c_size2); + c1 = next_codepoint(p1, &c_size1); + c2 = next_codepoint(p2, &c_size2); if (c2 == '?') { - d += push_codepoint_convenience(iconv_convenience, d, c1); + d += push_codepoint(d, c1); } else if (c2 == '*') { memcpy(d, p1, strlen(p1)); d += strlen(p1); break; } else { - d += push_codepoint_convenience(iconv_convenience, d, c2); + d += push_codepoint(d, c2); } p1 += c_size1; @@ -142,7 +141,6 @@ static const char *pvfs_resolve_wildcard_component(TALLOC_CTX *mem_ctx, resolve a wildcard rename pattern. */ static const char *pvfs_resolve_wildcard(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, const char *fname, const char *pattern) { @@ -175,8 +173,8 @@ static const char *pvfs_resolve_wildcard(TALLOC_CTX *mem_ctx, return NULL; } - base1 = pvfs_resolve_wildcard_component(mem_ctx, iconv_convenience, base1, base2); - ext1 = pvfs_resolve_wildcard_component(mem_ctx, iconv_convenience, ext1, ext2); + base1 = pvfs_resolve_wildcard_component(mem_ctx, base1, base2); + ext1 = pvfs_resolve_wildcard_component(mem_ctx, ext1, ext2); if (base1 == NULL || ext1 == NULL) { return NULL; } @@ -283,7 +281,7 @@ static NTSTATUS pvfs_rename_one(struct pvfs_state *pvfs, NTSTATUS status; /* resolve the wildcard pattern for this name */ - fname2 = pvfs_resolve_wildcard(mem_ctx, lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx), fname1, fname2); + fname2 = pvfs_resolve_wildcard(mem_ctx, fname1, fname2); if (fname2 == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/source4/ntvfs/posix/pvfs_resolve.c b/source4/ntvfs/posix/pvfs_resolve.c index 9613b7078a..0da64a790d 100644 --- a/source4/ntvfs/posix/pvfs_resolve.c +++ b/source4/ntvfs/posix/pvfs_resolve.c @@ -186,8 +186,7 @@ static NTSTATUS pvfs_case_search(struct pvfs_state *pvfs, /* parse a alternate data stream name */ -static NTSTATUS parse_stream_name(struct smb_iconv_convenience *ic, - struct pvfs_filename *name, +static NTSTATUS parse_stream_name(struct pvfs_filename *name, const char *s) { char *p, *stream_name; @@ -203,7 +202,7 @@ static NTSTATUS parse_stream_name(struct smb_iconv_convenience *ic, while (*p) { size_t c_size; - codepoint_t c = next_codepoint_convenience(ic, p, &c_size); + codepoint_t c = next_codepoint(p, &c_size); switch (c) { case '/': @@ -259,7 +258,6 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name, unsigned int flags, struct pvfs_filename *name) { char *ret, *p, *p_start; - struct smb_iconv_convenience *ic = NULL; NTSTATUS status; name->original_name = talloc_strdup(name, cifs_name); @@ -300,10 +298,9 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name, for legal characters */ p_start = p; - ic = lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx); while (*p) { size_t c_size; - codepoint_t c = next_codepoint_convenience(ic, p, &c_size); + codepoint_t c = next_codepoint(p, &c_size); if (c <= 0x1F) { return NT_STATUS_OBJECT_NAME_INVALID; @@ -336,7 +333,7 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name, if (name->has_wildcard) { return NT_STATUS_OBJECT_NAME_INVALID; } - status = parse_stream_name(ic, name, p); + status = parse_stream_name(name, p); if (!NT_STATUS_IS_OK(status)) { return status; } @@ -388,7 +385,6 @@ static NTSTATUS pvfs_unix_path(struct pvfs_state *pvfs, const char *cifs_name, return NULL if it can't be reduced */ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx, - struct smb_iconv_convenience *iconv_convenience, const char **fname, unsigned int flags) { codepoint_t c; @@ -401,7 +397,7 @@ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx, if (s == NULL) return NT_STATUS_NO_MEMORY; for (num_components=1, p=s; *p; p += c_size) { - c = next_codepoint_convenience(iconv_convenience, p, &c_size); + c = next_codepoint(p, &c_size); if (c == '\\') num_components++; } @@ -413,7 +409,7 @@ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx, components[0] = s; for (i=0, p=s; *p; p += c_size) { - c = next_codepoint_convenience(iconv_convenience, p, &c_size); + c = next_codepoint(p, &c_size); if (c == '\\') { *p = 0; components[++i] = p+1; @@ -539,7 +535,7 @@ NTSTATUS pvfs_resolve_name(struct pvfs_state *pvfs, if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_PATH_SYNTAX_BAD)) { /* it might contain .. components which need to be reduced */ - status = pvfs_reduce_name(*name, lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx), &cifs_name, flags); + status = pvfs_reduce_name(*name, &cifs_name, flags); if (!NT_STATUS_IS_OK(status)) { return status; } diff --git a/source4/ntvfs/posix/pvfs_shortname.c b/source4/ntvfs/posix/pvfs_shortname.c index 530def9163..fc1cad1894 100644 --- a/source4/ntvfs/posix/pvfs_shortname.c +++ b/source4/ntvfs/posix/pvfs_shortname.c @@ -104,8 +104,6 @@ struct pvfs_mangle_context { /* this is used to reverse the base 36 mapping */ unsigned char base_reverse[256]; - - struct smb_iconv_convenience *iconv_convenience; }; @@ -390,7 +388,7 @@ static bool is_legal_name(struct pvfs_mangle_context *ctx, const char *name) { while (*name) { size_t c_size; - codepoint_t c = next_codepoint_convenience(ctx->iconv_convenience, name, &c_size); + codepoint_t c = next_codepoint(name, &c_size); if (c == INVALID_CODEPOINT) { return false; } @@ -615,8 +613,6 @@ NTSTATUS pvfs_mangle_init(struct pvfs_state *pvfs) return NT_STATUS_NO_MEMORY; } - ctx->iconv_convenience = lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx); - /* by default have a max of 512 entries in the cache. */ ctx->cache_size = lp_parm_int(pvfs->ntvfs->ctx->lp_ctx, NULL, "mangle", "cachesize", 512); diff --git a/source4/ntvfs/posix/pvfs_xattr.c b/source4/ntvfs/posix/pvfs_xattr.c index 1ca09402a3..1eb7c31868 100644 --- a/source4/ntvfs/posix/pvfs_xattr.c +++ b/source4/ntvfs/posix/pvfs_xattr.c @@ -117,8 +117,8 @@ NTSTATUS pvfs_xattr_ndr_load(struct pvfs_state *pvfs, } /* pull the blob */ - ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx), - p, (ndr_pull_flags_fn_t)pull_fn); + ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, p, + (ndr_pull_flags_fn_t)pull_fn); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { return ndr_map_error2ntstatus(ndr_err); } @@ -140,7 +140,7 @@ NTSTATUS pvfs_xattr_ndr_save(struct pvfs_state *pvfs, NTSTATUS status; enum ndr_err_code ndr_err; - ndr_err = ndr_push_struct_blob(&blob, mem_ctx, lp_iconv_convenience(pvfs->ntvfs->ctx->lp_ctx), p, (ndr_push_flags_fn_t)push_fn); + ndr_err = ndr_push_struct_blob(&blob, mem_ctx, p, (ndr_push_flags_fn_t)push_fn); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { talloc_free(mem_ctx); return ndr_map_error2ntstatus(ndr_err); |