summaryrefslogtreecommitdiffstats
path: root/source3/lib
Commit message (Collapse)AuthorAgeFilesLines
* s3: use directory_create_or_exist_strict() to create corepathGregor Beck2013-12-111-16/+17
| | | | | | | | | This simplifies the code and even works in testenv where the chown call fails. Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3-lib: Fix %G substitution for domain users in smbdAndreas Schneider2013-12-101-1/+11
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10286 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org> Autobuild-User(master): Christian Ambach <ambi@samba.org> Autobuild-Date(master): Tue Dec 10 16:39:43 CET 2013 on sn-devel-104
* s3:lib/asys modify included headersChristian Ambach2013-12-101-4/+2
| | | | | | | use the headers from libreplace, not the system ones Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* CVE-2013-4408:s3:Ensure LookupRids() replies arrays are range checked.Jeremy Allison2013-12-092-0/+32
| | | | | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Karolin Seeger <kseeger@samba.org> Autobuild-Date(master): Mon Dec 9 09:00:41 CET 2013 on sn-devel-104
* CVE-2013-4408:s3:Ensure LookupNames replies arrays are range checked.Jeremy Allison2013-12-093-1/+145
| | | | | | | 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>
* CVE-2013-4408:s3:ctdb_conn: add some length verification to ctdb_packet_more()Stefan Metzmacher2013-12-091-0/+5
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* CVE-2013-4408:s3:util_tsock: add some overflow detection to ↵Stefan Metzmacher2013-12-091-0/+5
| | | | | | | | | tstream_read_packet_done() Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* idmap_cache: Use gencache_parseVolker Lendecke2013-12-051-32/+47
| | | | | | | | | | This avoids a few tallocs and brings down user CPU a bit more 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): Thu Dec 5 03:06:10 CET 2013 on sn-devel-104
* idmap_cache: Use an fstring instead of talloc_asprintfVolker Lendecke2013-12-051-12/+6
| | | | | | | | In a test doing one million uid2sid calls this brings down user CPU from 1.3 seconds to 0.9 seconds. And it saves a few code lines. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* messaging3: Do not go through messages.tdb for self-sendsVolker Lendecke2013-12-051-0/+54
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: Fix bug 10284Volker Lendecke2013-11-261-69/+31
| | | | | | | | | | | | | | | | | | If we msg_read_send on a nonempty channel, we create one tevent_immediate. If we directly receive another message and from within the msg_read_send's tevent_req callback we immediately do another msg_read_send, we end up with two tevent_immediate events for msg_channel_trigger with just one incoming message. Test to follow. This patch simplifies msg_channel.c by removing the explicit immediate events. Instead, it relies on the implicit immediate event available via tevent_req_defer_callback. For messages received from tdb with a msg_read_send req pending, we directly finish that request without putting the message on the queue. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10284 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-lib: Add grpname to talloc_sub_specified().Andreas Schneider2013-11-211-6/+25
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=2191 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* debug: remove unused sys_adminlogDavid Disseldorp2013-11-201-25/+0
| | | | | | | | | | printing.c was the last user of this syslog wrapper. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Nov 20 10:19:32 CET 2013 on sn-devel-104
* messaging: use local talloc ctx instead of talloc_tosDavid Disseldorp2013-11-201-4/+4
| | | | | | | | | messaging_tdb_send() allocates a stackframe and stores it in a local variable, subsequent allocations should use the variable instead of calling talloc_tos(). Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* smbd: Fix a talloc hierarchy problem in msg_channelVolker Lendecke2013-11-201-1/+1
| | | | | | | | | | | | | When tearing down a watch_send with an open tevent_immediate, we talloc_free the msg_channel while the tevent_immediate still references it. Don't make the tevent_immediate outlive the msg_channel. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10250 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Nov 20 00:13:51 CET 2013 on sn-devel-104
* netapi: Add support for info level 502 in NetShareAdd.Hans Leidekker2013-11-193-1/+58
| | | | | | | | Signed-off-by: Hans Leidekker <hans@meelstraat.net> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Nov 19 21:48:17 CET 2013 on sn-devel-104
* s3-lib: smbclient shows no error if deleting a directory with del failedJeremy Allison2013-11-141-0/+42
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10260 Move dir_check_ftype() to util.c Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* smbd: Fix CID 1035365 Buffer not null terminatedVolker Lendecke2013-11-111-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* smbd: Fix CID 1035366 Buffer not null terminatedVolker Lendecke2013-11-111-4/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* smbd: Use fstring in conn_tdb.cVolker Lendecke2013-11-111-2/+2
| | | | | | | It might be legacy, but as long as we have it, we can make use of it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* smbd: Use fstring in conn_tdb.hVolker Lendecke2013-11-111-3/+3
| | | | | | | It might be legacy, but as long as we have it, we can make use of it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* netapi: Fix CID 1127344 Uninitialized scalar variableVolker Lendecke2013-11-111-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* s3-smbd_shim: Add become_authenticated_pipe_user().Andreas Schneider2013-10-292-0/+20
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3: add cluster_probe_ok() in a new module util_cluster.Michael Adam2013-10-172-0/+66
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd/winbindd: Do an early check if ctdbd is functionalVolker Lendecke2013-10-171-0/+24
| | | | | | | | | This will avoid panic calls when smbd and winbind is started in cluster mode before ctdb is functional. It still logs something sane at debug level 0, but it does not panic and core anymore. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdbd_conn: Remove one call to cluster_fatalVolker Lendecke2013-10-171-1/+0
| | | | | | | | This is during startup of a ctdb connection, thus it is not as important as in other cases to immediately exit to free up resources Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdbd_conn: Remove one call to cluster_fatalVolker Lendecke2013-10-171-1/+2
| | | | | | | | This is during startup of a ctdb connection, thus it is not as important as in other cases to immediately exit to free up resources Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* ctdbd_conn: Lift the cluster_fatal call in get_cluster_vnnVolker Lendecke2013-10-171-1/+3
| | | | | | | We have to report a proper error when ctdbd is not around Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:lib/netapi: do not use rpc_pipe_np_smb_conn()Gregor Beck2013-10-171-1/+1
| | | | | | | Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* Add NetWkstaGetInfo.Hans Leidekker2013-10-168-1/+294
| | | | | | | | | | | Modified to include common.h entry for netapitest_wksta function by Kai Blin <kai@samba.org> Signed-off-by: Hans Leidekker <hans@meelstraat.net> Reviewed-by: Kai Blin <kai@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Oct 16 07:00:45 CEST 2013 on sn-devel-104
* build: get rid of vars=locals() in source3/lib/netapi/examples/wscript_buildMichael Adam2013-09-251-2/+1
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Sep 25 00:51:31 CEST 2013 on sn-devel-104
* libsmbconf:registry: add "state directory" to the list of forbidden parametersMichael Adam2013-09-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | At the time when the registry configuration was introduced, the registry database file was placed in the "lock directory". So the "lock directory" was added to the list of parameters that may not be changed in the registry configuration (because the next config reload would then load a different registry and drop all the original seetings). Later, "state directory" and "cache directory" were introduced, both defaulting to "lock directory". And the registry's location was changed to "state directory". It slipped my attention that the forbidden parameters for the should have been adapted at the time. So this patch adds "state directory" to the list. It keeps the lock directory, to catch the case where the state directory is not explicitly set, hence defaulting to the "lock directory". Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libsmbconf:registry: clarify the appearance of "includes" in forbidden_namesMichael Adam2013-09-241-1/+7
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libsmbconf:registry: reorganize the validity check and canonicalization of ↵Michael Adam2013-09-241-14/+19
| | | | | | | | | | | | | the input in "setparm" - first check that the name is an smbconf parameter - then check that the parameter is allowed in the registry config - then check that a global parameter is not to be set in a service section - then canonicalize the parameter and value name, thereby checking that the value has valid format Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libsmbconf:registry: publish smbconf_reg_parameter_is_valid()Michael Adam2013-09-242-1/+6
| | | | | | | So that this does not need to be duplicated.. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* libsmbconf:registry: rework smbconf_reg_parameter_forbidden(), renaming it.Michael Adam2013-09-241-17/+17
| | | | | | | | | | | | The logic is inverted, the lp_parameter_is_invalid call of smbconf_reg_valname_valid() is included, and the function is renamed to smbconf_reg_parameter_is_valid(). Use the new function everywhere in smbconf registry backend. And remove corresponding reverse function smbconf_reg_valname_valid(). Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* afs: implement afs_syscall() always, returning -1 if FAKE_KASERVER is not ↵Michael Adam2013-09-231-0/+6
| | | | | | | defined. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* afs: format afs_syscall() properlyMichael Adam2013-09-231-5/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3-rpc: use table->name directly in DEBUG contexts.Günther Deschner2013-09-201-1/+1
| | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* gencache: Avoid a duplicate call to string_term_tdb_dataVolker Lendecke2013-09-091-4/+2
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Sep 9 17:02:28 CEST 2013 on sn-devel-104
* smbd: Use talloc_pooled_object in cp_smb_filenameVolker Lendecke2013-09-081-16/+32
| | | | | | | Requires new talloc Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Apply some const to pull_file_id_24Volker Lendecke2013-09-062-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* lib: Use "mem_ctx" arg in gencache_getVolker Lendecke2013-09-052-17/+21
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Sep 5 20:09:21 CEST 2013 on sn-devel-104
* lib: Add a "mem_ctx" arg to gencache_get (unused so far)Volker Lendecke2013-09-053-6/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* gencache: Fix SAFE_FREE vs data_blob_freeVolker Lendecke2013-09-051-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Add "mem_ctx" to gencache_get_data_blobVolker Lendecke2013-09-051-4/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap_ctdb: Treat empty records as non-existingVolker Lendecke2013-08-282-0/+18
| | | | | | | | | This is a patch implementing the workaround Christian mentioned in https://bugzilla.samba.org/show_bug.cgi?id=10008#c5 Bug: https://bugzilla.samba.org/show_bug.cgi?id=10008 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
* Fix bug #10063 - source3/lib/util.c:1493 leaking memory w/ pam_winbind.so / ↵Jeremy Allison2013-08-241-2/+4
| | | | | | | | | | | | winbind Don't use talloc_tos() in something that can be linked to in pam_winbindd.so Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Simo Sorce <idra@samba.org> Autobuild-Date(master): Sat Aug 24 02:28:28 CEST 2013 on sn-devel-104
* libctdb: Avoid an explicit memsetVolker Lendecke2013-08-161-2/+1
| | | | | | | | | | Give the compiler a chance to use better code. Saves a few bytes of text. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Aug 16 01:51:55 CEST 2013 on sn-devel-104
* s3:lib: Factor read_ea_list_entry() and read_nttrans_ea_list() out so they ↵Jeremy Allison2013-08-152-0/+162
| | | | | | | can be used by the SMB2 client code. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>