]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
squid: Fix squid permiissions and config options.
authorChristian Schmidt <christian.schmidt@iipfire.org>
Fri, 28 Oct 2011 21:32:12 +0000 (21:32 +0000)
committerChristian Schmidt <christian.schmidt@iipfire.org>
Fri, 28 Oct 2011 21:32:12 +0000 (21:32 +0000)
squid/patches/squid-3.0.STABLE7-from_manpg.patch [deleted file]
squid/squid.nm

diff --git a/squid/patches/squid-3.0.STABLE7-from_manpg.patch b/squid/patches/squid-3.0.STABLE7-from_manpg.patch
deleted file mode 100644 (file)
index 368e634..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-diff -up squid-3.0.STABLE7/helpers/basic_auth/NCSA/ncsa_auth.8.from_manpg squid-3.0.STABLE7/helpers/basic_auth/NCSA/ncsa_auth.8
---- squid-3.0.STABLE7/helpers/basic_auth/NCSA/ncsa_auth.8.from_manpg   2008-06-22 05:35:49.000000000 +0200
-+++ squid-3.0.STABLE7/helpers/basic_auth/NCSA/ncsa_auth.8      2007-06-06 18:25:30.000000000 +0200
-@@ -1,38 +1,38 @@
--.\" This file is distributed in the hope that it will be useful,
--.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
--.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
--.\" the GNU General Public License for more details.
--.\"
--.\" You should have received a copy of the GNU General Public License
--.\" along with this file; if not, write to the Free Software
--.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston,
--.\" MA 02111-1307 USA
--.\"
--.\" HISTORY:
--.\" 2006-05-16, created by Rodrigo Rubira Branco <rrbranco@br.ibm.com>
--.TH ncsa_auth 8 "May 16, 2006" "Squid NCSA Auth helper"
--.SH NAME
--ncsa_auth \- NCSA httpd-style password file authentication helper for Squid
--\fB
--.SH SYNOPSIS
--.nf
--.fam C
--\fBncsa_auth\fP \fIpasswdfile\fP 
--.fam T
--.fi
--.SH DESCRIPTION
--\fBncsa_auth\fP allows Squid to read and authenticate user and password information from an NCSA/Apache httpd-style password file when using basic HTTP authentication.
--.PP
--The only parameter is the password file.  It must have permissions to be read by the user that Squid is running as (cache_effective_user in squid.conf).
--.PP
--This password file can be manipulated using htpasswd.
--.SH OPTIONS
--Only specify the password file name.
--.SH EXAMPLE
--\fBncsa_auth\fP /etc/squid/squid.pass
--.SH SECURITY
--\fBncsa_auth\fP must have access to the password file to be executed.
--.SH SEE ALSO
--\fBhtpasswd\fP(1), \fBsquid\fP(8)
--.SH AUTHOR
--Manpage written by Rodrigo Rubira Branco <rrbranco@br.ibm.com>
-+.\" This file is distributed in the hope that it will be useful,\r
-+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See\r
-+.\" the GNU General Public License for more details.\r
-+.\"\r
-+.\" You should have received a copy of the GNU General Public License\r
-+.\" along with this file; if not, write to the Free Software\r
-+.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston,\r
-+.\" MA 02111-1307 USA\r
-+.\"\r
-+.\" HISTORY:\r
-+.\" 2006-05-16, created by Rodrigo Rubira Branco <rrbranco@br.ibm.com>\r
-+.TH ncsa_auth 8 "May 16, 2006" "User Manuals" "User Manuals"\r
-+.SH NAME\r
-+ncsa_auth \- NCSA httpd-style password file authentication helper for Squid\r
-+\fB\r
-+.SH SYNOPSIS\r
-+.nf\r
-+.fam C\r
-+\fBncsa_auth\fP \fIpasswdfile\fP \r
-+.fam T\r
-+.fi\r
-+.SH DESCRIPTION\r
-+\fBncsa_auth\fP allows Squid to read and authenticate user and password information from an NCSA httpd-style password file when using basic HTTP authentication.\r
-+.PP\r
-+The only parameter is the password file.  It must have permissions to be read by the user that Squid is running as. By default this user is proxy. This can be changed using the cache_effective_user directive in the squid.conf file.\r
-+.PP\r
-+This password file can be manipulated using htpasswd.\r
-+.SH OPTIONS\r
-+Only specify the password file name.\r
-+.SH EXAMPLE\r
-+\fBncsa_auth\fP /etc/squid/squid.pass\r
-+.SH SECURITY\r
-+\fBncsa_auth\fP must have access to the password file to be executed.\r
-+.SH SEE ALSO\r
-+\fBhtpasswd\fP(1), \fBsquid\fP(8)\r
-+.SH AUTHOR\r
-+Manpage written by Rodrigo Rubira Branco <rrbranco@br.ibm.com>\r
index 9bb3e6c5e4de32059d5c7aba6889ad5b4fcaec69..59a8d9780dbc97d34450880a4a905966707f9c75 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = squid
 major_ver  = 3.1
-version    = %{major_ver}.12
+version    = %{major_ver}.16
 release    = 2
 
 maintainer = Christian Schmidt <christian.schmidt@ipfire.org>
@@ -36,6 +36,7 @@ build
                pam-devel
                libcap-devel
                /usr/bin/smbclient
+               shadow-utils
        end
 
        CFLAGS += -Wno-error
@@ -45,6 +46,7 @@ build
                --libexecdir=/usr/lib/squid \
                --localstatedir=/var \
                --sysconfdir=/etc/squid \
+               --with-logdir=/var/log/squid \
                --enable-storeio="aufs,diskd,ufs" \
                --enable-removal-policies="heap,lru" \
                --enable-icmp \
@@ -82,24 +84,41 @@ build
                --with-dl \
                --with-large-files
 
+       prepare_cmds
+               %{create_user}
+       end
+
        install_cmds
                rm -vf %{BUILDROOT}/etc/squid/errors
-               rmdir  %{BUILDROOT}/var/logs
 
                mkdir -pv %{BUILDROOT}/var/log/cache %{BUILDROOT}/var/log/squid
                touch %{BUILDROOT}/var/log/squid/access.log
+               touch %{BUILDROOT}/var/log/squid/cache.log
                mkdir -pv %{BUILDROOT}/var/cache/squid
 
-               # What is this?????
-               #groupadd -r squid && useradd -r -g squid -d %{BUILDROOT}/var/cache/squid -s /bin/false -p '*' squid
-               #chown -Rv squid:squid %{BUILDROOT}/var/log/squid %{BUILDROOT}/var/log/cache %{BUILDROOT}/var/cache/squid
-               #chmod 600 %{BUILDROOT}/var/cache/squid
-               #chown squid:squid %{BUILDROOT}/var/log/squid
+               echo "visible_hostname %{DISTRO_NAME}" >> %{BUILDROOT}/etc/squid/squid.conf
+               echo "cache_effective_user squid" >> %{BUILDROOT}/etc/squid/squid.conf
+               echo "cache_effective_group squid" >> %{BUILDROOT}/etc/squid/squid.conf
+
+               chown -Rv squid:squid %{BUILDROOT}/var/log/squid %{BUILDROOT}/var/log/cache %{BUILDROOT}/var/cache/squid
+               chmod 600 %{BUILDROOT}/var/cache/squid
        end
 end
 
+create_user
+       getent group squid >/dev/null || /usr/sbin/groupadd -r squid
+       getent passwd squid >/dev/null || /usr/sbin/useradd -r -g squid \
+               -d /var/cache/squid -s /sbin/nologin squid
+end
+
 packages
        package %{name}
+               prerequires = shadow-utils
+
+               script prein
+                       %{create_user}
+               end
+       
                requires = /usr/bin/smbclient
 
                filter_requires = perl\(Authen::Smb\)