aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorShaun Amott <shaun@FreeBSD.org>2006-10-09 17:50:13 +0000
committerShaun Amott <shaun@FreeBSD.org>2006-10-09 17:50:13 +0000
commit88774c26988c7f0a81e3e0f516f0a8139ad76fca (patch)
treedfe9b36f891f76eea9b276330a3953e7255ddee9 /net
parent87a631323c274184670e702bcd793fef1b86c85a (diff)
downloadports-88774c26988c7f0a81e3e0f516f0a8139ad76fca.tar.gz
ports-88774c26988c7f0a81e3e0f516f0a8139ad76fca.zip
Notes
Diffstat (limited to 'net')
-rw-r--r--net/samba3/Makefile2
-rw-r--r--net/samba3/files/patch-za129
-rw-r--r--net/samba3/files/patch-zb26
-rw-r--r--net/samba3/files/samba.in13
4 files changed, 164 insertions, 6 deletions
diff --git a/net/samba3/Makefile b/net/samba3/Makefile
index 113a7d4c8692..4e8a0e42bc50 100644
--- a/net/samba3/Makefile
+++ b/net/samba3/Makefile
@@ -7,7 +7,7 @@
PORTNAME= samba
PORTVERSION?= 3.0.23c
-PORTREVISION?= 0
+PORTREVISION?= 1
PORTEPOCH?= 1
CATEGORIES?= net
MASTER_SITES= ${MASTER_SITE_SAMBA}
diff --git a/net/samba3/files/patch-za b/net/samba3/files/patch-za
new file mode 100644
index 000000000000..cadc4bb4c754
--- /dev/null
+++ b/net/samba3/files/patch-za
@@ -0,0 +1,129 @@
+--- nsswitch/wb_common.c.orig Thu Apr 20 04:29:21 2006
++++ nsswitch/wb_common.c Mon Sep 25 12:49:04 2006
+@@ -525,15 +525,11 @@
+ NSS_STATUS winbindd_send_request(int req_type, struct winbindd_request *request)
+ {
+ struct winbindd_request lrequest;
+- char *env;
+- int value;
+-
++
+ /* Check for our tricky environment variable */
+
+- if ( (env = getenv(WINBINDD_DONT_ENV)) != NULL ) {
+- value = atoi(env);
+- if ( value == 1 )
+- return NSS_STATUS_NOTFOUND;
++ if (winbind_env_set()) {
++ return NSS_STATUS_NOTFOUND;
+ }
+
+ if (!request) {
+@@ -632,3 +628,14 @@
+ return putenv(s) != -1;
+ }
+
++BOOL winbind_env_set( void )
++{
++ char *env;
++
++ if ((env=getenv(WINBINDD_DONT_ENV)) != NULL) {
++ if(strequal(env, "1")) {
++ return True;
++ }
++ }
++ return False;
++}
+--- passdb/pdb_interface.c.orig Wed Aug 23 18:16:38 2006
++++ passdb/pdb_interface.c Mon Sep 25 13:10:15 2006
+@@ -1321,27 +1321,25 @@
+ struct group *grp;
+ char **gr;
+ struct passwd *pwd;
+- char *winbindd_env;
++ BOOL winbind_env;
+
+ *pp_uids = NULL;
+ *p_num = 0;
+
+ /* We only look at our own sam, so don't care about imported stuff */
+-
+- winbindd_env = getenv(WINBINDD_DONT_ENV);
++ winbind_env = winbind_env_set();
+ winbind_off();
+
+ if ((grp = getgrgid(gid)) == NULL) {
+ /* allow winbindd lookups, but only if they weren't already disabled */
+- if ( !(winbindd_env && strequal(winbindd_env, "1")) ) {
++ if (!winbind_env) {
+ winbind_on();
+ }
+-
++
+ return False;
+ }
+
+ /* Primary group members */
+-
+ setpwent();
+ while ((pwd = getpwent()) != NULL) {
+ if (pwd->pw_gid == gid) {
+@@ -1352,7 +1350,6 @@
+ endpwent();
+
+ /* Secondary group members */
+-
+ for (gr = grp->gr_mem; (*gr != NULL) && ((*gr)[0] != '\0'); gr += 1) {
+ struct passwd *pw = getpwnam(*gr);
+
+@@ -1362,11 +1359,10 @@
+ }
+
+ /* allow winbindd lookups, but only if they weren't already disabled */
+-
+- if ( !(winbindd_env && strequal(winbindd_env, "1")) ) {
++ if (!winbind_env) {
+ winbind_on();
+ }
+-
++
+ return True;
+ }
+
+--- lib/system_smbd.c.orig Thu Apr 20 04:29:23 2006
++++ lib/system_smbd.c Mon Sep 25 12:53:54 2006
+@@ -120,19 +120,15 @@
+ static int sys_getgrouplist(const char *user, gid_t gid, gid_t *groups, int *grpcnt)
+ {
+ int retval;
+- char *winbindd_env;
++ BOOL winbind_env;
+
+ DEBUG(10,("sys_getgrouplist: user [%s]\n", user));
+
+- /* Save the winbindd state and not just blindly turn it back on */
+-
+- winbindd_env = getenv(WINBINDD_DONT_ENV);
+-
+ /* This is only ever called for Unix users, remote memberships are
+ * always determined by the info3 coming back from auth3 or the
+ * PAC. */
+-
+- winbind_off() ;
++ winbind_env = winbind_env_set();
++ winbind_off();
+
+ #ifdef HAVE_GETGROUPLIST
+ retval = getgrouplist(user, gid, groups, grpcnt);
+@@ -142,9 +138,8 @@
+ unbecome_root();
+ #endif
+
+- /* allow winbindd lookups , but only if they were not already disabled */
+-
+- if ( !(winbindd_env && strequal(winbindd_env, "1")) ) {
++ /* allow winbindd lookups, but only if they were not already disabled */
++ if (!winbind_env) {
+ winbind_on();
+ }
+
diff --git a/net/samba3/files/patch-zb b/net/samba3/files/patch-zb
new file mode 100644
index 000000000000..ce30f8757936
--- /dev/null
+++ b/net/samba3/files/patch-zb
@@ -0,0 +1,26 @@
+--- param/loadparm.c.orig Fri Aug 25 13:40:09 2006
++++ param/loadparm.c Fri Aug 25 13:46:28 2006
+@@ -3852,7 +3852,7 @@
+
+ BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal)
+ {
+- service * pService = ServicePtrs[snum];
++ service * pService = NULL;
+ int i;
+ BOOL result = False;
+ parm_class p_class;
+@@ -3883,8 +3883,13 @@
+ if (isGlobal) {
+ p_class = P_GLOBAL;
+ flag = FLAG_GLOBAL;
+- } else
++ } else {
++ if (!VALID_SNUM(snum)) {
++ return False;
++ }
++ pService = ServicePtrs[snum];
+ p_class = P_LOCAL;
++ }
+
+ for (i = 0; parm_table[i].label; i++) {
+ if (strwicmp(parm_table[i].label, parm_name) == 0 &&
diff --git a/net/samba3/files/samba.in b/net/samba3/files/samba.in
index 767accc7d4bb..4c89021dfa64 100644
--- a/net/samba3/files/samba.in
+++ b/net/samba3/files/samba.in
@@ -51,8 +51,8 @@ smbcontrol_command="%%PREFIX%%/bin/smbcontrol"
samba_parm="${testparm_command} -s -v --parameter-name"
%%WINBIND%%samba_idmap=$(${samba_parm} 'idmap uid' ${samba_config} 2>/dev/null)
samba_lockdir=$(${samba_parm} 'lock directory' ${samba_config} 2>/dev/null)
-# Setup slave variables
-if [ -n "${samba_enable}" ] && checkyesno samba_enable; then
+# Setup dependent variables
+if [ -n "${rcvar}" ] && checkyesno ${rcvar}; then
nmbd_enable=${nmbd_enable="YES"}
smbd_enable=${smbd_enable="YES"}
%%WINBIND%% # Check that winbindd is actually configured
@@ -60,7 +60,9 @@ if [ -n "${samba_enable}" ] && checkyesno samba_enable; then
%%WINBIND%% winbindd_enable=${winbindd_enable="YES"}
%%WINBIND%% fi
fi
-# Defaults for slave variables
+# Hack to enable check of dependent variables
+eval real_${rcvar}=\${${rcvar}:="NO"} ${rcvar}="YES"
+# Defaults for dependent variables
nmbd_enable=${nmbd_enable:="NO"}
nmbd_flags=${nmbd_flags="-D"}
smbd_enable=${smbd_enable:="NO"}
@@ -102,13 +104,14 @@ samba_rcvar_cmd() {
# Check master variable
echo "# ${name}"
if [ -n "${rcvar}" ]; then
- if checkyesno ${rcvar}; then
+ # Use original configured value
+ if checkyesno "real_${rcvar}"; then
echo "\$${rcvar}=YES"
else
echo "\$${rcvar}=NO"
fi
fi
- # Check slave variables
+ # Check dependent variables
samba_cmd "${_rc_prefix}${rc_arg}" ${rc_extra_args}
}