r5603: add "authservice()" property to the interface property list
[samba.git] / source4 / librpc / rpc / dcerpc_auth.c
index c0b72b68423b248f67a9a154ec47ba700a23731e..1bcf4224c46a5905499f6bd846014e82befb81c4 100644 (file)
@@ -146,7 +146,8 @@ NTSTATUS dcerpc_bind_auth_password(struct dcerpc_pipe *p,
                                   const char *domain,
                                   const char *username,
                                   const char *password,
-                                  uint8_t auth_type)
+                                  uint8_t auth_type,
+                                  const char *service)
 {
        NTSTATUS status;
 
@@ -189,6 +190,15 @@ NTSTATUS dcerpc_bind_auth_password(struct dcerpc_pipe *p,
                return status;
        }
 
+       if (service) {
+               status = gensec_set_target_service(p->conn->security_state.generic_state, service);
+               if (!NT_STATUS_IS_OK(status)) {
+                       DEBUG(1, ("Failed to start set GENSEC target service: %s\n", 
+                                 nt_errstr(status)));
+                       return status;
+               }
+       }
+
        status = gensec_start_mech_by_authtype(p->conn->security_state.generic_state, 
                                               auth_type,
                                               dcerpc_auth_level(p->conn));