The branch, master has been updated via c0b17c3 ctdb:tests: timedout->timed out in 60.nfs.multi.004 test via 2fbf194 ctdb:eventscript: timedout->timed out in ctdb_event_script_args() via b360c72 ctdb:banning: timedout->timed out in dbg messages in ctdb_ban_node_event() via 537d5fc ctdb:tcp: add missing spaces in debug message in ctdb_tcp_node_connect() via b83a742 dsdb: Simplify acl_validate_spn_value via f722185 s3-dfree-quota: remove special handling of EDQUOT via b79ea7d s3-sysquotas: remove special handling of EDQUOT via 8078e5f vfs_fake_dfq - remove support for generating EDQUOT via 3d02489 selftest: remove test for EDQUOT returned from quota backend via 3b352d3 s3-sysquotas-linux: do not check for EDQUOT via 7583377 samba-too: Allow 'samba-tool fsmo' to cope with empty or missing fsmo roles via 4feffb6 s3/client/clitar.c: NULL-check correct variable from af6bd05 rwrap: Update resolve_wrapper to version 1.1.4
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit c0b17c39000f601fa0aa9618b38b0991cf6535a2 Author: Michael Adam <ob...@samba.org> Date: Wed Jun 1 00:45:00 2016 +0200 ctdb:tests: timedout->timed out in 60.nfs.multi.004 test Signed-off-by: Michael Adam <ob...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> Autobuild-User(master): Jeremy Allison <j...@samba.org> Autobuild-Date(master): Wed Jun 1 04:30:36 CEST 2016 on sn-devel-144 commit 2fbf19449e616d4d2489df3744982537c32c04f9 Author: Michael Adam <ob...@samba.org> Date: Wed Jun 1 00:44:21 2016 +0200 ctdb:eventscript: timedout->timed out in ctdb_event_script_args() Signed-off-by: Michael Adam <ob...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit b360c72eafa2df0726f966541668ca93f515271f Author: Michael Adam <ob...@samba.org> Date: Wed Jun 1 00:43:38 2016 +0200 ctdb:banning: timedout->timed out in dbg messages in ctdb_ban_node_event() Signed-off-by: Michael Adam <ob...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 537d5fc50e692d04863a5995324ce74e71799b43 Author: Michael Adam <ob...@samba.org> Date: Thu May 26 13:40:38 2016 +0200 ctdb:tcp: add missing spaces in debug message in ctdb_tcp_node_connect() Signed-off-by: Michael Adam <ob...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit b83a742fed21969906bacfb6a98df82c3f49206c Author: Volker Lendecke <v...@samba.org> Date: Fri May 27 10:40:55 2016 +0200 dsdb: Simplify acl_validate_spn_value Avoid pointless "else" and fix indentation Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit f7221857236f5449424cc9cbb1ac92f59fa51bbc Author: Uri Simchoni <u...@samba.org> Date: Fri May 27 22:15:46 2016 +0300 s3-dfree-quota: remove special handling of EDQUOT It is no longer part of the quota VFS interface to return an EDQUOT error as an indication that getting quota succeeded but the user/group is over-quota. A VFS module implementing quota interface always returns 0 on success. Signed-off-by: Uri Simchoni <u...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit b79ea7d3fb92ba95b3368604e79dbb26e88a4acf Author: Uri Simchoni <u...@samba.org> Date: Fri May 27 21:51:38 2016 +0300 s3-sysquotas: remove special handling of EDQUOT The sysquotas module has several supported backends for getting/setting user/group quota. This patch removes a check by the common code, to see if the backend has returned EDQUOT. Before this patch, it was OK for a backend to return with error and errno set to EDQUOT, and that meant success, but with a warning that the user/group is over quota. This is the system behavior on some Unices. This patch removes this from the protocol between the sysquota module and its backend drivers - it's the responsibility of the backend to return 0 iff it has fulfilled the request to get or set quota. Signed-off-by: Uri Simchoni <u...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 8078e5f15bb23f95faa1c12cb7ddc8a62dcf2661 Author: Uri Simchoni <u...@samba.org> Date: Fri May 27 21:42:49 2016 +0300 vfs_fake_dfq - remove support for generating EDQUOT Remove the option to retrieve valid user/group quota while returning -1 and EDQUOT errno - this is no longer part of the protocol between the quota backend and smbd. Signed-off-by: Uri Simchoni <u...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 3d02489ff19184751d2213d419f85f48c6ad78e3 Author: Uri Simchoni <u...@samba.org> Date: Fri May 27 21:40:06 2016 +0300 selftest: remove test for EDQUOT returned from quota backend Remove a test for special handling of EDQUOT errno when determining user/group quota - If the backend has obtained the quota settings it has to return 0 and not error. Signed-off-by: Uri Simchoni <u...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 3b352d3526ae075db7a90733617010befdb3c746 Author: Uri Simchoni <u...@samba.org> Date: Thu May 26 10:24:58 2016 +0300 s3-sysquotas-linux: do not check for EDQUOT When obtaining user/group quota, remove check for EDQUOT errno return. Apparently on some Unices, EDQUOT means that the get-quota function has succeeded, but the user/group is over-quota. Not so in Linux. Signed-off-by: Uri Simchoni <u...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> commit 7583377473ecd3d096c4f924e61a04a84be32a96 Author: Rowland Penny <rpe...@samba.org> Date: Thu Mar 31 12:07:00 2016 +0100 samba-too: Allow 'samba-tool fsmo' to cope with empty or missing fsmo roles samba-too: Allow 'samba-tool fsmo' to cope with empty or missing fsmo roles Signed-off-by: Rowland Penny <rpe...@samba.org> Signed-off-by: Andrew Bartlett <abart...@samba.org> commit 4feffb670720b7f378e5dc0914d928cf6e0ca6c6 Author: Aurelien Aptel <aap...@suse.com> Date: Tue May 31 15:44:27 2016 +0200 s3/client/clitar.c: NULL-check correct variable `f` was checked again instead of `s`. Signed-off-by: Aurelien Aptel <aap...@suse.com> Reviewed-by: ndreas Schneider <a...@samba.org> Reviewed-by: Jeremy Allison <j...@samba.org> ----------------------------------------------------------------------- Summary of changes: ctdb/server/ctdb_banning.c | 4 +- ctdb/server/eventscript.c | 2 +- ctdb/tcp/tcp_connect.c | 4 +- ctdb/tests/eventscripts/60.nfs.multi.004.sh | 2 +- python/samba/netcmd/fsmo.py | 233 ++++++++++++--------- python/samba/tests/{auth.py => samba_tool/fsmo.py} | 22 +- source3/client/clitar.c | 2 +- source3/lib/sysquotas.c | 10 - source3/lib/sysquotas_linux.c | 6 +- source3/modules/vfs_fake_dfq.c | 5 - source3/script/tests/test_dfree_quota.sh | 3 - source3/smbd/quotas.c | 22 +- source4/dsdb/samdb/ldb_modules/acl.c | 10 +- source4/selftest/tests.py | 4 + 14 files changed, 171 insertions(+), 158 deletions(-) copy python/samba/tests/{auth.py => samba_tool/fsmo.py} (59%) Changeset truncated at 500 lines: diff --git a/ctdb/server/ctdb_banning.c b/ctdb/server/ctdb_banning.c index 56d3b29..a4c56f5 100644 --- a/ctdb/server/ctdb_banning.c +++ b/ctdb/server/ctdb_banning.c @@ -42,12 +42,12 @@ static void ctdb_ban_node_event(struct tevent_context *ev, /* Make sure we were able to freeze databases during banning */ if (!ctdb_db_all_frozen(ctdb)) { - DEBUG(DEBUG_ERR, ("Banning timedout, but still unable to freeze databases\n")); + DEBUG(DEBUG_ERR, ("Banning timed out, but still unable to freeze databases\n")); ctdb_ban_self(ctdb); return; } - DEBUG(DEBUG_ERR,("Banning timedout\n")); + DEBUG(DEBUG_ERR,("Banning timed out\n")); ctdb->nodes[ctdb->pnn]->flags &= ~NODE_FLAGS_BANNED; if (ctdb->banning_ctx != NULL) { diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c index 5bc2ee8..17e4f35 100644 --- a/ctdb/server/eventscript.c +++ b/ctdb/server/eventscript.c @@ -906,7 +906,7 @@ int ctdb_event_script_args(struct ctdb_context *ctdb, enum ctdb_event call, while (status.done == false && tevent_loop_once(ctdb->ev) == 0) /* noop */; if (status.status == -ETIME) { - DEBUG(DEBUG_ERR, (__location__ " eventscript for '%s' timedout." + DEBUG(DEBUG_ERR, (__location__ " eventscript for '%s' timed out." " Immediately banning ourself for %d seconds\n", ctdb_eventscript_call_names[call], ctdb->tunable.recovery_ban_period)); diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c index fbb17c8..a56320d 100644 --- a/ctdb/tcp/tcp_connect.c +++ b/ctdb/tcp/tcp_connect.c @@ -145,7 +145,7 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te, tnode->fd = socket(sock_out.sa.sa_family, SOCK_STREAM, IPPROTO_TCP); if (tnode->fd == -1) { - DEBUG(DEBUG_ERR, (__location__ "Failed to create socket\n")); + DEBUG(DEBUG_ERR, (__location__ " Failed to create socket\n")); return; } set_nonblocking(tnode->fd); @@ -185,7 +185,7 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te, } if (bind(tnode->fd, (struct sockaddr *)&sock_in, sockin_size) == -1) { - DEBUG(DEBUG_ERR, (__location__ "Failed to bind socket %s(%d)\n", + DEBUG(DEBUG_ERR, (__location__ " Failed to bind socket %s(%d)\n", strerror(errno), errno)); close(tnode->fd); return; diff --git a/ctdb/tests/eventscripts/60.nfs.multi.004.sh b/ctdb/tests/eventscripts/60.nfs.multi.004.sh index e07f8d5..d01f96b 100755 --- a/ctdb/tests/eventscripts/60.nfs.multi.004.sh +++ b/ctdb/tests/eventscripts/60.nfs.multi.004.sh @@ -2,7 +2,7 @@ . "${TEST_SCRIPTS_DIR}/unit.sh" -define_test "takeip, take reconfigure lock, monitor -> reconfigure, replay timedout" +define_test "takeip, take reconfigure lock, monitor -> reconfigure, replay timed out" setup_nfs diff --git a/python/samba/netcmd/fsmo.py b/python/samba/netcmd/fsmo.py index 3904bcb..3d14939 100644 --- a/python/samba/netcmd/fsmo.py +++ b/python/samba/netcmd/fsmo.py @@ -31,17 +31,26 @@ from samba.netcmd import ( ) from samba.samdb import SamDB -def get_fsmo_roleowner(samdb, roledn): +def get_fsmo_roleowner(samdb, roledn, role): """Gets the owner of an FSMO role :param roledn: The DN of the FSMO role + :param role: The FSMO role """ - res = samdb.search(roledn, - scope=ldb.SCOPE_BASE, attrs=["fSMORoleOwner"]) - if len(res) == 0: - raise CommandError('"%s" does not have a FSMO roleowner' % roledn) - master_owner = res[0]["fSMORoleOwner"][0] - return master_owner + try: + res = samdb.search(roledn, + scope=ldb.SCOPE_BASE, attrs=["fSMORoleOwner"]) + except LdbError, (num, msg): + if num == ldb.ERR_NO_SUCH_OBJECT: + return "* The '%s' role is not present in this domain" % role + raise + + if 'fSMORoleOwner' in res[0]: + master_owner = res[0]["fSMORoleOwner"][0] + return master_owner + else: + master_owner = "* The '%s' role does not have an FSMO roleowner" % role + return master_owner def transfer_dns_role(outf, sambaopts, credopts, role, samdb): @@ -54,23 +63,23 @@ def transfer_dns_role(outf, sambaopts, credopts, role, samdb): forest_dn = samba.dn_from_dns_name(samdb.forest_dns_name()) role_object = "CN=Infrastructure,DC=ForestDnsZones," + forest_dn - try: - res = samdb.search(role_object, - attrs=["fSMORoleOwner"], - scope=ldb.SCOPE_BASE, - controls=["extended_dn:1:1"]) + res = samdb.search(role_object, + attrs=["fSMORoleOwner"], + scope=ldb.SCOPE_BASE, + controls=["extended_dn:1:1"]) - if 'fSMORoleOwner' in res[0]: - try: - master_guid = str(misc.GUID(ldb.Dn(samdb, - res[0]['fSMORoleOwner'][0]) - .get_extended_component('GUID'))) - master_owner = str(ldb.Dn(samdb, res[0]['fSMORoleOwner'][0])) - except LdbError, (num, msg): - raise CommandError("GUID not found in partition naming master DN %s : %s \n" % - (res[0]['fSMORoleOwner'][0], msg)) - except LdbError, (num, msg): - raise CommandError("DNS partion %s not found : %s" % (role, msg)) + if 'fSMORoleOwner' in res[0]: + try: + master_guid = str(misc.GUID(ldb.Dn(samdb, + res[0]['fSMORoleOwner'][0]) + .get_extended_component('GUID'))) + master_owner = str(ldb.Dn(samdb, res[0]['fSMORoleOwner'][0])) + except LdbError, (num, msg): + raise CommandError("No GUID found in naming master DN %s : %s \n" % + (res[0]['fSMORoleOwner'][0], msg)) + else: + outf.write("* The '%s' role does not have an FSMO roleowner\n" % role) + return False if role == "domaindns": master_dns_name = '%s._msdcs.%s' % (master_guid, @@ -150,12 +159,12 @@ def transfer_role(outf, role, samdb): m = ldb.Message() m.dn = ldb.Dn(samdb, "") if role == "rid": - master_owner = get_fsmo_roleowner(samdb, rid_dn) + master_owner = get_fsmo_roleowner(samdb, rid_dn, role) m["becomeRidMaster"]= ldb.MessageElement( "1", ldb.FLAG_MOD_REPLACE, "becomeRidMaster") elif role == "pdc": - master_owner = get_fsmo_roleowner(samdb, domain_dn) + master_owner = get_fsmo_roleowner(samdb, domain_dn, role) res = samdb.search(domain_dn, scope=ldb.SCOPE_BASE, attrs=["objectSid"]) @@ -165,34 +174,38 @@ def transfer_role(outf, role, samdb): sid, ldb.FLAG_MOD_REPLACE, "becomePdc") elif role == "naming": - master_owner = get_fsmo_roleowner(samdb, naming_dn) + master_owner = get_fsmo_roleowner(samdb, naming_dn, role) m["becomeDomainMaster"]= ldb.MessageElement( "1", ldb.FLAG_MOD_REPLACE, "becomeDomainMaster") elif role == "infrastructure": - master_owner = get_fsmo_roleowner(samdb, infrastructure_dn) + master_owner = get_fsmo_roleowner(samdb, infrastructure_dn, role) m["becomeInfrastructureMaster"]= ldb.MessageElement( "1", ldb.FLAG_MOD_REPLACE, "becomeInfrastructureMaster") elif role == "schema": - master_owner = get_fsmo_roleowner(samdb, schema_dn) + master_owner = get_fsmo_roleowner(samdb, schema_dn, role) m["becomeSchemaMaster"]= ldb.MessageElement( "1", ldb.FLAG_MOD_REPLACE, "becomeSchemaMaster") else: raise CommandError("Invalid FSMO role.") - if master_owner != new_owner: - try: - samdb.modify(m) - except LdbError, (num, msg): - raise CommandError("Transfer of '%s' role failed: %s" % - (role, msg)) + if not '*' in master_owner: + if master_owner != new_owner: + try: + samdb.modify(m) + except LdbError, (num, msg): + raise CommandError("Transfer of '%s' role failed: %s" % + (role, msg)) - outf.write("FSMO transfer of '%s' role successful\n" % role) - return True + outf.write("FSMO transfer of '%s' role successful\n" % role) + return True + else: + outf.write("This DC already has the '%s' FSMO role\n" % role) + return False else: - outf.write("This DC already has the '%s' FSMO role\n" % role) + outf.write("%s\n" % master_owner) return False class cmd_fsmo_seize(Command): @@ -210,7 +223,7 @@ class cmd_fsmo_seize(Command): Option("-H", "--URL", help="LDB URL for database or target server", type=str, metavar="URL", dest="H"), Option("--force", - help="Force seizing of the role without attempting to transfer first.", + help="Force seizing of role without attempting to transfer.", action="store_true"), Option("--role", type="choice", choices=["rid", "pdc", "infrastructure", "schema", "naming", "domaindns", "forestdns", "all"], @@ -253,32 +266,41 @@ You must provide an Admin user and password."""), raise CommandError("Invalid FSMO role.") #first try to transfer to avoid problem if the owner is still active seize = False - master_owner = get_fsmo_roleowner(samdb, m.dn) - if master_owner != serviceName: - if force is None: - self.message("Attempting transfer...") - if not transfer_role(self.outf, role, samdb): - #transfer failed, use the big axe... - seize = True - self.message("Transfer unsuccessful, seizing...") - else: - self.message("Not seizing role as transfer was successful") - - if force is not None or seize == True: - self.message("Seizing %s FSMO role..." % role) - m["fSMORoleOwner"]= ldb.MessageElement( - serviceName, ldb.FLAG_MOD_REPLACE, - "fSMORoleOwner") - try: - samdb.modify(m) - except LdbError, (num, msg): - raise CommandError("Failed to seize '%s' role: %s" % - (role, msg)) - self.outf.write("FSMO seize of '%s' role successful\n" % role) - return True + master_owner = get_fsmo_roleowner(samdb, m.dn, role) + if not '*' in master_owner: + # if there is a different owner + if master_owner != serviceName: + # if --force isn't given, attempt transfer + if force is None: + self.message("Attempting transfer...") + try: + transfer_role(self.outf, role, samdb) + except: + #transfer failed, use the big axe... + seize = True + self.message("Transfer unsuccessful, seizing...") + else: + self.message("Transfer successful, not seizing role") + return True + else: + self.outf.write("This DC already has the '%s' FSMO role\n" % + role) + return False else: - self.outf.write("This DC already has the '%s' FSMO role\n" % role) - return False + seize = True + + if force is not None or seize == True: + self.message("Seizing %s FSMO role..." % role) + m["fSMORoleOwner"]= ldb.MessageElement( + serviceName, ldb.FLAG_MOD_REPLACE, + "fSMORoleOwner") + try: + samdb.modify(m) + except LdbError, (num, msg): + raise CommandError("Failed to seize '%s' role: %s" % + (role, msg)) + self.outf.write("FSMO seize of '%s' role successful\n" % role) + return True def seize_dns_role(self, role, samdb, credopts, sambaopts, versionopts, force): @@ -299,33 +321,43 @@ You must provide an Admin user and password."""), raise CommandError("Invalid FSMO role.") #first try to transfer to avoid problem if the owner is still active seize = False - master_owner = get_fsmo_roleowner(samdb, m.dn) - if master_owner != serviceName: - if force is None: - self.message("Attempting transfer...") - if not transfer_dns_role(self.outf, sambaopts, credopts, role, - samdb): - #transfer failed, use the big axe... - seize = True - self.message("Transfer unsuccessful, seizing...") - else: - self.message("Not seizing role as transfer was successful\n") - - if force is not None or seize == True: - self.message("Seizing %s FSMO role..." % role) - m["fSMORoleOwner"]= ldb.MessageElement( - serviceName, ldb.FLAG_MOD_REPLACE, - "fSMORoleOwner") - try: - samdb.modify(m) - except LdbError, (num, msg): - raise CommandError("Failed to seize '%s' role: %s" % - (role, msg)) - self.outf.write("FSMO seize of '%s' role successful\n" % role) - return True + master_owner = get_fsmo_roleowner(samdb, m.dn, role) + if not '*' in master_owner: + # if there is a different owner + if master_owner != serviceName: + # if --force isn't given, attempt transfer + if force is None: + self.message("Attempting transfer...") + try: + transfer_dns_role(self.outf, sambaopts, credopts, role, + samdb) + except: + #transfer failed, use the big axe... + seize = True + self.message("Transfer unsuccessful, seizing...") + else: + self.message("Transfer successful, not seizing role\n") + return True + else: + self.outf.write("This DC already has the '%s' FSMO role\n" % + role) + return False else: - self.outf.write("This DC already has the '%s' FSMO role\n" % role) - return False + seize = True + + if force is not None or seize == True: + self.message("Seizing %s FSMO role..." % role) + m["fSMORoleOwner"]= ldb.MessageElement( + serviceName, ldb.FLAG_MOD_REPLACE, + "fSMORoleOwner") + try: + samdb.modify(m) + except LdbError, (num, msg): + raise CommandError("Failed to seize '%s' role: %s" % + (role, msg)) + self.outf.write("FSMO seize of '%s' role successful\n" % role) + return True + def run(self, force=None, H=None, role=None, credopts=None, sambaopts=None, versionopts=None): @@ -388,13 +420,16 @@ class cmd_fsmo_show(Command): domaindns_dn = "CN=Infrastructure,DC=DomainDnsZones," + domain_dn forestdns_dn = "CN=Infrastructure,DC=ForestDnsZones," + forest_dn - infrastructureMaster = get_fsmo_roleowner(samdb, infrastructure_dn) - pdcEmulator = get_fsmo_roleowner(samdb, domain_dn) - namingMaster = get_fsmo_roleowner(samdb, naming_dn) - schemaMaster = get_fsmo_roleowner(samdb, schema_dn) - ridMaster = get_fsmo_roleowner(samdb, rid_dn) - domaindnszonesMaster = get_fsmo_roleowner(samdb, domaindns_dn) - forestdnszonesMaster = get_fsmo_roleowner(samdb, forestdns_dn) + infrastructureMaster = get_fsmo_roleowner(samdb, infrastructure_dn, + "infrastructure") + pdcEmulator = get_fsmo_roleowner(samdb, domain_dn, "pdc") + namingMaster = get_fsmo_roleowner(samdb, naming_dn, "naming") + schemaMaster = get_fsmo_roleowner(samdb, schema_dn, "schema") + ridMaster = get_fsmo_roleowner(samdb, rid_dn, "rid") + domaindnszonesMaster = get_fsmo_roleowner(samdb, domaindns_dn, + "domaindns") + forestdnszonesMaster = get_fsmo_roleowner(samdb, forestdns_dn, + "forestdns") self.message("SchemaMasterRole owner: " + schemaMaster) self.message("InfrastructureMasterRole owner: " + infrastructureMaster) @@ -449,8 +484,10 @@ You must provide an Admin user and password."""), transfer_role(self.outf, "naming", samdb) transfer_role(self.outf, "infrastructure", samdb) transfer_role(self.outf, "schema", samdb) - transfer_dns_role(self.outf, sambaopts, credopts, "domaindns", samdb) - transfer_dns_role(self.outf, sambaopts, credopts, "forestdns", samdb) + transfer_dns_role(self.outf, sambaopts, credopts, + "domaindns", samdb) + transfer_dns_role(self.outf, sambaopts, credopts, "forestdns", + samdb) else: if role == "domaindns" or role == "forestdns": transfer_dns_role(self.outf, sambaopts, credopts, role, samdb) diff --git a/python/samba/tests/auth.py b/python/samba/tests/samba_tool/fsmo.py similarity index 59% copy from python/samba/tests/auth.py copy to python/samba/tests/samba_tool/fsmo.py index f71e1a7..7058277 100644 --- a/python/samba/tests/auth.py +++ b/python/samba/tests/samba_tool/fsmo.py @@ -1,5 +1,5 @@ # Unix SMB/CIFS implementation. -# Copyright (C) Jelmer Vernooij <jel...@samba.org> 2007 +# Copyright (C) Rowland Penny <rpe...@samba.org> 2016 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,17 +15,15 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -"""Tests for the Auth Python bindings. +import os +from samba.tests.samba_tool.base import SambaToolCmdTest -Note that this just tests the bindings work. It does not intend to test -the functionality, that's already done in other tests. -""" +class FsmoCmdTestCase(SambaToolCmdTest): + """Test for samba-tool fsmo show subcommand""" -from samba import auth -import samba.tests - -class AuthTests(samba.tests.TestCase): - - def test_system_session(self): - auth.system_session() + def test_fsmoget(self): + """Run fsmo show to see if it errors""" + (result, out, err) = self.runsubcmd("fsmo", "show") + self.assertCmdSuccess(result) + self.assertEquals(err,"","Shouldn't be any error messages") diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 8703f6b..188f65d 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -1510,7 +1510,7 @@ static NTSTATUS is_subpath(const char *sub, const char *full, } string_replace(f, '\\', '/'); s = strlower_talloc(tmp_ctx, sub); - if (f == NULL) { + if (s == NULL) { status = NT_STATUS_NO_MEMORY; goto out_ctx_free; } diff --git a/source3/lib/sysquotas.c b/source3/lib/sysquotas.c index 102e458..c2d09da 100644 --- a/source3/lib/sysquotas.c +++ b/source3/lib/sysquotas.c @@ -493,11 +493,6 @@ int sys_get_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DI SAFE_FREE(bdev); SAFE_FREE(fs); - if ((ret!=0)&& (errno == EDQUOT)) { - DEBUG(10,("sys_get_quota() warning over quota!\n")); - return 0; - } - return ret; } @@ -560,11 +555,6 @@ int sys_set_quota(const char *path, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DI SAFE_FREE(bdev); SAFE_FREE(fs); - if ((ret!=0)&& (errno == EDQUOT)) { - DEBUG(10,("sys_set_quota() warning over quota!\n")); - return 0; - } - return ret; } diff --git a/source3/lib/sysquotas_linux.c b/source3/lib/sysquotas_linux.c index 55d1518..c0987de 100644 --- a/source3/lib/sysquotas_linux.c +++ b/source3/lib/sysquotas_linux.c @@ -59,7 +59,8 @@ int sys_get_vfs_quota(const char *path, const char *bdev, "SMB_USER_QUOTA_TYPE uid[%u]\n", path, bdev, (unsigned)id.uid)); - if ((ret = quotactl(QCMD(Q_GETQUOTA,USRQUOTA), bdev, id.uid, (caddr_t)&D))&&errno != EDQUOT) { + if ((ret = quotactl(QCMD(Q_GETQUOTA, USRQUOTA), bdev, + id.uid, (caddr_t)&D))) { return ret; } @@ -69,7 +70,8 @@ int sys_get_vfs_quota(const char *path, const char *bdev, "SMB_GROUP_QUOTA_TYPE gid[%u]\n", path, bdev, (unsigned)id.gid)); - if ((ret = quotactl(QCMD(Q_GETQUOTA,GRPQUOTA), bdev, id.gid, (caddr_t)&D))&&errno != EDQUOT) { + if ((ret = quotactl(QCMD(Q_GETQUOTA, GRPQUOTA), bdev, + id.gid, (caddr_t)&D))) { return ret; } -- Samba Shared Repository