DEBUG when write access rejected to a read-only share: Might save newbies lots of frustration ...

simo idra at samba.org
Fri Jul 22 13:40:42 MDT 2011


On Fri, 2011-07-22 at 12:30 -0700, Richard Sharpe wrote:
> Hi,
> 
> Would anyone like to add this small change:
> 
> diff --git a/source3/smbd/process.c b/source3/smbd/process.c
> index 0e198ee..077cd24 100644
> --- a/source3/smbd/process.c
> +++ b/source3/smbd/process.c
> @@ -1448,6 +1448,7 @@ static connection_struct *switch_message(uint8 type, struc
> 
>                 /* Does it need write permission? */
>                 if ((flags & NEED_WRITE) && !CAN_WRITE(conn)) {
> +                       DEBUG(2, ("Write access to read-only share rejected.\n")
>                         reply_nterror(req, NT_STATUS_MEDIA_WRITE_PROTECTED);
>                         return conn;
>                 }
> 
> It might save newbies a lot of hair pulling.
> 

level 2 seem way too low, can quickly feel up logs if you have something
that keeps trying to write to a readonly share

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>



More information about the samba-technical mailing list