Mail delivery failed: returning message to sender (fwd)

Gerald Carter gcarter at valinux.com
Sun Apr 8 13:34:07 GMT 2001


Problems with our Mail server.  Let's try again.





Cheers, jerry

---------- Forwarded message ----------
Date: Sat, 7 Apr 2001 21:26:03 -0700 (PDT)
From: Gerald Carter <gcarter at valinux.com>
To:  <abartlet at pcug.org.au>,  <jeremy at valinux.com>
cc:  <samba-technical at samba.org>
Subject: Re: [PATCH] Check result from ALL getsam21pwnam calls (SAMBA 2.2.0cvs)

On Fri, 06 Apr 2001 22:03:11 Andrew Bartlett wrote:
>
>
> srv_netlog_nt.c:_net_sam_logon()
>
>         /*
>          * Do any case conversions.
>          */
>
>         pw=Get_Pwnam(nt_username, True);
>
>         become_root();
>         sam_pass = getsam21pwnam(nt_username);
>         smb_pass = getsmbpwnam(nt_username);
>         unbecome_root();
>
>         if (smb_pass == NULL)
>                 return NT_STATUS_NO_SUCH_USER;
>         else if (smb_pass->acct_ctrl & ACB_DISABLED)
>                 return NT_STATUS_ACCOUNT_DISABLED;
>
>         /* Validate password - if required. */
>
> This is the only case where any of the getsam21pw functions
> are used without checking that the result is not null.  The
> Get_Pwnam output should also be checked.

You absolutely right of course, but what is not apparent to me
if why we are calling both functions in the first place.

>         sam_pass = getsam21pwnam(nt_username);
>         smb_pass = getsmbpwnam(nt_username);


This means the above code goes through 2 iterations of
smbpasswd searches to find duplicate information on a user.  And
the we have an extra getpwnam() call just for good measure.  All
of this should be handled by getsam21pwnam().

ah....I know what happened.  :-)

Jeremy,

you added the getsam21pwnam() call and I remember when.
I think we should clean this up to a single getsam21pwnam()
and generate the smb_passwd struct from that.  Saves
on lookups.  The getpwnam() has already been done and filled
into the sam_passwd struct.  I'll do this on Monday.


Thanks again Andrew.  Nice eyes. :-)





Cheers, jerry
----------------------------------------------------------------------
   /\  Gerald (Jerry) Carter                     Professional Services
 \/    http://www.valinux.com/  VA Linux Systems   gcarter at valinux.com
       http://www.samba.org/       SAMBA Team          jerry at samba.org
       http://www.plainjoe.org/                     jerry at plainjoe.org

       "...a hundred billion castaways looking for a home."
                                - Sting "Message in a Bottle" ( 1979 )







More information about the samba-technical mailing list