summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-09-08torture-dns: Add test for dlz_bind9 lookupsAndrew Bartlett1-0/+224
Change-Id: I3b9d1b56e3aa873fb8540b98e196b713b82332ca Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 2189470c2f55afe29e9e8dad1d2659a7eb2d06f9)
2014-09-08s4:torture:dlz_bind9: fix spnego testsStefan Metzmacher1-2/+12
The dlz_bind9 module uses the special dns-${NETBIOSNAME} account, and this is only available under the dns/hostname.domain SPN, not host/hostname. Also the dlz_ssumatch() function returns isc_boolean_t instead of isc_result_t. As ISC_R_SUCCESS and ISC_FALSE have the same value we didn't notice this problem. Change-Id: I48539c3f48f5dde9eaa2fff6da0f3be2f9f66311 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 76943bf0ac259fb8855bd123fe4bc85a103ba418)
2014-09-08s4:dlz_bind9: do an early talloc_free(el_ctx) in dlz_allnodes()Stefan Metzmacher1-0/+2
We don't have to keep everything arround while walking the whole zone. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 5d397c8198bcd2cdccc3deda57377d4696e6abd1)
2014-09-08s4:dlz_bind9: avoid some compiler warningsStefan Metzmacher3-7/+8
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit fbebe7e756e4ccd0684e94e9b1e787f98f399ccc)
2014-09-08s4:dns_server: handle tombstones in handle_one_update()Stefan Metzmacher1-16/+25
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 491715399ff7e1ab788fec5e254581dc312e2cef)
2014-09-08s4:dns_server: add DNS_TYPE_TOMBSTONE support to dns_common_replace()Stefan Metzmacher1-4/+77
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit bb3ca930cc57964487bd23a74f4caabd1616a8bf)
2014-09-08s4:dns_server: make sure dns_common_lookup() doesn't return tombstonesStefan Metzmacher3-6/+53
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit a0a81ab01cb1d509b04f9af25177c8e0941b43aa)
2014-09-08s4:dns_server: use .wType = DNS_TYPE_TOMBSTONE instead of ZERO_STRUCT()Stefan Metzmacher1-5/+15
The result is the same, but it is clearer. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 3ff025a02cca3ff209668edd419d0e440e9865c6)
2014-09-08s4:dns_server: split out dns_common_replace()Stefan Metzmacher4-68/+90
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 0689e795e073008d2ad539c0ef5ddbdc6d9efdac)
2014-09-08s4:dns_server: remove const from dns_replace_records()Stefan Metzmacher2-2/+2
All callers are find we the record array gets modified. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 7e7df78bd7ae5575da7443b45c0e2e4167eebde2)
2014-09-08s4:dns_server: split out dns_common_extract() and dns_common_lookup()Stefan Metzmacher3-44/+92
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 342a087349f8a10833338a3fa49fbd4d4d29f3e5)
2014-09-08s4:dns_server: split out a private 'dnsserver_common' libraryStefan Metzmacher5-36/+105
This will contain common code for the internal dns server, the dlz_bind9 module and the rpc dns management server. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 99d5a5ead4f33723c25e8716a79d34b53822521e)
2014-09-08s4:dns_server: map LDB_ERR_NO_SUCH_OBJECT to WERR_DNS_ERROR_NAME_DOES_NOT_EXISTStefan Metzmacher2-14/+24
This is the correct fix for commit 8b24c43b382740106474e26dec59e1419ba77306 and Bug: https://bugzilla.samba.org/show_bug.cgi?id=9559 With this change we have a consistent behavior between internal server and the bind dlz module. We keep a dangling LDAP object without dnsRecord attribute arround forever. This will be fixed in the following commits. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit d0f424a23dc915d9fce625438d2bd63519757cba)
2014-09-08s4:dns_server: handle WERR_DNS_ERROR_NAME_DOES_NOT_EXIST in werr_to_dns_err()Stefan Metzmacher1-0/+2
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10749 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit deb21a9afe77591743fda522355a5a9eb08fb27b)
2014-09-08provision: Correctly provision the SOA record minimum TTLKai Blin2-0/+2
This fixes bug #10466 Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Guenter Kukkukk <kukks@samba.org> Autobuild-User(master): Kai Blin <kai@samba.org> Autobuild-Date(master): Wed May 21 10:55:00 CEST 2014 on sn-devel-104 (cherry picked from commit 634f116fbb89d723a627f4501b4cd89342cecb8e)
2014-09-08s4-rpc: dnsserver: return DNS_RANK_NS_GLUE recors when explicitly asked forStefan Metzmacher1-0/+9
NS records should be included in the query for sub-domains. NS records got dropped when the rank for NS records was correctly set to NS_GLUE from ZONE in commit 2036cbd9249c84d9b46370f0e8cd6a0264c737ba. samba-tool dns query 172.31.9.161 s4xdom.base @ ALL => Name=glue, Records=0, Children=0 samba-tool dns query 172.31.9.161 s4xdom.base glue ALL => Name=, Records=1, Children=0 NS: glue.dns.private. (flags=40000082, serial=21, ttl=900) Bug: https://bugzilla.samba.org/show_bug.cgi?id=10751 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Thu Sep 4 14:37:51 CEST 2014 on sn-devel-104 (cherry picked from commit 0b4a3b76111411e8969932a3da4ffab989e0da4c)
2014-09-08s4-rpc: dnsserver: Do not return NS_GLUE records with VIEW_GLUE_DATA filterAmitay Isaacs1-1/+1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10751 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Aug 21 11:36:55 CEST 2014 on sn-devel-104 (cherry picked from commit c9169a5e987864473108d041513f1781740401ac)
2014-09-08s4-rpc: dnsserver: Correctly set rank for glue NS recordsAmitay Isaacs1-3/+6
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10751 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 2036cbd9249c84d9b46370f0e8cd6a0264c737ba)
2014-09-08s4:setup/dns_update_list: make use of the new substitution variablesStefan Metzmacher1-36/+46
This let us register the same names as Windows Servers. We only exception are the NS records. In future we could add them by using something like this: samba-tool dns add ${HOSTNAME} ${DNSDOMAIN} @ NS ${HOSTNAME} samba-tool dns add ${HOSTNAME} _msdcs.${DNSFOREST} @ NS ${HOSTNAME} samba-tool dns add ${HOSTNAME} ${DNSFOREST} _msdcs NS ${HOSTNAME} Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Aug 26 11:38:54 CEST 2014 on sn-devel-104 (cherry picked from commit 4383ec5b83d12bd19749582217f082cbaa31a128)
2014-09-08s4:samba_dnsupdate: provide more substitution variables e.g. IF_RODCStefan Metzmacher1-0/+57
This will make the dns_update_list more flexible. Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit f1544e8d1de995aa304d63352d313ace8fea6ca5)
2014-09-08s4:samba_dnsupdate: don't try to be smart when verifying NS recordsStefan Metzmacher1-19/+0
We can't rely on the DNS delegation to be correct in the parent domain. What we really want is to check if we already have registered ourself as a NS record in our own domain. Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit b13974048b74c60028d8387eb7fe4fc7734f0a91)
2014-09-08s4:samba_dnsupdate: cache the already registered recordsStefan Metzmacher3-17/+115
This way we can delete records which are not used anymore. E.g. if the ip address changed. Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 25ec8e8656f66fe51a0d48718cdcfd8b209f6ca0)
2014-09-08s4:samba_dnsupdate: fix dnsobj.__str__()Stefan Metzmacher1-5/+5
We should not implicitly use the global variable 'd'. Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 6e853708def98545eeb6913b8a2dd59d439323e6)
2014-09-08s4:samba_dnsupdate: don't lower case the registered namesStefan Metzmacher1-5/+5
This matches Windows... Bug: https://bugzilla.samba.org/show_bug.cgi?id=9831 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit c5088f338a38850674399ec8fec9f8f146b5880f)
2014-09-08python/join: use lowercase for the dnshostname.Stefan Metzmacher1-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 5533d9c3db31ac86769288527ec20ad4e57f703c)
2014-09-08selftest/Samba3: also bind to ipv6Stefan Metzmacher1-3/+10
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (similar to commit a9545f3de7aaa0346735191953f78242017bd346)
2014-09-08selftest/Samba4: also bind to ipv6Stefan Metzmacher1-1/+18
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (similar to commit 5d4b36d1fec981e850d869edd2c98a6541b37114)
2014-09-08selftest: export _IPV6 environment variablesStefan Metzmacher2-0/+7
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 0e7abb398dd826c082bbddb333b9faac361be064)
2014-09-08libcli/dns: ignore NS entries in dns_hosts_file.c at a higher log level for nowStefan Metzmacher1-0/+12
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 3fcc4a545e936c2c0cf3f9f9a19646e1512f74d2)
2014-09-08libcli/dns: add AAAA support to dns_hosts_file.cStefan Metzmacher1-7/+16
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 7f18a3b58e7146e421653b85f509bb8503bd7402)
2014-09-07Updated Italian translation. Thanks Luca Monducci. Closes: #760743Jelmer Vernooij2-136/+34
Change-Id: I6cc875a61b6766a620331aeef60ea0f3d61007a3
2014-09-01s3: winbindd: On new client connect, prune idle or hung connections older ↵Jeremy Allison1-0/+36
than "winbind request timeout" Bug 3204 winbindd: Exceeding 200 client connections, no idle connection found https://bugzilla.samba.org/show_bug.cgi?id=3204 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jul 29 23:31:14 CEST 2014 on sn-devel-104 (cherry picked from commit f9588675ea3cb2f1fabd07a4ea8b2138d65aee83) Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Mon Sep 1 23:46:50 CEST 2014 on sn-devel-104
2014-09-01s3: winbindd: Add new parameter "winbind request timeout" set to 60 seconds ↵Jeremy Allison5-0/+28
with man page. "This parameter specifies the number of seconds the winbindd daemon will wait before disconnecting either a client connection with no outstanding requests (idle) or a client connection with a request that has remained outstanding (hung) for longer than this number of seconds." Bug 3204 winbindd: Exceeding 200 client connections, no idle connection found https://bugzilla.samba.org/show_bug.cgi?id=3204 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
2014-09-01dosmode: fix FSCTL_SET_SPARSE request validationDavid Disseldorp1-0/+13
Check that FSCTL_SET_SPARSE requests does not refer to directories. Also reject such requests when issued over IPC or printer share connections. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10787 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): Thu Aug 28 04:22:37 CEST 2014 on sn-devel-104 (cherry picked from commit 0751495b1327d002b79482632b7c590cae6e3f9d)
2014-09-01smbd: Properly initialize mangle_hashVolker Lendecke1-0/+4
[Bug 10782] mangle_hash() can fail to initialize charset (smbd crash). https://bugzilla.samba.org/show_bug.cgi?id=10782 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): Tue Aug 26 01:30:38 CEST 2014 on sn-devel-104
2014-09-01Don't discard result of checking grouptypeRoel van Meer1-2/+0
The pdb_samba_dsdb_getgrfilter() function first determines the security type of a group and sets map->sid_name_use accordingly. A little later, this variable is set again, undoing the previous work. https://bugzilla.samba.org/show_bug.cgi?id=10777 Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Aug 23 02:48:52 CEST 2014 on sn-devel-104
2014-09-01docs: Fix typos in smb.conf (inherit acls)Marc Muehlfeld1-3/+3
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10761 Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Thu Aug 7 00:52:42 CEST 2014 on sn-devel-104 (cherry picked from commit 4639f6d7bab9d8d6ee46bf5c65ff73a17a56cb17)
2014-09-01samba: Retain case sensitivity of cifs clientShirish Pargaonkar1-1/+2
When a client supports extended security but server does not, and that client, in Flags2 field of smb header indicates that - it supports extended security negotiation - it does not support security signatures - it does not require security signatures Samba server treats a client as a Vista client. That turns off case sensitivity and that is a problem for cifs vfs client. So include remote cifs client along with remote samba client to not do so otherwise. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10755 Signed-off-by: Shirish Pargaonkar <spargaonkar@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Fri Aug 1 16:11:43 CEST 2014 on sn-devel-104 (cherry picked from commit a0583976da2ba09da0fd94f739ed4f5851e2a858)
2014-09-01lib: strings: Simplify strcasecmpVolker Lendecke1-35/+13
This makes us fallback to strcasecmp early if any INVALID_CODEPOINT appears. Without this patch we just continue to compare if both strings happen to have an INVALID_CODEPOINT in the same spot. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Bug: https://bugzilla.samba.org/show_bug.cgi?id=10716 smbd constantly crashes when filename contains non-ascii character
2014-09-01s4: tests: Added local.charset test for Bug 10716 - smbd constantly crashes ↵Jeremy Allison1-0/+12
when filename contains non-ascii character https://bugzilla.samba.org/show_bug.cgi?id=10716 Signed-off-by: Jeremy Allison <jra@samba.org>
2014-09-01lib: strings: Fix the behavior of strncasecmp_m_handle() in the face of bad ↵Jeremy Allison1-2/+27
conversions. When either string has a bad conversion, we fall back to doing raw ascii byte comparisons using strcasecmp(). This is wrong - we should fall back to strncasecmp. The problem is we've already stepped past the character that failed the conversion, so we're not re-testing those characters for comparison. This can have the effect of causing strncasecmp_m_handle() to report that two strings are identical when they are not, if the failed conversion takes place at the end of the string. The correct behavior is to step back to the point of the string(s) that failed the conversion, and continue the test from there. This is a litle trickier than the previous fix, as it requires converting the incoming n variable from remaining characters to compare to remaining bytes to compare. As bytes are always the smallest character size (1 byte) then it's safe to convert the remaining characters to check by decrementing the source string by the last character length (in bytes) and incrementing the remaining bytes to scan by the same value, then calling strncasecmp() with the stepped back strings remaining. Signed-off-by: Jeremy Allison <jra@samba.org>
2014-09-01lib: strings: Fix the behavior of strcasecmp_m_handle() in the face of bad ↵Jeremy Allison1-1/+11
conversions. When either string has a bad conversion, we fall back to doing raw ascii byte comparisons using strcasecmp(). The problem is we've already stepped past the character that failed the conversion, so we're not re-testing those characters for comparison. This can have the effect of causing strcasecmp_m_handle() to report that two strings are identical when they are not, if the failed conversion takes place at the end of the string. The correct behavior is to step back to the point of the string(s) that failed the conversion, and continue the test from there. Found by <lev@zadarastorage.com> when investigating bug 10716 - smbd constantly crashes when filename contains non-ascii character. Given the normal character set of utf-8, and an on disk filename of ISO-8859-1 of file-é on disk hex value: 66 69 6c 65 2d e9, an incoming open given the correct utf8 name of file-é will collide when it should not. Fixes: Bug 10716 - smbd constantly crashes when filename contains non-ascii character https://bugzilla.samba.org/show_bug.cgi?id=10716 Signed-off-by: Jeremy Allison <jra@samba.org>
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-01smbd: split printer reload processingDavid Disseldorp2-47/+104
All printer inventory updates are currently done via delete_and_reload_printers(), which handles registry.tdb updates for added or removed printers, AD printer unpublishing on removal, as well as share service creation and deletion. This change splits this functionality into two functions such that per-client smbd processes do not perform registry.tdb updates or printer unpublishing. This is now only performed by the process that performs the printcap cache update. This change is similar to ac6604868d1325dd4c872dc0f6ab056d10ebaecf from the 3.6 branch. 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 2706af4d78fc9a47a4ac45b373edf276e3a9b354)
2014-09-01server: remove duplicate snum_is_shared_printer()David Disseldorp3-10/+2
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-01smbd: only reprocess printer_list.tdb if it changedDavid Disseldorp1-0/+21
The per-client smbd printer share inventory is currently updated from printer_list.tdb when a client enumerates printers, via EnumPrinters or NetShareEnum. printer_list.tdb is populated by the background print process, based on the latest printcap values retrieved from the printing backend (e.g. CUPS) at regular intervals. This change ensures that per-client smbd processes don't reparse printer_list.tdb if it hasn't been updated since the last enumeration. 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 a2182e03a061de6c1f111ce083cb5f668fe75e4e)
2014-09-01printing: return last change time with pcap_cache_loaded()David Disseldorp5-7/+13
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 30ce835670a6aeca6fb960ea7c4fe1b982bdd5b0)
2014-09-01printing: remove pcap_cache_add()David Disseldorp2-11/+6
All print list updates are now done via pcap_cache_replace(), which can call into the print_list code directly. 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 6d75e20ca8acf1a55838694ac77940e21e9a1e6a)
2014-09-01printing: reload printer_list.tdb from in memory listDavid Disseldorp6-34/+52
This will allow in future for a single atomic printer_list.tdb update. 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 e5e6e2c796f026ee6b04f99b327941d57b9bd026)
2014-09-01printing: only reload printer shares on client enumDavid Disseldorp5-50/+17
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)