From 40335b6da6ff7daeb3513d8accae4886ca63cecf Mon Sep 17 00:00:00 2001 From: Ivan Rako Date: Sun, 24 May 2009 22:11:01 +0200 Subject: [PATCH] cidr u hosts allow --- debian/changelog | 1 + debian/control | 2 +- debian/postinst | 17 +++++++++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5ce3b40..614f0aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ samba-cn (3.2.5-1) stable; urgency=low * prva verzija za lenny + * ovisnost o verzijama paketa u lennyju -- Ivan Rako Mon, 18 May 2009 15:04:10 +0200 diff --git a/debian/control b/debian/control index cf5c263..af309ac 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.6.1 Package: samba-cn Architecture: all -Depends: samba, smbclient +Depends: samba (>= 2:3.2.5), smbclient (>= 2:3.2.5) Description: a LanManager-like file and printer server for Unix The Samba software suite is a collection of programs that implements the SMB/CIFS protocol for unix systems, allowing you to serve 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 -- 1.7.10.4