summaryrefslogtreecommitdiff
path: root/source3/rpc_server
AgeCommit message (Collapse)AuthorFilesLines
2015-02-21s3-netlogon: Make sure we do not deference a NULL pointer.Andreas Schneider1-1/+6
This is an additional patch for CVE-2015-0240. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11077#c32 Pair-Programmed-With: Michael Adam <obnox@samba.org> Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2015-02-21CVE-2015-0240: s3: netlogon: Ensure we don't call talloc_free on an ↵Jeremy Allison1-1/+5
uninitialized pointer. Bug: https://bugzilla.samba.org/show_bug.cgi?id=11077 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-11-24samba: pass down size_t instead of int to add_string_to_array().Günther Deschner3-3/+4
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Mon Nov 17 19:53:22 CET 2014 on sn-devel-104 The last 3 patches address BUG: https://bugzilla.samba.org/show_bug.cgi?id=10942 cleanup add_string_to_array and usage
2014-11-17spoolss: remove unused fill_job_info3()David Disseldorp1-21/+0
This logic has been moved into the previous EnumJobs(level=3) caller. The info3 structure only contains two fields that are used, so it doesn't make sense to have a separate helper for it. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit d772b98283f289917a6a8370808d4d0912899384)
2014-11-17spoolss: fix jobid in level 3 EnumJobs responseDavid Disseldorp1-23/+33
Until now, these responses have incorrectly carried the printing backend job identifier (sysjob), rather than the one allocated and returned by Samba on job submission. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10905 Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 5e7ab3d2f4f7950099561eb22d6a9a1536297442)
2014-11-17spoolss: fix jobid in level 2 GetJob and EnumJobs responsesDavid Disseldorp1-14/+36
Until now, these responses have incorrectly carried the printing backend job identifier (sysjob), rather than the one allocated and returned by Samba on job submission. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10905 Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 45abaf81c67b62bab571df208931241afa660802)
2014-11-17spoolss: fix jobid in level 1 GetJob and EnumJobs responsesDavid Disseldorp1-12/+36
Until now, these responses have incorrectly carried the printing backend job identifier (sysjob), rather than the one allocated and returned by Samba on job submission. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10905 Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 4d7f5d2af6ef6960dccaccf89c6e88947e2591bf)
2014-11-17spoolss: fix GetJob jobid lookupsDavid Disseldorp1-5/+32
Clients issue GetJob requests using the jobid assigned by the spoolss server. The corresponding printing backend (sysjob) identifier needs to be resolved to locate the correct print queue entry. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10905 Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 3a28ae56977235d3c9e3abcd1f24b220e536c50d)
2014-11-09spoolss: fix handling of bad EnumJobs levelsDavid Disseldorp1-1/+6
Currently Samba is inconsistent when returning WERR_UNKNOWN_LEVEL errors for spoolss EnumJobs requests - if no print jobs are present, then WERR_OK will be returned, regardless of whether the EnumJobs level is supported or not. This change fixes this behaviour, by catching invalid or unsupported levels prior to the no-jobs response fast-path. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10898 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Oct 28 03:05:35 CET 2014 on sn-devel-104 (cherry picked from commit d4f233a746d89e13aae78008b499c71b695ff882)
2014-10-19s3: lib: Signal handling - ensure smbrun and change password code save and ↵Jeremy Allison1-4/+5
restore existing SIGCHLD handlers. Bug #10831 - SIGCLD Signal handler not correctly reinstalled on old library code use - smbrun etc. https://bugzilla.samba.org/show_bug.cgi?id=10831 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
2014-10-09s3: Move init_lsa_ref_domain_list to libChristof Schmitt2-48/+2
This will be used in the next patch in winbind. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 16594e7fc0a46249a48d0d0635de0c1050ecd340)
2014-09-01printing: reload printer shares on OpenPrinterDavid Disseldorp1-1/+11
The printer share inventory should be reloaded on open _and_ enumeration, as there are some clients, such as cupsaddsmb, that do not perform an enumeration prior to access. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Aug 8 16:33:50 CEST 2014 on sn-devel-104 (cherry picked from commit 1ad71f79eb473822d36d9629cf52c2fca4c53752)
2014-09-01server: remove duplicate snum_is_shared_printer()David Disseldorp1-9/+0
Only keep a single definition in server_reload.c Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit 2685df1177ffd39b1af34eb116bd7b24d4b12974)
2014-09-01printing: only reload printer shares on client enumDavid Disseldorp2-1/+11
Currently, automatic printer share updates are handled in the following way: - Background printer process (BPP) forked on startup - Parent smbd and per-client children await MSG_PRINTER_PCAP messages - BPP periodically polls the printing backend for printcap data - printcap data written to printer_list.tdb - MSG_PRINTER_PCAP sent to all smbd processes following update - smbd processes all read the latest printer_list.tdb data, and update their share listings This procedure is not scalable, as all smbd processes hit printer_list.tdb in parallel, resulting in a large spike in CPU usage. This change sees smbd processes only update their printer share lists only when a client asks for this information, e.g. via NetShareEnum or EnumPrinters. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10652 Suggested-by: Volker Lendecke <vl@samba.org> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit 4f4501ac1f35ab15f25d207c0d33e7c4d1abdf38)
2014-04-01s3-rpc_server: Fix handling of fragmented rpc requests.Andreas Schneider1-12/+7
We need to call pipe_init_outgoing_data() as the first thing in process_complete_pdu(). Otherwise the caller may use uninitialized memory and tries to write a response into the socket. The problem happens only if a real socket is used, which means in all cases for master and only with external rpc daemons in v4-0 and v4-1. The problem looks like this in the logs. [2014/03/20 14:49:35.531663, 10, pid=7309, effective(0, 0), real(0, 0), class=rpc_srv] ../source3/rpc_server/srv_pipe.c:1627(process_complete_pdu) Processing packet type 0 [2014/03/20 14:49:35.531695, 10, pid=7309, effective(0, 0), real(0, 0), class=rpc_srv] ../source3/rpc_server/srv_pipe.c:1472(dcesrv_auth_request) Checking request auth. [2014/03/20 14:49:35.531738, 10, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:521(named_pipe_packet_process) Sending 1 fragments in a total of 0 bytes [2014/03/20 14:49:35.531769, 10, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:526(named_pipe_packet_process) Sending PDU number: 0, PDU Length: 4294967228 [2014/03/20 14:49:35.531801, 2, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:565(named_pipe_packet_done) Writev failed! [2014/03/20 14:49:35.531845, 2, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:595(named_pipe_packet_done) Fatal error(Message too long). Terminating client(127.0.0.1) connection! BUG: https://bugzilla.samba.org/show_bug.cgi?id=10481 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Guenther Deschner <gd@samba.org Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Thu Mar 20 18:30:17 CET 2014 on sn-devel-104 (cherry picked from commit 5277fc4d0393ffe2e415ad26610b36d2986c62d7)
2014-04-01s3:rpc_server: minor refactoring of process_request_pdu()Gregor Beck1-15/+10
Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> (cherry picked from commit b5f30205931a4b9d0b3b257d5855869e606f8b63)
2014-03-11CVE-2013-4496:samr: Remove ChangePasswordUserAndrew Bartlett1-161/+8
This old password change mechanism does not provide the plaintext to validate against password complexity, and it is not used by modern clients. The missing features in both implementations (by design) were: - the password complexity checks (no plaintext) - the minimum password length (no plaintext) Additionally, the source3 version did not check: - the minimum password age - pdb_get_pass_can_change() which checks the security descriptor for the 'user cannot change password' setting. - the password history - the output of the 'passwd program' if 'unix passwd sync = yes'. Finally, the mechanism was almost useless, as it was incorrectly only made available to administrative users with permission to reset the password. It is removed here so that it is not mistakenly reinstated in the future. Andrew Bartlett Bug: https://bugzilla.samba.org/show_bug.cgi?id=10245 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-03-11CVE-2013-4496:s3-samr: Block attempts to crack passwords via repeated ↵Andrew Bartlett2-16/+129
password changes Bug: https://bugzilla.samba.org/show_bug.cgi?id=10245 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2014-03-10s3: printing: Fix problem with server taking too long to respond to a ↵Jeremy Allison1-0/+1
MSG_PRINTER_DRVUPGRADE message. Receiving a MSG_PRINTER_DRVUPGRADE causes smbd to iterate over all printers looking for ones that uses the driver. This is a very expensive operation requiring a read of all registry printer parameters. On a system with a large number of printers, this causes the clients to timeout (smbd can take longer than 60 seconds to respond). This patch fixes the problem by forwarding the MSG_PRINTER_DRVUPGRADE to the background lpq queue updater process and allowing it to take care of the updating of the changeid in the registry, allowing the smbd connected to the client to return to processing requests immediately. https://bugzilla.samba.org/show_bug.cgi?id=9942 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Feb 18 17:48:30 CET 2014 on sn-devel-104 (cherry picked from commit cd655715b8ee0a4e681d67b3996f71017b941401)
2013-12-09Merge tag 'samba-4.1.3' into v4-1-testKarolin Seeger1-1/+1
samba: tag release samba-4.1.3
2013-12-05CVE-2013-4408:s3:Ensure LookupNames replies arrays are range checked.Jeremy Allison1-1/+1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
2013-11-26spoolss: return the spoolss job ID in notificationsDavid Disseldorp1-6/+26
Print job notifications currently carry the system print job identifier from the queue structure. Instead, the spoolss job identifier should be resolved and returned. Print clients can use notification job-ids in subsequent spoolss SetJob requests. Returning an incorrect identifier can result in the failure of such requests, e.g. spoolss_SetJob(SPOOLSS_JOB_CONTROL_DELETE). BUG: https://bugzilla.samba.org/show_bug.cgi?id=10271 Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> (cherry picked from commit 24d025f85d6eea272bff5e1040d4fd2ba0e6b8f3)
2013-11-22spoolss: accept XPS_PASS datatype used by Windows 8Arvid Requate1-1/+7
The new v4 driver model used in Windows 8 declares print jobs intended to bypass the XPS processing layer by setting datatype to "XPS_PASS" instead of "RAW". BUG: https://bugzilla.samba.org/show_bug.cgi?id=10267 Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit b2815b4c8c3e436a79fb7f07be285a417fd6e8cb) Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Fri Nov 22 13:44:05 CET 2013 on sn-devel-104
2013-09-12Raise the level of a debug.Korobkin1-1/+1
Bug #10118 - Samba is chatty about being unable to open a printer Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Sep 11 03:10:08 CEST 2013 on sn-devel-104 (cherry picked from commit d809cf653b624a9fde48de3b0c2ab58aca705c50) Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Thu Sep 12 11:36:59 CEST 2013 on sn-devel-104
2013-06-11winreg3: Fix a const warningVolker Lendecke1-1/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-06-03Fix bug 9900: is_printer_published GUID retrievalDavid Disseldorp1-7/+33
Samba currently always responds to GetPrinter(level = 7) requests with DSPRINT_UNPUBLISH, regardless of the AD publish status tracked via the PRINTER_ATTRIBUTE_PUBLISHED flag. This is due to erroneous "objectGUID" unmarshalling in is_printer_published(). This change splits "objectGUID" retrieval into a separate function, and adds a pull_reg_sz() call to correctly unmarshall the GUID. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2013-05-20spoolss: add idl for spoolss_RpcSendRecvBidiData.Günther Deschner1-3/+3
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-16s3-rpc_server: Ensure we are root when starting and usiing gensecAndrew Bartlett1-6/+32
This fixes bug 9465. Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-05-14s3:rpc_server/srvsvc check access before doing workShekhar Amlekar1-10/+10
Before doing the (potentially) costly enumerations, check if the user has necessary privileges first Signed-off-by: Shekhar Amlekar <samlekar@in.ibm.com> Reviewed-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Tue May 14 16:22:24 CEST 2013 on sn-devel-104
2013-04-19s3:rpc_server increase a debug levelChristian Ambach1-8/+8
those messages are not worth level 0 or 1 and potentially clutter the system logs Reviewed-by: Volker Lendecke <vl@samba.org> Signed-off-by: Christian Ambach <ambi@samba.org>
2013-04-09s3-netlogon: enumerate UPN suffixes from PASSDB when availableAlexander Bokovoy1-12/+94
Optionally append list of UPN suffixes if PDB module returns non-empty one. Refactor fill_forest_trust_array() in source3 to allow reuse of the code between _netr_DsRGetForestTrustInformation() and _netr_GetForestTrustInformation() Implement a special case of _netr_DsRGetForestTrustInformation in smbd when trusted_domain_name is NULL (covered by test_DsrEnumerateDomainTrusts() in rpc.netlogon torture tests, see comment in source4/torture/rpc/netlogon.c). Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Apr 9 22:19:34 CEST 2013 on sn-devel-104
2013-04-02BUG 9758: Don't leak the epm_Map policy handle.Andreas Schneider1-0/+4
Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Tue Apr 2 17:16:56 CEST 2013 on sn-devel-104
2013-04-02epm: Increase debug level for already registered endpoints.Andreas Schneider1-1/+1
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-03-18wkssvc: Fix bug 9727, NULL pointer dereferenceVolker Lendecke1-2/+6
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Mon Mar 18 11:39:27 CET 2013 on sn-devel-104
2013-03-15s3-lsad: Cast getpid() result to unsigned int for GNU/Solaris buildAndrew Bartlett1-1/+1
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-15s3-epmd: Cast getpid() result to unsigned int for GNU/Solaris buildAndrew Bartlett1-1/+1
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-05s3-daemons: Set the comment field of the daemons.Andreas Schneider2-0/+10
PR_SET_NAME sets the comm field of a process. This way we can give processes a name and they are easier to identify. $ ps afx -o pid,comm 29447 smbd 29452 \_ epmd 29453 \_ lsasd-master 29455 | \_ lsasd-child 29457 | \_ lsasd-child 29459 | \_ lsasd-child 29461 | \_ lsasd-child 29463 | \_ lsasd-child 29454 \_ spoolssd-master 29456 \_ lpqd 29458 \_ spoolssd-child 29460 \_ spoolssd-child 29462 \_ spoolssd-child 29465 \_ spoolssd-child 29466 \_ spoolssd-child 29467 \_ spoolssd-child 29468 \_ spoolssd-child 29469 \_ spoolssd-child 29470 \_ spoolssd-child 29471 \_ spoolssd-child Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-02-22s3-rpc_server: Make sure that fd is really closed on error.Andreas Schneider1-0/+6
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22s3-lsasd: Don't leak file descriptors.Andreas Schneider1-11/+18
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22s3-spoolss: Don't leak memory.Andreas Schneider1-1/+3
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-19s3:rpc_server: s/event_add_timed/tevent_add_timerStefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19s3:rpc_server: s/struct timed_event/struct tevent_timerStefan Metzmacher1-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19s3:rpc_server: s/struct event_context/struct tevent_contextStefan Metzmacher3-6/+6
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-18srv_epmapper.c: Fix typo.Karolin Seeger1-5/+5
priviledge -> privilege Signed-off-by: Karolin Seeger <kseeger@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Mon Feb 18 13:57:40 CET 2013 on sn-devel-104
2013-02-18srv_netlog_nt.c: Fix typo in comment.Karolin Seeger1-1/+1
redundent -> redundant Signed-off-by: Karolin Seeger <kseeger@samba.org>
2013-02-07s3-rpc_server: Fix password encoding in _netr_ServerGetTrustInfo().Sumit Bose1-14/+8
Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2013-02-07s3-rpc_server: Dont wipe out ref pointers in _netr_ServerGetTrustInfo().Günther Deschner1-13/+4
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-24s3-spoolss: Make it easier to manipulate the returned OSVersion at runtime.Günther Deschner1-3/+11
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-24spoolss: make spoolss deal with ndr64 StartDocPrinter by using proper ↵Günther Deschner1-2/+2
container object. Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2013-01-21BUG 9474: Downgrade v4 printer driver requests to v3.Günther Deschner1-1/+8
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Jan 21 16:11:02 CET 2013 on sn-devel-104