[Samba] upgrade to 3.0alpha20: accented chars in filenames unreadable

Steve Langasek vorlon at netexpress.net
Wed Oct 16 14:31:00 GMT 2002


On Wed, Oct 16, 2002 at 09:16:58AM -0500, Gerald (Jerry) Carter wrote:
> Can anyone comment on this?

> > Upon upgrading from 2.2.5 to 3.0alpha20 on Debian unstable, filenames
> > with accented characters (ie: éàî etc.) became unreadable. For example
> > in W2K a filename previously called "résumé.xls" became "r" when looking at
> > the samba share; and the filename is impossible to modify from windows:
> > samba log says "file not found". From the shell the file looks like
> > "r?sum?.xls" but the "?" are actually 0x83.

> > Now, the file contents are intact and if modified from the unix command
> > line to non-accented they become accessible again from windows.

> > FWIW I used the following command to sanitize all filenames:

> > % rename -v 's/\x8c/i/g;s/[\x83\x8a\x82]/e/g' **/*

> > I know I'm using an "alpha" samba and "unstable" debian, but still I'd
> > like to understand what happened, if possible.

> > Is this a known issue?

The current Debian Samba package uses the following shell snippet to
convert between 2.2-style character set settings and 3.0-style settings,
if the user has opted to let Debian manage the smb.conf file directly.
If the user has chosen to not allow automatic management of smb.conf, any
"character set" and "client code page" values in smb.conf will need to be
converted by hand to the new "unix charset" and "dos charset" values.

If the user previously had these settings in smb.conf, and they were
converted but accents are still broken, please let me know.  (Preferably,
a bug would be filed with the Debian BTS.)

Steve Langasek
postmodern programmer

	# Update charset settings?
	if ! grep -q "^[[:space:]]*unix charset[[:space:]]*=" /etc/samba/smb.conf
		db_get samba-common/character_set || true
		if [ -n "$DISPLAYCHARSET" ]
			TMPFILE=`mktemp -q /tmp/smb.conf.XXXXXX`
			sed -e "/^[[:space:]]*character set[[:space:]]*=/c \\
   display charset = $DISPLAYCHARSET\\
   unix charset = $DISPLAYCHARSET" < /etc/samba/smb.conf > ${TMPFILE}
			mv -f ${TMPFILE} /etc/samba/smb.conf

	if ! grep -q "^[[:space:]]*dos charset[[:space:]]*=" /etc/samba/smb.conf
		db_get samba-common/codepage || true
		if [ -n "$DOSCHARSET" ]
			TMPFILE=`mktemp -q /tmp/smb.conf.XXXXXX`
			sed -e "/^[[:space:]]*client code page[[:space:]]*=/c \\
   dos charset = $DOSCHARSET" < /etc/samba/smb.conf > ${TMPFILE}
			mv -f ${TMPFILE} /etc/samba/smb.conf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20021016/0c644ee2/attachment.bin

More information about the samba-technical mailing list