[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Fri Oct 2 22:51:05 UTC 2020
The branch, master has been updated
via 666d2a38fcf libcli: Use GUID_to_ndr_buf() in smb2cli_validate_negotiate_info_send()
via 63ab004e38b libcli: Use GUID_to_ndr_buf() in smbXcli_negprot_smb2_subreq()
via 39180ca2d89 libcli: Use GUID_to_ndr_buf() in smb2_create_send()
via b1fa3e2bcc5 libcli: Use GUID_to_ndr_buf() in smbcli_push_guid()
via 5f1161f441c smbd: Use GUID_to_ndr_buf() in fsctl_validate_neg_info()
via bc638871245 smbd: Use GUID_to_ndr_buf() in smbXsrv_client_global_id_to_key()
via 77877cfed19 libcli: Use GUID_to_ndr_buf() in ldap_encode_ndr_GUID()
via 29e3c0cdb78 librpc: Use GUID_to_ndr_buf() in GUID_to_ndr_blob()
via bbb017637e8 librpc: Add GUID_to_ndr_buf()
via dfc870b6cd5 mdssvc: Slightly simplify dalloc_size()
via a61ed4df0e0 libcli: Align some integer types
via 5a143c09316 lib: Avoid a use of includes.h
via bcbe736300e vfs_fruit: Fix typos
via 552ceb5b41d smbd: Use ISDOT/ISDOTDOT instead of strcmp
via 818103c8250 vfs: Fix a typo
via f58ae505a24 torture3: Fix a cut&paste error in a printf message
via 6d369438b88 vfs: Fix a typo
via bb8d3330704 libcli: Don't leave a pointer uninitialized
via 9b453f475fe libcli: Remove a pointless if-expression
via 4c1f61cb800 libads: Improve a debug message
via f02e76d0237 libads: Improve a debug message
from 322574834f1 vfs: remove dirfsp arg from SMB_VFS_CREATE_FILE()
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 666d2a38fcf62eda3529ae21575381e43b2c046f
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 10:55:07 2020 +0200
libcli: Use GUID_to_ndr_buf() in smb2cli_validate_negotiate_info_send()
Avoid a talloc/free
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Fri Oct 2 22:50:43 UTC 2020 on sn-devel-184
commit 63ab004e38b24929b3f578e5db0574938c63aeb5
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 10:53:42 2020 +0200
libcli: Use GUID_to_ndr_buf() in smbXcli_negprot_smb2_subreq()
Avoid a talloc/free
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 39180ca2d8932946aee3327668966098b9f229e0
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 10:45:52 2020 +0200
libcli: Use GUID_to_ndr_buf() in smb2_create_send()
Avoid talloc/free
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit b1fa3e2bcc5fc2e08d335d2eb470c37f744cb5ab
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 10:43:29 2020 +0200
libcli: Use GUID_to_ndr_buf() in smbcli_push_guid()
Avoid two talloc/free
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 5f1161f441c74f09dd5af3954fc28b0d3534822e
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 10:20:41 2020 +0200
smbd: Use GUID_to_ndr_buf() in fsctl_validate_neg_info()
Avoid a talloc/free
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit bc6388712458ae4a278ac98b0a2f2bb286840923
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 10:17:29 2020 +0200
smbd: Use GUID_to_ndr_buf() in smbXsrv_client_global_id_to_key()
Avoid a talloc/free
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 77877cfed19ea98bfac3ba43529589f4cdd33714
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 10:13:20 2020 +0200
libcli: Use GUID_to_ndr_buf() in ldap_encode_ndr_GUID()
Avoid a talloc/free
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 29e3c0cdb787d8316287413c09d4584dda87b621
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 10:09:48 2020 +0200
librpc: Use GUID_to_ndr_buf() in GUID_to_ndr_blob()
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit bbb017637e85d9700c4f6ed8f43d47b40f38711a
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 09:59:29 2020 +0200
librpc: Add GUID_to_ndr_buf()
Avoids talloc
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit dfc870b6cd5ccaad7a14af04f455ac9d77566962
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 12:06:34 2020 +0200
mdssvc: Slightly simplify dalloc_size()
talloc_get_size() and thus talloc_array_length() deals fine with a
NULL pointer
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit a61ed4df0e050e3558820945808c5b67caac0ccb
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 09:55:22 2020 +0200
libcli: Align some integer types
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 5a143c09316f2984be3988805176163fb278ee2f
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 09:51:48 2020 +0200
lib: Avoid a use of includes.h
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit bcbe736300e974662017f820d636d5e3b749889a
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 17:35:19 2020 +0200
vfs_fruit: Fix typos
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 552ceb5b41deb44e7ba1f827d9d5ff22745489c1
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 13:04:28 2020 +0200
smbd: Use ISDOT/ISDOTDOT instead of strcmp
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 818103c8250fedd4dae82f8eb40e9f7b97a8f611
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 29 12:56:26 2020 +0200
vfs: Fix a typo
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit f58ae505a24f8c8d4957d67244b27d46628282a0
Author: Volker Lendecke <vl at samba.org>
Date: Tue Sep 15 10:30:37 2020 +0200
torture3: Fix a cut&paste error in a printf message
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 6d369438b886fcbb8b480092c8b19b1db94b06d2
Author: Volker Lendecke <vl at samba.org>
Date: Wed Aug 26 08:55:30 2020 +0200
vfs: Fix a typo
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit bb8d3330704cc3e411a9b1805a042b02d3d80a93
Author: Volker Lendecke <vl at samba.org>
Date: Mon Aug 24 22:31:01 2020 +0200
libcli: Don't leave a pointer uninitialized
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 9b453f475fe08db369c5dec6446b988f92d58951
Author: Volker Lendecke <vl at samba.org>
Date: Mon Aug 24 22:29:19 2020 +0200
libcli: Remove a pointless if-expression
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 4c1f61cb800da80e2f8844a66ac7fa201f87b8c4
Author: Volker Lendecke <vl at samba.org>
Date: Tue Aug 18 09:16:22 2020 +0200
libads: Improve a debug message
"kdc_ip_string" is a multi-line string starting with a tab. It looks
better in the debug message when starting in a new line.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit f02e76d0237dc574c4eb732f420217e2ab886d27
Author: Volker Lendecke <vl at samba.org>
Date: Tue Aug 18 09:16:22 2020 +0200
libads: Improve a debug message
"kdc_str" is a multi-line string starting with a tab. It looks
better in the debug message when starting in a new line.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
-----------------------------------------------------------------------
Summary of changes:
libcli/ldap/ldap_ndr.c | 6 +++---
libcli/security/sddl.c | 4 ++--
libcli/security/security_token.c | 9 ++------
libcli/smb/smbXcli_base.c | 16 +++++++-------
librpc/ABI/{ndr-1.0.0.sigs => ndr-1.0.1.sigs} | 1 +
librpc/ndr/libndr.h | 2 ++
librpc/ndr/uuid.c | 31 +++++++++++++++++++++------
librpc/wscript_build | 2 +-
source3/include/MacExtensions.h | 8 +++----
source3/libads/kerberos.c | 7 +++---
source3/modules/vfs_shadow_copy2.c | 2 +-
source3/modules/vfs_xattr_tdb.c | 2 +-
source3/rpc_server/mdssvc/dalloc.c | 5 -----
source3/smbd/dir.c | 2 +-
source3/smbd/smb2_ioctl_network_fs.c | 7 +++---
source3/smbd/smbXsrv_client.c | 7 +++---
source3/torture/test_smb2.c | 2 +-
source4/libcli/raw/rawrequest.c | 10 ++++-----
source4/libcli/smb2/create.c | 22 ++++++++-----------
19 files changed, 74 insertions(+), 71 deletions(-)
copy librpc/ABI/{ndr-1.0.0.sigs => ndr-1.0.1.sigs} (99%)
Changeset truncated at 500 lines:
diff --git a/libcli/ldap/ldap_ndr.c b/libcli/ldap/ldap_ndr.c
index 1743415f0fd..4f63bc179e7 100644
--- a/libcli/ldap/ldap_ndr.c
+++ b/libcli/ldap/ldap_ndr.c
@@ -63,15 +63,15 @@ char *ldap_encode_ndr_dom_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid)
*/
char *ldap_encode_ndr_GUID(TALLOC_CTX *mem_ctx, const struct GUID *guid)
{
- DATA_BLOB blob;
+ struct GUID_ndr_buf buf = { .buf = {0}, };
+ DATA_BLOB blob = { .data = buf.buf, .length = sizeof(buf.buf), };
NTSTATUS status;
char *ret;
- status = GUID_to_ndr_blob(guid, mem_ctx, &blob);
+ status = GUID_to_ndr_buf(guid, &buf);
if (!NT_STATUS_IS_OK(status)) {
return NULL;
}
ret = ldb_binary_encode(mem_ctx, blob);
- data_blob_free(&blob);
return ret;
}
diff --git a/libcli/security/sddl.c b/libcli/security/sddl.c
index 935a1d20503..ec8cc98e10a 100644
--- a/libcli/security/sddl.c
+++ b/libcli/security/sddl.c
@@ -124,7 +124,7 @@ static struct dom_sid *sddl_decode_sid(TALLOC_CTX *mem_ctx, const char **sddlp,
const struct dom_sid *domain_sid)
{
const char *sddl = (*sddlp);
- int i;
+ size_t i;
/* see if its in the numeric format */
if (strncmp(sddl, "S-", 2) == 0) {
@@ -456,7 +456,7 @@ failed:
static char *sddl_encode_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
const struct dom_sid *domain_sid)
{
- int i;
+ size_t i;
char *sidstr;
sidstr = dom_sid_string(mem_ctx, sid);
diff --git a/libcli/security/security_token.c b/libcli/security/security_token.c
index ad03f2d100d..186b6434006 100644
--- a/libcli/security/security_token.c
+++ b/libcli/security/security_token.c
@@ -31,13 +31,8 @@
*/
struct security_token *security_token_initialise(TALLOC_CTX *mem_ctx)
{
- struct security_token *st;
-
- st = talloc_zero(mem_ctx, struct security_token);
- if (!st) {
- return NULL;
- }
-
+ struct security_token *st = talloc_zero(
+ mem_ctx, struct security_token);
return st;
}
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 7d2da4b9ebc..96726458676 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -4749,14 +4749,14 @@ static struct tevent_req *smbXcli_negprot_smb2_subreq(struct smbXcli_negprot_sta
}
if (state->conn->max_protocol >= PROTOCOL_SMB2_10) {
NTSTATUS status;
- DATA_BLOB blob;
+ struct GUID_ndr_buf guid_buf = { .buf = {0}, };
- status = GUID_to_ndr_blob(&state->conn->smb2.client.guid,
- state, &blob);
+ status = GUID_to_ndr_buf(&state->conn->smb2.client.guid,
+ &guid_buf);
if (!NT_STATUS_IS_OK(status)) {
return NULL;
}
- memcpy(buf+12, blob.data, 16); /* ClientGuid */
+ memcpy(buf+12, guid_buf.buf, 16); /* ClientGuid */
} else {
memset(buf+12, 0, 16); /* ClientGuid */
}
@@ -5327,14 +5327,14 @@ struct tevent_req *smb2cli_validate_negotiate_info_send(TALLOC_CTX *mem_ctx,
}
if (state->conn->max_protocol >= PROTOCOL_SMB2_10) {
NTSTATUS status;
- DATA_BLOB blob;
+ struct GUID_ndr_buf guid_buf = { .buf = {0}, };
- status = GUID_to_ndr_blob(&conn->smb2.client.guid,
- state, &blob);
+ status = GUID_to_ndr_buf(&conn->smb2.client.guid,
+ &guid_buf);
if (!NT_STATUS_IS_OK(status)) {
return NULL;
}
- memcpy(buf+4, blob.data, 16); /* ClientGuid */
+ memcpy(buf+4, guid_buf.buf, 16); /* ClientGuid */
} else {
memset(buf+4, 0, 16); /* ClientGuid */
}
diff --git a/librpc/ABI/ndr-1.0.0.sigs b/librpc/ABI/ndr-1.0.1.sigs
similarity index 99%
copy from librpc/ABI/ndr-1.0.0.sigs
copy to librpc/ABI/ndr-1.0.1.sigs
index bc7c3e88848..84150859c9c 100644
--- a/librpc/ABI/ndr-1.0.0.sigs
+++ b/librpc/ABI/ndr-1.0.1.sigs
@@ -10,6 +10,7 @@ GUID_random: struct GUID (void)
GUID_string: char *(TALLOC_CTX *, const struct GUID *)
GUID_string2: char *(TALLOC_CTX *, const struct GUID *)
GUID_to_ndr_blob: NTSTATUS (const struct GUID *, TALLOC_CTX *, DATA_BLOB *)
+GUID_to_ndr_buf: NTSTATUS (const struct GUID *, struct GUID_ndr_buf *)
GUID_zero: struct GUID (void)
_ndr_pull_error: enum ndr_err_code (struct ndr_pull *, enum ndr_err_code, const char *, const char *, const char *, ...)
_ndr_push_error: enum ndr_err_code (struct ndr_push *, enum ndr_err_code, const char *, const char *, const char *, ...)
diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h
index fd87db928ed..8bb0def40c0 100644
--- a/librpc/ndr/libndr.h
+++ b/librpc/ndr/libndr.h
@@ -775,6 +775,8 @@ enum ndr_err_code ndr_push_charset_to_null(struct ndr_push *ndr, int ndr_flags,
/* GUIDs */
bool GUID_equal(const struct GUID *u1, const struct GUID *u2);
+struct GUID_ndr_buf { uint8_t buf[16]; };
+NTSTATUS GUID_to_ndr_buf(const struct GUID *guid, struct GUID_ndr_buf *buf);
NTSTATUS GUID_to_ndr_blob(const struct GUID *guid, TALLOC_CTX *mem_ctx, DATA_BLOB *b);
NTSTATUS GUID_from_ndr_blob(const DATA_BLOB *b, struct GUID *guid);
NTSTATUS GUID_from_data_blob(const DATA_BLOB *s, struct GUID *guid);
diff --git a/librpc/ndr/uuid.c b/librpc/ndr/uuid.c
index 6c5082190ca..ad5c9d37d11 100644
--- a/librpc/ndr/uuid.c
+++ b/librpc/ndr/uuid.c
@@ -21,23 +21,42 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
+#include "replace.h"
+#include "lib/util/samba_util.h"
+#include "lib/util/genrand.h"
#include "librpc/ndr/libndr.h"
#include "librpc/gen_ndr/ndr_misc.h"
#include "lib/util/util_str_hex.h"
+
+_PUBLIC_ NTSTATUS GUID_to_ndr_buf(
+ const struct GUID *guid, struct GUID_ndr_buf *buf)
+{
+ DATA_BLOB b = { .data = buf->buf, .length = sizeof(buf->buf), };
+ enum ndr_err_code ndr_err;
+
+ ndr_err = ndr_push_struct_into_fixed_blob(
+ &b, guid, (ndr_push_flags_fn_t)ndr_push_GUID);
+ return ndr_map_error2ntstatus(ndr_err);
+}
+
/**
build a NDR blob from a GUID
*/
_PUBLIC_ NTSTATUS GUID_to_ndr_blob(const struct GUID *guid, TALLOC_CTX *mem_ctx, DATA_BLOB *b)
{
- enum ndr_err_code ndr_err;
- *b = data_blob_talloc(mem_ctx, NULL, 16);
+ struct GUID_ndr_buf buf = { .buf = {0}, };
+ NTSTATUS status;
+
+ status = GUID_to_ndr_buf(guid, &buf);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ *b = data_blob_talloc(mem_ctx, buf.buf, sizeof(buf.buf));
if (b->data == NULL) {
return NT_STATUS_NO_MEMORY;
}
- ndr_err = ndr_push_struct_into_fixed_blob(
- b, guid, (ndr_push_flags_fn_t)ndr_push_GUID);
- return ndr_map_error2ntstatus(ndr_err);
+ return NT_STATUS_OK;
}
diff --git a/librpc/wscript_build b/librpc/wscript_build
index 398b299f339..9da1a3c8192 100644
--- a/librpc/wscript_build
+++ b/librpc/wscript_build
@@ -643,7 +643,7 @@ bld.SAMBA_LIBRARY('ndr',
public_deps='samba-errors talloc samba-util util_str_hex',
public_headers='gen_ndr/misc.h gen_ndr/ndr_misc.h ndr/libndr.h:ndr.h',
header_path= [('*gen_ndr*', 'gen_ndr')],
- vnum='1.0.0',
+ vnum='1.0.1',
abi_directory='ABI',
abi_match='!ndr_table_* ndr_* GUID_* _ndr_pull_error _ndr_push_error',
)
diff --git a/source3/include/MacExtensions.h b/source3/include/MacExtensions.h
index 981cb1613ef..0d98df7d9b4 100644
--- a/source3/include/MacExtensions.h
+++ b/source3/include/MacExtensions.h
@@ -55,7 +55,7 @@
#define AFP_OFF_FinderInfo 16
/*
-** Orginal AFP_AfpInfo stream used by NT
+** Original AFP_AfpInfo stream used by NT
** We needed a way to store the create date so SAMBA
** AFP_AfpInfo adds for bytes to this structrure
** and call's it _SambaAfpInfo
@@ -78,7 +78,7 @@ typedef struct _SambaAfpInfo
} SambaAfpInfo;
/*
-** On SAMBA this structrue is followed by 4 bytes that store the create
+** On SAMBA this structure is followed by 4 bytes that store the create
** date of the file or folder asociated with it.
*/
@@ -93,10 +93,10 @@ typedef struct _SambaAfpInfo
** Second to return some basic need information about the share to the Macintosh.
** Third to see if this share support any other Macintosh extensions.
**
-** We will be using infromation levels that are betwwen 0x300 and 0x399 for all Macintosh
+** We will be using information levels that are between 0x300 and 0x399 for all Macintosh
** extensions calls. The first of these will be the SMB_MAC_QUERY_FS_INFO level which
** will allow the server to return the MacQueryFSInfo structure. All fields are Little
-** Endian unless other wise specified.
+** Endian unless otherwise specified.
*/
#define SMB_MAC_QUERY_FS_INFO 0x301
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index 583067aac73..75beeef4a44 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -585,7 +585,7 @@ static char *get_kdc_ip_string(char *mem_ctx,
result = kdc_str;
out:
- DEBUG(10, ("get_kdc_ip_string: Returning %s\n", kdc_str));
+ DBG_DEBUG("Returning\n%s\n", kdc_str);
TALLOC_FREE(ip_sa_site);
TALLOC_FREE(ip_sa_nonsite);
@@ -824,9 +824,8 @@ bool create_local_private_krb5_conf_for_domain(const char *realm,
goto done;
}
- DEBUG(5,("create_local_private_krb5_conf_for_domain: wrote "
- "file %s with realm %s KDC list = %s\n",
- fname, realm_upper, kdc_ip_string));
+ DBG_INFO("wrote file %s with realm %s KDC list:\n%s\n",
+ fname, realm_upper, kdc_ip_string);
/* Set the environment variable to this file. */
setenv("KRB5_CONFIG", fname, 1);
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index 3be93f985dd..5081e37c05e 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -1000,7 +1000,7 @@ static void convert_sbuf(vfs_handle_struct *handle, const char *fname,
return);
if (priv->config->fixinodes) {
- /* some snapshot systems, like GPFS, return the name
+ /* some snapshot systems, like GPFS, return the same
device:inode for the snapshot files as the current
files. That breaks the 'restore' button in the shadow copy
GUI, as the client gets a sharing violation.
diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c
index 58e3e3c7c92..c8cc247345d 100644
--- a/source3/modules/vfs_xattr_tdb.c
+++ b/source3/modules/vfs_xattr_tdb.c
@@ -576,7 +576,7 @@ static int xattr_tdb_mkdirat(vfs_handle_struct *handle,
return -1;
}
- /* Always use LSTAT here - we just creaded the directory. */
+ /* Always use LSTAT here - we just created the directory. */
ret = SMB_VFS_LSTAT(handle->conn, smb_fname_tmp);
if (ret == -1) {
/* Rename race. Let upper level take care of it. */
diff --git a/source3/rpc_server/mdssvc/dalloc.c b/source3/rpc_server/mdssvc/dalloc.c
index 2e13203c4c6..007702d4540 100644
--- a/source3/rpc_server/mdssvc/dalloc.c
+++ b/source3/rpc_server/mdssvc/dalloc.c
@@ -79,11 +79,6 @@ size_t dalloc_size(const DALLOC_CTX *d)
if (d == NULL) {
return 0;
}
-
- if (d->dd_talloc_array == NULL) {
- return 0;
- }
-
return talloc_array_length(d->dd_talloc_array);
}
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 6a2538549e4..0001726e582 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -1235,7 +1235,7 @@ bool is_visible_file(connection_struct *conn,
struct smb_filename *smb_fname_base = NULL;
bool ret = false;
- if ((strcmp(".",name) == 0) || (strcmp("..",name) == 0)) {
+ if (ISDOT(name) || ISDOTDOT(name)) {
return True; /* . and .. are always visible. */
}
diff --git a/source3/smbd/smb2_ioctl_network_fs.c b/source3/smbd/smb2_ioctl_network_fs.c
index f202cddd29c..e1881ae4485 100644
--- a/source3/smbd/smb2_ioctl_network_fs.c
+++ b/source3/smbd/smb2_ioctl_network_fs.c
@@ -443,7 +443,7 @@ static NTSTATUS fsctl_validate_neg_info(TALLOC_CTX *mem_ctx,
uint16_t in_security_mode;
uint16_t in_num_dialects;
uint16_t dialect;
- DATA_BLOB out_guid_blob;
+ struct GUID_ndr_buf out_guid_buf = { .buf = {0}, };
NTSTATUS status;
enum protocol_types protocol = PROTOCOL_NONE;
@@ -520,8 +520,7 @@ static NTSTATUS fsctl_validate_neg_info(TALLOC_CTX *mem_ctx,
return NT_STATUS_ACCESS_DENIED;
}
- status = GUID_to_ndr_blob(&conn->smb2.server.guid, mem_ctx,
- &out_guid_blob);
+ status = GUID_to_ndr_buf(&conn->smb2.server.guid, &out_guid_buf);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -532,7 +531,7 @@ static NTSTATUS fsctl_validate_neg_info(TALLOC_CTX *mem_ctx,
}
SIVAL(out_output->data, 0x00, conn->smb2.server.capabilities);
- memcpy(out_output->data+0x04, out_guid_blob.data, 16);
+ memcpy(out_output->data+0x04, out_guid_buf.buf, 16);
SSVAL(out_output->data, 0x14, conn->smb2.server.security_mode);
SSVAL(out_output->data, 0x16, conn->smb2.server.dialect);
diff --git a/source3/smbd/smbXsrv_client.c b/source3/smbd/smbXsrv_client.c
index fcfa225048a..93e2509041d 100644
--- a/source3/smbd/smbXsrv_client.c
+++ b/source3/smbd/smbXsrv_client.c
@@ -105,14 +105,13 @@ static TDB_DATA smbXsrv_client_global_id_to_key(const struct GUID *client_guid,
{
TDB_DATA key = { .dsize = 0, };
NTSTATUS status;
- DATA_BLOB b;
+ struct GUID_ndr_buf buf = { .buf = {0}, };
- status = GUID_to_ndr_blob(client_guid, talloc_tos(), &b);
+ status = GUID_to_ndr_buf(client_guid, &buf);
if (!NT_STATUS_IS_OK(status)) {
return key;
}
- memcpy(key_buf, b.data, SMBXSRV_CLIENT_GLOBAL_TDB_KEY_SIZE);
- data_blob_free(&b);
+ memcpy(key_buf, buf.buf, SMBXSRV_CLIENT_GLOBAL_TDB_KEY_SIZE);
key = make_tdb_data(key_buf, SMBXSRV_CLIENT_GLOBAL_TDB_KEY_SIZE);
diff --git a/source3/torture/test_smb2.c b/source3/torture/test_smb2.c
index d5023d88cfd..fbb1edfbe88 100644
--- a/source3/torture/test_smb2.c
+++ b/source3/torture/test_smb2.c
@@ -2884,7 +2884,7 @@ bool run_smb2_quota1(int dummy)
uint16_t fnum = (uint16_t)-1;
SMB_NTQUOTA_STRUCT qt = {0};
- printf("Starting SMB2-SACL\n");
+ printf("Starting SMB2-QUOTA1\n");
if (!torture_init_connection(&cli)) {
return false;
diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c
index 5805c2f66fc..3a6cf5d700d 100644
--- a/source4/libcli/raw/rawrequest.c
+++ b/source4/libcli/raw/rawrequest.c
@@ -1043,15 +1043,13 @@ NTSTATUS smbcli_pull_guid(void *base, uint16_t offset,
*/
NTSTATUS smbcli_push_guid(void *base, uint16_t offset, const struct GUID *guid)
{
- TALLOC_CTX *tmp_ctx = talloc_new(NULL);
NTSTATUS status;
- DATA_BLOB blob;
- status = GUID_to_ndr_blob(guid, tmp_ctx, &blob);
+ struct GUID_ndr_buf buf = { .buf = {0}, };
+
+ status = GUID_to_ndr_buf(guid, &buf);
if (!NT_STATUS_IS_OK(status)) {
- talloc_free(tmp_ctx);
return status;
}
- memcpy(offset + (uint8_t *)base, blob.data, blob.length);
- talloc_free(tmp_ctx);
+ memcpy(offset + (uint8_t *)base, buf.buf, sizeof(buf.buf));
return NT_STATUS_OK;
}
diff --git a/source4/libcli/smb2/create.c b/source4/libcli/smb2/create.c
index eb0f6a421cd..c91b1501107 100644
--- a/source4/libcli/smb2/create.c
+++ b/source4/libcli/smb2/create.c
@@ -109,7 +109,7 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
if (io->in.durable_open_v2) {
uint8_t data[32];
uint32_t flags = 0;
- DATA_BLOB guid_blob;
+ struct GUID_ndr_buf guid_buf = { .buf = {0}, };
SIVAL(data, 0, io->in.timeout);
if (io->in.persistent_open) {
@@ -117,13 +117,12 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
}
SIVAL(data, 4, flags);
SBVAL(data, 8, 0x0); /* reserved */
- status = GUID_to_ndr_blob(&io->in.create_guid, req, /* TALLOC_CTX */
- &guid_blob);
+ status = GUID_to_ndr_buf(&io->in.create_guid, &guid_buf);
if (!NT_STATUS_IS_OK(status)) {
talloc_free(req);
return NULL;
}
- memcpy(data+16, guid_blob.data, 16);
+ memcpy(data+16, guid_buf.buf, sizeof(guid_buf.buf));
status = smb2_create_blob_add(req, &blobs,
SMB2_CREATE_TAG_DH2Q,
@@ -147,17 +146,16 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
if (io->in.durable_handle_v2) {
uint8_t data[36];
- DATA_BLOB guid_blob;
+ struct GUID_ndr_buf guid_buf = { .buf = {0}, };
uint32_t flags = 0;
smb2_push_handle(data, io->in.durable_handle_v2);
- status = GUID_to_ndr_blob(&io->in.create_guid, req, /* TALLOC_CTX */
- &guid_blob);
+ status = GUID_to_ndr_buf(&io->in.create_guid, &guid_buf);
if (!NT_STATUS_IS_OK(status)) {
talloc_free(req);
return NULL;
}
- memcpy(data+16, guid_blob.data, 16);
+ memcpy(data+16, guid_buf.buf, sizeof(guid_buf.buf));
if (io->in.persistent_open) {
flags = SMB2_DHANDLE_FLAG_PERSISTENT;
}
@@ -247,19 +245,17 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
if (io->in.app_instance_id) {
uint8_t data[20];
- DATA_BLOB guid_blob;
+ struct GUID_ndr_buf guid_buf = { .buf = {0}, };
SSVAL(data, 0, 20); /* structure size */
SSVAL(data, 2, 0); /* reserved */
- status = GUID_to_ndr_blob(io->in.app_instance_id,
- req, /* TALLOC_CTX */
- &guid_blob);
+ status = GUID_to_ndr_buf(io->in.app_instance_id, &guid_buf);
if (!NT_STATUS_IS_OK(status)) {
talloc_free(req);
return NULL;
}
- memcpy(data+4, guid_blob.data, 16);
+ memcpy(data+4, guid_buf.buf, sizeof(guid_buf.buf));
status = smb2_create_blob_add(req, &blobs,
SMB2_CREATE_TAG_APP_INSTANCE_ID,
--
Samba Shared Repository
More information about the samba-cvs
mailing list