summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-03-16 06:17:11 +0000
committerAndrew Tridgell <tridge@samba.org>2001-03-16 06:17:11 +0000
commit853b5c87ec5ac499a8320edb7b3bc2672a5a49e4 (patch)
tree5723360b64c39b01a6764bccd5b24155095dcf2e /source3
parent65d35749b721b76ae826a9423bdefd2f673f35c6 (diff)
downloadsamba-853b5c87ec5ac499a8320edb7b3bc2672a5a49e4.tar.gz
samba-853b5c87ec5ac499a8320edb7b3bc2672a5a49e4.tar.bz2
samba-853b5c87ec5ac499a8320edb7b3bc2672a5a49e4.zip
fixed volume_name(). It used dos_to_unix() which uses a static buffer,
and that buffer got clobbered in the trans2 QFS_VOLUME_INFO call, so the volume label always showed as "." from NT clients. (This used to be commit 2131d8bf76733d7cf046aa651d11bf3dade0913d)
Diffstat (limited to 'source3')
-rw-r--r--source3/param/loadparm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 85329e8c53..aebf43c9a5 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -3361,7 +3361,10 @@ char *volume_label(int snum)
/* lp_volume returns a unix charset - lp_servicename returns a
dos codepage - convert so volume_label() always returns UNIX.
*/
- return (dos_to_unix(lp_servicename(snum), False));
+ char *p = dos_to_unix(lp_servicename(snum), False);
+ int len = strlen(p)+1;
+ ret = (char *)talloc(lp_talloc, len);
+ memcpy(ret, p, len);
}
return (ret);
}