Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 134823 - Changes to support pf and nis in Squid ebuild.
Summary: Changes to support pf and nis in Squid ebuild.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High enhancement (vote)
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-29 14:07 UTC by Javier Villavicencio (RETIRED)
Modified: 2006-06-19 11:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
new squid ebuild with *bsd support. (squid-2.5.13.ebuild,7.06 KB, text/plain)
2006-05-29 14:08 UTC, Javier Villavicencio (RETIRED)
Details
squid-pf-patch.diff (squid-pf-patch.diff,2.89 KB, patch)
2006-05-29 14:14 UTC, Javier Villavicencio (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Javier Villavicencio (RETIRED) gentoo-dev 2006-05-29 14:07:20 UTC
Added suport for *BSD firewalls (pf and ipfilter), and fixes build when -libs haven't been compiled with "nis" support. Works on freebsd, should work on openbsd, and needs a couple more lines for netbsd.
Comment 1 Javier Villavicencio (RETIRED) gentoo-dev 2006-05-29 14:08:03 UTC
Created attachment 87824 [details]
new squid ebuild with *bsd support.
Comment 2 Javier Villavicencio (RETIRED) gentoo-dev 2006-05-29 14:10:32 UTC
Crappy summary.
Comment 3 Javier Villavicencio (RETIRED) gentoo-dev 2006-05-29 14:14:12 UTC
Created attachment 87825 [details, diff]
squid-pf-patch.diff

The same just in patch form, for better looks.
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-05-29 14:51:24 UTC
net-proxy, can you take a look?
Comment 5 Alin Năstac (RETIRED) gentoo-dev 2006-05-29 21:28:06 UTC
Is it really necessary to add freebsd-pf dependency? On linux, iptables support could be safely enabled, with or without iptables user-space tools (this option only enables transparent proxy functionality). 

I think it would be much simpler (from both dev and user pov) if we would simply force --enable-pf-transparent when installed on freebsd. Of course, if "ipf" is a valid option on freebsd, we have to make the selection available to user through a use flag, but otherwise I don't see why complicate things.

The basic_modules part of the patch is fine by me, excepting the useless "if use elibc_uclibc...". basic_modules is initializated with the same value in both cases.
Comment 6 Javier Villavicencio (RETIRED) gentoo-dev 2006-05-30 16:34:50 UTC
Indeed it is not a compile time dependency, neither a runtime one, just the user has to setup his /etc/pf.conf and configure a "minimal stateful firewall" for squid to work with this. So yes, freebsd-pf dependancy can be safely removed.

About forced pf in freebsd, it may be the only OS that has the "choice" between the two firewall implementations (pf and ipfilter), but maybe netbsd has that choice too. The only OS where i'm sure it's the only alternative and can be enabled without problems is openbsd where pf is the only choice, afaik. If i'm right then ipfilter would be use.mask'ed in openbsd and you have still the two choices for {free,net}bsd.

What about this for basic_modules?
[...]
	local basic_modules="getpwnam,NCSA,SMB,MSNT,multi-domain-NTLM,winbind"

	use ldap && basic_modules="LDAP,${basic_modules}"
	use pam && basic_modules="PAM,${basic_modules}"
	use sasl && basic_modules="SASL,${basic_modules}"
	# Support for uclibc #61175
	if use kernel_linux && ! use elibc_uclibc; then
		basic_modules="YP,${basic_modules}"
	elif use kernel_freebsd && built_with_use sys-freebsd/freebsd-lib nis; then
		basic_modules="YP,${basic_modules}"
	elif use kernel_openbsd && built_with_use sys-openbsd/openbsd-lib nis; then
		basic_modules="YP,${basic_modules}"
	fi
[...]
Comment 7 Alin Năstac (RETIRED) gentoo-dev 2006-05-31 14:46:58 UTC
The basic_module implementation described in comment #6 looks fine to me.

BSD team, feel free to modify squid ebuild as discussed here.
Comment 8 Alin Năstac (RETIRED) gentoo-dev 2006-06-18 10:16:54 UTC
I'm about to simplify the whole basic_modules selection to:
        local basic_modules="getpwnam,NCSA,SMB,MSNT,multi-domain-NTLM,winbind"
        use ldap && basic_modules="LDAP,${basic_modules}"
        use pam && basic_modules="PAM,${basic_modules}"
        use sasl && basic_modules="SASL,${basic_modules}"
        use nis && ! use elibc_uclibc && basic_modules="YP,${basic_modules}"

Is there a pf-ipfilter relationship as it is between ipchains and iptables on Linux? In other words, is one of them obsoleted by the other?
Comment 9 Javier Villavicencio (RETIRED) gentoo-dev 2006-06-19 02:31:02 UTC
(In reply to comment #8)
> Is there a pf-ipfilter relationship as it is between ipchains and iptables on
> Linux? In other words, is one of them obsoleted by the other?
> 

Negative, pf and ipfilter are mere "alternatives" (in fbsd at least), they don't obsolete each other, but you wouldn't want to use both at the same time.
Comment 10 Alin Năstac (RETIRED) gentoo-dev 2006-06-19 11:55:52 UTC
fixed in squid-2.5.14.
The new local USE flags are pf-transparent and ipf-transparent.