summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/globals.h3
-rw-r--r--source3/smbd/password.c22
-rw-r--r--source3/smbd/process.c3
3 files changed, 8 insertions, 20 deletions
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index cd4516501b..36661482ce 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -515,9 +515,6 @@ struct smbd_server_connection {
user_struct *validated_users;
uint16_t next_vuid;
int num_validated_vuids;
-#ifdef HAVE_NETGROUP
- char *my_yp_domain;
-#endif
} sessions;
struct {
connection_struct *Connections;
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index 809a913d6c..7101f7c8c4 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -412,24 +412,22 @@ bool user_in_netgroup(struct smbd_server_connection *sconn,
const char *user, const char *ngname)
{
#ifdef HAVE_NETGROUP
+ static char *my_yp_domain = NULL;
fstring lowercase_user;
- if (sconn->smb1.sessions.my_yp_domain == NULL) {
- yp_get_default_domain(&sconn->smb1.sessions.my_yp_domain);
+ if (my_yp_domain == NULL) {
+ yp_get_default_domain(&my_yp_domain);
}
- if (sconn->smb1.sessions.my_yp_domain == NULL) {
+ if (my_yp_domain == NULL) {
DEBUG(5,("Unable to get default yp domain, "
"let's try without specifying it\n"));
}
DEBUG(5,("looking for user %s of domain %s in netgroup %s\n",
- user,
- sconn->smb1.sessions.my_yp_domain?
- sconn->smb1.sessions.my_yp_domain:"(ANY)",
- ngname));
+ user, my_yp_domain?my_yp_domain:"(ANY)", ngname));
- if (innetgr(ngname, NULL, user, sconn->smb1.sessions.my_yp_domain)) {
+ if (innetgr(ngname, NULL, user, my_yp_domain)) {
DEBUG(5,("user_in_netgroup: Found\n"));
return true;
}
@@ -447,13 +445,9 @@ bool user_in_netgroup(struct smbd_server_connection *sconn,
}
DEBUG(5,("looking for user %s of domain %s in netgroup %s\n",
- lowercase_user,
- sconn->smb1.sessions.my_yp_domain?
- sconn->smb1.sessions.my_yp_domain:"(ANY)",
- ngname));
+ lowercase_user, my_yp_domain?my_yp_domain:"(ANY)", ngname));
- if (innetgr(ngname, NULL, lowercase_user,
- sconn->smb1.sessions.my_yp_domain)) {
+ if (innetgr(ngname, NULL, lowercase_user, my_yp_domain)) {
DEBUG(5,("user_in_netgroup: Found\n"));
return true;
}
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index c8497577a4..3396f89bc1 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -3061,9 +3061,6 @@ void smbd_process(void)
smbd_server_conn->smb1.sessions.validated_users = NULL;
smbd_server_conn->smb1.sessions.next_vuid = VUID_OFFSET;
smbd_server_conn->smb1.sessions.num_validated_vuids = 0;
-#ifdef HAVE_NETGROUP
- smbd_server_conn->smb1.sessions.my_yp_domain = NULL;
-#endif
conn_init(smbd_server_conn);
if (!init_dptrs(smbd_server_conn)) {