View | Details | Raw Unified | Return to bug 104200
Collapse All | Expand All

(-)Makefile (-1 / +1 lines)
Lines 7-13 Link Here
7
7
8
PORTNAME=		samba
8
PORTNAME=		samba
9
PORTVERSION?=		3.0.23c
9
PORTVERSION?=		3.0.23c
10
PORTREVISION?=		0
10
PORTREVISION?=		1
11
PORTEPOCH?=		1
11
PORTEPOCH?=		1
12
CATEGORIES?=		net
12
CATEGORIES?=		net
13
MASTER_SITES=		${MASTER_SITE_SAMBA}
13
MASTER_SITES=		${MASTER_SITE_SAMBA}
(-)files/patch-za (+129 lines)
Added Link Here
1
--- nsswitch/wb_common.c.orig	Thu Apr 20 04:29:21 2006
2
+++ nsswitch/wb_common.c	Mon Sep 25 12:49:04 2006
3
@@ -525,15 +525,11 @@
4
 NSS_STATUS winbindd_send_request(int req_type, struct winbindd_request *request)
5
 {
6
 	struct winbindd_request lrequest;
7
-	char *env;
8
-	int  value;
9
-	
10
+
11
 	/* Check for our tricky environment variable */
12
 
13
-	if ( (env = getenv(WINBINDD_DONT_ENV)) != NULL ) {
14
-		value = atoi(env);
15
-		if ( value == 1 )
16
-			return NSS_STATUS_NOTFOUND;
17
+	if (winbind_env_set()) {
18
+		return NSS_STATUS_NOTFOUND;
19
 	}
20
 
21
 	if (!request) {
22
@@ -632,3 +628,14 @@
23
 	return putenv(s) != -1;
24
 }
25
 
26
+BOOL winbind_env_set( void )
27
+{
28
+	char *env;
29
+	
30
+	if ((env=getenv(WINBINDD_DONT_ENV)) != NULL) {
31
+		if(strequal(env, "1")) {
32
+			return True;
33
+		}
34
+	}
35
+	return False;
36
+}
37
--- passdb/pdb_interface.c.orig	Wed Aug 23 18:16:38 2006
38
+++ passdb/pdb_interface.c	Mon Sep 25 13:10:15 2006
39
@@ -1321,27 +1321,25 @@
40
 	struct group *grp;
41
 	char **gr;
42
 	struct passwd *pwd;
43
-	char *winbindd_env;
44
+	BOOL winbind_env;
45
  
46
 	*pp_uids = NULL;
47
 	*p_num = 0;
48
 
49
 	/* We only look at our own sam, so don't care about imported stuff */
50
-
51
-	winbindd_env = getenv(WINBINDD_DONT_ENV);
52
+	winbind_env = winbind_env_set();
53
 	winbind_off();
54
 
55
 	if ((grp = getgrgid(gid)) == NULL) {
56
 		/* allow winbindd lookups, but only if they weren't already disabled */
57
-		if ( !(winbindd_env && strequal(winbindd_env, "1")) ) {
58
+		if (!winbind_env) {
59
 			winbind_on();
60
 		}
61
-
62
+		
63
 		return False;
64
 	}
65
 
66
 	/* Primary group members */
67
-
68
 	setpwent();
69
 	while ((pwd = getpwent()) != NULL) {
70
 		if (pwd->pw_gid == gid) {
71
@@ -1352,7 +1350,6 @@
72
 	endpwent();
73
 
74
 	/* Secondary group members */
75
-
76
 	for (gr = grp->gr_mem; (*gr != NULL) && ((*gr)[0] != '\0'); gr += 1) {
77
 		struct passwd *pw = getpwnam(*gr);
78
 
79
@@ -1362,11 +1359,10 @@
80
 	}
81
 
82
 	/* allow winbindd lookups, but only if they weren't already disabled */
83
-
84
-	if ( !(winbindd_env && strequal(winbindd_env, "1")) ) {
85
+	if (!winbind_env) {
86
 		winbind_on();
87
 	}
88
-
89
+	
90
 	return True;
91
 }
92
 
93
--- lib/system_smbd.c.orig	Thu Apr 20 04:29:23 2006
94
+++ lib/system_smbd.c	Mon Sep 25 12:53:54 2006
95
@@ -120,19 +120,15 @@
96
 static int sys_getgrouplist(const char *user, gid_t gid, gid_t *groups, int *grpcnt)
97
 {
98
 	int retval;
99
-	char *winbindd_env;
100
+	BOOL winbind_env;
101
 
102
 	DEBUG(10,("sys_getgrouplist: user [%s]\n", user));
103
 
104
-	/* Save the winbindd state and not just blindly turn it back on */
105
-
106
-	winbindd_env = getenv(WINBINDD_DONT_ENV);
107
-	
108
 	/* This is only ever called for Unix users, remote memberships are
109
 	 * always determined by the info3 coming back from auth3 or the
110
 	 * PAC. */
111
-
112
-	winbind_off() ;
113
+	winbind_env = winbind_env_set();
114
+	winbind_off();
115
 
116
 #ifdef HAVE_GETGROUPLIST
117
 	retval = getgrouplist(user, gid, groups, grpcnt);
118
@@ -142,9 +138,8 @@
119
 	unbecome_root();
120
 #endif
121
 
122
-	/* allow winbindd lookups , but only if they were not already disabled */
123
-
124
-	if ( !(winbindd_env && strequal(winbindd_env, "1")) ) {
125
+	/* allow winbindd lookups, but only if they were not already disabled */
126
+	if (!winbind_env) {
127
 		winbind_on();
128
 	}
129
 
(-)files/patch-zb (+26 lines)
Added Link Here
1
--- param/loadparm.c.orig	Fri Aug 25 13:40:09 2006
2
+++ param/loadparm.c	Fri Aug 25 13:46:28 2006
3
@@ -3852,7 +3852,7 @@
4
 
5
 BOOL dump_a_parameter(int snum, char *parm_name, FILE * f, BOOL isGlobal)
6
 {
7
-	service * pService = ServicePtrs[snum];
8
+	service * pService = NULL;
9
 	int i;
10
 	BOOL result = False;
11
 	parm_class p_class;
12
@@ -3883,8 +3883,13 @@
13
 	if (isGlobal) {
14
 		p_class = P_GLOBAL;
15
 		flag = FLAG_GLOBAL;
16
-	} else
17
+	} else {
18
+		if (!VALID_SNUM(snum)) {
19
+			return False;
20
+		}
21
+		pService = ServicePtrs[snum];
22
 		p_class = P_LOCAL;
23
+	}
24
 
25
 	for (i = 0; parm_table[i].label; i++) {
26
 		if (strwicmp(parm_table[i].label, parm_name) == 0 &&
(-)files/samba.in (-5 / +8 lines)
Lines 51-58 Link Here
51
samba_parm="${testparm_command} -s -v --parameter-name"
51
samba_parm="${testparm_command} -s -v --parameter-name"
52
%%WINBIND%%samba_idmap=$(${samba_parm} 'idmap uid' ${samba_config} 2>/dev/null)
52
%%WINBIND%%samba_idmap=$(${samba_parm} 'idmap uid' ${samba_config} 2>/dev/null)
53
samba_lockdir=$(${samba_parm} 'lock directory' ${samba_config} 2>/dev/null)
53
samba_lockdir=$(${samba_parm} 'lock directory' ${samba_config} 2>/dev/null)
54
# Setup slave variables
54
# Setup dependent variables
55
if [ -n "${samba_enable}" ] && checkyesno samba_enable; then
55
if [ -n "${rcvar}" ] && checkyesno ${rcvar}; then
56
    nmbd_enable=${nmbd_enable="YES"}
56
    nmbd_enable=${nmbd_enable="YES"}
57
    smbd_enable=${smbd_enable="YES"}
57
    smbd_enable=${smbd_enable="YES"}
58
%%WINBIND%%    # Check that winbindd is actually configured
58
%%WINBIND%%    # Check that winbindd is actually configured
Lines 60-66 Link Here
60
%%WINBIND%%	winbindd_enable=${winbindd_enable="YES"}
60
%%WINBIND%%	winbindd_enable=${winbindd_enable="YES"}
61
%%WINBIND%%    fi
61
%%WINBIND%%    fi
62
fi
62
fi
63
# Defaults for slave variables
63
# Hack to enable check of dependent variables
64
eval real_${rcvar}=\${${rcvar}:="NO"}	${rcvar}="YES"
65
# Defaults for dependent variables
64
nmbd_enable=${nmbd_enable:="NO"}
66
nmbd_enable=${nmbd_enable:="NO"}
65
nmbd_flags=${nmbd_flags="-D"}
67
nmbd_flags=${nmbd_flags="-D"}
66
smbd_enable=${smbd_enable:="NO"}
68
smbd_enable=${smbd_enable:="NO"}
Lines 102-114 Link Here
102
    # Check master variable
104
    # Check master variable
103
    echo "# ${name}"
105
    echo "# ${name}"
104
    if [ -n "${rcvar}" ]; then
106
    if [ -n "${rcvar}" ]; then
105
	if checkyesno ${rcvar}; then
107
	# Use original configured value
108
	if checkyesno "real_${rcvar}"; then
106
	    echo "\$${rcvar}=YES"
109
	    echo "\$${rcvar}=YES"
107
	else
110
	else
108
	    echo "\$${rcvar}=NO"
111
	    echo "\$${rcvar}=NO"
109
	fi
112
	fi
110
    fi
113
    fi
111
    # Check slave variables
114
    # Check dependent variables
112
    samba_cmd "${_rc_prefix}${rc_arg}" ${rc_extra_args}
115
    samba_cmd "${_rc_prefix}${rc_arg}" ${rc_extra_args}
113
}
116
}

Return to bug 104200