s4-rpc_server: Get the real initial uid for selftest
authorAndreas Schneider <asn@samba.org>
Wed, 4 Nov 2015 09:15:13 +0000 (10:15 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 5 Nov 2015 08:23:15 +0000 (09:23 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/rpc_server/dcerpc_server.c

index 7c1e2d3fb08f525c4aef2590868319f833bb4683..ad1e82d4f9b430e2c474c3cab7087387d4516a30 100644 (file)
@@ -1230,7 +1230,15 @@ _PUBLIC_ NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx,
 
        dce_ctx = talloc(mem_ctx, struct dcesrv_context);
        NT_STATUS_HAVE_NO_MEMORY(dce_ctx);
+
+       if (uid_wrapper_enabled()) {
+               setenv("UID_WRAPPER_MYUID", "1", 1);
+       }
        dce_ctx->initial_euid = geteuid();
+       if (uid_wrapper_enabled()) {
+               unsetenv("UID_WRAPPER_MYUID");
+       }
+
        dce_ctx->endpoint_list  = NULL;
        dce_ctx->lp_ctx = lp_ctx;
        dce_ctx->assoc_groups_idr = idr_init(dce_ctx);