Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/nsswitch/pam_winbind.c

    r414 r740  
    157157{
    158158        if (!initialized) {
    159                 bindtextdomain(MODULE_NAME, dyn_LOCALEDIR);
     159                bindtextdomain(MODULE_NAME, LOCALEDIR);
    160160                initialized = 1;
    161161        }
     
    10781078                                       int sid_list_buffer_size)
    10791079{
    1080         const char* sid_string = NULL;
    1081         char *sid_str = NULL;
     1080        char sid_string[WBC_SID_STRING_BUFLEN];
    10821081
    10831082        /* lookup name? */
    10841083        if (IS_SID_STRING(name)) {
    1085                 sid_string = name;
     1084                strlcpy(sid_string, name, sizeof(sid_string));
    10861085        } else {
    10871086                wbcErr wbc_status;
     
    10991098                }
    11001099
    1101                 wbc_status = wbcSidToString(&sid, &sid_str);
    1102                 if (!WBC_ERROR_IS_OK(wbc_status)) {
    1103                         return false;
    1104                 }
    1105 
    1106                 sid_string = sid_str;
     1100                wbcSidToStringBuf(&sid, sid_string, sizeof(sid_string));
    11071101        }
    11081102
    11091103        if (!safe_append_string(sid_list_buffer, sid_string,
    11101104                                sid_list_buffer_size)) {
    1111                 wbcFreeMemory(sid_str);
    11121105                return false;
    11131106        }
    1114 
    1115         wbcFreeMemory(sid_str);
    11161107        return true;
    11171108}
     
    11451136
    11461137        search_location = name_list;
    1147         while ((comma = strstr(search_location, ",")) != NULL) {
     1138        while ((comma = strchr(search_location, ',')) != NULL) {
    11481139                current_name = strndup(search_location,
    11491140                                       comma - search_location);
     
    12001191                 */
    12011192                len = strlen(sid_list_buffer);
    1202                 if (len) {
    1203                         if (sid_list_buffer[len - 1] == ',') {
    1204                                 sid_list_buffer[len - 1] = '\0';
    1205                         }
     1193                if ((len != 0) && (sid_list_buffer[len - 1] == ',')) {
     1194                        sid_list_buffer[len - 1] = '\0';
    12061195                }
    12071196        }
     
    14351424                                       const struct wbcAuthErrorInfo *e,
    14361425                                       const char *nt_status_string,
    1437                                        int *pam_error)
     1426                                       int *pam_err)
    14381427{
    14391428        const char *ntstatus = NULL;
    14401429        const char *error_string = NULL;
    14411430
    1442         if (!e || !pam_error) {
     1431        if (!e || !pam_err) {
    14431432                return false;
    14441433        }
     
    14541443                if (error_string) {
    14551444                        _make_remark(ctx, PAM_ERROR_MSG, error_string);
    1456                         *pam_error = e->pam_error;
     1445                        *pam_err = e->pam_error;
    14571446                        return true;
    14581447                }
    14591448
    14601449                if (e->display_string) {
    1461                         _make_remark(ctx, PAM_ERROR_MSG, e->display_string);
    1462                         *pam_error = e->pam_error;
     1450                        _make_remark(ctx, PAM_ERROR_MSG, _(e->display_string));
     1451                        *pam_err = e->pam_error;
    14631452                        return true;
    14641453                }
    14651454
    14661455                _make_remark(ctx, PAM_ERROR_MSG, nt_status_string);
    1467                 *pam_error = e->pam_error;
     1456                *pam_err = e->pam_error;
    14681457
    14691458                return true;
     
    19021891
    19031892 done:
    1904         if (logon.blobs) {
    1905                 wbcFreeMemory(logon.blobs);
    1906         }
     1893        wbcFreeMemory(logon.blobs);
    19071894        if (info && info->blobs && !p_info) {
    19081895                wbcFreeMemory(info->blobs);
     
    20011988                        case -1:
    20021989                                break;
    2003                         case WBC_PWD_CHANGE_REJECT_OTHER:
     1990                        case WBC_PWD_CHANGE_NO_ERROR:
    20041991                                if ((min_pwd_age > 0) &&
    20051992                                    (pwd_last_set + min_pwd_age > time(NULL))) {
     
    20081995                                }
    20091996                                break;
    2010                         case WBC_PWD_CHANGE_REJECT_TOO_SHORT:
     1997                        case WBC_PWD_CHANGE_PASSWORD_TOO_SHORT:
    20111998                                PAM_WB_REMARK_DIRECT(ctx,
    20121999                                        "NT_STATUS_PWD_TOO_SHORT");
    20132000                                break;
    2014                         case WBC_PWD_CHANGE_REJECT_IN_HISTORY:
     2001                        case WBC_PWD_CHANGE_PWD_IN_HISTORY:
    20152002                                PAM_WB_REMARK_DIRECT(ctx,
    20162003                                        "NT_STATUS_PWD_HISTORY_CONFLICT");
    20172004                                break;
    2018                         case WBC_PWD_CHANGE_REJECT_COMPLEXITY:
     2005                        case WBC_PWD_CHANGE_NOT_COMPLEX:
    20192006                                _make_remark(ctx, PAM_ERROR_MSG,
    20202007                                             _("Password does not meet "
     
    24252412        struct wbcDomainSid sid;
    24262413        enum wbcSidType type;
    2427         char *domain;
     2414        char *domain = NULL;
    24282415        char *name;
    24292416        char *p;
Note: See TracChangeset for help on using the changeset viewer.