summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorNadezhda Ivanova <nadezhda.ivanova@postpath.com>2010-01-04 11:24:10 +0200
committerNadezhda Ivanova <nadezhda.ivanova@postpath.com>2010-01-04 11:24:10 +0200
commitfb5383c69ee52fb5e6d066a43451dc8c806cc795 (patch)
tree45b72e03f68ab6d212755c524f8e8a60a3b4373a /source4/libcli
parent60d8ab3b7b0bd2c9b633f0380d1fdf5bcf5e2621 (diff)
parenta06e5cdb99ddf7abf16486d3837105ec4e0da9ee (diff)
downloadsamba-fb5383c69ee52fb5e6d066a43451dc8c806cc795.tar.gz
samba-fb5383c69ee52fb5e6d066a43451dc8c806cc795.tar.bz2
samba-fb5383c69ee52fb5e6d066a43451dc8c806cc795.zip
Merge branch 'master' of git://git.samba.org/samba
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/finddcs.c3
-rw-r--r--source4/libcli/security/sddl.c2
-rw-r--r--source4/libcli/security/tests/bindings.py11
3 files changed, 12 insertions, 4 deletions
diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c
index 8330042ea1..04b25d37ef 100644
--- a/source4/libcli/finddcs.c
+++ b/source4/libcli/finddcs.c
@@ -158,6 +158,9 @@ static void finddcs_name_resolved(struct composite_context *ctx)
if (composite_nomem(state->r.in.my_accountname, state->ctx)) return;
state->r.in.account_control = ACB_WSTRUST;
state->r.in.domain_sid = state->domain_sid;
+ if (state->r.in.domain_sid == NULL) {
+ state->r.in.domain_sid = talloc_zero(state, struct dom_sid);
+ }
ireq = irpc_call_send(state->msg_ctx, nbt_servers[0],
&ndr_table_irpc, NDR_NBTD_GETDCNAME,
diff --git a/source4/libcli/security/sddl.c b/source4/libcli/security/sddl.c
index 2244a3d3ed..c4f8c5667b 100644
--- a/source4/libcli/security/sddl.c
+++ b/source4/libcli/security/sddl.c
@@ -304,7 +304,7 @@ static struct security_acl *sddl_decode_acl(struct security_descriptor *sd,
acl = talloc_zero(sd, struct security_acl);
if (acl == NULL) return NULL;
- acl->revision = SECURITY_ACL_REVISION_NT4;
+ acl->revision = SECURITY_ACL_REVISION_ADS;
if (isupper(sddl[0]) && sddl[1] == ':') {
/* its an empty ACL */
diff --git a/source4/libcli/security/tests/bindings.py b/source4/libcli/security/tests/bindings.py
index 00fa05d070..6fe3d5471d 100644
--- a/source4/libcli/security/tests/bindings.py
+++ b/source4/libcli/security/tests/bindings.py
@@ -2,17 +2,17 @@
# Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
-#
+#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
@@ -46,6 +46,7 @@ class SecurityTokenTests(unittest.TestCase):
class SecurityDescriptorTests(unittest.TestCase):
+
def setUp(self):
self.descriptor = security.descriptor()
@@ -100,6 +101,10 @@ class SecurityDescriptorTests(unittest.TestCase):
desc1 = security.descriptor.from_sddl(text, dom)
self.assertNotEqual(desc1.as_sddl(), desc1.as_sddl(dom))
+ def test_split(self):
+ dom = security.dom_sid("S-2-0-7")
+ self.assertEquals((security.dom_sid("S-2-0"), 7), dom.split())
+
class DomSidTests(unittest.TestCase):
def test_parse_sid(self):