The Samba-Bugzilla – Attachment 684 Details for
Bug 1846
smbmount does not convert from default DOS character set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
My patch for this bug
samba-3.0.3-mntcodes.patch (text/plain), 2.60 KB, created by
Patrick Monnerat
on 2004-09-28 10:39:17 UTC
(
hide
)
Description:
My patch for this bug
Filename:
MIME Type:
Creator:
Patrick Monnerat
Created:
2004-09-28 10:39:17 UTC
Size:
2.60 KB
patch
obsolete
>diff -Naur samba-3.0.3.orig/source/client/smbmount.c samba-3.0.3/source/client/smbmount.c >--- samba-3.0.3.orig/source/client/smbmount.c 2004-04-20 22:42:58.000000000 +0200 >+++ samba-3.0.3/source/client/smbmount.c 2004-08-31 22:40:09.140404175 +0200 >@@ -700,6 +700,57 @@ > > > /**************************************************************************** >+ Append character set definition to option string. >+ A light translation is made to ease matching a kernel character set name. >+ ****************************************************************************/ >+static char * >+append_charset(char * p, char * option, char * value, int maxchar) >+ >+{ >+ char * setname; >+ >+ if (!*value) >+ return p; >+ >+ while (*option && maxchar > 0) { >+ *p++ = *option++; >+ maxchar--; >+ } >+ >+ if (maxchar > 0) { >+ *p++ = '='; >+ maxchar--; >+ } >+ >+ /* Translate charset name to lower case. */ >+ >+ setname = p; >+ >+ while (*value && maxchar > 0) { >+ *p++ = isupper(*value)? tolower(*value): *value; >+ value++; >+ maxchar--; >+ } >+ >+ /* Special case: translate "utf-8" into "utf8". */ >+ >+ *p = '\0'; /* Terminator byte may always be stored. */ >+ >+ if (!strcmp(setname, "utf-8")) { >+ p--; >+ p[-1] = '8'; >+ maxchar++; >+ } >+ >+ if (maxchar > 0) >+ *p++ = ','; >+ >+ *p = '\0'; /* Terminator byte may always be stored. */ >+ return p; >+} >+ >+ >+/**************************************************************************** > Argument parsing for mount.smbfs interface > mount will call us like this: > mount.smbfs device mountpoint -o <options> >@@ -714,6 +765,8 @@ > extern char *optarg; > int val; > char *p; >+ pstring dos_charset; >+ pstring unix_charset; > > /* FIXME: This function can silently fail if the arguments are > * not in the expected order. >@@ -745,6 +798,8 @@ > return; > } > >+ pstrcpy(dos_charset, lp_dos_charset()); >+ pstrcpy(unix_charset, lp_unix_charset()); > options[0] = 0; > p = options; > >@@ -806,6 +861,10 @@ > pstrcpy(user_socket_options,opteq+1); > } else if(!strcmp(opts, "scope")) { > set_global_scope(opteq+1); >+ } else if(!strcmp(opts, "codepage")) { >+ pstrcpy(dos_charset, opteq + 1); >+ } else if(!strcmp(opts, "iocharset")) { >+ pstrcpy(unix_charset, opteq + 1); > } else { > slprintf(p, sizeof(pstring) - (p - options) - 1, "%s=%s,", opts, opteq+1); > p += strlen(p); >@@ -850,6 +909,11 @@ > exit(1); > } > >+ p = append_charset(p, "codepage", dos_charset, >+ sizeof(pstring) - (p - options) - 1); >+ p = append_charset(p, "iocharset", unix_charset, >+ sizeof(pstring) - (p - options) - 1); >+ > if (p != options) { > *(p-1) = 0; /* remove trailing , */ > DEBUG(3,("passthrough options '%s'\n", options));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1846
: 684