After consultation with tpot, remove the 'winbind_domain' environment
authorAndrew Bartlett <abartlet@samba.org>
Tue, 26 Nov 2002 12:04:16 +0000 (12:04 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 26 Nov 2002 12:04:16 +0000 (12:04 +0000)
variable hack, the feild on the pipe, and the server-side.

It only controlled some enum operations in any case.

This is to try and have less 'magic' environment variables.

Andrew Bartlett
(This used to be commit e4be82e4e2c7cdf15f3e20f73fe9f281f6384423)

source3/nsswitch/wb_common.c
source3/nsswitch/winbindd.c
source3/nsswitch/winbindd_group.c
source3/nsswitch/winbindd_nss.h
source3/nsswitch/winbindd_user.c

index 51792f63fe2ef768b543032529bd75f81d1d4a74..e0cae0abe3efc7a1d3e4af17f4c9e5085a07891b 100644 (file)
@@ -45,25 +45,11 @@ void free_response(struct winbindd_response *response)
 
 void init_request(struct winbindd_request *request, int request_type)
 {
-        static char *domain_env;
-        static BOOL initialised;
-
        request->length = sizeof(struct winbindd_request);
 
        request->cmd = (enum winbindd_cmd)request_type;
        request->pid = getpid();
-       request->domain[0] = '\0';
-
-       if (!initialised) {
-               initialised = True;
-               domain_env = getenv(WINBINDD_DOMAIN_ENV);
-       }
 
-       if (domain_env) {
-               strncpy(request->domain, domain_env,
-                       sizeof(request->domain) - 1);
-               request->domain[sizeof(request->domain) - 1] = '\0';
-       }
 }
 
 /* Initialise a response structure */
index 773e3a84f3c90a5a50783998c3105975120ee698..57c1fc84b578a9a508422097ae670fde1b35b8f2 100644 (file)
@@ -362,7 +362,7 @@ void winbind_process_packet(struct winbindd_cli_state *state)
        /* Process request */
        
        /* Ensure null termination of entire request */
-       state->request.domain[sizeof(state->request.domain)-1]='\0';
+       state->request.null_term = '\0';
 
        state->pid = state->request.pid;
        
index 507d5caf0f7d64289d2cf221cb8bbf4833102c6d..ab6268583f74d86c41db20f42544cd5c15b1ecbd 100644 (file)
@@ -356,13 +356,6 @@ enum winbindd_result winbindd_setgrent(struct winbindd_cli_state *state)
        for (domain = domain_list(); domain != NULL; domain = domain->next) {
                struct getent_state *domain_state;
                
-               /* Skip domains other than WINBINDD_DOMAIN environment 
-                  variable */
-               
-               if ((strcmp(state->request.domain, "") != 0) &&
-                   !check_domain_env(state->request.domain, domain->name))
-                       continue;
-               
                /* Create a state record for this domain */
                
                if ((domain_state = (struct getent_state *)
@@ -748,12 +741,6 @@ enum winbindd_result winbindd_list_groups(struct winbindd_cli_state *state)
 
                ZERO_STRUCT(groups);
 
-               /* Skip domains other than WINBINDD_DOMAIN environment
-                  variable */ 
-               if ((strcmp(state->request.domain, "") != 0) &&
-                   !check_domain_env(state->request.domain, domain->name))
-                       continue;
-
                /* Get list of sam groups */
                ZERO_STRUCT(groups);
                fstrcpy(groups.domain_name, domain->name);
index 368bf10cea5b40770a71fdf973bffb9dfe0e15a2..5c2db2ac2c0ab3234675c0ac8297b1060d32cf8c 100644 (file)
@@ -36,7 +36,7 @@
 
 /* Update this when you change the interface.  */
 
-#define WINBIND_INTERFACE_VERSION 5
+#define WINBIND_INTERFACE_VERSION 6
 
 /* Socket commands */
 
@@ -156,7 +156,7 @@ struct winbindd_request {
                } name;
                uint32 num_entries;  /* getpwent, getgrent */
        } data;
-       fstring domain;      /* {set,get,end}{pw,gr}ent() */
+       char null_term;
 };
 
 /* Response values */
index 4f57fd2c7225ce786bc148de89566cad26141811..bb281463ce219d61949a4997ad86a58c539c151f 100644 (file)
@@ -284,16 +284,6 @@ enum winbindd_result winbindd_setpwent(struct winbindd_cli_state *state)
        for(domain = domain_list(); domain != NULL; domain = domain->next) {
                struct getent_state *domain_state;
                 
-               /*
-                * Skip domains other than WINBINDD_DOMAIN environment
-                * variable.
-                */
-                
-               if ((strcmp(state->request.domain, "") != 0) &&
-                               !check_domain_env(state->request.domain, 
-                                                 domain->name))
-                       continue;
-
                /* Create a state record for this domain */
                 
                if ((domain_state = (struct getent_state *)
@@ -551,13 +541,6 @@ enum winbindd_result winbindd_list_users(struct winbindd_cli_state *state)
                struct winbindd_methods *methods;
                int i;
 
-               /* Skip domains other than WINBINDD_DOMAIN environment
-                  variable */ 
-
-               if ((strcmp(state->request.domain, "") != 0) &&
-                   !check_domain_env(state->request.domain, domain->name))
-                       continue;
-
                methods = domain->methods;
 
                /* Query display info */