summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvorlon <vorlon@alioth.debian.org>2002-09-08 03:05:18 +0000
committervorlon <vorlon@alioth.debian.org>2002-09-08 03:05:18 +0000
commitdca18788d342633a8cf9a587234491d31e2bb6ba (patch)
tree2aeef7798af24861fd1ef082d61a00ead351e79e
parent5cde5620d0489ec2fe8aaf51c1bee1541cfbaa89 (diff)
downloadsamba-dca18788d342633a8cf9a587234491d31e2bb6ba.tar.gz
bugfixes for charset handling
git-svn-id: svn://svn.debian.org/svn/pkg-samba/trunk@335 fc4039ab-9d04-0410-8cac-899223bdd6b0
-rw-r--r--samba-common.postinst38
-rw-r--r--samba-common.templates2
2 files changed, 24 insertions, 16 deletions
diff --git a/samba-common.postinst b/samba-common.postinst
index 4e0a56f703..1cadec77e7 100644
--- a/samba-common.postinst
+++ b/samba-common.postinst
@@ -39,23 +39,31 @@ if [ "${RET}" = "true" ]; then
mv -f ${TMPFILE} /etc/samba/smb.conf
# Update charset settings?
- 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 character set = $DISPLAYCHARSET\
- unix character set = $DISPLAYCHARSET" < /etc/samba/smb.conf > ${TMPFILE}
- mv -f ${TMPFILE} /etc/samba/smb.conf
+ 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
- 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 character set = $DOSCHARSET" < /etc/samba/smb.conf > ${TMPFILE}
- mv -f ${TMPFILE} /etc/samba/smb.conf
+ 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
fi
diff --git a/samba-common.templates b/samba-common.templates
index 3bf8a43122..c78692a410 100644
--- a/samba-common.templates
+++ b/samba-common.templates
@@ -1,4 +1,4 @@
-Template: samba-common/charset
+Template: samba-common/character_set
Type: string
Description: Character Set for Unix filesystem
You currently have a "character set" configured in your smb.conf. In