[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Thu Mar 9 19:13:02 UTC 2023
The branch, master has been updated
via f55a357c6b9 dsgetdcname: do not assume local system uses IPv4
via 9bb8795aebd libsmb: Convert cli_posix_stat_send/recv() to modern conventions
via cc4a2d4edc7 librpc: Simplify dcerpc_default_transport_endpoint()
via 43b34b01597 libcli: Shrink .data segment by 43264 bytes
via e6a03c04a76 libcli: Shrink .data segment by 43264 bytes
via 9e00acd0d0f build: Fix a long line
via dec4d5aa9d7 rpcd: Use size_t for walking an array
via 4814b95dbcf smbd: Directly initialize a "fsp1"
via 62651ace1cb smbd: DBG_DEBUG raw create contexts received from the client
via bbcc9b326eb lib: Add dump_data_addbuf()
via e5d1527f74a lib: Move the dump_data_pw() prototype to the other dump_data_* ones
via 0195f8bc9a9 lib: Fix a typo
via 8faccb6e195 lib: Remove a talloc_stackframe()
via 35976fc2ffd libcli/util: Avoid an includes.h
via d76ec8519e0 libcli/security: Avoid includes.h
via 04379c0bcfd lib: librpc/gen_ndr/security.h needs DATA_BLOB
via 2ac2c055614 lib: Fix whitespace
via 4d8a396c4c1 smbd: Remove a variable only ever set to NULL
via 8926770ae94 smbd: Fix a typo
via 1a52b30d921 vfs: Replace a "== false" with a "!"
via efbfa9fc44b libsmb: Avoid a duplicate memset(.., 0, ..);
via da93b648abc Fix a typo
via bf6599fecea samba-tool: Ensure modifying GPO increments GPT.INI vers
via ce29f55129f samba-tool: Test that modifying GPO increments GPT.INI vers
via 42517d576ac samba-tool: Subclass GPOCommand for calling samdb_connect
from 403598b3076 s4-dsdb:tests: Correctly handle LdbError
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit f55a357c6b9387883a7628a1b1083263a10121a6
Author: Nathaniel W. Turner <nturner at exagrid.com>
Date: Fri Sep 23 16:37:46 2022 -0400
dsgetdcname: do not assume local system uses IPv4
Return the first IPv4 and the first IPv6 address found for each DC.
This is slightly inelegant, but resolves an issue where IPv6-only
systems were unable to run "net ads join" against domain controllers
that have both A and AAAA records in DNS.
While this impacts performance due to the additional LDAP ping attempts,
in practice an attempt to connect to an IPv6 address on an IPv4-only
system (or vice versa) will fail immediately with
NT_STATUS_NETWORK_UNREACHABLE, and thus the performance impact should be
negligible.
The alternative approach, using an smb.conf setting to control whether
the logic prefers a single address of one family or the other ends up
being a bit awkward, as it pushes the problem onto admins and tools such
as "realm join" that want to dynamically synthesize an smb.conf on the
fly.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15325
Signed-off-by: Nathaniel W. Turner <nturner at exagrid.com>
Reviewed-by: Jeremy Allison <jra at samba.org>
Reviewed-by: David Mulder <dmulder at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu Mar 9 19:12:15 UTC 2023 on atb-devel-224
commit 9bb8795aebdaad10713c791e45f11e3a4b94d5ff
Author: Volker Lendecke <vl at samba.org>
Date: Thu Feb 16 17:35:24 2023 +0100
libsmb: Convert cli_posix_stat_send/recv() to modern conventions
It's unusual these days to pass output arguments in the _send
function, instead save the result in the _state struct
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit cc4a2d4edc756e79ad91b10086df910e512f9c7a
Author: Volker Lendecke <vl at samba.org>
Date: Mon Feb 20 18:48:20 2023 +0100
librpc: Simplify dcerpc_default_transport_endpoint()
We don't need strcmp for just 1 byte
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 43b34b015979fd250171b7610db7d55f6b2ac7cf
Author: Volker Lendecke <vl at samba.org>
Date: Tue Feb 28 20:53:59 2023 +0100
libcli: Shrink .data segment by 43264 bytes
A case statement only references const strings, pointers in an array
need to be relocated at exec() time.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit e6a03c04a765e4d6c41b137d365a1e64f6285a8e
Author: Volker Lendecke <vl at samba.org>
Date: Tue Feb 28 20:53:59 2023 +0100
libcli: Shrink .data segment by 43264 bytes
A case statement only references const strings, pointers in an array
need to be relocated at exec() time.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 9e00acd0d0fc5419d920e743426dd2b310d45083
Author: Volker Lendecke <vl at samba.org>
Date: Tue Feb 28 20:27:30 2023 +0100
build: Fix a long line
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit dec4d5aa9d72adf5b955086e5622259f085ba811
Author: Volker Lendecke <vl at samba.org>
Date: Thu Feb 23 10:00:10 2023 +0100
rpcd: Use size_t for walking an array
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 4814b95dbcfe71ccfdcdb9e49d24db01025da55b
Author: Volker Lendecke <vl at samba.org>
Date: Mon Feb 13 15:18:50 2023 +0100
smbd: Directly initialize a "fsp1"
Don't leave it dangling
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 62651ace1cbdb56206fdd66a58c3f2afd617a893
Author: Volker Lendecke <vl at samba.org>
Date: Thu Feb 9 17:38:43 2023 +0100
smbd: DBG_DEBUG raw create contexts received from the client
Got
smbd_smb2_request_process_create: Got 2 create blobs
[0]
[0000] 93 AD 25 50 9C B4 11 E7 B4 23 83 DE 96 8B CD 7C ..%P.... .#.....|
[0000] 05 00 00 00 ....
[1]
[0000] 51 46 69 64 QFid
from cifs.ko, trying to find out where the "05 00 00 00" comes from..
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit bbcc9b326eb4b49018d78063e7a4fc4178d2b855
Author: Volker Lendecke <vl at samba.org>
Date: Thu Feb 9 17:38:15 2023 +0100
lib: Add dump_data_addbuf()
Helper function to build up debug strings
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit e5d1527f74a90e98019fccd839566467bf8dbb7e
Author: Volker Lendecke <vl at samba.org>
Date: Thu Feb 9 17:36:46 2023 +0100
lib: Move the dump_data_pw() prototype to the other dump_data_* ones
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 0195f8bc9a91d85c2b76edb1e145a80ba0fe5543
Author: Volker Lendecke <vl at samba.org>
Date: Fri Mar 3 18:57:34 2023 +0100
lib: Fix a typo
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 8faccb6e1959214ac014127c883dbc48d9180370
Author: Volker Lendecke <vl at samba.org>
Date: Fri Mar 3 18:55:38 2023 +0100
lib: Remove a talloc_stackframe()
This made sense before we used dom_sid_str_buf() in the DEBUG
statements.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 35976fc2ffdc9936e0931cb3f568ec1c66871267
Author: Volker Lendecke <vl at samba.org>
Date: Tue Feb 28 20:19:17 2023 +0100
libcli/util: Avoid an includes.h
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit d76ec8519e06c838ba76c3f56425e6d4bf62866f
Author: Volker Lendecke <vl at samba.org>
Date: Fri Mar 3 18:41:33 2023 +0100
libcli/security: Avoid includes.h
Don't rebuild libcli/security when not necessary
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 04379c0bcfde0c6c80a98335e1295fe3296935bf
Author: Volker Lendecke <vl at samba.org>
Date: Fri Mar 3 19:01:02 2023 +0100
lib: librpc/gen_ndr/security.h needs DATA_BLOB
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 2ac2c055614c0aaa63b6c80a12d950d8e5d0cbf0
Author: Volker Lendecke <vl at samba.org>
Date: Fri Mar 3 18:48:25 2023 +0100
lib: Fix whitespace
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 4d8a396c4c1e2687b624267007101879ca5e7210
Author: Volker Lendecke <vl at samba.org>
Date: Mon Feb 13 15:23:58 2023 +0100
smbd: Remove a variable only ever set to NULL
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 8926770ae94dacfeed100a5333cd985651db0458
Author: Volker Lendecke <vl at samba.org>
Date: Mon Feb 13 12:36:38 2023 +0100
smbd: Fix a typo
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 1a52b30d9211464566ead2175eb5aa8384fcac13
Author: Volker Lendecke <vl at samba.org>
Date: Tue Feb 14 16:04:00 2023 +0100
vfs: Replace a "== false" with a "!"
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit efbfa9fc44bc56484dc4cc9cb93df6494dc06bc4
Author: Volker Lendecke <vl at samba.org>
Date: Thu Feb 16 12:26:16 2023 +0100
libsmb: Avoid a duplicate memset(.., 0, ..);
tevent_req_create() does a talloc_zero() on "state" already
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit da93b648abc5a50c2acd738f49a3e100fcb1efb2
Author: Volker Lendecke <vl at samba.org>
Date: Fri Feb 17 09:29:38 2023 +0100
Fix a typo
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit bf6599fecea3a21b0193618f9c87e853d9eb163d
Author: David Mulder <dmulder at samba.org>
Date: Tue Mar 7 14:57:36 2023 -0700
samba-tool: Ensure modifying GPO increments GPT.INI vers
When we modify a GPO, we must increment the
version number in the GPT.INI, otherwise client
machines won't process the update.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15327
Signed-off-by: David Mulder <dmulder at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
commit ce29f55129f6e78b9ac9a36b4f77d7f555cdbeb6
Author: David Mulder <dmulder at samba.org>
Date: Tue Mar 7 14:58:46 2023 -0700
samba-tool: Test that modifying GPO increments GPT.INI vers
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15327
Signed-off-by: David Mulder <dmulder at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
commit 42517d576ac58b8a7b476af609fe568e10aafeb0
Author: David Mulder <dmulder at samba.org>
Date: Tue Mar 7 15:44:32 2023 -0700
samba-tool: Subclass GPOCommand for calling samdb_connect
These sub commands will need to call samdb_connect in an upcoming
commit. Subclass from GPOCommand to make this possible.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15327
Signed-off-by: David Mulder <dmulder at samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
-----------------------------------------------------------------------
Summary of changes:
VERSION | 2 +-
lib/util/samba_util.h | 8 ---
lib/util/util.c | 11 ++++
lib/util/util.h | 12 +++++
lib/util/util_str.c | 14 +++---
libcli/security/access_check.c | 3 +-
libcli/security/create_descriptor.c | 3 +-
libcli/security/display_sec.c | 2 +-
libcli/security/object_tree.c | 2 +-
libcli/security/sddl.c | 33 ++++++------
libcli/security/secace.c | 12 ++---
libcli/security/secacl.c | 2 +-
libcli/security/secdesc.c | 10 ++--
libcli/security/security_descriptor.c | 34 ++++++-------
libcli/security/security_token.c | 3 +-
libcli/security/security_token.h | 2 +
libcli/security/session.c | 3 +-
libcli/security/util_sid.c | 3 +-
libcli/util/doserr.c | 33 ++++++------
libcli/util/doserr.h | 8 +--
libcli/util/errmap_unix.c | 8 +--
libcli/util/error.h | 10 ++--
libcli/util/errormap.c | 40 +++++++--------
libcli/util/ntstatus.h | 6 +--
libcli/util/werror.h | 12 ++---
libcli/util/wscript_build | 9 +++-
librpc/rpc/dcerpc_util.c | 2 +-
python/samba/netcmd/gpo.py | 93 ++++++++++++++++++++++++++++------
python/samba/tests/samba_tool/gpo.py | 95 +++++++++++++++++++++++++++++++++++
source3/libsmb/clifile.c | 36 +++++++------
source3/libsmb/dsgetdcname.c | 49 +++++++++---------
source3/libsmb/proto.h | 7 ++-
source3/modules/vfs_acl_common.c | 2 +-
source3/rpc_server/rpc_host.c | 2 +-
source3/smbd/smb2_create.c | 20 ++++++++
source3/smbd/smb2_getinfo.c | 3 +-
source3/smbd/smb2_trans2.c | 4 +-
source3/smbd/smbXsrv_open.c | 2 +-
source4/scripting/bin/gen_werror.py | 37 +++++++-------
39 files changed, 418 insertions(+), 219 deletions(-)
Changeset truncated at 500 lines:
diff --git a/VERSION b/VERSION
index a850ffa9b9a..667a209b999 100644
--- a/VERSION
+++ b/VERSION
@@ -117,7 +117,7 @@ SAMBA_VERSION_RELEASE_NICKNAME=
# #
# <MAJOR>.<MINOR>.<RELEASE>[...]-<VENDOR_SUFFIX> #
# #
-# Note the '-' is automaticaly added #
+# Note the '-' is automatically added #
# #
# e.g. SAMBA_VERSION_VENDOR_SUFFIX=VendorVersion #
# -> "3.0.0rc2-VendorVersion" #
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index f7e13bc8884..95470a066a3 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -543,14 +543,6 @@ char *smb_xstrndup(const char *s, size_t n);
**/
_PUBLIC_ void *smb_memdup(const void *p, size_t size);
-/**
- * Write a password to the log file.
- *
- * @note Only actually does something if DEBUG_PASSWORD was defined during
- * compile-time.
- */
-_PUBLIC_ void dump_data_pw(const char *msg, const uint8_t * data, size_t len);
-
/**
* see if a range of memory is all zero. A NULL pointer is considered
* to be all zero
diff --git a/lib/util/util.c b/lib/util/util.c
index ecb32a9acaf..faa4218d19f 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -828,6 +828,17 @@ _PUBLIC_ void dump_data_pw(const char *msg, const uint8_t * data, size_t len)
#endif
}
+static void dump_data_addbuf_cb(const char *buf, void *private_data)
+{
+ char **str = private_data;
+ talloc_asprintf_addbuf(str, "%s", buf);
+}
+
+_PUBLIC_ void dump_data_addbuf(const uint8_t *buf, size_t buflen, char **str)
+{
+ dump_data_cb(buf, buflen, false, dump_data_addbuf_cb, str);
+}
+
/**
* see if a range of memory is all zero. A NULL pointer is considered
diff --git a/lib/util/util.h b/lib/util/util.h
index 072f0486234..59d24a8babf 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -79,4 +79,16 @@ _PUBLIC_ void dump_data_file_diff(FILE *f,
const uint8_t *buf1, size_t len1,
const uint8_t *buf2, size_t len2);
+/**
+ * Write a password to the log file.
+ *
+ * @note Only actually does something if DEBUG_PASSWORD was defined during
+ * compile-time.
+ */
+_PUBLIC_ void dump_data_pw(const char *msg, const uint8_t * data, size_t len);
+
+/**
+ * Dump data to "str" via talloc_asprintf_addbuf()
+ */
+_PUBLIC_ void dump_data_addbuf(const uint8_t *buf, size_t buflen, char **str);
#endif
diff --git a/lib/util/util_str.c b/lib/util/util_str.c
index 833eb754918..7c1d15dbeb0 100644
--- a/lib/util/util_str.c
+++ b/lib/util/util_str.c
@@ -1,22 +1,22 @@
-/*
+/*
Unix SMB/CIFS implementation.
Samba utility functions
-
+
Copyright (C) Andrew Tridgell 1992-2001
Copyright (C) Simo Sorce 2001-2002
Copyright (C) Martin Pool 2003
Copyright (C) James Peach 2005
-
+
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/>.
*/
@@ -59,7 +59,7 @@ _PUBLIC_ bool conv_str_bool(const char * str, bool * val)
}
/**
- * Convert a size specification like 16K into an integral number of bytes.
+ * Convert a size specification like 16K into an integral number of bytes.
**/
_PUBLIC_ bool conv_str_size_error(const char * str, uint64_t * val)
{
@@ -132,7 +132,7 @@ _PUBLIC_ bool strequal(const char *s1, const char *s2)
return true;
if (!s1 || !s2)
return false;
-
+
return strcasecmp_m(s1,s2) == 0;
}
diff --git a/libcli/security/access_check.c b/libcli/security/access_check.c
index 7d8eca74c43..482ab4ce145 100644
--- a/libcli/security/access_check.c
+++ b/libcli/security/access_check.c
@@ -21,7 +21,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
+#include "replace.h"
+#include "lib/util/debug.h"
#include "libcli/security/security.h"
/* Map generic access rights to object specific rights. This technique is
diff --git a/libcli/security/create_descriptor.c b/libcli/security/create_descriptor.c
index ef60d847033..5a2351511ce 100644
--- a/libcli/security/create_descriptor.c
+++ b/libcli/security/create_descriptor.c
@@ -26,7 +26,8 @@
*
* Author: Nadezhda Ivanova
*/
-#include "includes.h"
+#include "replace.h"
+#include "lib/util/debug.h"
#include "libcli/security/security.h"
#include "librpc/gen_ndr/ndr_security.h"
diff --git a/libcli/security/display_sec.c b/libcli/security/display_sec.c
index d75b89071c3..3fc338fb233 100644
--- a/libcli/security/display_sec.c
+++ b/libcli/security/display_sec.c
@@ -18,7 +18,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
+#include "replace.h"
#include "libcli/security/security.h"
#include "librpc/ndr/libndr.h"
#include "libcli/security/display_sec.h"
diff --git a/libcli/security/object_tree.c b/libcli/security/object_tree.c
index fd00068ef7a..c1025e766f6 100644
--- a/libcli/security/object_tree.c
+++ b/libcli/security/object_tree.c
@@ -28,7 +28,7 @@
*
* Author: Nadezhda Ivanova
*/
-#include "includes.h"
+#include "replace.h"
#include "libcli/security/security.h"
#include "librpc/ndr/libndr.h"
diff --git a/libcli/security/sddl.c b/libcli/security/sddl.c
index e6c3c94f215..076f040cfb8 100644
--- a/libcli/security/sddl.c
+++ b/libcli/security/sddl.c
@@ -1,25 +1,26 @@
-/*
+/*
Unix SMB/CIFS implementation.
security descriptor description language functions
Copyright (C) Andrew Tridgell 2005
-
+
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/>.
*/
-#include "includes.h"
+#include "replace.h"
+#include "lib/util/debug.h"
#include "libcli/security/security.h"
#include "librpc/gen_ndr/ndr_misc.h"
#include "system/locale.h"
@@ -52,7 +53,7 @@ static bool sddl_map_flag(
/*
map a series of letter codes into a uint32_t
*/
-static bool sddl_map_flags(const struct flag_map *map, const char *str,
+static bool sddl_map_flags(const struct flag_map *map, const char *str,
uint32_t *pflags, size_t *plen)
{
const char *str0 = str;
@@ -336,7 +337,7 @@ static bool sddl_decode_ace(TALLOC_CTX *mem_ctx, struct security_ace *ace, char
return false;
}
ace->flags = v;
-
+
/* access mask */
ok = sddl_decode_access(tok[2], &ace->access_mask);
if (!ok) {
@@ -345,7 +346,7 @@ static bool sddl_decode_ace(TALLOC_CTX *mem_ctx, struct security_ace *ace, char
/* object */
if (tok[3][0] != 0) {
- NTSTATUS status = GUID_from_string(tok[3],
+ NTSTATUS status = GUID_from_string(tok[3],
&ace->object.object.type.type);
if (!NT_STATUS_IS_OK(status)) {
return false;
@@ -355,7 +356,7 @@ static bool sddl_decode_ace(TALLOC_CTX *mem_ctx, struct security_ace *ace, char
/* inherit object */
if (tok[4][0] != 0) {
- NTSTATUS status = GUID_from_string(tok[4],
+ NTSTATUS status = GUID_from_string(tok[4],
&ace->object.object.inherited_type.inherited_type);
if (!NT_STATUS_IS_OK(status)) {
return false;
@@ -385,7 +386,7 @@ static const struct flag_map acl_flags[] = {
/*
decode an ACL
*/
-static struct security_acl *sddl_decode_acl(struct security_descriptor *sd,
+static struct security_acl *sddl_decode_acl(struct security_descriptor *sd,
const char **sddlp, uint32_t *flags,
const struct dom_sid *domain_sid)
{
@@ -420,13 +421,13 @@ static struct security_acl *sddl_decode_acl(struct security_descriptor *sd,
talloc_free(acl);
return NULL;
}
- acl->aces = talloc_realloc(acl, acl->aces, struct security_ace,
+ acl->aces = talloc_realloc(acl, acl->aces, struct security_ace,
acl->num_aces+1);
if (acl->aces == NULL) {
talloc_free(acl);
return NULL;
}
- if (!sddl_decode_ace(acl->aces, &acl->aces[acl->num_aces],
+ if (!sddl_decode_ace(acl->aces, &acl->aces[acl->num_aces],
astr, domain_sid)) {
talloc_free(acl);
return NULL;
@@ -461,7 +462,7 @@ struct security_descriptor *sddl_decode(TALLOC_CTX *mem_ctx, const char *sddl,
sd->revision = SECURITY_DESCRIPTOR_REVISION_1;
sd->type = SEC_DESC_SELF_RELATIVE;
-
+
while (*sddl) {
uint32_t flags;
char c = sddl[0];
@@ -554,7 +555,7 @@ static char *sddl_encode_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
sidstr = dom_sid_string(mem_ctx, sid);
if (sidstr == NULL) return NULL;
- /* seen if its a well known sid */
+ /* seen if its a well known sid */
for (i=0;sid_codes[i].sid;i++) {
if (strcmp(sidstr, sid_codes[i].sid) == 0) {
talloc_free(sidstr);
@@ -572,7 +573,7 @@ static char *sddl_encode_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
}
}
}
-
+
talloc_free(sidstr);
/* TODO: encode well known sids as two letter codes */
@@ -732,5 +733,3 @@ failed:
talloc_free(sddl);
return NULL;
}
-
-
diff --git a/libcli/security/secace.c b/libcli/security/secace.c
index 26c366ac39c..2452da24b0f 100644
--- a/libcli/security/secace.c
+++ b/libcli/security/secace.c
@@ -1,26 +1,26 @@
-/*
+/*
* Unix SMB/Netbios implementation.
* struct security_ace handling functions
* Copyright (C) Andrew Tridgell 1992-1998,
* Copyright (C) Jeremy R. Allison 1995-2003.
* Copyright (C) Luke Kenneth Casson Leighton 1996-1998,
* Copyright (C) Paul Ashton 1997-1998.
- *
+ *
* 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/>.
*/
-#include "includes.h"
+#include "replace.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/security/security.h"
#include "lib/util/tsort.h"
@@ -167,5 +167,3 @@ void dacl_sort_into_canonical_order(struct security_ace *srclist, unsigned int n
/* Now sort the inherited ACEs. */
TYPESAFE_QSORT(&srclist[i], num_aces - i, nt_ace_canon_comp);
}
-
-
diff --git a/libcli/security/secacl.c b/libcli/security/secacl.c
index a367ab676d2..6c92a2eda76 100644
--- a/libcli/security/secacl.c
+++ b/libcli/security/secacl.c
@@ -20,7 +20,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
+#include "replace.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/security/secace.h"
#include "libcli/security/secacl.h"
diff --git a/libcli/security/secdesc.c b/libcli/security/secdesc.c
index cd944306ee1..cb8037cc3cf 100644
--- a/libcli/security/secdesc.c
+++ b/libcli/security/secdesc.c
@@ -20,7 +20,9 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
+#include "replace.h"
+#include "lib/util/debug.h"
+#include "lib/util/fault.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "libcli/security/security.h"
@@ -448,8 +450,6 @@ NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx,
unsigned int new_ace_list_ndx = 0, i;
bool set_inherited_flags = (parent_ctr->type & SEC_DESC_DACL_AUTO_INHERITED);
- TALLOC_CTX *frame;
-
*ppsd = NULL;
*psize = 0;
@@ -472,8 +472,6 @@ NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx,
new_ace_list = NULL;
}
- frame = talloc_stackframe();
-
for (i = 0; i < the_acl->num_aces; i++) {
const struct security_ace *ace = &the_acl->aces[i];
struct security_ace *new_ace = &new_ace_list[new_ace_list_ndx];
@@ -563,8 +561,6 @@ NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx,
new_ace_list_ndx++;
}
- talloc_free(frame);
-
/*
* remove duplicates
*/
diff --git a/libcli/security/security_descriptor.c b/libcli/security/security_descriptor.c
index 23d436dbaeb..ff3aa07606c 100644
--- a/libcli/security/security_descriptor.c
+++ b/libcli/security/security_descriptor.c
@@ -1,25 +1,25 @@
-/*
+/*
Unix SMB/CIFS implementation.
- security descriptror utility functions
+ security descriptor utility functions
Copyright (C) Andrew Tridgell 2004
-
+
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/>.
*/
-#include "includes.h"
+#include "replace.h"
#include "libcli/security/security.h"
#include "librpc/ndr/libndr.h"
@@ -87,7 +87,7 @@ struct security_acl *security_acl_dup(TALLOC_CTX *mem_ctx,
failed:
talloc_free (nacl);
return NULL;
-
+
}
struct security_acl *security_acl_concatenate(TALLOC_CTX *mem_ctx,
@@ -140,10 +140,10 @@ struct security_acl *security_acl_concatenate(TALLOC_CTX *mem_ctx,
}
-/*
+/*
talloc and copy a security descriptor
*/
-struct security_descriptor *security_descriptor_copy(TALLOC_CTX *mem_ctx,
+struct security_descriptor *security_descriptor_copy(TALLOC_CTX *mem_ctx,
const struct security_descriptor *osd)
{
struct security_descriptor *nsd;
@@ -159,7 +159,7 @@ struct security_descriptor *security_descriptor_copy(TALLOC_CTX *mem_ctx,
goto failed;
}
}
-
+
if (osd->group_sid) {
nsd->group_sid = dom_sid_dup(nsd, osd->group_sid);
if (nsd->group_sid == NULL) {
@@ -552,7 +552,7 @@ bool security_ace_equal(const struct security_ace *ace1,
/*
compare two security acl structures
*/
-bool security_acl_equal(const struct security_acl *acl1,
+bool security_acl_equal(const struct security_acl *acl1,
const struct security_acl *acl2)
{
uint32_t i;
@@ -565,13 +565,13 @@ bool security_acl_equal(const struct security_acl *acl1,
for (i=0;i<acl1->num_aces;i++) {
if (!security_ace_equal(&acl1->aces[i], &acl2->aces[i])) return false;
}
- return true;
+ return true;
}
/*
compare two security descriptors.
*/
-bool security_descriptor_equal(const struct security_descriptor *sd1,
+bool security_descriptor_equal(const struct security_descriptor *sd1,
const struct security_descriptor *sd2)
{
if (sd1 == sd2) return true;
@@ -584,15 +584,15 @@ bool security_descriptor_equal(const struct security_descriptor *sd1,
if (!security_acl_equal(sd1->sacl, sd2->sacl)) return false;
--
Samba Shared Repository
More information about the samba-cvs
mailing list