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)
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 */
/* 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;
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 *)
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);
/* Update this when you change the interface. */
-#define WINBIND_INTERFACE_VERSION 5
+#define WINBIND_INTERFACE_VERSION 6
/* Socket commands */
} name;
uint32 num_entries; /* getpwent, getgrent */
} data;
- fstring domain; /* {set,get,end}{pw,gr}ent() */
+ char null_term;
};
/* Response values */
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 *)
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 */