X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;ds=sidebyside;f=debian%2Fpostinst;h=1ea1c59fca447e12e33be7acb350b8d6c0ed7756;hb=40335b6da6ff7daeb3513d8accae4886ca63cecf;hp=3c34409254bde7570882f5c9d52cab2974d73871;hpb=da9c52c63eaff9b6facda1502fbcc8936bd36682;p=samba-cn.git diff --git a/debian/postinst b/debian/postinst index 3c34409..1ea1c59 100755 --- a/debian/postinst +++ b/debian/postinst @@ -6,10 +6,23 @@ # Load CARNet Tools . /usr/share/carnet-tools/functions.sh -cp_check_and_sed '; security = user' \ - 's/; security = user/ security = user/g' \ +cp_check_and_sed '#[[:space:]]*security = user' \ + 's/#[[:space:]]*security = user/ security = user/g' \ /etc/samba/smb.conf || true +cp_check_and_sed ';[[:space:]]*security = user' \ + 's/;[[:space:]]*security = user/ security = user/g' \ + /etc/samba/smb.conf || true + +cp_get_netaddr || true +net="$RET" +if ! grep -q '^[[:space:]]*hosts allow' /etc/samba/smb.conf; then + echo " hosts allow = $net 127.0.0.1" >> /etc/samba/smb.conf +fi +if ! grep -q '^[[:space:]]*hosts deny' /etc/samba/smb.conf; then + echo " hosts deny = ALL" >> /etc/samba/smb.conf +fi + # restart if [ -x /usr/sbin/invoke-rc.d ]; then [ -x /etc/init.d/samba ] && invoke-rc.d samba restart