s3:rpc_server: Switch to new debug macros for dcesrv_create_ncalrpc_socket
authorSamuel Cabrero <scabrero@suse.de>
Tue, 4 Jun 2019 12:21:11 +0000 (14:21 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 22 Jul 2019 16:49:12 +0000 (16:49 +0000)
Additionally new debug messages are added and the existing ones improved.

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/rpc_server/rpc_server.c

index 60f04550d3c84c37f902c2c51083acccb609a7f2..81ebbf23a1e9a06cd2eaa1a6f5cca0ac0a4979f7 100644 (file)
@@ -776,20 +776,21 @@ NTSTATUS dcesrv_create_ncalrpc_socket(const char *name, int *out_fd)
 
        if (!directory_create_or_exist(lp_ncalrpc_dir(), 0755)) {
                status = map_nt_error_from_unix_common(errno);
-               DEBUG(0, ("Failed to create ncalrpc directory %s - %s\n",
-                         lp_ncalrpc_dir(), strerror(errno)));
+               DBG_ERR("Failed to create ncalrpc directory '%s': %s\n",
+                       lp_ncalrpc_dir(), strerror(errno));
                goto out;
        }
 
        fd = create_pipe_sock(lp_ncalrpc_dir(), name, 0755);
        if (fd == -1) {
                status = map_nt_error_from_unix_common(errno);
-               DEBUG(0, ("Failed to create ncalrpc socket! [%s/%s]\n",
-                         lp_ncalrpc_dir(), name));
+               DBG_ERR("Failed to create ncalrpc socket '%s/%s': %s\n",
+                       lp_ncalrpc_dir(), name, strerror(errno));
                goto out;
        }
 
-       DEBUG(10, ("Opened ncalrpc socket fd %d for %s\n", fd, name));
+       DBG_DEBUG("Opened ncalrpc socket fd '%d' for '%s/%s'\n",
+                 fd, lp_ncalrpc_dir(), name);
 
        *out_fd = fd;
 
@@ -831,6 +832,8 @@ bool setup_dcerpc_ncalrpc_socket(struct tevent_context *ev_ctx,
 
        status = dcesrv_create_ncalrpc_socket(name, &state->fd);
        if (!NT_STATUS_IS_OK(status)) {
+               DBG_ERR("Failed to create ncalrpc socket: %s\n",
+                       nt_errstr(status));
                goto out;
        }