summaryrefslogtreecommitdiffstats
path: root/source/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-08-22 00:26:37 +0000
committerJeremy Allison <jra@samba.org>2003-08-22 00:26:37 +0000
commiteb792727437c74417f5ef7614b300ab84f06fdaf (patch)
tree922af1254e5f4d7fd5c77f0d010ba9e3ca980bec /source/libsmb
parent6585446afd29768fde8c3f882bfb57554cf4e4da (diff)
downloadsamba-eb792727437c74417f5ef7614b300ab84f06fdaf.tar.gz
samba-eb792727437c74417f5ef7614b300ab84f06fdaf.tar.xz
samba-eb792727437c74417f5ef7614b300ab84f06fdaf.zip
Ensure nmb_namestr() converts back from CH_DOS to CH_UNIX.
Jeremy.
Diffstat (limited to 'source/libsmb')
-rw-r--r--source/libsmb/nmblib.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/source/libsmb/nmblib.c b/source/libsmb/nmblib.c
index 6ee05f01045..b833a2f5df3 100644
--- a/source/libsmb/nmblib.c
+++ b/source/libsmb/nmblib.c
@@ -310,21 +310,24 @@ static int put_nmb_name(char *buf,int offset,struct nmb_name *name)
}
/*******************************************************************
- useful for debugging messages
- ******************************************************************/
+ Useful for debugging messages.
+******************************************************************/
+
char *nmb_namestr(struct nmb_name *n)
{
- static int i=0;
- static fstring ret[4];
- char *p = ret[i];
-
- if (!n->scope[0])
- slprintf(p,sizeof(fstring)-1, "%s<%02x>",n->name,n->name_type);
- else
- slprintf(p,sizeof(fstring)-1, "%s<%02x>.%s",n->name,n->name_type,n->scope);
-
- i = (i+1)%4;
- return(p);
+ static int i=0;
+ static fstring ret[4];
+ fstring name;
+ char *p = ret[i];
+
+ pull_ascii_fstring(name, n->name);
+ if (!n->scope[0])
+ slprintf(p,sizeof(fstring)-1, "%s<%02x>",name,n->name_type);
+ else
+ slprintf(p,sizeof(fstring)-1, "%s<%02x>.%s",name,n->name_type,n->scope);
+
+ i = (i+1)%4;
+ return(p);
}
/*******************************************************************