Bug 86850 - [patch] port www/squid builds smb_auth with the wrong path to samba
Summary: [patch] port www/squid builds smb_auth with the wrong path to samba
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Marcus Alves Grando
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-03 03:20 UTC by Dean M. Phillips
Modified: 2005-10-06 19:48 UTC (History)
0 users

See Also:


Attachments
file.diff (403 bytes, patch)
2005-10-03 03:20 UTC, Dean M. Phillips
no flags Details | Diff
file.diff (610 bytes, patch)
2005-10-03 03:20 UTC, Dean M. Phillips
no flags Details | Diff
file.diff (572 bytes, patch)
2005-10-03 03:20 UTC, Dean M. Phillips
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dean M. Phillips 2005-10-03 03:20:14 UTC
The www/squid autoconfig program does not test for the actual configuration of the net/samba smbclient program.  Instead it hardcodes it to /usr/local/samba, while net/samba installs in /usr/local by default.  Since smb_auth can not execute smbclient, it returns a failure every time denying all users access to the cache.

Fix: This 'fix' is really a bandaid, but it worked for me :)

Replace patch-helpers-basic_auth-SMB-smb_auth.sh with:

Add patch-helpers-basic_auth-SMB-Makefile.am:
Add patch-helpers-basic_auth-SMB-Makefile.in:
How-To-Repeat: Set up proxy auth using smb_auth as instructed in the port documentation.
Comment 1 Marcus Alves Grando freebsd_committer freebsd_triage 2005-10-03 04:19:11 UTC
Dear maintainer,

Do you approve this update?

http://www.freebsd.org/cgi/query-pr.cgi?pr=86850

Thanks

-- 
Marcus Alves Grando
marcus(at)corp.grupos.com.br  |  Grupos Internet S/A
  mnag(at)FreeBSD.org         |  FreeBSD.org
Comment 2 Marcus Alves Grando freebsd_committer freebsd_triage 2005-10-03 04:19:18 UTC
State Changed
From-To: open->feedback

Ask for maintainer approval.
Comment 3 Thomas-Martin Seck 2005-10-03 14:59:47 UTC
(Somehow the feedback request mail did not reach me yet; I've noticed
the PR while checking portsmon.)

Hi,

thanks for pointing this out; I do not use smb_auth myself and
appreciate your report.

However, I prefer the patch below (we do not need to mess around
with the .in an .am files when we can fix the script directly).

I also removed the hardcoded /usr/local assumption for ${LOCALBASE}
while at it.

Dean, could you try the patch below and see whether it works for you?

If it does, this patch should be committed.

Index: files/patch-helpers-basic_auth-SMB-smb_auth.sh
===================================================================
--- files/patch-helpers-basic_auth-SMB-smb_auth.sh	(revision 587)
+++ files/patch-helpers-basic_auth-SMB-smb_auth.sh	(revision 588)
@@ -6,7 +6,7 @@
   # along with this program; if not, write to the Free Software
   # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   
-+ SAMBAPREFIX=${SAMBAPREFIX:-/usr/local/bin}
++ SAMBAPREFIX=${SAMBAPREFIX:-%%LOCALBASE%%}
 + 
   read DOMAINNAME
   read PASSTHROUGH
Index: Makefile
===================================================================
--- Makefile	(revision 587)
+++ Makefile	(revision 588)
@@ -70,7 +70,7 @@
 
 PORTNAME=	squid
 PORTVERSION=	2.5.11
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	www
 MASTER_SITES=	\
 		ftp://ftp.squid-cache.org/pub/%SUBDIR%/ \
@@ -348,6 +348,8 @@
 	@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
 	@${REINPLACE_CMD} -e 's|%%SQUID_UID%%|${SQUID_UID}|g' \
 	    -e 's|%%SQUID_GID%%|${SQUID_GID}|g' ${WRKSRC}/src/cf.data.pre
+	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
+	    ${WRKSRC}/helpers/basic_auth/SMB/smb_auth.sh
 
 pre-install:
 # Prevent installation of .orig files by deleting them.
Comment 4 Marcus Alves Grando freebsd_committer freebsd_triage 2005-10-03 16:36:06 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mnag

I'll take it.
Comment 5 Marcus Alves Grando freebsd_committer freebsd_triage 2005-10-03 16:36:25 UTC
State Changed
From-To: feedback->open

Feedback received.
Comment 6 Thomas-Martin Seck 2005-10-06 18:21:02 UTC
As Glen pointed out to me offline, the previous patch is not enough
because SAMBAPREFIX is hardcoded at compile time into ${PREFIX}/libexec/
smb_auth which calls smb_auth.sh with SAMBAPREFIX defined.

Setting a sane default for SAMBAPREFIX is in my opinion a good thing
nonetheless so I decided to keep
files/patch-helpers-basic_auth-SMB-smb_auth.sh and correct an obvious
bug no one seems to have noticed :)

Added file:
files/patch-helpers-basic_auth-SMB-Makefile.in

This patchset was tested by Glen and confirmed to work ok:

Index: files/patch-helpers-basic_auth-SMB-smb_auth.sh
===================================================================
--- files/patch-helpers-basic_auth-SMB-smb_auth.sh	(.../www/squid)	(revision 589)
+++ files/patch-helpers-basic_auth-SMB-smb_auth.sh	(.../local/squid)	(revision 589)
@@ -6,7 +6,7 @@
   # along with this program; if not, write to the Free Software
   # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   
-+ SAMBAPREFIX=${SAMBAPREFIX:-/usr/local/bin}
++ SAMBAPREFIX=${SAMBAPREFIX:-%%LOCALBASE%%}
 + 
   read DOMAINNAME
   read PASSTHROUGH
Index: files/patch-helpers-basic_auth-SMB-Makefile.in
===================================================================
--- files/patch-helpers-basic_auth-SMB-Makefile.in	(.../www/squid)	(revision 0)
+++ files/patch-helpers-basic_auth-SMB-Makefile.in	(.../local/squid)	(revision 589)
@@ -0,0 +1,11 @@
+--- helpers/basic_auth/SMB/Makefile.in.orig	Tue Oct  4 07:29:26 2005
++++ helpers/basic_auth/SMB/Makefile.in	Tue Oct  4 07:29:49 2005
+@@ -129,7 +129,7 @@
+ makesnmplib = @makesnmplib@
+ 
+ SMB_AUTH_HELPER = smb_auth.sh
+-SAMBAPREFIX = /usr/local/samba
++SAMBAPREFIX = %%LOCALBASE%%
+ SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER)
+ 
+ libexec_SCRIPTS = $(SMB_AUTH_HELPER)
Index: Makefile
===================================================================
--- Makefile	(.../www/squid)	(revision 589)
+++ Makefile	(.../local/squid)	(revision 589)
@@ -70,7 +70,7 @@
 
 PORTNAME=	squid
 PORTVERSION=	2.5.11
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	www
 MASTER_SITES=	\
 		ftp://ftp.squid-cache.org/pub/%SUBDIR%/ \
@@ -348,6 +348,9 @@
 	@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
 	@${REINPLACE_CMD} -e 's|%%SQUID_UID%%|${SQUID_UID}|g' \
 	    -e 's|%%SQUID_GID%%|${SQUID_GID}|g' ${WRKSRC}/src/cf.data.pre
+	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
+	    ${WRKSRC}/helpers/basic_auth/SMB/Makefile.in \
+	    ${WRKSRC}/helpers/basic_auth/SMB/smb_auth.sh
 
 pre-install:
 # Prevent installation of .orig files by deleting them.
Comment 7 Thomas-Martin Seck 2005-10-06 18:27:38 UTC
> As Glen pointed out to me offline, the previous patch is not enough
> because SAMBAPREFIX is hardcoded at compile time into ${PREFIX}/libexec/
> smb_auth which calls smb_auth.sh with SAMBAPREFIX defined.

Doh, the submitter's first name is *Dean*. No cookie for me.

Sorry Dean and thanks for helping me fixing this!
Comment 8 Marcus Alves Grando freebsd_committer freebsd_triage 2005-10-06 19:48:42 UTC
State Changed
From-To: open->closed

Fixed. Thanks.