diff options
author | Jeremy Allison <jra@samba.org> | 2001-06-28 23:21:43 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-06-28 23:21:43 +0000 |
commit | 95d1969e7ee38380b82f250ae4e6ec9e78e79216 (patch) | |
tree | 57af1ad29f10a7dde68f99ca87e0c9ebdf774b05 /source3 | |
parent | 9e7896144ae1f7cc4539d875e6c2a94f8b54a2bb (diff) | |
download | samba-95d1969e7ee38380b82f250ae4e6ec9e78e79216.tar.gz samba-95d1969e7ee38380b82f250ae4e6ec9e78e79216.tar.bz2 samba-95d1969e7ee38380b82f250ae4e6ec9e78e79216.zip |
param/loadparm.c: Fix for bad volume label, found by TAKAHASHI Motonobu
Samba Users Group Japan. Ensure same as in 2.2.x codebase.
Jeremy.
(This used to be commit 5a5d33b9464fe6289e55dbfd229d2859914b9293)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/param/loadparm.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 4ba219adbf..a6bfab880a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -997,7 +997,7 @@ static struct parm_struct parm_table[] = { {"root preexec close", P_BOOL, P_LOCAL, &sDefault.bRootpreexecClose, NULL, NULL, FLAG_SHARE}, {"root postexec", P_STRING, P_LOCAL, &sDefault.szRootPostExec, NULL, NULL, FLAG_SHARE | FLAG_PRINT}, {"available", P_BOOL, P_LOCAL, &sDefault.bAvailable, NULL, NULL, FLAG_BASIC | FLAG_SHARE | FLAG_PRINT}, - {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE}, + {"volume", P_STRING, P_LOCAL, &sDefault.volume, NULL, NULL, FLAG_SHARE | FLAG_DOS_STRING}, {"fstype", P_STRING, P_LOCAL, &sDefault.fstype, NULL, NULL, FLAG_SHARE}, {"set directory", P_BOOLREV, P_LOCAL, &sDefault.bNo_set_dir, NULL, NULL, FLAG_SHARE}, {"source environment", P_STRING, P_GLOBAL, &Globals.szSourceEnv, handle_source_env, NULL, 0}, @@ -3439,20 +3439,14 @@ int lp_servicenumber(char *pszServiceName) } /******************************************************************* - a useful volume label function - ******************************************************************/ + A useful volume label function. Returns a string in DOS codepage. +********************************************************************/ + char *volume_label(int snum) { char *ret = lp_volume(snum); - if (!*ret) { - /* lp_volume returns a unix charset - lp_servicename returns a - dos codepage - convert so volume_label() always returns UNIX. - */ - char *p = dos_to_unix(lp_servicename(snum), False); - int len = strlen(p)+1; - ret = (char *)talloc(lp_talloc, len); - memcpy(ret, p, len); - } + if (!*ret) + return lp_servicename(snum); return (ret); } |