Changeset 860 for vendor/current/source4


Ignore:
Timestamp:
May 12, 2014, 8:58:38 PM (11 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.6: updated vendor to latest version

Location:
vendor/current/source4
Files:
8 added
17 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/libcli/util/clilsa.c

    r740 r860  
    255255        if (names.count != 1) {
    256256                talloc_free(mem_ctx2);
    257                 return NT_STATUS_UNSUCCESSFUL;
     257                return NT_STATUS_INVALID_NETWORK_RESPONSE;
     258        }
     259        if (domains == NULL) {
     260                talloc_free(mem_ctx2);
     261                return NT_STATUS_INVALID_NETWORK_RESPONSE;
     262        }
     263        if (domains->count != 1) {
     264                talloc_free(mem_ctx2);
     265                return NT_STATUS_INVALID_NETWORK_RESPONSE;
     266        }
     267        if (names.names[0].sid_index != UINT32_MAX &&
     268            names.names[0].sid_index >= domains->count)
     269        {
     270                talloc_free(mem_ctx2);
     271                return NT_STATUS_INVALID_NETWORK_RESPONSE;
    258272        }
    259273
     
    316330        if (sids.count != 1) {
    317331                talloc_free(mem_ctx2);
    318                 return NT_STATUS_UNSUCCESSFUL;
     332                return NT_STATUS_INVALID_NETWORK_RESPONSE;
     333        }
     334        if (domains->count != 1) {
     335                talloc_free(mem_ctx2);
     336                return NT_STATUS_INVALID_NETWORK_RESPONSE;
    319337        }
    320338
  • vendor/current/source4/libnet/groupinfo.c

    r740 r860  
    8888                s->monitor_fn(&msg);
    8989        }
    90        
    9190
    9291        /* have we actually got name resolved
    9392           - we're looking for only one at the moment */
    94         if (s->lookup.out.rids->count == 0) {
    95                 composite_error(c, NT_STATUS_NO_SUCH_USER);
     93        if (s->lookup.out.rids->count != s->lookup.in.num_names) {
     94                composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE);
     95                return;
     96        }
     97        if (s->lookup.out.types->count != s->lookup.in.num_names) {
     98                composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE);
     99                return;
    96100        }
    97101
  • vendor/current/source4/libnet/groupman.c

    r740 r860  
    213213        /* what to do when there's no group account to delete
    214214           and what if there's more than one rid resolved */
    215         if (!s->lookupname.out.rids->count) {
    216                 c->status = NT_STATUS_NO_SUCH_GROUP;
    217                 composite_error(c, c->status);
    218                 return;
    219 
    220         } else if (!s->lookupname.out.rids->count > 1) {
    221                 c->status = NT_STATUS_INVALID_ACCOUNT_NAME;
     215        if (s->lookupname.out.rids->count != s->lookupname.in.num_names) {
     216                c->status = NT_STATUS_INVALID_NETWORK_RESPONSE;
     217                composite_error(c, c->status);
     218                return;
     219        }
     220        if (s->lookupname.out.types->count != s->lookupname.in.num_names) {
     221                c->status = NT_STATUS_INVALID_NETWORK_RESPONSE;
    222222                composite_error(c, c->status);
    223223                return;
  • vendor/current/source4/libnet/libnet_join.c

    r740 r860  
    657657                                                              r->in.account_name, ln.out.rids->count);
    658658                        talloc_free(tmp_ctx);
    659                         return NT_STATUS_INVALID_PARAMETER;
    660                 }
    661                
     659                        return NT_STATUS_INVALID_NETWORK_RESPONSE;
     660                }
     661
     662                if (ln.out.types->count != 1) {
     663                        r->out.error_string = talloc_asprintf(mem_ctx,
     664                                                                "samr_LookupNames for [%s] returns %d RID TYPEs",
     665                                                                r->in.account_name, ln.out.types->count);
     666                        talloc_free(tmp_ctx);
     667                        return NT_STATUS_INVALID_NETWORK_RESPONSE;
     668                }
     669
    662670                /* prepare samr_OpenUser */
    663671                ZERO_STRUCTP(u_handle);
  • vendor/current/source4/libnet/libnet_lookup.c

    r740 r860  
    364364        if (!composite_is_ok(c)) return;
    365365
     366        if (s->lookup.out.sids->count != s->lookup.in.num_names) {
     367                composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE);
     368                return;
     369        }
     370
    366371        composite_done(c);
    367372}
  • vendor/current/source4/libnet/libnet_passwd.c

    r746 r860  
    628628                                                "samr_LookupNames for [%s] returns %d RIDs",
    629629                                                r->samr.in.account_name, ln.out.rids->count);
    630                 status = NT_STATUS_INVALID_PARAMETER;
     630                status = NT_STATUS_INVALID_NETWORK_RESPONSE;
    631631                goto disconnect;       
     632        }
     633
     634        if (ln.out.types->count != 1) {
     635                r->samr.out.error_string = talloc_asprintf(mem_ctx,
     636                                                "samr_LookupNames for [%s] returns %d RID TYPEs",
     637                                                r->samr.in.account_name, ln.out.types->count);
     638                status = NT_STATUS_INVALID_NETWORK_RESPONSE;
     639                goto disconnect;
    632640        }
    633641
  • vendor/current/source4/libnet/userinfo.c

    r740 r860  
    9191        /* have we actually got name resolved
    9292           - we're looking for only one at the moment */
    93         if (s->lookup.out.rids->count == 0) {
    94                 composite_error(c, NT_STATUS_NO_SUCH_USER);
     93        if (s->lookup.out.rids->count != s->lookup.in.num_names) {
     94                composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE);
     95                return;
     96        }
     97        if (s->lookup.out.types->count != s->lookup.in.num_names) {
     98                composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE);
     99                return;
    95100        }
    96101
  • vendor/current/source4/libnet/userman.c

    r740 r860  
    237237        /* what to do when there's no user account to delete
    238238           and what if there's more than one rid resolved */
    239         if (!s->lookupname.out.rids->count) {
    240                 c->status = NT_STATUS_NO_SUCH_USER;
    241                 composite_error(c, c->status);
    242                 return;
    243 
    244         } else if (!s->lookupname.out.rids->count > 1) {
    245                 c->status = NT_STATUS_INVALID_ACCOUNT_NAME;
    246                 composite_error(c, c->status);
     239        if (s->lookupname.out.rids->count != s->lookupname.in.num_names) {
     240                composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE);
     241                return;
     242        }
     243        if (s->lookupname.out.types->count != s->lookupname.in.num_names) {
     244                composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE);
    247245                return;
    248246        }
     
    512510        /* what to do when there's no user account to delete
    513511           and what if there's more than one rid resolved */
    514         if (!s->lookupname.out.rids->count) {
    515                 c->status = NT_STATUS_NO_SUCH_USER;
    516                 composite_error(c, c->status);
    517                 return;
    518 
    519         } else if (!s->lookupname.out.rids->count > 1) {
    520                 c->status = NT_STATUS_INVALID_ACCOUNT_NAME;
    521                 composite_error(c, c->status);
     512        if (s->lookupname.out.rids->count != s->lookupname.in.num_names) {
     513                composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE);
     514                return;
     515        }
     516        if (s->lookupname.out.types->count != s->lookupname.in.num_names) {
     517                composite_error(c, NT_STATUS_INVALID_NETWORK_RESPONSE);
    522518                return;
    523519        }
  • vendor/current/source4/librpc/rpc/dcerpc.c

    r740 r860  
    657657        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
    658658                return ndr_map_error2ntstatus(ndr_err);
     659        }
     660
     661        if (pkt->frag_length != blob->length) {
     662                return NT_STATUS_RPC_PROTOCOL_ERROR;
    659663        }
    660664
  • vendor/current/source4/librpc/rpc/dcerpc_smb.c

    r740 r860  
    161161                uint32_t frag_length = blob->length>=16?
    162162                        dcerpc_get_frag_length(blob):0x2000;
     163
     164                if (frag_length < state->data.length) {
     165                        talloc_free(state);
     166                        return NT_STATUS_RPC_PROTOCOL_ERROR;
     167                }
     168
    163169                state->received = blob->length;
    164170                state->data = data_blob_talloc(state, NULL, frag_length);
  • vendor/current/source4/librpc/rpc/dcerpc_smb2.c

    r740 r860  
    171171        if (state->data.length >= 16) {
    172172                uint16_t frag_length = dcerpc_get_frag_length(&state->data);
     173
     174                if (frag_length < state->data.length) {
     175                        talloc_free(state);
     176                        return NT_STATUS_RPC_PROTOCOL_ERROR;
     177                }
     178
    173179                io.in.length = frag_length - state->data.length;
    174180        } else {
  • vendor/current/source4/librpc/rpc/dcerpc_sock.c

    r740 r860  
    103103        }
    104104        *size = dcerpc_get_frag_length(&blob);
     105        if (*size < blob.length) {
     106                /*
     107                 * something is wrong, let the caller deal with it
     108                 */
     109                *size = blob.length;
     110        }
    105111        if (*size > blob.length) {
    106112                return STATUS_MORE_ENTRIES;
  • vendor/current/source4/rpc_server/samr/samr_password.c

    r746 r860  
    3333/*
    3434  samr_ChangePasswordUser
     35
     36  So old it is just not worth implementing
     37  because it does not supply a plaintext and so we can't do password
     38  complexity checking and cannot update all the other password hashes.
     39
    3540*/
    3641NTSTATUS dcesrv_samr_ChangePasswordUser(struct dcesrv_call_state *dce_call,
     
    3843                                        struct samr_ChangePasswordUser *r)
    3944{
    40         struct dcesrv_handle *h;
    41         struct samr_account_state *a_state;
    42         struct ldb_context *sam_ctx;
    43         struct ldb_message **res;
    44         int ret;
    45         struct samr_Password new_lmPwdHash, new_ntPwdHash, checkHash;
    46         struct samr_Password *lm_pwd, *nt_pwd;
    47         NTSTATUS status = NT_STATUS_OK;
    48         const char * const attrs[] = { "dBCSPwd", "unicodePwd" , NULL };
    49 
    50         DCESRV_PULL_HANDLE(h, r->in.user_handle, SAMR_HANDLE_USER);
    51 
    52         a_state = h->data;
    53 
    54         /* basic sanity checking on parameters.  Do this before any database ops */
    55         if (!r->in.lm_present || !r->in.nt_present ||
    56             !r->in.old_lm_crypted || !r->in.new_lm_crypted ||
    57             !r->in.old_nt_crypted || !r->in.new_nt_crypted) {
    58                 /* we should really handle a change with lm not
    59                    present */
    60                 return NT_STATUS_INVALID_PARAMETER_MIX;
    61         }
    62 
    63         /* Connect to a SAMDB with system privileges for fetching the old pw
    64          * hashes. */
    65         sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
    66                                 dce_call->conn->dce_ctx->lp_ctx,
    67                                 system_session(dce_call->conn->dce_ctx->lp_ctx), 0);
    68         if (sam_ctx == NULL) {
    69                 return NT_STATUS_INVALID_SYSTEM_SERVICE;
    70         }
    71 
    72         /* fetch the old hashes */
    73         ret = gendb_search_dn(sam_ctx, mem_ctx,
    74                               a_state->account_dn, &res, attrs);
    75         if (ret != 1) {
    76                 return NT_STATUS_WRONG_PASSWORD;
    77         }
    78 
    79         status = samdb_result_passwords(mem_ctx,
    80                                         dce_call->conn->dce_ctx->lp_ctx,
    81                                         res[0], &lm_pwd, &nt_pwd);
    82         if (!NT_STATUS_IS_OK(status) || !nt_pwd) {
    83                 return NT_STATUS_WRONG_PASSWORD;
    84         }
    85 
    86         /* decrypt and check the new lm hash */
    87         if (lm_pwd) {
    88                 D_P16(lm_pwd->hash, r->in.new_lm_crypted->hash, new_lmPwdHash.hash);
    89                 D_P16(new_lmPwdHash.hash, r->in.old_lm_crypted->hash, checkHash.hash);
    90                 if (memcmp(checkHash.hash, lm_pwd, 16) != 0) {
    91                         return NT_STATUS_WRONG_PASSWORD;
    92                 }
    93         }
    94 
    95         /* decrypt and check the new nt hash */
    96         D_P16(nt_pwd->hash, r->in.new_nt_crypted->hash, new_ntPwdHash.hash);
    97         D_P16(new_ntPwdHash.hash, r->in.old_nt_crypted->hash, checkHash.hash);
    98         if (memcmp(checkHash.hash, nt_pwd, 16) != 0) {
    99                 return NT_STATUS_WRONG_PASSWORD;
    100         }
    101 
    102         /* The NT Cross is not required by Win2k3 R2, but if present
    103            check the nt cross hash */
    104         if (r->in.cross1_present && r->in.nt_cross && lm_pwd) {
    105                 D_P16(lm_pwd->hash, r->in.nt_cross->hash, checkHash.hash);
    106                 if (memcmp(checkHash.hash, new_ntPwdHash.hash, 16) != 0) {
    107                         return NT_STATUS_WRONG_PASSWORD;
    108                 }
    109         }
    110 
    111         /* The LM Cross is not required by Win2k3 R2, but if present
    112            check the lm cross hash */
    113         if (r->in.cross2_present && r->in.lm_cross && lm_pwd) {
    114                 D_P16(nt_pwd->hash, r->in.lm_cross->hash, checkHash.hash);
    115                 if (memcmp(checkHash.hash, new_lmPwdHash.hash, 16) != 0) {
    116                         return NT_STATUS_WRONG_PASSWORD;
    117                 }
    118         }
    119 
    120         /* Start a SAM with user privileges for the password change */
    121         sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx,
    122                                 dce_call->conn->dce_ctx->lp_ctx,
    123                                 dce_call->conn->auth_state.session_info, 0);
    124         if (sam_ctx == NULL) {
    125                 return NT_STATUS_INVALID_SYSTEM_SERVICE;
    126         }
    127 
    128         /* Start transaction */
    129         ret = ldb_transaction_start(sam_ctx);
    130         if (ret != LDB_SUCCESS) {
    131                 DEBUG(1, ("Failed to start transaction: %s\n", ldb_errstring(sam_ctx)));
    132                 return NT_STATUS_TRANSACTION_ABORTED;
    133         }
    134 
    135         /* Performs the password modification. We pass the old hashes read out
    136          * from the database since they were already checked against the user-
    137          * provided ones. */
    138         status = samdb_set_password(sam_ctx, mem_ctx,
    139                                     a_state->account_dn,
    140                                     a_state->domain_state->domain_dn,
    141                                     NULL, &new_lmPwdHash, &new_ntPwdHash,
    142                                     lm_pwd, nt_pwd, /* this is a user password change */
    143                                     NULL,
    144                                     NULL);
    145         if (!NT_STATUS_IS_OK(status)) {
    146                 ldb_transaction_cancel(sam_ctx);
    147                 return status;
    148         }
    149 
    150         /* And this confirms it in a transaction commit */
    151         ret = ldb_transaction_commit(sam_ctx);
    152         if (ret != LDB_SUCCESS) {
    153                 DEBUG(1,("Failed to commit transaction to change password on %s: %s\n",
    154                          ldb_dn_get_linearized(a_state->account_dn),
    155                          ldb_errstring(sam_ctx)));
    156                 return NT_STATUS_TRANSACTION_ABORTED;
    157         }
    158 
    159         return NT_STATUS_OK;
     45        return NT_STATUS_NOT_IMPLEMENTED;
    16046}
    16147
  • vendor/current/source4/torture/ndr/ntprinting.c

    r748 r860  
    2323#include "librpc/gen_ndr/ndr_ntprinting.h"
    2424#include "torture/ndr/proto.h"
     25#include "param/param.h"
    2526
    2627static const uint8_t ntprinting_printer_data[] = {
     
    297298};
    298299
     300static const uint8_t ntprinting_printer_data_latin1[] = {
     301        0x48, 0x1a, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
     302        0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     303        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     304        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     305        0x94, 0x46, 0x50, 0x0e, 0x00, 0x00, 0x00, 0x00,
     306        0x94, 0xee, 0xb9, 0x50, 0x00, 0x53, 0x30, 0x42,
     307        0x43, 0x00, 0x53, 0x30, 0x42, 0x43, 0x00, 0x53,
     308        0x61, 0x6d, 0x62, 0x61, 0x20, 0x50, 0x72, 0x69,
     309        0x6e, 0x74, 0x65, 0x72, 0x20, 0x50, 0x6f, 0x72,
     310        0x74, 0x00, 0x48, 0x50, 0x20, 0x44, 0x65, 0x73,
     311        0x69, 0x67, 0x6e, 0x6a, 0x65, 0x74, 0x20, 0x38,
     312        0x30, 0x30, 0x50, 0x53, 0x20, 0x34, 0x32, 0x20,
     313        0x62, 0x79, 0x20, 0x48, 0x50, 0x00, 0x22, 0x20,
     314        0x53, 0x41, 0x4c, 0x41, 0x20, 0x44, 0x41, 0x20,
     315        0x52, 0x45, 0x43, 0x45, 0x50, 0xc7, 0xc3, 0x4f,
     316        0x20, 0x44, 0x41, 0x20, 0x43, 0x4f, 0x4e, 0x53,
     317        0x54, 0x52, 0x55, 0xc7, 0xc3, 0x4f, 0x20, 0x2d,
     318        0x20, 0x52, 0x41, 0x4e, 0x44, 0x30, 0x20, 0x4c,
     319        0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x00, 0x55,
     320        0x54, 0x47, 0x43, 0x41, 0x20, 0x00, 0x00, 0x77,
     321        0x69, 0x6e, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x00,
     322        0x52, 0x41, 0x57, 0x00, 0x00, 0x01, 0x00, 0x00,
     323        0x00, 0x5c, 0x5c, 0x4c, 0x4f, 0x43, 0x41, 0x4c,
     324        0x48, 0x4f, 0x53, 0x54, 0x5c, 0x53, 0x30, 0x42,
     325        0x43, 0x00, 0x4c, 0x65, 0x74, 0x74, 0x65, 0x72,
     326        0x00, 0x01, 0x04, 0x00, 0x04, 0xdc, 0x00, 0x00,
     327        0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
     328        0x00, 0x64, 0x00, 0x01, 0x00, 0x0f, 0x00, 0xfc,
     329        0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03,
     330        0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x47, 0x01,
     331        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     332        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     333        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     334        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     335        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     336        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     337        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
     338        0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x72, 0x69,
     339        0x6e, 0x74, 0x65, 0x72, 0x44, 0x72, 0x69, 0x76,
     340        0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x00, 0x00,
     341        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
     342        0x00, 0x00, 0x00, 0x50, 0x72, 0x69, 0x6e, 0x74,
     343        0x65, 0x72, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72,
     344        0x44, 0x61, 0x74, 0x61, 0x5c, 0x44, 0x72, 0x76,
     345        0x50, 0x61, 0x70, 0x65, 0x72, 0x53, 0x74, 0x61,
     346        0x6e, 0x64, 0x61, 0x72, 0x64, 0x73, 0x00, 0x04,
     347        0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x61,
     348        0xc2, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x00, 0x50,
     349        0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x44, 0x72,
     350        0x69, 0x76, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61,
     351        0x5c, 0x44, 0x72, 0x76, 0x44, 0x65, 0x76, 0x4d,
     352        0x6f, 0x64, 0x65, 0x00, 0x01, 0x00, 0x00, 0x00,
     353        0x42, 0x02, 0x00, 0x00, 0x31, 0x00, 0x3b, 0x00,
     354        0x31, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x36, 0x00,
     355        0x36, 0x00, 0x3b, 0x00, 0x2d, 0x00, 0x33, 0x00,
     356        0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00, 0x31, 0x00,
     357        0x30, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     358        0x30, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
     359        0x31, 0x00, 0x30, 0x00, 0x37, 0x00, 0x33, 0x00,
     360        0x37, 0x00, 0x34, 0x00, 0x31, 0x00, 0x39, 0x00,
     361        0x30, 0x00, 0x35, 0x00, 0x3b, 0x00, 0x30, 0x00,
     362        0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x30, 0x00,
     363        0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00, 0x35, 0x00,
     364        0x30, 0x00, 0x3b, 0x00, 0x34, 0x00, 0x3b, 0x00,
     365        0x35, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     366        0x32, 0x00, 0x30, 0x00, 0x30, 0x00, 0x3b, 0x00,
     367        0x30, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     368        0x30, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     369        0x32, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x3b, 0x00,
     370        0x32, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
     371        0x31, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
     372        0x30, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x36, 0x00,
     373        0x32, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x30, 0x00,
     374        0x30, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x36, 0x00,
     375        0x37, 0x00, 0x37, 0x00, 0x37, 0x00, 0x32, 0x00,
     376        0x31, 0x00, 0x36, 0x00, 0x3b, 0x00, 0x30, 0x00,
     377        0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00, 0x30, 0x00,
     378        0x3b, 0x00, 0x31, 0x00, 0x36, 0x00, 0x3b, 0x00,
     379        0x32, 0x00, 0x31, 0x00, 0x3b, 0x00, 0x32, 0x00,
     380        0x30, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
     381        0x31, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     382        0x30, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     383        0x30, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
     384        0x31, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     385        0x34, 0x00, 0x3b, 0x00, 0x36, 0x00, 0x35, 0x00,
     386        0x35, 0x00, 0x33, 0x00, 0x35, 0x00, 0x3b, 0x00,
     387        0x32, 0x00, 0x36, 0x00, 0x33, 0x00, 0x31, 0x00,
     388        0x37, 0x00, 0x32, 0x00, 0x3b, 0x00, 0x30, 0x00,
     389        0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x31, 0x00,
     390        0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x37, 0x00,
     391        0x3b, 0x00, 0x31, 0x00, 0x30, 0x00, 0x32, 0x00,
     392        0x37, 0x00, 0x3b, 0x00, 0x31, 0x00, 0x3b, 0x00,
     393        0x30, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x3b, 0x00,
     394        0x31, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
     395        0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
     396        0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
     397        0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
     398        0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
     399        0x34, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
     400        0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
     401        0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
     402        0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
     403        0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
     404        0x34, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
     405        0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
     406        0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
     407        0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
     408        0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
     409        0x34, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
     410        0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
     411        0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
     412        0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
     413        0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
     414        0x34, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x31, 0x00,
     415        0x35, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x32, 0x00,
     416        0x37, 0x00, 0x39, 0x00, 0x34, 0x00, 0x3b, 0x00,
     417        0x32, 0x00, 0x31, 0x00, 0x35, 0x00, 0x39, 0x00,
     418        0x3b, 0x00, 0x32, 0x00, 0x37, 0x00, 0x39, 0x00,
     419        0x34, 0x00, 0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00,
     420        0x3b, 0x00, 0x3b, 0x00, 0x3b, 0x00, 0x3b, 0x00,
     421        0x3b, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00,
     422        0x3b, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00,
     423        0x3b, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00,
     424        0x3b, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x30, 0x00,
     425        0x3b, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x01, 0x00,
     426        0x00, 0x00, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x65,
     427        0x72, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44,
     428        0x61, 0x74, 0x61, 0x5c, 0x44, 0x72, 0x76, 0x45,
     429        0x57, 0x53, 0x49, 0x50, 0x00, 0x01, 0x00, 0x00,
     430        0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
     431        0x00, 0x00, 0x00, 0x44, 0x73, 0x53, 0x70, 0x6f,
     432        0x6f, 0x6c, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00,
     433        0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
     434        0x00, 0x44, 0x73, 0x53, 0x70, 0x6f, 0x6f, 0x6c,
     435        0x65, 0x72, 0x5c, 0x70, 0x72, 0x69, 0x6e, 0x74,
     436        0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x00, 0x01,
     437        0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x53,
     438        0x00, 0x30, 0x00, 0x42, 0x00, 0x43, 0x00, 0x00,
     439        0x00, 0x01, 0x00, 0x00, 0x00, 0x44, 0x73, 0x53,
     440        0x70, 0x6f, 0x6f, 0x6c, 0x65, 0x72, 0x5c, 0x73,
     441        0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d,
     442        0x65, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00,
     443        0x00, 0x00, 0x53, 0x00, 0x36, 0x00, 0x30, 0x00,
     444        0x32, 0x00, 0x30, 0x00, 0x50, 0x00, 0x53, 0x00,
     445        0x36, 0x00, 0x36, 0x00, 0x00, 0x00, 0x01, 0x00,
     446        0x00, 0x00, 0x44, 0x73, 0x53, 0x70, 0x6f, 0x6f,
     447        0x6c, 0x65, 0x72, 0x5c, 0x73, 0x68, 0x6f, 0x72,
     448        0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e,
     449        0x61, 0x6d, 0x65, 0x00, 0x01, 0x00, 0x00, 0x00,
     450        0x14, 0x00, 0x00, 0x00, 0x53, 0x00, 0x36, 0x00,
     451        0x30, 0x00, 0x32, 0x00, 0x30, 0x00, 0x50, 0x00,
     452        0x53, 0x00, 0x36, 0x00, 0x36, 0x00, 0x00, 0x00,
     453        0x01, 0x00, 0x00, 0x00, 0x44, 0x73, 0x53, 0x70,
     454        0x6f, 0x6f, 0x6c, 0x65, 0x72, 0x5c, 0x75, 0x4e,
     455        0x43, 0x4e, 0x61, 0x6d, 0x65, 0x00, 0x01, 0x00,
     456        0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x5c, 0x00,
     457        0x5c, 0x00, 0x53, 0x00, 0x36, 0x00, 0x30, 0x00,
     458        0x32, 0x00, 0x30, 0x00, 0x50, 0x00, 0x53, 0x00,
     459        0x36, 0x00, 0x36, 0x00, 0x5c, 0x00, 0x53, 0x00,
     460        0x30, 0x00, 0x42, 0x00, 0x43, 0x00, 0x00, 0x00,
     461        0x00, 0x00, 0x00, 0x00
     462};
     463
    299464static bool ntprinting_printer_check(struct torture_context *tctx,
    300465                                     struct ntprinting_printer *r)
     
    422587}
    423588
     589static bool ntprinting_printer_latin1_check(struct torture_context *tctx)
     590{
     591        enum ndr_err_code ndr_err;
     592        struct ntprinting_printer r;
     593        DATA_BLOB blob;
     594        bool ok;
     595
     596        ok = lpcfg_do_global_parameter(tctx->lp_ctx, "dos charset", "CP1252");
     597        if (!ok) {
     598                torture_comment(tctx, "Could not set 'dos charset' option.\n");
     599                return false;
     600        }
     601        reload_charcnv(tctx->lp_ctx);
     602
     603        ZERO_STRUCT(r);
     604        r.info.string_flags = LIBNDR_FLAG_STR_ASCII;
     605
     606        blob = data_blob_const(ntprinting_printer_data_latin1,
     607                               sizeof(ntprinting_printer_data_latin1));
     608
     609        ndr_err = ndr_pull_struct_blob(&blob, tctx, &r,
     610                   (ndr_pull_flags_fn_t)ndr_pull_ntprinting_printer);
     611
     612        torture_assert_ndr_success(tctx,
     613                                   ndr_err,
     614                                   "ndr_pull_ntprinting_printer");
     615#if 0
     616        ndr_print_debug((ndr_print_fn_t) ndr_print_ntprinting_printer,
     617                        "ntprinter",
     618                        &r);
     619#endif
     620        torture_assert_str_equal(tctx,
     621                                 r.info.printername,
     622                                 "S0BC",
     623                                 "printername");
     624        /* latin1 encoding check */
     625        torture_assert_str_equal(tctx,
     626                                 r.info.comment,
     627                                 "\" SALA DA RECEPÇÃO DA CONSTRUÇÃO - RAND0 LOCATIO",
     628                                 "comment");
     629        torture_assert_str_equal(tctx,
     630                                 r.info.location,
     631                                 "UTGCA ",
     632                                 "location");
     633
     634        return true;
     635}
     636
    424637struct torture_suite *ndr_ntprinting_suite(TALLOC_CTX *ctx)
    425638{
    426639        struct torture_suite *suite = torture_suite_create(ctx, "ntprinting");
     640
     641        torture_suite_add_simple_test(suite,
     642                                      "ntprinting latin1 check",
     643                                      ntprinting_printer_latin1_check);
    427644
    428645        torture_suite_add_ndr_pull_test(suite,
  • vendor/current/source4/torture/rpc/samr.c

    r746 r860  
    17291729        torture_assert_ntstatus_ok(tctx, dcerpc_samr_ChangePasswordUser_r(b, tctx, &r),
    17301730                "ChangePasswordUser failed");
    1731         torture_assert_ntstatus_equal(tctx, r.out.result, NT_STATUS_WRONG_PASSWORD,
    1732                 "ChangePasswordUser failed: expected NT_STATUS_WRONG_PASSWORD because we broke the LM hash");
     1731
     1732        /* Do not proceed if this call has been removed */
     1733        if (NT_STATUS_EQUAL(r.out.result, NT_STATUS_NOT_IMPLEMENTED)) {
     1734                return true;
     1735        }
     1736
     1737        if (!NT_STATUS_EQUAL(r.out.result, NT_STATUS_PASSWORD_RESTRICTION)) {
     1738                torture_assert_ntstatus_equal(tctx, r.out.result, NT_STATUS_WRONG_PASSWORD,
     1739                        "ChangePasswordUser failed: expected NT_STATUS_WRONG_PASSWORD because we broke the LM hash");
     1740        }
    17331741
    17341742        /* Unbreak the LM hash */
  • vendor/current/source4/torture/smb2/create.c

    r740 r860  
    445445        CHECK_STATUS(status, NT_STATUS_OK);
    446446
    447         torture_comment(tctx, "Testing bad tag length\n");
     447        torture_comment(tctx, "Testing bad tag length 0\n");
     448        ZERO_STRUCT(io.in.blobs);
     449        status = smb2_create_blob_add(tctx, &io.in.blobs,
     450                                      "x", data_blob(NULL, 0));
     451        CHECK_STATUS(status, NT_STATUS_OK);
     452        status = smb2_create(tree, tctx, &io);
     453        CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
     454
     455        torture_comment(tctx, "Testing bad tag length 1\n");
     456        ZERO_STRUCT(io.in.blobs);
     457        status = smb2_create_blob_add(tctx, &io.in.blobs,
     458                                      "x", data_blob(NULL, 0));
     459        CHECK_STATUS(status, NT_STATUS_OK);
     460        status = smb2_create(tree, tctx, &io);
     461        CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
     462
     463        torture_comment(tctx, "Testing bad tag length 2\n");
     464        ZERO_STRUCT(io.in.blobs);
     465        status = smb2_create_blob_add(tctx, &io.in.blobs,
     466                                      "xx", data_blob(NULL, 0));
     467        CHECK_STATUS(status, NT_STATUS_OK);
     468        status = smb2_create(tree, tctx, &io);
     469        CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
     470
     471        torture_comment(tctx, "Testing bad tag length 3\n");
     472        ZERO_STRUCT(io.in.blobs);
    448473        status = smb2_create_blob_add(tctx, &io.in.blobs,
    449474                                      "xxx", data_blob(NULL, 0));
    450475        CHECK_STATUS(status, NT_STATUS_OK);
    451 
    452476        status = smb2_create(tree, tctx, &io);
    453477        CHECK_STATUS(status, NT_STATUS_INVALID_PARAMETER);
     478
     479        torture_comment(tctx, "Testing tag length 4\n");
     480        ZERO_STRUCT(io.in.blobs);
     481        status = smb2_create_blob_add(tctx, &io.in.blobs,
     482                                      "xxxx", data_blob(NULL, 0));
     483        CHECK_STATUS(status, NT_STATUS_OK);
     484        status = smb2_create(tree, tctx, &io);
     485        CHECK_STATUS(status, NT_STATUS_OK);
     486
     487        torture_comment(tctx, "Testing tag length 5\n");
     488        ZERO_STRUCT(io.in.blobs);
     489        status = smb2_create_blob_add(tctx, &io.in.blobs,
     490                                      "xxxxx", data_blob(NULL, 0));
     491        CHECK_STATUS(status, NT_STATUS_OK);
     492        status = smb2_create(tree, tctx, &io);
     493        CHECK_STATUS(status, NT_STATUS_OK);
     494
     495        torture_comment(tctx, "Testing tag length 6\n");
     496        ZERO_STRUCT(io.in.blobs);
     497        status = smb2_create_blob_add(tctx, &io.in.blobs,
     498                                      "xxxxxx", data_blob(NULL, 0));
     499        CHECK_STATUS(status, NT_STATUS_OK);
     500        status = smb2_create(tree, tctx, &io);
     501        CHECK_STATUS(status, NT_STATUS_OK);
     502
     503        torture_comment(tctx, "Testing tag length 7\n");
     504        ZERO_STRUCT(io.in.blobs);
     505        status = smb2_create_blob_add(tctx, &io.in.blobs,
     506                                      "xxxxxxx", data_blob(NULL, 0));
     507        CHECK_STATUS(status, NT_STATUS_OK);
     508        status = smb2_create(tree, tctx, &io);
     509        CHECK_STATUS(status, NT_STATUS_OK);
     510
     511        torture_comment(tctx, "Testing tag length 8\n");
     512        ZERO_STRUCT(io.in.blobs);
     513        status = smb2_create_blob_add(tctx, &io.in.blobs,
     514                                      "xxxxxxxx", data_blob(NULL, 0));
     515        CHECK_STATUS(status, NT_STATUS_OK);
     516        status = smb2_create(tree, tctx, &io);
     517        CHECK_STATUS(status, NT_STATUS_OK);
     518
     519        torture_comment(tctx, "Testing tag length 16\n");
     520        ZERO_STRUCT(io.in.blobs);
     521        status = smb2_create_blob_add(tctx, &io.in.blobs,
     522                                      "xxxxxxxxxxxxxxxx", data_blob(NULL, 0));
     523        CHECK_STATUS(status, NT_STATUS_OK);
     524        status = smb2_create(tree, tctx, &io);
     525        CHECK_STATUS(status, NT_STATUS_OK);
     526
     527        torture_comment(tctx, "Testing tag length 17\n");
     528        ZERO_STRUCT(io.in.blobs);
     529        status = smb2_create_blob_add(tctx, &io.in.blobs,
     530                                      "xxxxxxxxxxxxxxxxx", data_blob(NULL, 0));
     531        CHECK_STATUS(status, NT_STATUS_OK);
     532        status = smb2_create(tree, tctx, &io);
     533        CHECK_STATUS(status, NT_STATUS_OK);
     534
     535        torture_comment(tctx, "Testing tag length 34\n");
     536        ZERO_STRUCT(io.in.blobs);
     537        status = smb2_create_blob_add(tctx, &io.in.blobs,
     538                                      "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
     539                                      data_blob(NULL, 0));
     540        CHECK_STATUS(status, NT_STATUS_OK);
     541        status = smb2_create(tree, tctx, &io);
     542        CHECK_STATUS(status, NT_STATUS_OK);
    454543
    455544        smb2_deltree(tree, FNAME);
  • vendor/current/source4/winbind/wb_async_helpers.c

    r740 r860  
    121121        }
    122122
     123        if (state->names.count != state->num_sids) {
     124                composite_error(state->ctx,
     125                                NT_STATUS_INVALID_NETWORK_RESPONSE);
     126                return;
     127        }
     128
    123129        state->result = talloc_array(state, struct wb_sid_object *,
    124130                                     state->num_sids);
     
    141147                }
    142148
     149                if (domains == NULL) {
     150                        composite_error(state->ctx,
     151                                        NT_STATUS_INVALID_NETWORK_RESPONSE);
     152                        return;
     153                }
    143154                if (name->sid_index >= domains->count) {
    144155                        composite_error(state->ctx,
    145                                         NT_STATUS_INVALID_PARAMETER);
     156                                        NT_STATUS_INVALID_NETWORK_RESPONSE);
    146157                        return;
    147158                }
     
    273284        }
    274285
     286        if (state->sids.count != state->num_names) {
     287                composite_error(state->ctx,
     288                                NT_STATUS_INVALID_NETWORK_RESPONSE);
     289                return;
     290        }
     291
    275292        state->result = talloc_array(state, struct wb_sid_object *,
    276293                                     state->num_names);
     
    291308                }
    292309
     310                if (domains == NULL) {
     311                        composite_error(state->ctx,
     312                                        NT_STATUS_INVALID_NETWORK_RESPONSE);
     313                        return;
     314                }
    293315                if (sid->sid_index >= domains->count) {
    294316                        composite_error(state->ctx,
    295                                         NT_STATUS_INVALID_PARAMETER);
     317                                        NT_STATUS_INVALID_NETWORK_RESPONSE);
    296318                        return;
    297319                }
Note: See TracChangeset for help on using the changeset viewer.