[PATCH] Updated error message text and reduced its debug level

Jeremy Allison jra at samba.org
Thu Oct 12 19:11:37 UTC 2017


On Thu, Oct 12, 2017 at 06:56:30PM +0200, Marc Muehlfeld via samba-technical wrote:
> Am 12.10.2017 um 15:00 schrieb Andreas Schneider via samba-technical:
> > On Wednesday, 11 October 2017 11:52:21 CEST Marc Muehlfeld via samba-technical 
> > wrote:
> >> Hi,
> >>
> >> I tried to figure out why my "net rpc share add" command failed. After
> >> increasing the log level to 10 I only saw a less helpful error in the
> >> log file.
> >>
> >> The attached patch contains a better error message. Additionally, I
> >> reduced the log level for the error from 10 to 1. I think it makes sense
> >> in this case. The error is only logged when you run the command, so this
> >> won't flood the logs.
> >>
> >> Please review the attached patch and push. Thanks.
> > 
> > Please use DBG_WARNING()
> 
> Find attached the updated patch.

LGTM. Pushed - thanks !

> From f510901d9ed7228d2c51bf307c8a296b72c5247a Mon Sep 17 00:00:00 2001
> From: Marc Muehlfeld <mmuehlfeld at samba.org>
> Date: Wed, 11 Oct 2017 09:49:45 +0200
> Subject: [PATCH] Updated error message text and reduced its debug level
> 
> Previously, "net rpc share add|remove" commands failed if no
> "add|delete share command" parameter was set in smb.conf. However,
> the error was only logged at level 10 and not very clear.
> This patch updates the error message text and sets the log level of this
> error to 1 to make it more obvious what is missing.
> 
> Signed-off-by: Marc Muehlfeld <mmuehlfeld at samba.org>
> ---
>  source3/rpc_server/srvsvc/srv_srvsvc_nt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
> index f3173aee42f..2a8cf8de650 100644
> --- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
> +++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
> @@ -1984,7 +1984,7 @@ WERROR _srvsvc_NetShareAdd(struct pipes_struct *p,
>  		return WERR_ACCESS_DENIED;
>  
>  	if (!lp_add_share_command(talloc_tos()) || !*lp_add_share_command(talloc_tos())) {
> -		DEBUG(10,("_srvsvc_NetShareAdd: No add share command\n"));
> +		DBG_WARNING("_srvsvc_NetShareAdd: No \"add share command\" parameter set in smb.conf.\n");
>  		return WERR_ACCESS_DENIED;
>  	}
>  
> @@ -2196,7 +2196,7 @@ WERROR _srvsvc_NetShareDel(struct pipes_struct *p,
>  		return WERR_ACCESS_DENIED;
>  
>  	if (!lp_delete_share_command(talloc_tos()) || !*lp_delete_share_command(talloc_tos())) {
> -		DEBUG(10,("_srvsvc_NetShareDel: No delete share command\n"));
> +		DBG_WARNING("_srvsvc_NetShareDel: No \"delete share command\" parameter set in smb.conf.\n");
>  		return WERR_ACCESS_DENIED;
>  	}
>  
> -- 
> 2.14.2
> 




More information about the samba-technical mailing list