svn commit: samba r16397 - in branches/SAMBA_3_0/source/smbd: .

Jeremy Allison jra at samba.org
Tue Jun 20 16:14:57 GMT 2006


On Tue, Jun 20, 2006 at 10:53:17AM -0500, Gerald (Jerry) Carter wrote:
> 
> James is right.  The logic is different in two places,
> Before if change_to_user() failed bu the AS_GUEST flag was
> set the code would fall on through.  Now it always fails.
> Can you help me understand under what conditions the old
> code would have been executed? I have a feeling it may
> be for security = share.
> 
> - -      /* does this protocol need to be run as the connected user? */
> - -      if ((flags & AS_USER) && !change_to_user (conn, session_tag))
> +	  if (!change_to_user (conn, session_tag))
>  	{
> - -	  if (flags & AS_GUEST)
> - -	    flags &= ~AS_USER;
> - -	  else
>  	    return (ERROR_FORCE_DOS (ERRSRV, ERRbaduid));
>  	}
> 
> 
> - -      /* this code is to work around a bug is MS client 3 without
> - -         introducing a security hole - it needs to be able to do
> - -         print queue checks as guest if it isn't logged in properly */
> - -      if (flags & AS_USER)
> - -	flags &= ~AS_GUEST;
> +	  /* All NEED_WRITE and CAN_IPC flags must also have AS_USER. */

The change I discovered was that AS_GUEST is never set at the
same time as AS_USER in the function dispatch table. That means that
the removed code would never be executed, as it was conditional
on AS_USER being set.

Please let me know if I made an error here, but I don't see one.
I'm trying to make this code simple to maintain (you know how old
and brittle this can be).

Sorry for not pointing out the relevent part of the change to
review.

Jeremy.


More information about the samba-technical mailing list