Discussion:
[SCM] Samba Shared Repository - branch v4-7-test updated
Karolin Seeger
2018-04-10 12:10:02 UTC
Permalink
The branch, v4-7-test has been updated
via 00428e8 s3: smbd: Fix memory leak in vfswrap_getwd()
via d217375 s3: lib: messages: Don't use the result of sec_init() before calling sec_init().
via c62c1c9 dsdb: Fix CID 1034966 Uninitialized scalar variable
via 119c28b s3:smbd: don't use the directory cache for SMB2/3
via 4de5e3b ctdb-scripts: Drop "net serverid wipe" from 50.samba event script
from 8ac2ffa s4: torture: Test all combinations of directory open with existing directory to ensure behavior is the same.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-7-test


- Log -----------------------------------------------------------------
commit 00428e8b36ee25110922989ec5507f875aba8797
Author: Jeremy Allison <***@samba.org>
Date: Fri Apr 6 13:52:52 2018 -0700

s3: smbd: Fix memory leak in vfswrap_getwd()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13372

Signed-off-by: Andrew Walker <***@ixsystems.com>.
Reviewed-by: Jeremy Allison <***@samba.org>
Reviewed-by: Ralph Boehme <***@samba.org>

Autobuild-User(master): Jeremy Allison <***@samba.org>
Autobuild-Date(master): Mon Apr 9 21:48:12 CEST 2018 on sn-devel-144

(cherry picked from commit 461a1172ff819692aa0a2dc5ce7fc5379c8a529e)

Autobuild-User(v4-7-test): Karolin Seeger <***@samba.org>
Autobuild-Date(v4-7-test): Tue Apr 10 14:09:46 CEST 2018 on sn-devel-144

commit d217375a87d49d65aeff9957d50046722b40e734
Author: Lutz Justen <***@google.com>
Date: Wed Apr 4 09:50:12 2018 -0700

s3: lib: messages: Don't use the result of sec_init() before calling sec_init().

Commit ad8c7171ba86e8a47d78b0c7329bb814e5a8871e accidently
moved sec_init() to the point after sec_initial_uid() is
called in the call to directory_create_or_exist_strict().
I missed this in the review (sorry). This works as root
as initial_uid/initial_gid are static (and so initialized
as zero) but doesn't work on ChromeOS as this code isn't
running as root.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13368

Signed-off-by: Lutz Justen <***@google.com>
Reviewed-by: Jeremy Allison <***@samba.org>
Reviewed-by: Andreas Schneider <***@samba.org>

Autobuild-User(master): Jeremy Allison <***@samba.org>
Autobuild-Date(master): Wed Apr 4 23:52:02 CEST 2018 on sn-devel-144

(cherry picked from commit e895b6cf4a7eb3d50d618a022be74db85975bf69)

commit c62c1c93f5712e7c3590eb9b9df9573300bd229a
Author: Volker Lendecke <***@samba.org>
Date: Wed Mar 28 15:43:53 2018 -0500

dsdb: Fix CID 1034966 Uninitialized scalar variable

"continue" in a do-while loop jumps to the "while"-check, so "id_exists" needs
to be initialized by that point.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13367

Signed-off-by: Volker Lendecke <***@samba.org>
Reviewed-by: Jeremy Allison <***@samba.org>
Reviewed-by: Stefan Metzmacher <***@samba.org>
(cherry picked from commit 925d1f23291c4bdbc832977b2b4577964b8301c8)

commit 119c28bba77f258f3d2912b9524884b369200b2d
Author: Ralph Boehme <***@samba.org>
Date: Thu Mar 29 20:06:47 2018 +0200

s3:smbd: don't use the directory cache for SMB2/3

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13363

Signed-off-by: Ralph Boehme <***@samba.org>
Reviewed-by: Jeremy Allison <***@samba.org>

Autobuild-User(master): Jeremy Allison <***@samba.org>
Autobuild-Date(master): Fri Mar 30 03:51:48 CEST 2018 on sn-devel-144

(cherry picked from commit 66052fdccd28922cf1caa2bc750e39051a6414cf)

commit 4de5e3bb09a62eae2e2f8f27d84251a5695ecf92
Author: Amitay Isaacs <***@gmail.com>
Date: Thu Mar 29 10:45:19 2018 +1100

ctdb-scripts: Drop "net serverid wipe" from 50.samba event script

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13359

There is no serverid database anymore.

Signed-off-by: Amitay Isaacs <***@gmail.com>
Reviewed-by: Volker Lendecke <***@samba.org>
Reviewed-by: Martin Schwenke <***@meltin.net>

Autobuild-User(master): Martin Schwenke <***@samba.org>
Autobuild-Date(master): Sat Mar 31 08:34:00 CEST 2018 on sn-devel-144

(cherry picked from commit 6b75d2c650aa9ee632122fa87ea8a2a98f1fa613)

-----------------------------------------------------------------------

Summary of changes:
ctdb/config/events.d/50.samba | 2 --
.../smbdotconf/misc/directorynamecachesize.xml | 5 ++--
source3/lib/messages.c | 9 ++++--
source3/modules/vfs_default.c | 9 ++++--
source3/smbd/dir.c | 32 ++++++++++++++++++++--
source4/dsdb/samdb/ldb_modules/samldb.c | 1 +
6 files changed, 46 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/config/events.d/50.samba b/ctdb/config/events.d/50.samba
index 4c32e4e..f0d8e84 100755
--- a/ctdb/config/events.d/50.samba
+++ b/ctdb/config/events.d/50.samba
@@ -53,8 +53,6 @@ service_start ()
# start Samba service. Start it reniced, as under very heavy load
# the number of smbd processes will mean that it leaves few cycles
# for anything else
- net serverid wipe
-
if [ -n "$CTDB_SERVICE_NMB" ] ; then
nice_service "$CTDB_SERVICE_NMB" start || die "Failed to start nmbd"
fi
diff --git a/docs-xml/smbdotconf/misc/directorynamecachesize.xml b/docs-xml/smbdotconf/misc/directorynamecachesize.xml
index 7a89bf2..22999a6 100644
--- a/docs-xml/smbdotconf/misc/directorynamecachesize.xml
+++ b/docs-xml/smbdotconf/misc/directorynamecachesize.xml
@@ -4,8 +4,9 @@
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
<description>
<para>
- This parameter specifies the size of the directory name cache.
- It will be needed to turn this off for *BSD systems.
+ This parameter specifies the size of the directory name cache for SMB1
+ connections. It is not used for SMB2. It will be needed to turn this off
+ for *BSD systems.
</para>

</description>
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index b94a696..fca3994 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -248,6 +248,13 @@ static NTSTATUS messaging_init_internal(TALLOC_CTX *mem_ctx,
const char *priv_path;
bool ok;

+ /*
+ * sec_init() *must* be called before any other
+ * functions that use sec_XXX(). e.g. sec_initial_uid().
+ */
+
+ sec_init();
+
lck_path = lock_path("msg.lock");
if (lck_path == NULL) {
return NT_STATUS_NO_MEMORY;
@@ -292,8 +299,6 @@ static NTSTATUS messaging_init_internal(TALLOC_CTX *mem_ctx,

ctx->event_ctx = ev;

- sec_init();
-
ctx->msg_dgm_ref = messaging_dgm_ref(ctx,
ctx->event_ctx,
&ctx->id.unique_id,
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 6686303..ead11ee 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -2235,9 +2235,12 @@ static struct smb_filename *vfswrap_getwd(vfs_handle_struct *handle,
NULL,
NULL,
0);
- if (smb_fname == NULL) {
- SAFE_FREE(result);
- }
+ /*
+ * sys_getwd() *always* returns malloced memory.
+ * We must free here to avoid leaks:
+ * BUG:https://bugzilla.samba.org/show_bug.cgi?id=13372
+ */
+ SAFE_FREE(result);
return smb_fname;
}

diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 19e2964..edac280 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -1227,7 +1227,15 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
mask, smb_fname_str_dbg(&smb_fname),
dname, fname));

- DirCacheAdd(dirptr->dir_hnd, dname, cur_offset);
+ if (!conn->sconn->using_smb2) {
+ /*
+ * The dircache is only needed for SMB1 because SMB1
+ * uses a name for the resume wheras SMB2 always
+ * continues from the next position (unless it's told to
+ * restart or close-and-reopen the listing).
+ */
+ DirCacheAdd(dirptr->dir_hnd, dname, cur_offset);
+ }

TALLOC_FREE(dname);

@@ -1654,7 +1662,16 @@ static struct smb_Dir *OpenDir_internal(TALLOC_CTX *mem_ctx,
}

dirp->conn = conn;
- dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn));
+
+ if (!conn->sconn->using_smb2) {
+ /*
+ * The dircache is only needed for SMB1 because SMB1 uses a name
+ * for the resume wheras SMB2 always continues from the next
+ * position (unless it's told to restart or close-and-reopen the
+ * listing).
+ */
+ dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn));
+ }

if (sconn && !sconn->using_smb2) {
sconn->searches.dirhandles_open++;
@@ -1776,7 +1793,16 @@ static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn,
}

dirp->conn = conn;
- dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn));
+
+ if (!conn->sconn->using_smb2) {
+ /*
+ * The dircache is only needed for SMB1 because SMB1 uses a name
+ * for the resume wheras SMB2 always continues from the next
+ * position (unless it's told to restart or close-and-reopen the
+ * listing).
+ */
+ dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn));
+ }

dirp->dir_smb_fname = cp_smb_filename(dirp, fsp->fsp_name);
if (!dirp->dir_smb_fname) {
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 3e429e1..11da629 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -875,6 +875,7 @@ static int samldb_add_handle_msDS_IntId(struct samldb_ctx *ac)
* order to be sure.
*/
if (dsdb_attribute_by_attributeID_id(schema, msds_intid)) {
+ id_exists = true;
msds_intid = generate_random() % 0X3FFFFFFF;
msds_intid += 0x80000000;
continue;
--
Samba Shared Repository
Karolin Seeger
2018-04-11 00:27:01 UTC
Permalink
The branch, v4-7-test has been updated
via d7f84b6 s3: smbd: Unix extensions attempts to change wrong field in fchown call.
from 00428e8 s3: smbd: Fix memory leak in vfswrap_getwd()

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-7-test


- Log -----------------------------------------------------------------
commit d7f84b64897192c252b992db0d9b5f06845d53c5
Author: Jeremy Allison <***@samba.org>
Date: Mon Apr 9 09:32:23 2018 -0700

s3: smbd: Unix extensions attempts to change wrong field in fchown call.

Cut and paste error.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13375

Reported-by: Rungta, Vandana <***@amazon.com>
Signed-off-by: Jeremy Allison <***@samba.org>
Reviewed-by: David Disseldorp <***@samba.org>

Autobuild-User(master): David Disseldorp <***@samba.org>
Autobuild-Date(master): Tue Apr 10 00:45:56 CEST 2018 on sn-devel-144

(cherry picked from commit 3227b110d065500ed84fc70063da70ab35823a2e)

Autobuild-User(v4-7-test): Karolin Seeger <***@samba.org>
Autobuild-Date(v4-7-test): Wed Apr 11 02:26:18 CEST 2018 on sn-devel-144

-----------------------------------------------------------------------

Summary of changes:
source3/smbd/trans2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index de6073a..d028dd0 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -7783,10 +7783,10 @@ static NTSTATUS smb_set_file_unix_basic(connection_struct *conn,

DEBUG(10,("smb_set_file_unix_basic: SMB_SET_FILE_UNIX_BASIC "
"changing group %u for file %s\n",
- (unsigned int)set_owner,
+ (unsigned int)set_grp,
smb_fname_str_dbg(smb_fname)));
if (fsp && fsp->fh->fd != -1) {
- ret = SMB_VFS_FCHOWN(fsp, set_owner, (gid_t)-1);
+ ret = SMB_VFS_FCHOWN(fsp, (uid_t)-1, set_grp);
} else {
/*
* UNIX extensions calls must always operate
--
Samba Shared Repository
Karolin Seeger
2018-04-11 11:54:03 UTC
Permalink
The branch, v4-7-test has been updated
via 686b2ba winbindd: Do not ignore domain in the LOOKUPNAME request
via 81c3e2d Add test for wbinfo name lookup
via ccbdb3c nsswitch: Fix wbcListGroups test
via af5d75d nsswitch: Fix wbcListUsers test
via 705b1fa test_smbclient_s3.sh: Use correct separator in "list with backup privilege" test
from d7f84b6 s3: smbd: Unix extensions attempts to change wrong field in fchown call.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-7-test


- Log -----------------------------------------------------------------
commit 686b2ba3641f6c0367dd8531cab5feda51837416
Author: Christof Schmitt <***@samba.org>
Date: Wed Feb 28 12:05:34 2018 -0700

winbindd: Do not ignore domain in the LOOKUPNAME request

A LOOKUPNAME request with a domain and a name containing a winbind
separator character would return the result for the joined domain,
instead of the specified domain.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13312

Signed-off-by: Christof Schmitt <***@samba.org>
Reviewed-by: Andreas Schneider <***@samba.org>

Autobuild-User(master): Andreas Schneider <***@cryptomilk.org>
Autobuild-Date(master): Fri Apr 6 21:03:31 CEST 2018 on sn-devel-144

(cherry picked from commit 1775ac8aa4dc00b9a0845ade238254ebb8b32429)

Autobuild-User(v4-7-test): Karolin Seeger <***@samba.org>
Autobuild-Date(v4-7-test): Wed Apr 11 13:53:02 CEST 2018 on sn-devel-144

commit 81c3e2dbc830563d3721005974bdbc46b595f7d5
Author: Christof Schmitt <***@samba.org>
Date: Wed Feb 28 13:10:43 2018 -0700

Add test for wbinfo name lookup

This demonstrates that wbinfo -n / --name-to-sid returns information
instead of failing the request. More specifically the query for
INVALIDDOMAIN//user returns the user SID for the joined domain, instead
of failing the request.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13312

Signed-off-by: Christof Schmitt <***@samba.org>
Reviewed-by: Andreas Schneider <***@samba.org>
(cherry picked from commit 552a00ec1f6795b9025298931a6cc50ebe552052)

commit ccbdb3c0741feaea1645f8777251b62f40e9a4e3
Author: Christof Schmitt <***@samba.org>
Date: Fri Mar 30 14:35:03 2018 -0700

nsswitch: Fix wbcListGroups test

With an AD DC, wbcListGroups returns the users in the DOMAIN SEPARATOR
GROUPNAME format. The test then calls wbcLookupName with the domain
name and the previous string (including domain and separator) as
username. Fix this by passing the correct username and adding some
additional checks.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13312

Signed-off-by: Christof Schmitt <***@samba.org>
Reviewed-by: Andreas Schneider <***@samba.org>
(cherry picked from commit f4db4e86c341a89357082e81e30c302440647530)

commit af5d75d009eac8f24c44c407dbe4efebceaff695
Author: Christof Schmitt <***@samba.org>
Date: Fri Mar 30 14:28:46 2018 -0700

nsswitch: Fix wbcListUsers test

With an AD DC, wbcListUsers returns the users in the DOMAIN SEPARATOR
USERNAME format. The test then calls wbcLookupName with the domain name
and the previous string (including domain and separator) as username.
Fix this by passing the correct username and adding some additional
checks.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13312

Signed-off-by: Christof Schmitt <***@samba.org>
Reviewed-by: Andreas Schneider <***@samba.org>
(cherry picked from commit 3c146be404affc894c0c702bbfbfcc4fb9ed902b)

commit 705b1fa689829b0234209d245b950e3927439c15
Author: Christof Schmitt <***@samba.org>
Date: Fri Mar 16 13:52:14 2018 -0700

test_smbclient_s3.sh: Use correct separator in "list with backup privilege" test

Samba selftest uses the forward slash as winbind separator and in the
USERNAME passed to the test. "net sam rights" expect the backslash. Map
the separator used in selftest to a backslash to avoid creating an
incorrect username DOMAIN\DOMAIN/USERNAME.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13312

Signed-off-by: Christof Schmitt <***@samba.org>
Reviewed-by: Andreas Schneider <***@samba.org>
(cherry picked from commit 6f07afad07d9c670a00d9d314a8134efdda5e424)

-----------------------------------------------------------------------

Summary of changes:
nsswitch/libwbclient/tests/wbclient.c | 66 ++++++++++++++++++++++++++++++-
nsswitch/tests/test_wbinfo_name_lookup.sh | 40 +++++++++++++++++++
source3/script/tests/test_smbclient_s3.sh | 10 +++--
source3/selftest/tests.py | 4 ++
source3/winbindd/winbindd_lookupname.c | 33 ++++++++++------
5 files changed, 136 insertions(+), 17 deletions(-)
create mode 100755 nsswitch/tests/test_wbinfo_name_lookup.sh


Changeset truncated at 500 lines:

diff --git a/nsswitch/libwbclient/tests/wbclient.c b/nsswitch/libwbclient/tests/wbclient.c
index e80afc4..d107942 100644
--- a/nsswitch/libwbclient/tests/wbclient.c
+++ b/nsswitch/libwbclient/tests/wbclient.c
@@ -296,6 +296,7 @@ static bool test_wbc_users(struct torture_context *tctx)
char *name = NULL;
char *sid_string = NULL;
wbcErr ret = false;
+ char separator;

torture_assert_wbc_ok(tctx, wbcInterfaceDetails(&details),
"%s", "wbcInterfaceDetails failed");
@@ -306,6 +307,7 @@ static bool test_wbc_users(struct torture_context *tctx)
ret,
fail,
"Failed to allocate domain_name");
+ separator = details->winbind_separator;
wbcFreeMemory(details);
details = NULL;

@@ -323,9 +325,38 @@ static bool test_wbc_users(struct torture_context *tctx)
struct wbcDomainSid sid;
enum wbcSidType name_type;
uint32_t num_sids;
+ const char *user;
+ char *c;
+
+ c = strchr(users[i], separator);
+
+ if (c == NULL) {
+ /*
+ * NT4 DC
+ * user name does not contain DOMAIN SEPARATOR prefix.
+ */
+
+ user = users[i];
+ } else {
+ /*
+ * AD DC
+ * user name starts with DOMAIN SEPARATOR prefix.
+ */
+ const char *dom;
+
+ *c = '\0';
+ dom = users[i];
+ user = c + 1;
+
+ torture_assert_str_equal_goto(tctx, dom, domain_name,
+ ret, fail, "Domain part "
+ "of user name does not "
+ "match domain name.\n");
+ }

torture_assert_wbc_ok_goto_fail(tctx,
- wbcLookupName(domain_name, users[i], &sid, &name_type),
+ wbcLookupName(domain_name, user,
+ &sid, &name_type),
"wbcLookupName of %s failed",
users[i]);
torture_assert_int_equal_goto(tctx,
@@ -399,6 +430,7 @@ static bool test_wbc_groups(struct torture_context *tctx)
char *domain = NULL;
char *name = NULL;
char *sid_string = NULL;
+ char separator;

torture_assert_wbc_ok(tctx, wbcInterfaceDetails(&details),
"%s", "wbcInterfaceDetails failed");
@@ -409,6 +441,7 @@ static bool test_wbc_groups(struct torture_context *tctx)
ret,
fail,
"Failed to allocate domain_name");
+ separator = details->winbind_separator;
wbcFreeMemory(details);
details = NULL;

@@ -425,10 +458,39 @@ static bool test_wbc_groups(struct torture_context *tctx)
for (i=0; i < MIN(num_groups,100); i++) {
struct wbcDomainSid sid;
enum wbcSidType name_type;
+ const char *group;
+ char *c;
+
+ c = strchr(groups[i], separator);
+
+ if (c == NULL) {
+ /*
+ * NT4 DC
+ * group name does not contain DOMAIN SEPARATOR prefix.
+ */
+
+ group = groups[i];
+ } else {
+ /*
+ * AD DC
+ * group name starts with DOMAIN SEPARATOR prefix.
+ */
+ const char *dom;
+
+
+ *c = '\0';
+ dom = groups[i];
+ group = c + 1;
+
+ torture_assert_str_equal_goto(tctx, dom, domain_name,
+ ret, fail, "Domain part "
+ "of group name does not "
+ "match domain name.\n");
+ }

torture_assert_wbc_ok_goto_fail(tctx,
wbcLookupName(domain_name,
- groups[i],
+ group,
&sid,
&name_type),
"wbcLookupName for %s failed",
diff --git a/nsswitch/tests/test_wbinfo_name_lookup.sh b/nsswitch/tests/test_wbinfo_name_lookup.sh
new file mode 100755
index 0000000..696e25b
--- /dev/null
+++ b/nsswitch/tests/test_wbinfo_name_lookup.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Blackbox test for wbinfo name lookup
+if [ $# -lt 2 ]; then
+cat <<EOF
+Usage: test_wbinfo.sh DOMAIN DC_USERNAME
+EOF
+exit 1;
+fi
+
+DOMAIN=$1
+DC_USERNAME=$2
+shift 2
+
+failed=0
+sambabindir="$BINDIR"
+wbinfo="$VALGRIND $sambabindir/wbinfo"
+
+. `dirname $0`/../../testprogs/blackbox/subunit.sh
+
+# Correct query is expected to work
+testit "name-to-sid.single-separator" \
+ $wbinfo -n $DOMAIN/$DC_USERNAME || \
+ failed=$(expr $failed + 1)
+
+# Two separator characters should fail
+testit_expect_failure "name-to-sid.double-separator" \
+ $wbinfo -n $DOMAIN//$DC_USERNAME || \
+ failed=$(expr $failed + 1)
+
+# Invalid domain is expected to fail
+testit_expect_failure "name-to-sid.invalid-domain" \
+ $wbinfo -n INVALID/$DC_USERNAME || \
+ failed=$(expr $failed + 1)
+
+# Invalid domain with two separator characters is expected to fail
+testit_expect_failure "name-to-sid.double-separator-invalid-domain" \
+ $wbinfo -n INVALID//$DC_USERNAME || \
+ failed=$(expr $failed + 1)
+
+exit $failed
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 905da58..05fcf69 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -643,13 +643,17 @@ test_backup_privilege_list()
{
tmpfile=$PREFIX/smbclient_backup_privilege_list

+ # selftest uses the forward slash as a separator, but "net sam rights
+ # grant" requires the backslash separator
+ USER_TMP=$(printf '%s' "$USERNAME" | tr '/' '\\')
+
# If we don't have a DOMAIN component to the username, add it.
- echo "$USERNAME" | grep '\\' 2>&1
+ printf '%s' "$USER_TMP" | grep '\\' 2>&1
ret=$?
if [ $ret != 0 ] ; then
- priv_username="$DOMAIN\\$USERNAME"
+ priv_username="$DOMAIN\\$USER_TMP"
else
- priv_username=$USERNAME
+ priv_username="$USER_TMP"
fi

$NET sam rights grant $priv_username SeBackupPrivilege 2>&1
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 1520990..593ac1d 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -198,6 +198,10 @@ for env in ["nt4_member", "ad_member"]:
env = "ad_member"
t = "--krb5auth=$DOMAIN/$DC_USERNAME%$DC_PASSWORD"
plantestsuite("samba3.wbinfo_simple.(%s:local).%s" % (env, t), "%s:local" % env, [os.path.join(srcdir(), "nsswitch/tests/test_wbinfo_simple.sh"), t])
+plantestsuite("samba3.wbinfo_name_lookup", env,
+ [ os.path.join(srcdir(),
+ "nsswitch/tests/test_wbinfo_name_lookup.sh"),
+ '$DOMAIN', '$DC_USERNAME' ])
t = "WBCLIENT-MULTI-PING"
plantestsuite("samba3.smbtorture_s3.%s" % t, env, [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), t, '//foo/bar', '""', '""', smbtorture3, ""])
plantestsuite("samba3.substitutions", env, [os.path.join(samba3srcdir, "script/tests/test_substitutions.sh"), "$SERVER", "alice", "Secret007", "$PREFIX"])
diff --git a/source3/winbindd/winbindd_lookupname.c b/source3/winbindd/winbindd_lookupname.c
index 1be29fd..b022691 100644
--- a/source3/winbindd/winbindd_lookupname.c
+++ b/source3/winbindd/winbindd_lookupname.c
@@ -35,7 +35,8 @@ struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
{
struct tevent_req *req, *subreq;
struct winbindd_lookupname_state *state;
- char *domname, *name, *p;
+ const char *domname = NULL, *name = NULL;
+ char *p = NULL;

req = tevent_req_create(mem_ctx, &state,
struct winbindd_lookupname_state);
@@ -49,17 +50,25 @@ struct tevent_req *winbindd_lookupname_send(TALLOC_CTX *mem_ctx,
sizeof(request->data.name.dom_name)-1]='\0';
request->data.name.name[sizeof(request->data.name.name)-1]='\0';

- /* cope with the name being a fully qualified name */
- p = strstr(request->data.name.name, lp_winbind_separator());
- if (p) {
- *p = 0;
- domname = request->data.name.name;
- name = p+1;
- } else if ((p = strchr(request->data.name.name, '@')) != NULL) {
- /* upn */
- domname = p + 1;
- *p = 0;
- name = request->data.name.name;
+ if (strlen(request->data.name.dom_name) == 0) {
+ /* cope with the name being a fully qualified name */
+ p = strstr(request->data.name.name, lp_winbind_separator());
+ if (p != NULL) {
+ *p = '\0';
+ domname = request->data.name.name;
+ name = p + 1;
+ } else {
+ p = strchr(request->data.name.name, '@');
+ if (p != NULL) {
+ /* upn */
+ domname = p + 1;
+ *p = '\0';
+ name = request->data.name.name;
+ } else {
+ domname = "";
+ name = request->data.name.name;
+ }
+ }
} else {
domname = request->data.name.dom_name;
name = request->data.name.name;
--
Samba Shared Repository
Stefan Metzmacher
2018-04-13 20:49:02 UTC
Permalink
The branch, v4-7-test has been updated
via 5a2066f torture: Test compound request request counters
via bb15458 s3:smb2_server: correctly maintain request counters for compound requests
from 686b2ba winbindd: Do not ignore domain in the LOOKUPNAME request

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-7-test


- Log -----------------------------------------------------------------
commit 5a2066f5ca52d8f1421139f27112183952070a05
Author: Volker Lendecke <***@samba.org>
Date: Wed Apr 11 15:11:10 2018 +0200

torture: Test compound request request counters

This will send an unfixed smbd into the

SMB_ASSERT(op->request_count > 0);

in smbd_smb2_request_reply_update_counts

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13215
Signed-off-by: Volker Lendecke <***@samba.org>
Reviewed-by: Stefan Metzmacher <***@samba.org>

Autobuild-User(master): Volker Lendecke <***@samba.org>
Autobuild-Date(master): Thu Apr 12 14:38:39 CEST 2018 on sn-devel-144

(cherry picked from commit 40edd1bc273f664d5567ef5be169033899acee1f)

Autobuild-User(v4-7-test): Stefan Metzmacher <***@samba.org>
Autobuild-Date(v4-7-test): Fri Apr 13 22:48:05 CEST 2018 on sn-devel-144

commit bb15458485e48ce173e54186f1b54aef2e852544
Author: Stefan Metzmacher <***@samba.org>
Date: Wed Apr 11 12:14:59 2018 +0200

s3:smb2_server: correctly maintain request counters for compound requests

If a session expires during a compound request chain,
we exit smbd_smb2_request_dispatch() with
'return smbd_smb2_request_error(req, ...)' before
calling smbd_smb2_request_dispatch_update_counts().

As req->request_counters_updated was only reset
within smbd_smb2_request_dispatch_update_counts(),
smbd_smb2_request_reply_update_counts() was called
twice on the same request, which triggers
SMB_ASSERT(op->request_count > 0);

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13215

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit 87e25cd1e45bfe57292b62ffc44ddafc01c61ca0)

-----------------------------------------------------------------------

Summary of changes:
source3/smbd/smb2_server.c | 6 +++-
source4/torture/smb2/compound.c | 77 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index ee03a8e..177e5ff 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -2180,7 +2180,7 @@ static NTSTATUS smbd_smb2_request_dispatch_update_counts(
bool update_open = false;
NTSTATUS status = NT_STATUS_OK;

- req->request_counters_updated = false;
+ SMB_ASSERT(!req->request_counters_updated);

if (xconn->protocol < PROTOCOL_SMB2_22) {
return NT_STATUS_OK;
@@ -2315,6 +2315,8 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)

DO_PROFILE_INC(request);

+ SMB_ASSERT(!req->request_counters_updated);
+
/* TODO: verify more things */

flags = IVAL(inhdr, SMB2_HDR_FLAGS);
@@ -2755,6 +2757,8 @@ static void smbd_smb2_request_reply_update_counts(struct smbd_smb2_request *req)
return;
}

+ req->request_counters_updated = false;
+
if (xconn->protocol < PROTOCOL_SMB2_22) {
return;
}
diff --git a/source4/torture/smb2/compound.c b/source4/torture/smb2/compound.c
index c592308..d2d4d7e 100644
--- a/source4/torture/smb2/compound.c
+++ b/source4/torture/smb2/compound.c
@@ -1030,6 +1030,81 @@ done:
return ret;
}

+static bool test_compound_invalid4(struct torture_context *tctx,
+ struct smb2_tree *tree)
+{
+ struct smb2_create cr;
+ struct smb2_read rd;
+ NTSTATUS status;
+ const char *fname = "compound_invalid4.dat";
+ struct smb2_close cl;
+ bool ret = true;
+ bool ok;
+ struct smb2_request *req[2];
+
+ smb2_transport_credits_ask_num(tree->session->transport, 2);
+
+ smb2_util_unlink(tree, fname);
+
+ ZERO_STRUCT(cr);
+ cr.in.security_flags = 0x00;
+ cr.in.oplock_level = 0;
+ cr.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
+ cr.in.create_flags = 0x00000000;
+ cr.in.reserved = 0x00000000;
+ cr.in.desired_access = SEC_RIGHTS_FILE_ALL;
+ cr.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
+ cr.in.share_access = NTCREATEX_SHARE_ACCESS_READ |
+ NTCREATEX_SHARE_ACCESS_WRITE |
+ NTCREATEX_SHARE_ACCESS_DELETE;
+ cr.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
+ cr.in.create_options = NTCREATEX_OPTIONS_SEQUENTIAL_ONLY |
+ NTCREATEX_OPTIONS_ASYNC_ALERT |
+ NTCREATEX_OPTIONS_NON_DIRECTORY_FILE |
+ 0x00200000;
+ cr.in.fname = fname;
+
+ status = smb2_create(tree, tctx, &cr);
+ CHECK_STATUS(status, NT_STATUS_OK);
+
+ smb2_transport_compound_start(tree->session->transport, 2);
+
+ ZERO_STRUCT(rd);
+ rd.in.file.handle = cr.out.file.handle;
+ rd.in.length = 1;
+ rd.in.offset = 0;
+ req[0] = smb2_read_send(tree, &rd);
+
+ smb2_transport_compound_set_related(tree->session->transport, true);
+
+ /*
+ * Send a completely bogus request as second compound
+ * element. This triggers smbd_smb2_request_error() in in
+ * smbd_smb2_request_dispatch() before calling
+ * smbd_smb2_request_dispatch_update_counts().
+ */
+
+ req[1] = smb2_request_init_tree(tree, 0xff, 0x04, false, 0);
+ smb2_transport_send(req[1]);
+
+ status = smb2_read_recv(req[0], tctx, &rd);
+ CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
+
+ ok = smb2_request_receive(req[1]);
+ torture_assert(tctx, ok, "Invalid request failed\n");
+ CHECK_STATUS(req[1]->status, NT_STATUS_INVALID_PARAMETER);
+
+ ZERO_STRUCT(cl);
+ cl.in.file.handle = cr.out.file.handle;
+
+ status = smb2_close(tree, &cl);
+ CHECK_STATUS(status, NT_STATUS_OK);
+
+ smb2_util_unlink(tree, fname);
+done:
+ return ret;
+}
+
/* Send a compound request where we expect the last request (Create, Notify)
* to go asynchronous. This works against a Win7 server and the reply is
* sent in two different packets. */
@@ -1297,6 +1372,8 @@ struct torture_suite *torture_smb2_compound_init(TALLOC_CTX *ctx)
torture_suite_add_1smb2_test(suite, "invalid1", test_compound_invalid1);
torture_suite_add_1smb2_test(suite, "invalid2", test_compound_invalid2);
torture_suite_add_1smb2_test(suite, "invalid3", test_compound_invalid3);
+ torture_suite_add_1smb2_test(
+ suite, "invalid4", test_compound_invalid4);
torture_suite_add_1smb2_test(suite, "interim1", test_compound_interim1);
torture_suite_add_1smb2_test(suite, "interim2", test_compound_interim2);
torture_suite_add_1smb2_test(suite, "compound-break", test_compound_break);
--
Samba Shared Repository
Karolin Seeger
2018-04-17 06:58:07 UTC
Permalink
The branch, v4-7-test has been updated
via a79aad4 VERISON: Bump version up to 4.7.8...
via 19a46b0 WHATSNEW: Add release notes for Samba 4.7.7.
from 5a2066f torture: Test compound request request counters

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-7-test


- Log -----------------------------------------------------------------
commit a79aad47de6606d6b211d33c6c22217f3c14bd97
Author: Karolin Seeger <***@samba.org>
Date: Wed Apr 11 11:16:34 2018 +0200

VERISON: Bump version up to 4.7.8...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <***@samba.org>

commit 19a46b0f221e9ae43425ec9d9b9bab4284538d73
Author: Karolin Seeger <***@samba.org>
Date: Wed Apr 11 11:02:52 2018 +0200

WHATSNEW: Add release notes for Samba 4.7.7.

Signed-off-by: Karolin Seeger <***@samba.org>

-----------------------------------------------------------------------

Summary of changes:
VERSION | 4 +--
WHATSNEW.txt | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 109 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index f9f4813..b54c7f1 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
########################################################
SAMBA_VERSION_MAJOR=4
SAMBA_VERSION_MINOR=7
-SAMBA_VERSION_RELEASE=7
+SAMBA_VERSION_RELEASE=8

########################################################
# If a official release has a serious bug #
@@ -99,7 +99,7 @@ SAMBA_VERSION_RC_RELEASE=
# e.g. SAMBA_VERSION_IS_SVN_SNAPSHOT=yes #
# -> "3.0.0-SVN-build-199" #
########################################################
-SAMBA_VERSION_IS_GIT_SNAPSHOT=no
+SAMBA_VERSION_IS_GIT_SNAPSHOT=yes

########################################################
# This is for specifying a release nickname #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 021f2e7..3eea285 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,4 +1,109 @@
=============================
+ Release Notes for Samba 4.7.7
+ April 12, 2018
+ =============================
+
+
+This is the latest stable release of the Samba 4.7 release series.
+
+
+Changes since 4.7.6:
+--------------------
+
+o Jeremy Allison <***@samba.org>
+ * BUG 13206: s4:auth_sam: Allow logons with an empty domain name.
+ * BUG 13244: s3: ldap: Ensure the ADS_STRUCT pointer doesn't get freed on
+ error, we don't own it here.
+ * BUG 13270: s3: smbd: Fix possible directory fd leak if the underlying
+ OS doesn't support fdopendir().
+ * BUG 13319: Round-tripping ACL get/set through vfs_fruit will increase
+ the number of ACE entries without limit.
+ * BUG 13347: s3: smbd: SMB2: Add DBGC_SMB2_CREDITS class to specifically
+ debug credit issues.
+ * BUG 13358: s3: smbd: Files or directories can't be opened DELETE_ON_CLOSE
+ without delete access.
+ * BUG 13372: s3: smbd: Fix memory leak in vfswrap_getwd().
+ * BUG 13375: s3: smbd: Unix extensions attempts to change wrong field
+ in fchown call.
+
+o Ralph Boehme <***@samba.org>
+ * BUG 13363: s3:smbd: Don't use the directory cache for SMB2/3.
+
+o Günther Deschner <***@samba.org>
+ * BUG 13277: build: Fix libceph-common detection.
+
+o David Disseldorp <***@suse.de>
+ * BUG 13250: build: Fix ceph_statx check when configured with libcephfs_dir.
+
+o Poornima G <***@redhat.com>
+ * BUG 13297: vfs_glusterfs: Fix the wrong pointer being sent in
+ glfs_fsync_async.
+
+o Amitay Isaacs <***@gmail.com>
+ * BUG 13359: ctdb-scripts: Drop 'net serverid wipe' from 50.samba event
+ script.
+
+o Lutz Justen <***@google.com>
+ * BUG 13368: s3: lib: messages: Don't use the result of sec_init() before
+ calling sec_init().
+
+o Volker Lendecke <***@samba.org>
+ * BUG 13215: smbd can panic if the client-supplied channel sequence number
+ wraps.
+ * BUG 13367: dsdb: Fix CID 1034966 Uninitialized scalar variable.
+
+o Stefan Metzmacher <***@samba.org>
+ * BUG 13206: s3:libsmb: Allow -U"\\administrator" to work.
+ * BUG 13328: Windows 10 cannot logon on Samba NT4 domain.
+
+o David Mulder <***@suse.com>
+ * BUG 13050: smbc_opendir should not return EEXIST with invalid login
+ credentials.
+
+o Anton Nefedov
+ * BUG 13338: s3:smbd: map nterror on smb2_flush errorpath.
+
+o Dan Robertson <***@tripwire.com>
+ * BUG 13310: libsmb: Use smb2 tcon if conn_protocol >= SMB2_02.
+
+o Garming Sam <***@catalyst.net.nz>
+ * BUG 13031: subnet: Avoid a segfault when renaming subnet objects.
+
+o Christof Schmitt <***@samba.org>
+ * BUG 13312: 'wbinfo --name-to-sid' returns misleading result on invalid
+ query.
+
+o Andreas Schneider <***@samba.org>
+ * BUG 13315: s3:smbd: Do not crash if we fail to init the session table.
+
+o Eric Vannier <***@google.com>
+ * BUG 13302: Allow AESNI to be used on all processor supporting AESNI.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored. All bug reports should
+be filed under the "Samba 4.1 and newer" product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
+
+ =============================
Release Notes for Samba 4.7.6
March 13, 2018
=============================
@@ -71,8 +176,8 @@ database (https://bugzilla.samba.org/).
======================================================================


-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
+

=============================
Release Notes for Samba 4.7.5
--
Samba Shared Repository
Karolin Seeger
2018-04-17 07:31:24 UTC
Permalink
The branch, v4-7-test has been updated
via 2366b51 VERISON: Bump version up to 4.7.8...
via 41f51e0 WHATSNEW: Fix release date.
via c2df74d Revert "VERISON: Bump version up to 4.7.8..."
from a79aad4 VERISON: Bump version up to 4.7.8...

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-7-test


- Log -----------------------------------------------------------------
commit 2366b510ba25d8a40c970997164a5761d591c24b
Author: Karolin Seeger <***@samba.org>
Date: Wed Apr 11 11:16:34 2018 +0200

VERISON: Bump version up to 4.7.8...

and re-enable GIT_SNAPSHOT.

Signed-off-by: Karolin Seeger <***@samba.org>

commit 41f51e0180615494bc61ec643ba4e921208cc369
Author: Karolin Seeger <***@samba.org>
Date: Tue Apr 17 09:02:57 2018 +0200

WHATSNEW: Fix release date.

Signed-off-by: Karolin Seeger <***@samba.org>

commit c2df74dbdfa7482235bbcad716d073aabaca0976
Author: Karolin Seeger <***@samba.org>
Date: Tue Apr 17 09:05:38 2018 +0200

Revert "VERISON: Bump version up to 4.7.8..."

This reverts commit a79aad47de6606d6b211d33c6c22217f3c14bd97.

-----------------------------------------------------------------------

Summary of changes:
WHATSNEW.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 3eea285..629dba8 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,6 +1,6 @@
=============================
Release Notes for Samba 4.7.7
- April 12, 2018
+ April 17, 2018
=============================
--
Samba Shared Repository
Karolin Seeger
2018-04-20 14:44:03 UTC
Permalink
The branch, v4-7-test has been updated
via 38af417 s3:passdb: Do not return OK if we don't have pinfo set up
via 7a58eb8 lib/util: remove unused '#include <sys/syscall.h>' from tests/tfork.c
via 5d00889 winbind: Use one queue for all domain children
via 470aa11 winbind: Maintain a binding handle per domain and always go via wb_domain_request_send()
via fe8982b winbind: make choose_domain_child() static
via 8a544c7 winbind: add locator_child_handle() and use it instead of child->binding_handle
via 136c16e winbind: add idmap_child_handle() and use it instead of child->binding_handle
via 128789f winbind: improve wb_domain_request_send() to use wb_dsgetdcname_send() for a foreign domain
via 5bbe243 winbind: use state->{ev,request} in wb_domain_request_send()
via ed83d30 winbind: avoid using fstrcpy(dcname,...) in _dual_init_connection
via bd14266 winbind: cleanup winbindd_cli_state->pwent_state if winbindd_getpwent_recv() returns an error
via e404058 winbind: cleanup winbindd_cli_state->grent_state if winbindd_getgrent_recv() returns an error
via 2594449 winbind: call lp_winbind_enum_{users,groups}() already in set{pw,gr}ent()
via 06c5e07 winbind: protect a pending wb_child_request against a talloc_free()
via dbb72ad winbind: use tevent_queue_wait_send/recv in wb_child_request_*()
via 28680d7 winbind: Improve child selection
via e19b0731 smbclient: Handle ENUM_DIR in "notify" command
via 0c5e24d libsmb: Handle IO_TIMEOUT in cli_smb2_notify properly
via b28593e libsmb: Handle long-running smb2cli_notify
via 3c3746f libsmb: Enable "cli_notify" for SMB2+
via 41666d5 libsmb: Add cli_smb2_notify
via 898297b libsmb: Add smb2cli_notify()
via 8b47aed rpc_server: Init local_server_* in make_internal_rpc_pipe_socketpair
via 80b822b tevent: version 0.9.36
via c2a3333 tevent: add tevent_queue_entry_untrigger()
via 55b8d61 tevent: improve documentation of tevent_queue_add_optimize_empty()
via a588c39 tevent: version 0.9.35
via 5457c2f lib/async_req/async_sock.c set socket close on exec
via b344866 lib/tevent/echo_server.c set socket close on exec
via 7206dfd tevent: Fix typos
via 772ca21 lib: tevent: Minor cleanup. wakeup_fd can always be gotten from the event context.
via bc24206 lib: tevent: Use system <tevent.h>, not internal header path (except in self-test).
via 383f130 libads: Fix the build --without-ads
from 2366b51 VERISON: Bump version up to 4.7.8...

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-7-test


- Log -----------------------------------------------------------------
commit 38af417f34bee9d60417affb8ece81bc2c172b92
Author: Andreas Schneider <***@samba.org>
Date: Tue Apr 17 08:55:23 2018 +0200

s3:passdb: Do not return OK if we don't have pinfo set up

This prevents a crash in fill_mem_keytab_from_secrets()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13376

Signed-off-by: Andreas Schneider <***@samba.org>
Reviewed-by: Stefan Metzmacher <***@samba.org>

(cherry picked from commit 99859479fc6e12b2f74ce2dfa83da56d8b8f3d26)

Autobuild-User(v4-7-test): Karolin Seeger <***@samba.org>
Autobuild-Date(v4-7-test): Fri Apr 20 16:43:11 CEST 2018 on sn-devel-144

commit 7a58eb8aac648f4fb34c9f09cad0b8633469d14c
Author: Stefan Metzmacher <***@samba.org>
Date: Tue Mar 20 16:49:30 2018 +0100

lib/util: remove unused '#include <sys/syscall.h>' from tests/tfork.c

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13342

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Ralph Boehme <***@samba.org>
(cherry picked from commit f2ff61ce9e8ab56d8a69fce29c9f214d5d98f89e)

commit 5d008894dca367f4683f3455edea1f3f778c4aed
Author: Stefan Metzmacher <***@samba.org>
Date: Wed Feb 14 15:04:01 2018 +0100

winbind: Use one queue for all domain children

If we have multiple domain children, it's important
that the first idle child takes over the next waiting request.

Before we had the problem that a request could get stuck in the
queue of a busy child, while later requests could get served fine by
other children.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13292

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>

Autobuild-User(master): Stefan Metzmacher <***@samba.org>
Autobuild-Date(master): Fri Feb 23 09:04:23 CET 2018 on sn-devel-144

(similar to commit 7f2d45a6c2a88dd8833fc66d314ec21507dd52c3)

commit 470aa11c339a1e5283245750bac831075910f0c4
Author: Volker Lendecke <***@samba.org>
Date: Tue Feb 13 16:04:44 2018 +0100

winbind: Maintain a binding handle per domain and always go via wb_domain_request_send()

Pair-Programmed-With: Stefan Metzmacher <***@samba.org>

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13292

Signed-off-by: Stefan Metzmacher <***@samba.org>
Signed-off-by: Volker Lendecke <***@samba.org>
(similar to commit b518cb0597d269002105644302c58ca8f9f0f717)

commit fe8982b3850e878dd3b848bcb8fdb4e5671a4aba
Author: Stefan Metzmacher <***@samba.org>
Date: Tue Feb 20 14:43:38 2018 +0100

winbind: make choose_domain_child() static

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13292

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit 5116aff286bdffe4abc9ddda09cf64ab999fd13e)

commit 8a544c7cab5fb913ed2078c1ac82dcdef36832a9
Author: Stefan Metzmacher <***@samba.org>
Date: Wed Feb 14 13:24:54 2018 +0100

winbind: add locator_child_handle() and use it instead of child->binding_handle

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13292

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit 44ebaaac8933f5fc16a043b8c15a9449746af47b)

commit 136c16eee0515fae174a10c7120e7a8caa857e1c
Author: Stefan Metzmacher <***@samba.org>
Date: Wed Feb 14 13:24:54 2018 +0100

winbind: add idmap_child_handle() and use it instead of child->binding_handle

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13292

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit c2d78a0a0a3f9b9ade61cf707f23e59a1a16c61b)

commit 128789f0861fecd30667cecaaaea9ce35db29b4a
Author: Stefan Metzmacher <***@samba.org>
Date: Wed Feb 14 15:11:50 2018 +0100

winbind: improve wb_domain_request_send() to use wb_dsgetdcname_send() for a foreign domain

Commit ed3bc614cccec6167c64ac58d78344b6426cd019 got the logic wrong while
trying to implement the logic we had in init_child_connection(),
which was removed by commit d61f3626b79e0523beadff355453145aa7b0195c.

Instead of doing a WINBINDD_GETDCNAME request (which would caused an error
because the implementation was removed in commit
958fdaf5c3ba17969a5110e6b2b08babb9096d7e), we sent the callers request
and interpreted the result as WINBINDD_GETDCNAME response, which
led to an empty dcname variable. As result the domain child
opened a connection to the primary domain in order to lookup
a dc.

If we want to connect the primary domain from the parent via
a domain child of the primary domain.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13295

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit 1f41193e005df37401a28004f0a95d4d73b98ccd)

commit 5bbe243fe5421d8102f61ca7b1f7b8f8baf5ba90
Author: Stefan Metzmacher <***@samba.org>
Date: Wed Feb 14 15:09:51 2018 +0100

winbind: use state->{ev,request} in wb_domain_request_send()

This will reduce the diff for the following changes.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13295

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit 4d804f5f3e65df0e2f646d4f88793cab8e2f32d1)

commit ed83d30ead1edfd2ea4ab8ecddd51613150f6aa2
Author: Stefan Metzmacher <***@samba.org>
Date: Thu Feb 15 16:00:33 2018 +0100

winbind: avoid using fstrcpy(dcname,...) in _dual_init_connection

domain->dcname was converted from fstring to char * by commit
14bae61ba36814ea5eca7c51cf1cc039e9e6803f.

Luckily this was only ever called with an empty string in
state->request->data.init_conn.dcname.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13294

Signed-off-by: Stefan Metzmacher <***@samba.org>
(cherry picked from commit d73e3d451976e692c6c346f98547d7123f7b9006)

commit bd14266978a29676b545164fb6fcd50252fe52cd
Author: Stefan Metzmacher <***@samba.org>
Date: Fri Feb 16 16:13:16 2018 +0100

winbind: cleanup winbindd_cli_state->pwent_state if winbindd_getpwent_recv() returns an error

A client may skip the explicit endpwent() if getgrent() fails.

This allows client_is_idle() return true in more cases.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13293

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit b158d4e4c1c3fee0a8884bc5e8f0c5a5ce49687f)

commit e40405854191f8f5f733e9c58f2e8c9b1976624c
Author: Stefan Metzmacher <***@samba.org>
Date: Fri Feb 16 16:13:16 2018 +0100

winbind: cleanup winbindd_cli_state->grent_state if winbindd_getgrent_recv() returns an error

A client may skip the explicit endgrent() if getgrent() fails.

This allows client_is_idle() return true in more cases.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13293

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit b7789da8468c3f070727011639d5f74aca76cb59)

commit 2594449b6da14a4b566b85f4c1a7230017e41bd9
Author: Stefan Metzmacher <***@samba.org>
Date: Fri Feb 16 16:09:58 2018 +0100

winbind: call lp_winbind_enum_{users,groups}() already in set{pw,gr}ent()

This way we don't keep winbindd_cli_state->{pw,gr}ent_state arround forever,
if the client forgets an explicit end{pw,gr}ent().

This allows client_is_idle() return true in more cases.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13293

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit 6548b82b5c1ed30ce14e17e4ba9d4bc24ab49c42)

commit 06c5e074e1c17c2f3c752753d6e9f8152cbbce70
Author: Stefan Metzmacher <***@samba.org>
Date: Fri Feb 16 15:05:57 2018 +0100

winbind: protect a pending wb_child_request against a talloc_free()

If the (winbind) client gave up we call TALLOC_FREE(state->mem_ctx)
in remove_client(). This triggers a recursive talloc_free() for all
in flight requests.

In order to maintain the winbindd parent-child protocol, we need
to keep the orphaned wb_simple_trans request until the parent
got the response from the child.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13290

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit 43af57d8728883c5ddbe169e1483181246fb68a8)

commit dbb72add2e76bd4d7ee14d84a59ec86b05e8706f
Author: Stefan Metzmacher <***@samba.org>
Date: Fri Feb 16 15:02:42 2018 +0100

winbind: use tevent_queue_wait_send/recv in wb_child_request_*()

We need a way to keep the child->queue blocked without relying on
the current 'req' (wb_child_request_state).

The next commit will make use of this.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13290

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit d29dda141e08af42c535e8718226f95c45aadab8)

commit 28680d7bdd955b565b0cefb2efb2357373b23b21
Author: Volker Lendecke <***@samba.org>
Date: Fri Feb 9 10:27:55 2018 +0100

winbind: Improve child selection

This improves the situation when a client request blocks a winbind
child. This might be a slow samlogon or lookupnames to a domain that's
far away. With random selection of the child for new request coming in
we could end up with a long queue when other, non-blocked children
could serve those new requests. Choose the shortest queue.

This is an immediate and simple fix. Step two will be to have a
per-domain and not a per-child queue. Right now we're pre-selecting
the check-out queue at Fry's randomly without looking at the queue
length. With this change we're picking the shortest queue. The better
change will be what Fry's really does: One central queue and red/green
lights on the busy/free checkout counters.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13290

Signed-off-by: Volker Lendecke <***@samba.org>
Reviewed-by: Andreas Schneider <***@samba.org>

Autobuild-User(master): Volker Lendecke <***@samba.org>
Autobuild-Date(master): Mon Feb 12 19:51:35 CET 2018 on sn-devel-144

(cherry picked from commit b4384b7f0ecf3b47dd60acaf77636b679e3adc05)

commit e19b0731070af35c3ee492c27cdfccc7cbf966f0
Author: Volker Lendecke <***@samba.org>
Date: Mon Oct 30 16:15:03 2017 +0100

smbclient: Handle ENUM_DIR in "notify" command

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13382
Signed-off-by: Volker Lendecke <***@samba.org>
Reviewed-by: Jeremy Allison <***@samba.org>

Autobuild-User(master): Jeremy Allison <***@samba.org>
Autobuild-Date(master): Thu Apr 5 04:05:52 CEST 2018 on sn-devel-144

(cherry picked from commit 1452677ef0044815df0702de5424d4711e18144b)

commit 0c5e24d0f2085d836b0301272a1d54bb08f4a25d
Author: Volker Lendecke <***@samba.org>
Date: Mon Oct 30 14:36:46 2017 +0100

libsmb: Handle IO_TIMEOUT in cli_smb2_notify properly

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13382
Signed-off-by: Volker Lendecke <***@samba.org>
Reviewed-by: Jeremy Allison <***@samba.org>
(cherry picked from commit abfe482828e8c1dc233d67657a4d11a91a731f70)

commit b28593e86c5ff78076e1e01a60d11f02cc961579
Author: Volker Lendecke <***@samba.org>
Date: Mon Oct 30 14:34:12 2017 +0100

libsmb: Handle long-running smb2cli_notify

This likely runs into a timeout. Properly cancel the smb2 request,
allowing the higher-level caller to re-issue this request on an existing
handle.

I did not see a proper way to achieve this with tevent_req_set_endtime or
something like that.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13382
Signed-off-by: Volker Lendecke <***@samba.org>
Reviewed-by: Jeremy Allison <***@samba.org>
(cherry picked from commit 91c0f497816bb88d8935a8a79c146c08379ecf53)

commit 3c3746fc05d80fab374ac9a2b819cc61a5990b0d
Author: Volker Lendecke <***@samba.org>
Date: Tue Jul 25 12:30:47 2017 +0200

libsmb: Enable "cli_notify" for SMB2+

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13382
Signed-off-by: Volker Lendecke <***@samba.org>
Reviewed-by: Jeremy Allison <***@samba.org>

Autobuild-User(master): Jeremy Allison <***@samba.org>
Autobuild-Date(master): Wed Jul 26 01:33:25 CEST 2017 on sn-devel-144

(cherry picked from commit 5005a3a6961d40fe349f76db67c980be7dc9f3ea)

commit 41666d5992a2a8a15cd46069c88792310eb2af78
Author: Volker Lendecke <***@samba.org>
Date: Tue Jul 25 12:12:02 2017 +0200

libsmb: Add cli_smb2_notify

We have to do the parsing manually. Looking at librpc/gen_ndr/ndr_notify.c we
have the following code snippet:

size_FileName1_0 = strlen_m(r->FileName1);
NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->FileName1,
size_FileName1_0, sizeof(uint16_t),
CH_UTF16));

which means that we take strlen_m(r->FileName1) before we pull
it off the wire. Not sure how to fix this, but that is clearly
broken pidl output. Once that is fixed, we can convert this
to ndr_pull_struct.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13382
Signed-off-by: Volker Lendecke <***@samba.org>
Reviewed-by: Jeremy Allison <***@samba.org>
(cherry picked from commit 18011343d80a28fb46894d712b22c84dce067342)

commit 898297b7a1ef4397b018327b83e3f77c709f94f8
Author: Volker Lendecke <***@samba.org>
Date: Tue Jul 25 12:11:37 2017 +0200

libsmb: Add smb2cli_notify()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13382
Signed-off-by: Volker Lendecke <***@samba.org>
Reviewed-by: Jeremy Allison <***@samba.org>
(cherry picked from commit ad33964f8c85b67a2d2b451bece208d8bfb8cad6)

commit 8b47aedf5e6def042495c2721cf774c3b3d03009
Author: Volker Lendecke <***@samba.org>
Date: Wed Apr 11 10:42:21 2018 +0200

rpc_server: Init local_server_* in make_internal_rpc_pipe_socketpair

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13370
Signed-off-by: Volker Lendecke <***@samba.org>
Reviewed-by: Stefan Metzmacher <***@samba.org>

Autobuild-User(master): Volker Lendecke <***@samba.org>
Autobuild-Date(master): Wed Apr 11 15:19:19 CEST 2018 on sn-devel-144

(cherry picked from commit 212815969f4a706bc8395e2f6dbf225318ff2ad7)

commit 80b822b60f988a2820e627e25ac00f205586fc15
Author: Stefan Metzmacher <***@samba.org>
Date: Tue Feb 20 13:54:49 2018 +0100

tevent: version 0.9.36

* improve documentation of tevent_queue_add_optimize_empty()
* add tevent_queue_entry_untrigger()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13291

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit f00c7cf9f5f325de0b754b127fcc0f07bea2d825)

commit c2a333337da85afc921ae2dd0d8bbeeb7f435b89
Author: Stefan Metzmacher <***@samba.org>
Date: Thu Feb 15 14:47:25 2018 +0100

tevent: add tevent_queue_entry_untrigger()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13291

Pair-Programmed-With: Volker Lendecke <***@samba.org>

Signed-off-by: Stefan Metzmacher <***@samba.org>
Signed-off-by: Volker Lendecke <***@samba.org>
(cherry picked from commit 5c6f31697a8edb03d36eece5c79581b952743b5b)

commit 55b8d619cf3efd4d02dc9460c3b62e7b8a9ada83
Author: Stefan Metzmacher <***@samba.org>
Date: Fri Feb 16 16:47:57 2018 +0100

tevent: improve documentation of tevent_queue_add_optimize_empty()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13291

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Volker Lendecke <***@samba.org>
(cherry picked from commit 88d6703b89f9a7f847b6ec47d97569432927dcff)

commit a588c39a7e661c721706608e579bd08e70393d19
Author: Stefan Metzmacher <***@samba.org>
Date: Fri Jan 12 15:08:14 2018 +0100

tevent: version 0.9.35

* Minor cleanup. wakeup_fd can always be gotten from the event context.
* Use smb_set_close_on_exec() in example code.

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Ralph Boehme <***@samba.org>
(cherry picked from commit 6dd0a8c1a67922d1f893d5ef500861ec5e7c5a36)

commit 5457c2fd4b5caf370973c9f79b8f7e2056230785
Author: Gary Lockyer <***@catalyst.net.nz>
Date: Mon Dec 11 09:31:33 2017 +1300

lib/async_req/async_sock.c set socket close on exec

Set SOCKET_CLOEXEC on the sockets returned by accept. This ensures that
the socket is unavailable to any child process created by system().
Making it harder for malicious code to set up a command channel,
as seen in the exploit for CVE-2015-0240

Signed-off-by: Gary Lockyer <***@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <***@samba.org>
(cherry picked from commit 8b3c58251146d2e982a6c9fdb3828ca65e307a96)

commit b3448666ccebe142d7844271d150d48f430504ed
Author: Gary Lockyer <***@catalyst.net.nz>
Date: Mon Dec 11 09:17:49 2017 +1300

lib/tevent/echo_server.c set socket close on exec

Set SOCKET_CLOEXEC on the sockets returned by accept. This ensures that
the socket is unavailable to any child process created by system().
Making it harder for malicious code to set up a command channel,
as seen in the exploit for CVE-2015-0240

Signed-off-by: Gary Lockyer <***@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <***@samba.org>
(cherry picked from commit 954eddd0b8c25424fd44bbd002ba36873fe2c8d4)

commit 7206dfd4fbf17b542f682556be831fdd2b764186
Author: Volker Lendecke <***@samba.org>
Date: Mon Oct 30 13:51:25 2017 +0100

tevent: Fix typos

While there, fix comment formatting

Signed-off-by: Volker Lendecke <***@samba.org>
Reviewed-by: Jeremy Allison <***@samba.org>
(cherry picked from commit c19b49bad8071bc33089e5b3c053fcb890a8ea11)

commit 772ca21780decfa34d7608e12c93e5d3882cc8fb
Author: Jeremy Allison <***@samba.org>
Date: Fri Nov 10 19:26:55 2017 -0800

lib: tevent: Minor cleanup. wakeup_fd can always be gotten from the event context.

We don't need to store it. I prefer this as it shows that we must always
get wakeup_fd from the event context at time of use, rather than possibly
storing an out-of-date variable.

Signed-off-by: Jeremy Allison <***@samba.org>
Reviewed-by: Ralph Boehme <***@samba.org>

Autobuild-User(master): Ralph Böhme <***@samba.org>
Autobuild-Date(master): Fri Nov 17 12:43:01 CET 2017 on sn-devel-144

(cherry picked from commit 993fa5793fd6a95173eda574562661ab8959c544)

commit bc24206dfbd2356b6059814d0bf7efdf480ca0ef
Author: Jeremy Allison <***@samba.org>
Date: Mon Aug 14 15:54:39 2017 -0700

lib: tevent: Use system <tevent.h>, not internal header path (except in self-test).

Signed-off-by: Jeremy Allison <***@samba.org>
Reviewed-by: Andreas Schneider <***@samba.org>

(similar to commit bee22f187cfca26da13efb4cc980a705ec252a21)

commit 383f130f70ff5bb9c09927b6368c219ba9bdf64d
Author: Volker Lendecke <***@samba.org>
Date: Sat Feb 3 07:07:24 2018 +0100

libads: Fix the build --without-ads

Signed-off-by: Volker Lendecke <***@samba.org>
Reviewed-by: David Disseldorp <***@samba.org>

Autobuild-User(master): David Disseldorp <***@samba.org>
Autobuild-Date(master): Tue Feb 6 02:47:44 CET 2018 on sn-devel-144

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13273

(cherry picked from commit 859698d29b547217356851094ed8188236e717b6)

-----------------------------------------------------------------------

Summary of changes:
lib/async_req/async_connect_send_test.c | 2 +-
lib/async_req/async_sock.c | 1 +
.../ABI/{tevent-0.9.34.sigs => tevent-0.9.35.sigs} | 0
.../ABI/{tevent-0.9.34.sigs => tevent-0.9.36.sigs} | 1 +
lib/tevent/echo_server.c | 1 +
lib/tevent/testsuite.c | 2 +-
lib/tevent/tevent.h | 29 ++-
lib/tevent/tevent_internal.h | 1 -
lib/tevent/tevent_queue.c | 13 +
lib/tevent/tevent_threads.c | 4 +-
lib/tevent/wscript | 2 +-
lib/util/tests/tfork.c | 1 -
libcli/smb/smb2cli_notify.c | 214 ++++++++++++++++
libcli/smb/smbXcli_base.h | 26 ++
libcli/smb/wscript | 1 +
source3/client/client.c | 9 +-
source3/libads/kerberos_keytab.c | 4 +
source3/libsmb/cli_smb2_fnum.c | 101 ++++++++
source3/libsmb/cli_smb2_fnum.h | 5 +
source3/libsmb/clifile.c | 10 +-
source3/passdb/machine_account_secrets.c | 2 +-
source3/rpc_server/rpc_ncacn_np.c | 31 ++-
source3/rpc_server/rpc_ncacn_np.h | 18 +-
source3/rpc_server/srv_pipe_hnd.c | 18 +-
source3/winbindd/wb_dsgetdcname.c | 8 +-
source3/winbindd/wb_sids2xids.c | 6 +-
source3/winbindd/winbindd.h | 3 +
source3/winbindd/winbindd_allocate_gid.c | 6 +-
source3/winbindd/winbindd_allocate_uid.c | 6 +-
source3/winbindd/winbindd_dsgetdcname.c | 6 +-
source3/winbindd/winbindd_dual.c | 285 ++++++++++++++++-----
source3/winbindd/winbindd_dual_ndr.c | 61 ++++-
source3/winbindd/winbindd_getgrent.c | 9 +-
source3/winbindd/winbindd_getpwent.c | 6 +-
source3/winbindd/winbindd_idmap.c | 5 +
source3/winbindd/winbindd_locator.c | 5 +
source3/winbindd/winbindd_proto.h | 3 +-
source3/winbindd/winbindd_setgrent.c | 5 +
source3/winbindd/winbindd_setpwent.c | 5 +
source3/winbindd/winbindd_util.c | 19 +-
source4/librpc/rpc/dcerpc_roh_channel_in.c | 2 +-
source4/librpc/rpc/dcerpc_roh_channel_out.c | 2 +-
source4/torture/smb2/rename.c | 2 +-
43 files changed, 798 insertions(+), 142 deletions(-)
copy lib/tevent/ABI/{tevent-0.9.34.sigs => tevent-0.9.35.sigs} (100%)
copy lib/tevent/ABI/{tevent-0.9.34.sigs => tevent-0.9.36.sigs} (99%)
create mode 100644 libcli/smb/smb2cli_notify.c


Changeset truncated at 500 lines:

diff --git a/lib/async_req/async_connect_send_test.c b/lib/async_req/async_connect_send_test.c
index 34ea6b7..d570c60 100644
--- a/lib/async_req/async_connect_send_test.c
+++ b/lib/async_req/async_connect_send_test.c
@@ -17,7 +17,7 @@
*/

#include "replace.h"
-#include "lib/tevent/tevent.h"
+#include <tevent.h>
#include "lib/async_req/async_sock.h"
#include <stdio.h>
#include <string.h>
diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c
index db3916e..0a8a333 100644
--- a/lib/async_req/async_sock.c
+++ b/lib/async_req/async_sock.c
@@ -738,6 +738,7 @@ static void accept_handler(struct tevent_context *ev, struct tevent_fd *fde,
tevent_req_error(req, errno);
return;
}
+ smb_set_close_on_exec(ret);
state->sock = ret;
tevent_req_done(req);
}
diff --git a/lib/tevent/ABI/tevent-0.9.34.sigs b/lib/tevent/ABI/tevent-0.9.35.sigs
similarity index 100%
copy from lib/tevent/ABI/tevent-0.9.34.sigs
copy to lib/tevent/ABI/tevent-0.9.35.sigs
diff --git a/lib/tevent/ABI/tevent-0.9.34.sigs b/lib/tevent/ABI/tevent-0.9.36.sigs
similarity index 99%
copy from lib/tevent/ABI/tevent-0.9.34.sigs
copy to lib/tevent/ABI/tevent-0.9.36.sigs
index 7a6a236..8a579c8 100644
--- a/lib/tevent/ABI/tevent-0.9.34.sigs
+++ b/lib/tevent/ABI/tevent-0.9.36.sigs
@@ -53,6 +53,7 @@ tevent_num_signals: size_t (void)
tevent_queue_add: bool (struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
tevent_queue_add_entry: struct tevent_queue_entry *(struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
tevent_queue_add_optimize_empty: struct tevent_queue_entry *(struct tevent_queue *, struct tevent_context *, struct tevent_req *, tevent_queue_trigger_fn_t, void *)
+tevent_queue_entry_untrigger: void (struct tevent_queue_entry *)
tevent_queue_length: size_t (struct tevent_queue *)
tevent_queue_running: bool (struct tevent_queue *)
tevent_queue_start: void (struct tevent_queue *)
diff --git a/lib/tevent/echo_server.c b/lib/tevent/echo_server.c
index 6e7f181..f93d8bc 100644
--- a/lib/tevent/echo_server.c
+++ b/lib/tevent/echo_server.c
@@ -118,6 +118,7 @@ static void accept_handler(struct tevent_context *ev, struct tevent_fd *fde,
tevent_req_error(req, errno);
return;
}
+ smb_set_close_on_exec(ret);
state->sock = ret;
tevent_req_done(req);
}
diff --git a/lib/tevent/testsuite.c b/lib/tevent/testsuite.c
index ee29e5b..e508452 100644
--- a/lib/tevent/testsuite.c
+++ b/lib/tevent/testsuite.c
@@ -25,7 +25,7 @@
*/

#include "includes.h"
-#include "lib/tevent/tevent.h"
+#include "tevent.h"
#include "system/filesys.h"
#include "system/select.h"
#include "system/network.h"
diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
index 728cf62..7bb9c61 100644
--- a/lib/tevent/tevent.h
+++ b/lib/tevent/tevent.h
@@ -936,8 +936,8 @@ void tevent_req_set_cancel_fn(struct tevent_req *req, tevent_req_cancel_fn fn);
*
* @param[in] req The request to use.
*
- * @return This function returns true is the request is cancelable,
- * othererwise false is returned.
+ * @return This function returns true if the request is
+ * cancelable, otherwise false is returned.
*
* @note Even if the function returns true, the caller need to wait
* for the function to complete normally.
@@ -1611,6 +1611,9 @@ struct tevent_queue_entry *tevent_queue_add_entry(
* already called tevent_req_notify_callback(), tevent_req_error(),
* tevent_req_done() or a similar function.
*
+ * The trigger function has no chance to see the returned
+ * queue_entry in the optimized case.
+ *
* The request can be removed from the queue by calling talloc_free()
* (or a similar function) on the returned queue entry.
*
@@ -1641,6 +1644,28 @@ struct tevent_queue_entry *tevent_queue_add_optimize_empty(
void *private_data);

/**
+ * @brief Untrigger an already triggered queue entry.
+ *
+ * If a trigger function detects that it needs to remain
+ * in the queue, it needs to call tevent_queue_stop()
+ * followed by tevent_queue_entry_untrigger().
+ *
+ * @note In order to call tevent_queue_entry_untrigger()
+ * the queue must be already stopped and the given queue_entry
+ * must be the first one in the queue! Otherwise it calls abort().
+ *
+ * @note You can't use this together with tevent_queue_add_optimize_empty()
+ * because the trigger function don't have access to the quene entry
+ * in the case of an empty queue.
+ *
+ * @param[in] queue_entry The queue entry to rearm.
+ *
+ * @see tevent_queue_add_entry()
+ * @see tevent_queue_stop()
+ */
+void tevent_queue_entry_untrigger(struct tevent_queue_entry *entry);
+
+/**
* @brief Start a tevent queue.
*
* The queue is started by default.
diff --git a/lib/tevent/tevent_internal.h b/lib/tevent/tevent_internal.h
index 47ea39b..ec3955e 100644
--- a/lib/tevent/tevent_internal.h
+++ b/lib/tevent/tevent_internal.h
@@ -235,7 +235,6 @@ struct tevent_threaded_context {
pthread_mutex_t event_ctx_mutex;
#endif
struct tevent_context *event_ctx;
- int wakeup_fd;
};

struct tevent_debug_ops {
diff --git a/lib/tevent/tevent_queue.c b/lib/tevent/tevent_queue.c
index 5516c6c..9c3973b 100644
--- a/lib/tevent/tevent_queue.c
+++ b/lib/tevent/tevent_queue.c
@@ -266,6 +266,19 @@ struct tevent_queue_entry *tevent_queue_add_optimize_empty(
trigger, private_data, true);
}

+void tevent_queue_entry_untrigger(struct tevent_queue_entry *entry)
+{
+ if (entry->queue->running) {
+ abort();
+ }
+
+ if (entry->queue->list != entry) {
+ abort();
+ }
+
+ entry->triggered = false;
+}
+
void tevent_queue_start(struct tevent_queue *queue)
{
if (queue->running) {
diff --git a/lib/tevent/tevent_threads.c b/lib/tevent/tevent_threads.c
index 2e83f1b..2c6e66b 100644
--- a/lib/tevent/tevent_threads.c
+++ b/lib/tevent/tevent_threads.c
@@ -424,7 +424,6 @@ struct tevent_threaded_context *tevent_threaded_context_create(
return NULL;
}
tctx->event_ctx = ev;
- tctx->wakeup_fd = ev->wakeup_fd;

ret = pthread_mutex_init(&tctx->event_ctx_mutex, NULL);
if (ret != 0) {
@@ -489,14 +488,13 @@ void _tevent_threaded_schedule_immediate(struct tevent_threaded_context *tctx,
}

DLIST_ADD_END(ev->scheduled_immediates, im);
+ wakeup_fd = ev->wakeup_fd;

ret = pthread_mutex_unlock(&ev->scheduled_mutex);
if (ret != 0) {
abort();
}

- wakeup_fd = tctx->wakeup_fd;
-
ret = pthread_mutex_unlock(&tctx->event_ctx_mutex);
if (ret != 0) {
abort();
diff --git a/lib/tevent/wscript b/lib/tevent/wscript
index 31f7ee7..94d190f 100644
--- a/lib/tevent/wscript
+++ b/lib/tevent/wscript
@@ -1,7 +1,7 @@
#!/usr/bin/env python

APPNAME = 'tevent'
-VERSION = '0.9.34'
+VERSION = '0.9.36'

blddir = 'bin'

diff --git a/lib/util/tests/tfork.c b/lib/util/tests/tfork.c
index bf642fe..9bcdc2f 100644
--- a/lib/util/tests/tfork.c
+++ b/lib/util/tests/tfork.c
@@ -32,7 +32,6 @@
#include "lib/util/sys_rw.h"
#ifdef HAVE_PTHREAD
#include <pthread.h>
-#include <sys/syscall.h>
#endif

static bool test_tfork_simple(struct torture_context *tctx)
diff --git a/libcli/smb/smb2cli_notify.c b/libcli/smb/smb2cli_notify.c
new file mode 100644
index 0000000..34329ba
--- /dev/null
+++ b/libcli/smb/smb2cli_notify.c
@@ -0,0 +1,214 @@
+/*
+ Unix SMB/CIFS implementation.
+ smb2 lib
+ Copyright (C) Volker Lendecke 2017
+
+ 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 "system/network.h"
+#include "lib/util/tevent_ntstatus.h"
+#include "smb_common.h"
+#include "smbXcli_base.h"
+#include "librpc/gen_ndr/ndr_notify.h"
+
+struct smb2cli_notify_state {
+ uint8_t fixed[32];
+
+ struct iovec *recv_iov;
+ uint8_t *data;
+ uint32_t data_length;
+
+ struct tevent_req *subreq;
+};
+
+static void smb2cli_notify_done(struct tevent_req *subreq);
+static void smb2cli_notify_timedout(struct tevent_req *subreq);
+
+struct tevent_req *smb2cli_notify_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ struct smbXcli_tcon *tcon,
+ uint32_t output_buffer_length,
+ uint64_t fid_persistent,
+ uint64_t fid_volatile,
+ uint32_t completion_filter,
+ bool recursive)
+{
+ struct tevent_req *req, *subreq;
+ struct smb2cli_notify_state *state;
+ uint8_t *fixed;
+
+ req = tevent_req_create(mem_ctx, &state,
+ struct smb2cli_notify_state);
+ if (req == NULL) {
+ return NULL;
+ }
+ fixed = state->fixed;
+ SSVAL(fixed, 0, 32);
+ SSVAL(fixed, 2, recursive ? SMB2_WATCH_TREE : 0);
+ SIVAL(fixed, 4, output_buffer_length);
+ SBVAL(fixed, 8, fid_persistent);
+ SBVAL(fixed, 16, fid_volatile);
+ SIVAL(fixed, 24, completion_filter);
+ SIVAL(fixed, 28, 0); /* reserved */
+
+ state->subreq = smb2cli_req_send(state, ev, conn, SMB2_OP_NOTIFY,
+ 0, 0, /* flags */
+ 0, /* timeout_msec */
+ tcon,
+ session,
+ state->fixed, sizeof(state->fixed),
+ NULL, 0, /* dyn* */
+ 0); /* max_dyn_len */
+ if (tevent_req_nomem(state->subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+ tevent_req_set_callback(state->subreq, smb2cli_notify_done, req);
+
+ subreq = tevent_wakeup_send(state, ev,
+ timeval_current_ofs_msec(timeout_msec));
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+ tevent_req_set_callback(subreq, smb2cli_notify_timedout, req);
+
+ return req;
+}
+
+static void smb2cli_notify_timedout(struct tevent_req *subreq)
+{
+ struct tevent_req *req = tevent_req_callback_data(
+ subreq, struct tevent_req);
+ struct smb2cli_notify_state *state = tevent_req_data(
+ req, struct smb2cli_notify_state);
+ bool ok;
+
+ ok = tevent_wakeup_recv(subreq);
+ if (!ok) {
+ tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
+ return;
+ }
+
+ ok = tevent_req_cancel(state->subreq);
+ if (!ok) {
+ tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
+ return;
+ }
+}
+
+static void smb2cli_notify_done(struct tevent_req *subreq)
+{
+ struct tevent_req *req = tevent_req_callback_data(
+ subreq, struct tevent_req);
+ struct smb2cli_notify_state *state = tevent_req_data(
+ req, struct smb2cli_notify_state);
+ NTSTATUS status;
+ struct iovec *iov;
+ uint16_t data_offset;
+ static const struct smb2cli_req_expected_response expected[] = {
+ {
+ .status = NT_STATUS_OK,
+ .body_size = 0x09
+ }
+ };
+
+ status = smb2cli_req_recv(subreq, state, &iov,
+ expected, ARRAY_SIZE(expected));
+ TALLOC_FREE(subreq);
+
+ if (NT_STATUS_EQUAL(status, NT_STATUS_CANCELLED)) {
+ status = NT_STATUS_IO_TIMEOUT;
+ }
+ if (tevent_req_nterror(req, status)) {
+ return;
+ }
+
+ data_offset = SVAL(iov[1].iov_base, 2);
+ state->data_length = IVAL(iov[1].iov_base, 4);
+
+ if ((data_offset != SMB2_HDR_BODY + 8) ||
+ (state->data_length > iov[2].iov_len)) {
+ tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
+ return;
+ }
+
+ state->recv_iov = iov;
+ state->data = (uint8_t *)iov[2].iov_base;
+ tevent_req_done(req);
+}
+
+NTSTATUS smb2cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+ uint8_t **data, uint32_t *data_length)
+{
+ struct smb2cli_notify_state *state = tevent_req_data(
+ req, struct smb2cli_notify_state);
+ NTSTATUS status;
+
+ if (tevent_req_is_nterror(req, &status)) {
+ return status;
+ }
+ talloc_steal(mem_ctx, state->recv_iov);
+ *data_length = state->data_length;
+ *data = state->data;
+ return NT_STATUS_OK;
+}
+
+NTSTATUS smb2cli_notify(struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ struct smbXcli_tcon *tcon,
+ uint32_t output_buffer_length,
+ uint64_t fid_persistent,
+ uint64_t fid_volatile,
+ uint32_t completion_filter,
+ bool recursive,
+ TALLOC_CTX *mem_ctx,
+ uint8_t **data,
+ uint32_t *data_length)
+{
+ TALLOC_CTX *frame = talloc_stackframe();
+ struct tevent_context *ev;
+ struct tevent_req *req;
+ NTSTATUS status = NT_STATUS_NO_MEMORY;
+
+ if (smbXcli_conn_has_async_calls(conn)) {
+ /*
+ * Can't use sync call while an async call is in flight
+ */
+ status = NT_STATUS_INVALID_PARAMETER;
+ goto fail;
+ }
+ ev = samba_tevent_context_init(frame);
+ if (ev == NULL) {
+ goto fail;
+ }
+ req = smb2cli_notify_send(frame, ev, conn, timeout_msec,
+ session, tcon, output_buffer_length,
+ fid_persistent, fid_volatile,
+ completion_filter, recursive);
+ if (req == NULL) {
+ goto fail;
+ }
+ if (!tevent_req_poll_ntstatus(req, ev, &status)) {
+ goto fail;
+ }
+ status = smb2cli_notify_recv(req, mem_ctx, data, data_length);
+ fail:
+ TALLOC_FREE(frame);
+ return status;
+}
diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h
index 2532084..20ef26e 100644
--- a/libcli/smb/smbXcli_base.h
+++ b/libcli/smb/smbXcli_base.h
@@ -811,6 +811,32 @@ NTSTATUS smb2cli_query_directory(struct smbXcli_conn *conn,
uint8_t **data,
uint32_t *data_length);

+struct tevent_req *smb2cli_notify_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ struct smbXcli_tcon *tcon,
+ uint32_t output_buffer_length,
+ uint64_t fid_persistent,
+ uint64_t fid_volatile,
+ uint32_t completion_filter,
+ bool recursive);
+NTSTATUS smb2cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+ uint8_t **data, uint32_t *data_length);
+NTSTATUS smb2cli_notify(struct smbXcli_conn *conn,
+ uint32_t timeout_msec,
+ struct smbXcli_session *session,
+ struct smbXcli_tcon *tcon,
+ uint32_t output_buffer_length,
+ uint64_t fid_persistent,
+ uint64_t fid_volatile,
+ uint32_t completion_filter,
+ bool recursive,
+ TALLOC_CTX *mem_ctx,
+ uint8_t **data,
+ uint32_t *data_length);
+
struct tevent_req *smb2cli_ioctl_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct smbXcli_conn *conn,
diff --git a/libcli/smb/wscript b/libcli/smb/wscript
index e662826..53a5c21 100644
--- a/libcli/smb/wscript
+++ b/libcli/smb/wscript
@@ -39,6 +39,7 @@ def build(bld):
smb2cli_flush.c
smb2cli_set_info.c
smb2cli_query_info.c
+ smb2cli_notify.c
smb2cli_query_directory.c
smb2cli_ioctl.c
smb2cli_echo.c
diff --git a/source3/client/client.c b/source3/client/client.c
index 0ee084a..639d9fa 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -4561,12 +4561,17 @@ static int cmd_notify(void)
}

while (1) {
- uint32_t i, num_changes;
- struct notify_change *changes;
+ uint32_t i;
+ uint32_t num_changes = 0;
+ struct notify_change *changes = NULL;

status = cli_notify(cli, fnum, 1000, FILE_NOTIFY_CHANGE_ALL,
true,
talloc_tos(), &num_changes, &changes);
+ if (NT_STATUS_EQUAL(status, STATUS_NOTIFY_ENUM_DIR)) {
+ printf("NOTIFY_ENUM_DIR\n");
--
Samba Shared Repository
Karolin Seeger
2018-04-25 11:16:02 UTC
Permalink
The branch, v4-7-test has been updated
via 825aea7 s4:rpc_server: fix call_id truncation in dcesrv_find_fragmented_call()
via bdfdf93 tests:dcerpc/raw_protocol: reproduce call_id truncation bug
via 7a636de winbindd: initialize type = SID_NAME_UNKNOWN in wb_lookupsids_single_done()
via d1869c6 winbindd: don't split the rid for SID_NAME_DOMAIN sids in wb_lookupsids
from 38af417 s3:passdb: Do not return OK if we don't have pinfo set up

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-7-test


- Log -----------------------------------------------------------------
commit 825aea77e5cb4d600933b6493633c8ed0515f783
Author: Stefan Metzmacher <***@samba.org>
Date: Wed Feb 21 00:49:55 2018 +0100

s4:rpc_server: fix call_id truncation in dcesrv_find_fragmented_call()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13289

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Ralph Boehme <***@samba.org>

Autobuild-User(master): Ralph Böhme <***@samba.org>
Autobuild-Date(master): Wed Feb 21 19:02:56 CET 2018 on sn-devel-144

(cherry picked from commit 5d113f80944f2e1d2a7e80f73aea7a4cfdfbd140)

Autobuild-User(v4-7-test): Karolin Seeger <***@samba.org>
Autobuild-Date(v4-7-test): Wed Apr 25 13:15:10 CEST 2018 on sn-devel-144

commit bdfdf93f0ca2bc847d640733bbaa71efb0d8e262
Author: Stefan Metzmacher <***@samba.org>
Date: Wed Feb 21 00:50:26 2018 +0100

tests:dcerpc/raw_protocol: reproduce call_id truncation bug

We need to make sure the server handles call_id values > UINT16_MAX.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13289

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Ralph Boehme <***@samba.org>
(cherry picked from commit 65e8edb382fbc7450919aad8b42cfcae9e779d11)

commit 7a636de5fabdf1f46fe9f7178114540b48e00b39
Author: Stefan Metzmacher <***@samba.org>
Date: Tue Jan 23 23:52:59 2018 +0100

winbindd: initialize type = SID_NAME_UNKNOWN in wb_lookupsids_single_done()

We check for !NT_STATUS_LOOKUP_ERR(), but wb_lookupsid_recv()
only initializes the results together with NT_STATUS_OK.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13280

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Ralph Boehme <***@samba.org>
(cherry picked from commit b5ffa0e21f74fa0c452df38cf50e542eb278562d)

commit d1869c670fb2d9ccca0c2ad17c5901d42449d54e
Author: Stefan Metzmacher <***@samba.org>
Date: Tue Jan 23 14:34:45 2018 +0100

winbindd: don't split the rid for SID_NAME_DOMAIN sids in wb_lookupsids

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13279

Signed-off-by: Stefan Metzmacher <***@samba.org>
Reviewed-by: Ralph Boehme <***@samba.org>
(cherry picked from commit 17c48f26dea5701feed1c24769348f332695391c)

-----------------------------------------------------------------------

Summary of changes:
python/samba/tests/dcerpc/raw_protocol.py | 2 +-
source3/winbindd/wb_lookupsids.c | 6 ++++--
source4/rpc_server/dcerpc_server.c | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/tests/dcerpc/raw_protocol.py b/python/samba/tests/dcerpc/raw_protocol.py
index 587df54..ff815e9 100755
--- a/python/samba/tests/dcerpc/raw_protocol.py
+++ b/python/samba/tests/dcerpc/raw_protocol.py
@@ -1974,7 +1974,7 @@ class TestDCERPC_BIND(RawDCERPCTest):

# And now try a request without auth_info
# netr_ServerReqChallenge()
- req = self.generate_request(call_id = 2,
+ req = self.generate_request(call_id = 0x21234,
pfc_flags=pfc_flags,
context_id=ctx.context_id,
opnum=4,
diff --git a/source3/winbindd/wb_lookupsids.c b/source3/winbindd/wb_lookupsids.c
index f2b2768..bd90c43 100644
--- a/source3/winbindd/wb_lookupsids.c
+++ b/source3/winbindd/wb_lookupsids.c
@@ -513,7 +513,7 @@ static void wb_lookupsids_single_done(struct tevent_req *subreq)
req, struct wb_lookupsids_state);
const char *domain_name = NULL;
const char *name = NULL;
- enum lsa_SidType type;
+ enum lsa_SidType type = SID_NAME_UNKNOWN;
uint32_t res_sid_index;
uint32_t src_rid;

@@ -545,7 +545,9 @@ static void wb_lookupsids_single_done(struct tevent_req *subreq)
*/

sid_copy(&src_domain_sid, &state->sids[res_sid_index]);
- sid_split_rid(&src_domain_sid, &src_rid);
+ if (type != SID_NAME_DOMAIN) {
+ sid_split_rid(&src_domain_sid, &src_rid);
+ }

src_domain.name.string = domain_name;
src_domain.sid = &src_domain_sid;
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index 6a985c5..262eb70 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -239,7 +239,7 @@ const struct dcesrv_interface *find_interface_by_uuid(const struct dcesrv_endpoi
/*
find the earlier parts of a fragmented call awaiting reassembily
*/
-static struct dcesrv_call_state *dcesrv_find_fragmented_call(struct dcesrv_connection *dce_conn, uint16_t call_id)
+static struct dcesrv_call_state *dcesrv_find_fragmented_call(struct dcesrv_connection *dce_conn, uint32_t call_id)
{
struct dcesrv_call_state *c;
for (c=dce_conn->incoming_fragmented_call_list;c;c=c->next) {
--
Samba Shared Repository
Loading...