net rpc samdump segfaults here The log just before is : [2006/11/22 13:16:38, 1] rpc_client/cli_pipe.c:cli_pipe_validate_current_pdu(625) cli_pipe_validate_current_pdu: RPC fault code DCERPC_FAULT_OP_RNG_ERROR received from remote machine cs3 pipe \NETLOGON fnum 0x77d5! [2006/11/22 13:16:38, 10] rpc_client/cli_pipe.c:rpc_api_pipe(843) rpc_api_pipe: got PDU len of 32 at offset 0 The segfault occurs because of the following code in dump_database : ===== result = rpccli_netlogon_sam_sync(pipe_hnd, mem_ctx, db_type, sync_context, &num_deltas, &hdr_deltas, &deltas); if (NT_STATUS_IS_ERR(result)) break; for (i = 0; i < num_deltas; i++) { ===== There is an error, num_deltas has an aberrant value but NT_STATUS_IS_ERR is false. Replacing NT_STATUS_IS_ERR with !NT_STATUS_IS_OK avoids the crash
I added some debug, the error code is 0x1c010002 which NT_STATUS_IS_ERR does not handle. BTW, with net rpc vampire I get the same error but it is correctly handled : [2006/11/22 15:53:20, 1] rpc_client/cli_pipe.c:cli_pipe_validate_current_pdu(625) cli_pipe_validate_current_pdu: RPC fault code DCERPC_FAULT_OP_RNG_ERROR received from remote machine cs3 pipe \NETLOGON fnum 0x75ad! [2006/11/22 15:53:20, 10] rpc_client/cli_pipe.c:rpc_api_pipe(843) rpc_api_pipe: got PDU len of 32 at offset 0 Failed to fetch domain database: NT code 0x1c010002 [2006/11/22 15:53:20, 1] utils/net_rpc.c:run_rpc_command(170) rpc command function failed! (NT code 0x1c010002)
Fixed with r20001, thanks! Volker