Hello,

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.)

Regards,
Steve Langasek
postmodern programmer

        # Update charset settings?
        if ! grep -q "^[[:space:]]*unix charset[[:space:]]*=" /etc/samba/smb.conf
        then
                db_get samba-common/character_set || true
                DISPLAYCHARSET="${RET}"
                if [ -n "$DISPLAYCHARSET" ]
                then
                        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
                fi
        fi

        if ! grep -q "^[[:space:]]*dos charset[[:space:]]*=" /etc/samba/smb.conf
        then
                db_get samba-common/codepage || true
                DOSCHARSET="${RET}"
                if [ -n "$DOSCHARSET" ]
                then
                        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
                fi
        fi

Attachment: msg03727/pgp00000.pgp
Description: PGP signature

Reply via email to