summaryrefslogtreecommitdiff
path: root/source3
Commit message (Collapse)AuthorAgeFilesLines
* s3-printing: precreate DriverStore directories.Günther Deschner2017-07-261-0/+22
| | | | | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Jul 26 05:34:15 CEST 2017 on sn-devel-144
* s3-printing: add spoolss_get_short_filesys_environment function.Günther Deschner2017-07-262-0/+12
| | | | | | | | | | Note this is different from "get_short_archi" and reflects what windows uses internally. Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-printing: pre-create color and PCC directories under print$.Günther Deschner2017-07-261-0/+27
| | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* libsmb: Enable "cli_notify" for SMB2+Volker Lendecke2017-07-261-1/+9
| | | | | | | | 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 Jul 26 01:33:25 CEST 2017 on sn-devel-144
* libsmb: Add cli_smb2_notifyVolker Lendecke2017-07-252-0/+97
| | | | | | | | | | | | | | | | | | We have to do the parsing manually. Looking at librpc/gen_ndr/ndr_notify.c we have the following code snippet: size_FileName1_0 = strlen_m(r->FileName1); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->FileName1, size_FileName1_0, sizeof(uint16_t), CH_UTF16)); which means that we take strlen_m(r->FileName1) before we pull it off the wire. Not sure how to fix this, but that is clearly broken pidl output. Once that is fixed, we can convert this to ndr_pull_struct. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* messaging: Remove "struct messaging_backend"Volker Lendecke2017-07-251-9/+0
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Jul 25 21:35:49 CEST 2017 on sn-devel-144
* messaging: Remove messages_ctdbd.cVolker Lendecke2017-07-253-439/+0
| | | | | | | Replaced by messages_ctdb.[ch] Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* ctdb_conn: Use messaging_ctdb_connectionVolker Lendecke2017-07-259-25/+24
| | | | | | | Replace messaging_ctdbd_connection Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* messaging: Use messaging_ctdb_ref()Volker Lendecke2017-07-251-50/+33
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* messages_ctdb: Add messaging_ctdb_connectionVolker Lendecke2017-07-252-0/+10
| | | | | | | | | | | | | This will be the replacement for messaging_ctdbd_connection(). This does not default to initializing messaging but panics. We just don't have correct default arguments for messaging_init. Implicit multiple messaging and event contexts is a bug also. It *might* be that some tools fail due to this, but this needs fixing in different ways. See the previous commit for smbpasswd. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbpasswd: Initialize messaging for messaging_ctdb_connVolker Lendecke2017-07-251-0/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dbwrap_ctdb: Use messaging_ctdbd_connectionVolker Lendecke2017-07-255-28/+24
| | | | | | | | | | | With messages_ctdb, the global ctdb connection will change after fork. Don't store the wrong parent connection across a fork. The alternative would be to do a reinit on all dbwrap_ctdb databases, but that seems overkill given that we only have one "standard" ctdb connection anyway. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* messaging: Add messages_ctdb_refVolker Lendecke2017-07-254-0/+194
| | | | | | | Modeled after messages_dgm_ref Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* messaging: Add messaging_ctdb_init/destroyVolker Lendecke2017-07-254-0/+316
| | | | | | | | | | | | | This models connecting to ctdb after the dgm code. The main point is that we should never open more than more ctdb socket for messaging. With more than one socket, we might end up with our pid registered with ctdb on more than one socket. This could lead to memory overconsumption in ctdb. ctdbd will eventually throw away messages, but they will take up space unnecessarily. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dbwrap: Avoid dbwrap_merge_dbufs in db_ctdb_storevVolker Lendecke2017-07-251-12/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* messages_ctdb: Handle async msgs for nested event contextsVolker Lendecke2017-07-254-55/+62
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* messaging: Add messaging_ctdbd_register_tevent_contextVolker Lendecke2017-07-254-16/+135
| | | | | | | We need to listen for the ctdb socket in nested event contexts Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* ctdbd_conn: Pass "ev" through ctdbd_socket_readableVolker Lendecke2017-07-253-4/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* ctdbd_conn: Pass "ev" through ctdb_handle_messageVolker Lendecke2017-07-251-3/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* ctdbd_conn: Pass "ev" through ctdbd_msg_call_backVolker Lendecke2017-07-251-4/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* ctdbd_conn: Pass "ev" through ctdb connection callbacksVolker Lendecke2017-07-257-11/+24
| | | | | | | | | This prepares the same logic we've implemented in messages_dgm for clustering that is used in 6d3c064f1a5: We need to reply for messages from ctdb in nested event contexts properly. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* messaging: Broadcast messages to all event contextsVolker Lendecke2017-07-251-38/+127
| | | | | | | | | | We must give all event contexts that might be interested the chance to pick up the message. If we send a message to ourselves via messaging_send_iov_from, nested event contexts need to get a chance to see the message. Before this patch only the main event context in msg_ctx got it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* messaging: Keep an array of event contexts registeredVolker Lendecke2017-07-251-0/+96
| | | | | | | | | | This is done with an explicit reference-counting and without talloc destructors. The code is isolated enough for now that explicit refcount management seems simpler. This might change in the future, but for now keep it simple. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* messaging: Factor out messaging_dispatch_waitersVolker Lendecke2017-07-251-23/+33
| | | | | | | | No real code change: This makes dispatching to non-classic receives available for other callers. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* g_lock: remove unused functions g_lock_get() and g_lock_get_talloc()Volker Lendecke2017-07-251-76/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* g_lock: Use parse_record in g_lock_dumpVolker Lendecke2017-07-251-24/+64
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* g_lock: remove unused functions g_lock_put() and g_lock_record_store()Volker Lendecke2017-07-251-80/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* g_lock: Use dbwrap_do_locked in g_lock_write_dataVolker Lendecke2017-07-251-34/+62
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* torture3: Add verification for g_lock_retryVolker Lendecke2017-07-251-0/+52
| | | | | | | | During development I had a bug that would have been found early by this Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* g_lock: Use dbwrap_do_locked in g_lock_lock_retryVolker Lendecke2017-07-251-28/+25
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* g_lock: Use dbwrap_do_locked for g_lock_lockVolker Lendecke2017-07-251-21/+43
| | | | | | | Don't talloc the record Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* g_lock: Avoid talloc in g_lock_trylockVolker Lendecke2017-07-251-39/+28
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* g_lock: Initialize variablesVolker Lendecke2017-07-251-2/+2
| | | | | | | gcc -O3 complains, but I think this is a false positive Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* g_lock: Implement g_lock_unlock without tallocVolker Lendecke2017-07-251-45/+50
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* g_lock: add "struct g_lock" without tallocVolker Lendecke2017-07-251-0/+89
| | | | | | | Enable handing the g_lock.tdb content without having to talloc Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* g_lock: simplify g_lock_trylockVolker Lendecke2017-07-251-15/+18
| | | | | | | The now mandatory talloc_realloc_array will go away soon Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* g_lock: Walk locks only once in g_lock_trylockVolker Lendecke2017-07-251-10/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dbwrap_watch: Implement do_lockedVolker Lendecke2017-07-252-17/+182
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dbwrap_watch: Introduce dbwrap_watch_recVolker Lendecke2017-07-251-195/+130
| | | | | | | | | | The idea is to leave the "watchers" array unparsed until it's needed. This avoids a few talloc calls and unnecessary parsing. Also, it deletes quite a few lines of code and .text bytes. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* torture3: Test dbwrap_do_lockedVolker Lendecke2017-07-255-0/+136
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* dbwrap: Convert backend store to storevVolker Lendecke2017-07-252-16/+52
| | | | | | | | | | Convert all implementors of dbwrap_store to a storev-style call by using the dbwrap_merge_dbufs call For dbwrap_tdb, this matches tdb_storev. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* torture: Add local-g-lock-ping-pongVolker Lendecke2017-07-253-4/+98
| | | | | | | This is similar to the ctdb ping_pong test. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: torture: Add a test for cli_setpathinfo_basic() to smbtorture3.Jeremy Allison2017-07-251-0/+137
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12913 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: libsmb: Implement cli_smb2_setatr() by calling cli_smb2_setpathinfo().Jeremy Allison2017-07-251-52/+5
| | | | | | | | | | | This removes duplicate code paths and ensures we have only one function calling the underlying smb2cli_set_info() for setting info levels by path. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12913 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: libsmb: Add cli_smb2_setpathinfo(), to be called by cli_setpathinfo_basic().Jeremy Allison2017-07-253-0/+89
| | | | | | | | | | Fix to prevent libsmbclient from accidently making SMB1 calls inside an SMB2 connection. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12913 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: libsmbclient: Fix cli_setpathinfo_basic() to treat mode == -1 as no change.Jeremy Allison2017-07-251-2/+11
| | | | | | | | | | This is only called from SMBC_setatr(), so bring it into line with the specification for that function. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12913 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3:tests: Add tests for smbspool_krb5_wrapperAndreas Schneider2017-07-251-0/+44
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Jul 25 13:17:13 CEST 2017 on sn-devel-144
* s3:client: Use KRB5CCNAME in smbspool_krb5_wrapper if setAndreas Schneider2017-07-251-0/+8
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:tests: Add test for smbspoolAndreas Schneider2017-07-252-0/+112
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3:client: Only use kerberos if credential cache exists in smbspoolAndreas Schneider2017-07-251-6/+58
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>