summaryrefslogtreecommitdiffstats
path: root/source/lib/charcnv.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-03-22 02:14:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:09 -0500
commit22fca746576810c5408540031a9603625a66cd75 (patch)
tree650d2b1b13c48b07e76104564ca2c31e35ce748c /source/lib/charcnv.c
parentbf3ce651ff3f654938bc98c604ad56214760a05e (diff)
downloadsamba-22fca746576810c5408540031a9603625a66cd75.tar.gz
samba-22fca746576810c5408540031a9603625a66cd75.tar.xz
samba-22fca746576810c5408540031a9603625a66cd75.zip
r5933: We were handling setting of EA's incorrectly - we should be able to set
a list. Also not converting names from DOS CP to UNIX CP correctly. This code doesn't quite work yet but it's a work in progress to be fixed tomorrow (don't want to lose it). Jeremy.
Diffstat (limited to 'source/lib/charcnv.c')
-rw-r--r--source/lib/charcnv.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/lib/charcnv.c b/source/lib/charcnv.c
index b9b9d90db67..4fbad0f3d18 100644
--- a/source/lib/charcnv.c
+++ b/source/lib/charcnv.c
@@ -1269,6 +1269,21 @@ size_t pull_utf8_allocate(char **dest, const char *src)
}
/**
+ * Copy a string from a DOS src to a unix char * destination, allocating a buffer using talloc
+ *
+ * @param dest always set at least to NULL
+ *
+ * @returns The number of bytes occupied by the string in the destination
+ **/
+
+size_t pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src)
+{
+ size_t src_len = strlen(src)+1;
+ *dest = NULL;
+ return convert_string_talloc(ctx, CH_DOS, CH_UNIX, src, src_len, (void **)dest, True);
+}
+
+/**
Copy a string from a char* src to a unicode or ascii
dos codepage destination choosing unicode or ascii based on the
flags in the SMB buffer starting at base_ptr.