Ignore:
Timestamp:
Jun 17, 2009, 2:19:52 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.3 branch to 3.3.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/auth/auth_util.c

    r222 r274  
    293293        unsigned char key[16];
    294294       
    295         ZERO_STRUCT(key);
    296         memcpy(key, dc_sess_key, 8);
     295        memcpy(key, dc_sess_key, 16);
    297296       
    298297        if (lm_interactive_pwd)
     
    885884                                                pdb_get_username(sam_acct));
    886885
     886                /*
     887                 * If the SID from lookup_name() was the guest sid, passdb knows
     888                 * about the mapping of guest sid to lp_guestaccount()
     889                 * username and will return the unix_pw info for a guest
     890                 * user. Use it if it's there, else lookup the *uid details
     891                 * using getpwnam_alloc(). See bug #6291 for details. JRA.
     892                 */
     893
     894                /* We must always assign the *uid. */
     895                if (sam_acct->unix_pw == NULL) {
     896                        struct passwd *pwd = getpwnam_alloc(sam_acct, *found_username );
     897                        if (!pwd) {
     898                                DEBUG(10, ("getpwnam_alloc failed for %s\n",
     899                                        *found_username));
     900                                result = NT_STATUS_NO_SUCH_USER;
     901                                goto done;
     902                        }
     903                        result = samu_set_unix(sam_acct, pwd );
     904                        if (!NT_STATUS_IS_OK(result)) {
     905                                DEBUG(10, ("samu_set_unix failed for %s\n",
     906                                        *found_username));
     907                                result = NT_STATUS_NO_SUCH_USER;
     908                                goto done;
     909                        }
     910                }
     911                *uid = sam_acct->unix_pw->pw_uid;
     912
    887913        } else  if (sid_check_is_in_unix_users(&user_sid)) {
    888914
     
    901927
    902928                if (!sid_to_uid(&user_sid, uid)) {
    903                         DEBUG(1, ("sid_to_uid for %s (%s) failed\n",
     929                        DEBUG(1, ("unix_user case, sid_to_uid for %s (%s) failed\n",
    904930                                  username, sid_string_dbg(&user_sid)));
     931                        result = NT_STATUS_NO_SUCH_USER;
    905932                        goto done;
    906933                }
     
    954981
    955982                uint32 dummy;
     983
     984                /* We must always assign the *uid. */
     985                if (!sid_to_uid(&user_sid, uid)) {
     986                        DEBUG(1, ("winbindd case, sid_to_uid for %s (%s) failed\n",
     987                                  username, sid_string_dbg(&user_sid)));
     988                        result = NT_STATUS_NO_SUCH_USER;
     989                        goto done;
     990                }
    956991
    957992                num_group_sids = 1;
Note: See TracChangeset for help on using the changeset viewer.