diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-02-11 07:20:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:41 -0500 |
commit | f3d1fa124bafde1842c09fa6d408a52f99b5d984 (patch) | |
tree | e442661bcd555abab9226c144932c724a8824fff /source4/libcli | |
parent | 82fd60e904d93ef38c43cee423b668c1327f22aa (diff) | |
download | samba-f3d1fa124bafde1842c09fa6d408a52f99b5d984.tar.gz samba-f3d1fa124bafde1842c09fa6d408a52f99b5d984.tar.bz2 samba-f3d1fa124bafde1842c09fa6d408a52f99b5d984.zip |
r5326: removed the charset conversion from the nbtname code, so we no longer
convert from/to DOS strings in NBT names. This will allow us to
support all foreign names as a WINS server, as long as they don't
contain a 0 byte.
(This used to be commit 8e5d3a74d341de086d850d823cf8a1bfc9387fe8)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/nbt/nbtname.c | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/source4/libcli/nbt/nbtname.c b/source4/libcli/nbt/nbtname.c index 1b53cb3ca6..1904b33a9b 100644 --- a/source4/libcli/nbt/nbtname.c +++ b/source4/libcli/nbt/nbtname.c @@ -160,8 +160,6 @@ NTSTATUS ndr_pull_nbt_name(struct ndr_pull *ndr, int ndr_flags, struct nbt_name uint32_t max_offset = offset; uint8_t *components[MAX_COMPONENTS]; int i; - ssize_t ret; - void *p; uint8_t *scope; if (!(ndr_flags & NDR_SCALARS)) { @@ -192,12 +190,7 @@ NTSTATUS ndr_pull_nbt_name(struct ndr_pull *ndr, int ndr_flags, struct nbt_name status = decompress_name(components[0], &r->type); NT_STATUS_NOT_OK_RETURN(status); - ret = convert_string_talloc(ndr, CH_DOS, CH_UNIX, components[0], - strlen(components[0])+1, &p); - if (ret <= 0) { - return NT_STATUS_BAD_NETWORK_NAME; - } - r->name = p; + r->name = components[0]; /* combine the remaining components into the scope */ scope = components[1]; @@ -206,16 +199,7 @@ NTSTATUS ndr_pull_nbt_name(struct ndr_pull *ndr, int ndr_flags, struct nbt_name NT_STATUS_HAVE_NO_MEMORY(scope); } - if (scope) { - ret = convert_string_talloc(ndr, CH_DOS, CH_UNIX, scope, - strlen(scope)+1, &p); - if (ret <= 0) { - return NT_STATUS_BAD_NETWORK_NAME; - } - r->scope = p; - } else { - r->scope = NULL; - } + r->scope = scope; return NT_STATUS_OK; } @@ -227,31 +211,18 @@ NTSTATUS ndr_push_nbt_name(struct ndr_push *ndr, int ndr_flags, struct nbt_name { uint_t num_components; uint8_t *components[MAX_COMPONENTS]; - void *ptr; char *dname, *dscope=NULL, *p; uint8_t *cname; - ssize_t ret; int i; if (!(ndr_flags & NDR_SCALARS)) { return NT_STATUS_OK; } - /* convert to DOS format */ - ret = convert_string_talloc(ndr, CH_UNIX, CH_DOS, r->name, - strlen(r->name)+1, &ptr); - if (ret <= 0) { - return NT_STATUS_BAD_NETWORK_NAME; - } - dname = strupper_talloc(ndr, ptr); + dname = strupper_talloc(ndr, r->name); NT_STATUS_HAVE_NO_MEMORY(dname); if (r->scope) { - ret = convert_string_talloc(ndr, CH_UNIX, CH_DOS, r->scope, - strlen(r->scope)+1, &ptr); - if (ret <= 0) { - return NT_STATUS_BAD_NETWORK_NAME; - } - dscope = strupper_talloc(ndr, ptr); + dscope = strupper_talloc(ndr, r->scope); NT_STATUS_HAVE_NO_MEMORY(dscope); } |