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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Samba - samba-technical mailing list
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.


Regards,
Marc

0001-Updated-error-message-text-and-reduced-its-debug-lev.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Samba - samba-technical mailing list
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()

Thanks :-)

--
Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             [hidden email]
www.samba.org

Reply | Threaded
Open this post in threaded view
|

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

Samba - samba-technical mailing list
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.


Regards,
Marc



0001-Updated-error-message-text-and-reduced-its-debug-lev.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Samba - samba-technical mailing list
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 <[hidden email]>
> 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 <[hidden email]>
> ---
>  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
>