On Mon, Mar 02, 2009 at 01:42:05PM -0800, Afshin Salek wrote:
> Jordan Brown wrote:
> >/var/smb/passwd currently has both username and uid, right?
> >
> >In theory it only needs one or the other, because the other can be 
> >derived from /etc/passwd.
> 
> Not necessarily because when you call getpwuid the information might
> not be populated from /etc/passwd

I don't get it.  Why must the UID be in /var/smb/passwd?  Is it an
optimization?  Or are both, name and UID stored in there to help detect
user renames and renumberings?  If the former, that seems wrong.  If the
latter, then it didn't work :)

I think the latter would be commendable, if it worked.  I think it could
work:

        pw = getpwnam_r(cifs_username, &pwd, pwbuf, sizeof (pwbuf));

        if (pw == NULL) {
                /* not found *
                ...
        } else {
                smbpw = lookup_smb_pwbyname(pw->pw_name);

                if (smbpw->uid != pw->pw_uid) {
                        /* Stale entry found */
                        ...
                } else {
                        /* Found a /var/smb/passwd entry */
                        ...
                }
        }

Nico
-- 
_______________________________________________
cifs-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/cifs-discuss

Reply via email to