[SCM] Samba Shared Repository - branch v4-0-stable updated
Karolin Seeger
kseeger at samba.org
Tue Jan 7 01:06:09 MST 2014
The branch, v4-0-stable has been updated
via 2b2ec18 VERSION: Disable git snapshots for the 4.0.14 release.
via 65e6f29 WHATSNEW: Add release notes for Samba 4.0.14.
via bdafdcb ldb: bad if test in ldb_comparison_fold()
via 5b9e579 s3: smbpasswd - fix crashes on invalid input.
via 64302c1 s3:configure: require tevent >= 0.9.18 as external library
via eca8433 smbtorture: New torture test for bug #9870.
via df348b8 smbd - allow updates on directory write times on open handles.
via 717edc2 smbd: Fix a panic when a smb2 brlock times out
via e533a99 selftest: Remove samba3.smb2.lock.*.rw-exclusive from flapping file
via 5b0b88d selftest: Run smb2.lock tests also against AIO share
via 009d5aa selftest: Introduce share for testing AIO
via 5c99489 s3: Return correct error code from SMB2 AIO read failure
via c36bda8 s3-aio: Use correct locking context for SMB2
via 9c622f0 s3:smb2_server: avoid calling set_current_user_info() for each request
via 83f3344 s3:smb2_server: generate a header blob for the sendfile path
via 3efa732 s3:smb2_server: allocate smbd_smb2_request on talloc_tos()
via 6d4df0f s3:smb2_server: use tevent_req_notify_callback() in smbd_smb2_request_pending_queue()
via e2169a7 s3:smb2_server: for performance reasons we use tevent_fd and readv/writev directly
via 8b72512 s3:smb2_server: fix drain_socket error handling
via fe04555 smbd: Always use UCF_PREP_CREATEFILE for filename_convert calls to resolve a path for open.
via b1fb353 smbd: change flag name from UCF_CREATING_FILE to UCF_PREP_CREATEFILE
via 790a3b2 smbd: Fix regression for the dropbox case.
via db8b33d VERSION: Bump version up to 4.0.14
via d580670 Merge tag 'samba-4.0.13' into v4-0-test
via c880a38 smbd: Fix bug 10284
via 9ad3d28 printing: always store sytem job-ID in queue state
via 0fa726b spoolss: return the spoolss job ID in notifications
via 68f0047 s3-winbind: Pass the group name to fillup_pw_field().
via ff8c218 s3-lib: Add grpname to talloc_sub_specified().
via be0a7af spoolss: accept XPS_PASS datatype used by Windows 8
via 7dbcb14 smbd: Fix a talloc hierarchy problem in msg_channel
via 59da16e VERSION: Bump version number up to 4.0.13...
from b0574ae VERSION: Disable git snapshots for the 4.0.13 release.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-stable
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
VERSION | 2 +-
WHATSNEW.txt | 81 +++-
lib/ldb/common/attrib_handlers.c | 2 +-
selftest/flapping | 1 -
selftest/knownfail | 1 +
selftest/target/Samba3.pm | 4 +
source3/configure.in | 2 +-
source3/include/printing.h | 1 +
source3/include/proto.h | 1 +
source3/lib/msg_channel.c | 100 +--
source3/lib/substitute.c | 31 +-
source3/passdb/passdb.c | 8 +-
source3/passdb/pdb_ldap.c | 24 +-
source3/printing/printing.c | 45 +-
source3/rpc_server/spoolss/srv_spoolss_nt.c | 40 +-
source3/selftest/tests.py | 4 +
source3/smbd/aio.c | 4 +-
source3/smbd/filename.c | 10 +-
source3/smbd/globals.h | 31 +-
source3/smbd/nttrans.c | 6 +-
source3/smbd/open.c | 9 +-
source3/smbd/process.c | 5 +-
source3/smbd/reply.c | 12 +-
source3/smbd/smb2_create.c | 3 +-
source3/smbd/smb2_lock.c | 2 +-
source3/smbd/smb2_read.c | 12 +-
source3/smbd/smb2_server.c | 886 +++++++++++++-------------
source3/smbd/smbd.h | 2 +-
source3/torture/torture.c | 2 +-
source3/utils/net.c | 5 +
source3/utils/net_sam.c | 2 +
source3/utils/passwd_util.c | 14 +-
source3/utils/smbpasswd.c | 14 +
source3/winbindd/wb_fill_pwent.c | 73 ++-
source4/torture/basic/delaywrite.c | 95 +++
35 files changed, 903 insertions(+), 631 deletions(-)
Changeset truncated at 500 lines:
diff --git a/VERSION b/VERSION
index 7631cb8..e1ed5ca 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
########################################################
SAMBA_VERSION_MAJOR=4
SAMBA_VERSION_MINOR=0
-SAMBA_VERSION_RELEASE=13
+SAMBA_VERSION_RELEASE=14
########################################################
# If a official release has a serious bug #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 50ba8aa..661cf51 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,4 +1,81 @@
==============================
+ Release Notes for Samba 4.0.14
+ January 7, 2014
+ ==============================
+
+
+This is the latest stable release of Samba 4.0.
+
+Major enhancements in Samba 4.0.14 include:
+
+o Fix segfault in smbd (bug #10284).
+o Fix SMB2 server panic when a smb2 brlock times out (bug #10311).
+
+
+Changes since 4.0.13:
+---------------------
+
+o Jeremy Allison <jra at samba.org>
+ * BUG 9870: smbd: Allow updates on directory write times on open handles.
+ * BUG 10297: smbd: Fix writing to a directory with -wx permissions
+ on a share.
+ * BUG 10305: ldb: Fix bad if test in ldb_comparison_fold().
+ * BUG 10320: s3:smbpasswd: Fix crashes on invalid input.
+
+
+o David Disseldorp <ddiss at samba.org>
+ * BUG 10271: Send correct job-ID in print job notifications.
+
+
+o Volker Lendecke <vl at samba.org>
+ * BUG 10250: smbd: Fix a talloc hierarchy problem in msg_channel.
+ * BUG 10284: smbd: Fix segfault.
+ * BUG 10297: smbd: Fix writing to a directory with -wx permissions
+ on a share.
+ * BUG 10311: Fix SMB2 server panic when a smb2 brlock times out.
+
+
+o Stefan Metzmacher <metze at samba.org>
+ * BUG 10298: Reduce smb2_server processing overhead.
+ * BUG 10330: s3:configure: Require tevent >= 0.9.18 as external library.
+
+
+o Arvid Requate <requate at univention.de>
+ * BUG 10267: spoolss: Accept XPS_PASS datatype used by Windows 8.
+
+
+o Christof Schmitt <cs at samba.org>
+ * BUG 10310: Fix AIO with SMB2 and locks.
+
+
+o Andreas Schneider <asn at samba.org>
+ * BUG 2191: Fix substution of %G/%g in 'template * homedir'.
+
+
+######################################################################
+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.0 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.0.13
December 9, 2013
==============================
@@ -88,8 +165,8 @@ database (https://bugzilla.samba.org/).
======================================================================
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
+
==============================
Release Notes for Samba 4.0.12
diff --git a/lib/ldb/common/attrib_handlers.c b/lib/ldb/common/attrib_handlers.c
index daeb422..4b94d39 100644
--- a/lib/ldb/common/attrib_handlers.c
+++ b/lib/ldb/common/attrib_handlers.c
@@ -254,7 +254,7 @@ int ldb_comparison_fold(struct ldb_context *ldb, void *mem_ctx,
if (n2 == 0 && n1 != 0) {
return (int)toupper(*s1);
}
- if (n2 == 0 && n2 == 0) {
+ if (n1 == 0 && n2 == 0) {
return 0;
}
return (int)toupper(*s1) - (int)toupper(*s2);
diff --git a/selftest/flapping b/selftest/flapping
index afeae65..fd2e0c3 100644
--- a/selftest/flapping
+++ b/selftest/flapping
@@ -16,7 +16,6 @@
^samba3.rap.printing # fails sometimes on sn-devel
^samba3.rpc.spoolss.printer.*addprinter.print_test # fails on some hosts due to timing issues ?
^samba3.rpc.lsa.privileges.lsa.Privileges\(s3dc\) # fails sometimes on sn-devel
-^samba3.smb2.lock.*.rw-exclusive # another intermittent failure
^samba4.blackbox.gentest # is flakey due to timing
^samba3.smb2.acls.INHERITANCE\(plugin_s4_dc\) # Seems to flap - succeeds on sn-devel, fails on Fedora 16
^samba3.smb2.acls.DYNAMIC\(plugin_s4_dc\) # Seems to flap - succeeds on sn-devel, fails on Fedora 16
diff --git a/selftest/knownfail b/selftest/knownfail
index e393635..1889a6e 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -116,6 +116,7 @@
^samba4.*base.delaywrite.*delayed update of write time 3c\(.*\)$
^samba4.*base.delaywrite.*update of write time using SET_END_OF_FILE\(.*\)$
^samba4.*base.delaywrite.*update of write time using SET_ALLOCATION_SIZE\(.*\)$
+^samba4.*base.delaywrite.*directory timestamp update test\(.*\)$
^samba4.ldap.python \(dc\).Test add_ldif\(\) with BASE64 security descriptor input using WRONG domain SID\(.*\)$
# some operations don't work over the CIFS NTVFS backend yet (eg. root_fid)
^samba4.ntvfs.cifs.*.base.createx_sharemodes_dir
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 2061d97..792bbca 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -1004,6 +1004,10 @@ sub provision($$$$$$)
directory mask = 0777
force directory mode = 0
vfs objects = $vfs_modulesdir_abs/xattr_tdb.so
+[aio]
+ copy = tmp
+ aio read size = 1
+ aio write size = 1
[print\$]
copy = tmp
diff --git a/source3/configure.in b/source3/configure.in
index f5487c3..f4403e1 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -1873,7 +1873,7 @@ AC_ARG_ENABLE(external_libtevent,
if test "x$enable_external_libtevent" != xno
then
- PKG_CHECK_MODULES(LIBTEVENT, tevent >= 0.9.11,
+ PKG_CHECK_MODULES(LIBTEVENT, tevent >= 0.9.18,
[ enable_external_libtevent=yes ],
[ if test x$enable_external_libtevent = xyes; then
AC_MSG_ERROR([Unable to find libtevent])
diff --git a/source3/include/printing.h b/source3/include/printing.h
index 391fb7a..ec5a53b 100644
--- a/source3/include/printing.h
+++ b/source3/include/printing.h
@@ -193,6 +193,7 @@ uint16_t print_spool_rap_jobid(struct print_file_data *print_file);
/* The following definitions come from printing/printing.c */
+uint32 sysjob_to_jobid_pdb(struct tdb_print_db *pdb, int sysjob);
uint32 sysjob_to_jobid(int unix_jobid);
bool print_notify_register_pid(int snum);
bool print_notify_deregister_pid(int snum);
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 0defbc9..0276244 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -222,6 +222,7 @@ char *talloc_sub_basic(TALLOC_CTX *mem_ctx, const char *smb_name,
char *talloc_sub_specified(TALLOC_CTX *mem_ctx,
const char *input_string,
const char *username,
+ const char *grpname,
const char *domain,
uid_t uid,
gid_t gid);
diff --git a/source3/lib/msg_channel.c b/source3/lib/msg_channel.c
index c68c11e..5f6ddeb 100644
--- a/source3/lib/msg_channel.c
+++ b/source3/lib/msg_channel.c
@@ -41,9 +41,6 @@ static void msg_channel_init_got_ctdb(struct tevent_req *subreq);
static void msg_channel_init_got_msg(struct messaging_context *msg,
void *priv, uint32_t msg_type,
struct server_id server_id, DATA_BLOB *data);
-static void msg_channel_trigger(struct tevent_context *ev,
- struct tevent_immediate *im,
- void *priv);
static int msg_channel_destructor(struct msg_channel *s);
struct tevent_req *msg_channel_init_send(TALLOC_CTX *mem_ctx,
@@ -157,6 +154,12 @@ fail:
return err;
}
+struct msg_read_state {
+ struct tevent_context *ev;
+ struct msg_channel *channel;
+ struct messaging_rec *rec;
+};
+
static void msg_channel_init_got_msg(struct messaging_context *msg,
void *priv, uint32_t msg_type,
struct server_id server_id,
@@ -167,7 +170,6 @@ static void msg_channel_init_got_msg(struct messaging_context *msg,
struct messaging_rec *rec;
struct messaging_rec **msgs;
size_t num_msgs;
- struct tevent_immediate *im;
rec = talloc(s, struct messaging_rec);
if (rec == NULL) {
@@ -184,6 +186,19 @@ static void msg_channel_init_got_msg(struct messaging_context *msg,
}
rec->buf.length = data->length;
+ if (s->pending_req != NULL) {
+ struct tevent_req *req = s->pending_req;
+ struct msg_read_state *state = tevent_req_data(
+ req, struct msg_read_state);
+
+ s->pending_req = NULL;
+
+ state->rec = talloc_move(state, &rec);
+ tevent_req_defer_callback(req, s->ev);
+ tevent_req_done(req);
+ return;
+ }
+
num_msgs = talloc_array_length(s->msgs);
msgs = talloc_realloc(s, s->msgs, struct messaging_rec *, num_msgs+1);
if (msgs == NULL) {
@@ -192,28 +207,11 @@ static void msg_channel_init_got_msg(struct messaging_context *msg,
s->msgs = msgs;
s->msgs[num_msgs] = talloc_move(s->msgs, &rec);
- if (s->pending_req == NULL) {
- return;
- }
-
- im = tevent_create_immediate(s);
- if (im == NULL) {
- goto fail;
- }
- tevent_schedule_immediate(im, s->ev, msg_channel_trigger, s);
return;
fail:
TALLOC_FREE(rec);
}
-struct msg_read_state {
- struct tevent_context *ev;
- struct tevent_req *req;
- struct msg_channel *channel;
- struct messaging_rec *rec;
-};
-
-static int msg_read_state_destructor(struct msg_read_state *s);
static void msg_read_got_ctdb(struct tevent_req *subreq);
struct tevent_req *msg_read_send(TALLOC_CTX *mem_ctx,
@@ -221,7 +219,6 @@ struct tevent_req *msg_read_send(TALLOC_CTX *mem_ctx,
struct msg_channel *channel)
{
struct tevent_req *req;
- struct tevent_immediate *im;
struct msg_read_state *state;
void *msg_tdb_event;
size_t num_msgs;
@@ -231,28 +228,28 @@ struct tevent_req *msg_read_send(TALLOC_CTX *mem_ctx,
return NULL;
}
state->ev = ev;
- state->req = req;
state->channel = channel;
if (channel->pending_req != NULL) {
tevent_req_error(req, EBUSY);
return tevent_req_post(req, ev);
}
- channel->pending_req = req;
- channel->ev = ev;
- talloc_set_destructor(state, msg_read_state_destructor);
num_msgs = talloc_array_length(channel->msgs);
if (num_msgs != 0) {
- im = tevent_create_immediate(channel->ev);
- if (tevent_req_nomem(im, req)) {
- return tevent_req_post(req, ev);
- }
- tevent_schedule_immediate(im, channel->ev, msg_channel_trigger,
- channel);
- return req;
+ state->rec = talloc_move(state, &channel->msgs[0]);
+ memmove(channel->msgs, channel->msgs+1,
+ sizeof(struct messaging_rec *) * (num_msgs-1));
+ channel->msgs = talloc_realloc(
+ channel, channel->msgs, struct messaging_rec *,
+ num_msgs - 1);
+ tevent_req_done(req);
+ return tevent_req_post(req, ev);
}
+ channel->pending_req = req;
+ channel->ev = ev;
+
msg_tdb_event = messaging_tdb_event(state, channel->msg, ev);
if (tevent_req_nomem(msg_tdb_event, req)) {
return tevent_req_post(req, ev);
@@ -271,42 +268,6 @@ struct tevent_req *msg_read_send(TALLOC_CTX *mem_ctx,
return req;
}
-static int msg_read_state_destructor(struct msg_read_state *s)
-{
- assert(s->channel->pending_req == s->req);
- s->channel->pending_req = NULL;
- return 0;
-}
-
-static void msg_channel_trigger(struct tevent_context *ev,
- struct tevent_immediate *im,
- void *priv)
-{
- struct msg_channel *channel;
- struct tevent_req *req;
- struct msg_read_state *state;
- size_t num_msgs;
-
- channel = talloc_get_type_abort(priv, struct msg_channel);
- req = channel->pending_req;
- state = tevent_req_data(req, struct msg_read_state);
-
- talloc_set_destructor(state, NULL);
- msg_read_state_destructor(state);
-
- num_msgs = talloc_array_length(channel->msgs);
- assert(num_msgs > 0);
-
- state->rec = talloc_move(state, &channel->msgs[0]);
-
- memmove(channel->msgs, channel->msgs+1,
- sizeof(struct messaging_rec *) * (num_msgs-1));
- channel->msgs = talloc_realloc(
- channel, channel->msgs, struct messaging_rec *, num_msgs - 1);
-
- tevent_req_done(req);
-}
-
static void msg_read_got_ctdb(struct tevent_req *subreq)
{
struct tevent_req *req = tevent_req_callback_data(
@@ -368,5 +329,6 @@ int msg_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
return err;
}
*prec = talloc_move(mem_ctx, &state->rec);
+ tevent_req_received(req);
return 0;
}
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index a254bca..ca2ac79 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -613,6 +613,7 @@ done:
char *talloc_sub_specified(TALLOC_CTX *mem_ctx,
const char *input_string,
const char *username,
+ const char *grpname,
const char *domain,
uid_t uid,
gid_t gid)
@@ -648,9 +649,18 @@ char *talloc_sub_specified(TALLOC_CTX *mem_ctx,
break;
case 'G' :
if (gid != -1) {
- a_string = talloc_string_sub(
- tmp_ctx, a_string, "%G",
- gidtoname(gid));
+ const char *name;
+
+ if (grpname != NULL) {
+ name = grpname;
+ } else {
+ name = gidtoname(gid);
+ }
+
+ a_string = talloc_string_sub(tmp_ctx,
+ a_string,
+ "%G",
+ name);
} else {
a_string = talloc_string_sub(
tmp_ctx, a_string,
@@ -659,9 +669,18 @@ char *talloc_sub_specified(TALLOC_CTX *mem_ctx,
break;
case 'g' :
if (gid != -1) {
- a_string = talloc_string_sub(
- tmp_ctx, a_string, "%g",
- gidtoname(gid));
+ const char *name;
+
+ if (grpname != NULL) {
+ name = grpname;
+ } else {
+ name = gidtoname(gid);
+ }
+
+ a_string = talloc_string_sub(tmp_ctx,
+ a_string,
+ "%g",
+ name);
} else {
a_string = talloc_string_sub(
tmp_ctx, a_string, "%g", "NO_GROUP");
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 379d858..5a4620f 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -228,16 +228,16 @@ static NTSTATUS samu_set_unix_internal(struct pdb_methods *methods,
/* set some basic attributes */
pdb_set_profile_path(user, talloc_sub_specified(user,
- lp_logon_path(), pwd->pw_name, domain, pwd->pw_uid, pwd->pw_gid),
+ lp_logon_path(), pwd->pw_name, NULL, domain, pwd->pw_uid, pwd->pw_gid),
PDB_DEFAULT);
pdb_set_homedir(user, talloc_sub_specified(user,
- lp_logon_home(), pwd->pw_name, domain, pwd->pw_uid, pwd->pw_gid),
+ lp_logon_home(), pwd->pw_name, NULL, domain, pwd->pw_uid, pwd->pw_gid),
PDB_DEFAULT);
pdb_set_dir_drive(user, talloc_sub_specified(user,
- lp_logon_drive(), pwd->pw_name, domain, pwd->pw_uid, pwd->pw_gid),
+ lp_logon_drive(), pwd->pw_name, NULL, domain, pwd->pw_uid, pwd->pw_gid),
PDB_DEFAULT);
pdb_set_logon_script(user, talloc_sub_specified(user,
- lp_logon_script(), pwd->pw_name, domain, pwd->pw_uid, pwd->pw_gid),
+ lp_logon_script(), pwd->pw_name, NULL, domain, pwd->pw_uid, pwd->pw_gid),
PDB_DEFAULT);
}
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 7ae9056..a9db3fa 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -5343,11 +5343,29 @@ static NTSTATUS ldapsam_create_user(struct pdb_methods *my_methods,
if (is_machine) {
/* TODO: choose a more appropriate default for machines */
- homedir = talloc_sub_specified(tmp_ctx, lp_template_homedir(), "SMB_workstations_home", ldap_state->domain_name, uid, gid);
+ homedir = talloc_sub_specified(tmp_ctx,
+ lp_template_homedir(),
+ "SMB_workstations_home",
+ NULL,
+ ldap_state->domain_name,
+ uid,
+ gid);
shell = talloc_strdup(tmp_ctx, "/bin/false");
} else {
- homedir = talloc_sub_specified(tmp_ctx, lp_template_homedir(), name, ldap_state->domain_name, uid, gid);
- shell = talloc_sub_specified(tmp_ctx, lp_template_shell(), name, ldap_state->domain_name, uid, gid);
+ homedir = talloc_sub_specified(tmp_ctx,
+ lp_template_homedir(),
+ name,
+ NULL,
+ ldap_state->domain_name,
+ uid,
+ gid);
+ shell = talloc_sub_specified(tmp_ctx,
+ lp_template_shell(),
+ name,
+ NULL,
+ ldap_state->domain_name,
+ uid,
+ gid);
}
uidstr = talloc_asprintf(tmp_ctx, "%u", (unsigned int)uid);
gidstr = talloc_asprintf(tmp_ctx, "%u", (unsigned int)gid);
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
--
Samba Shared Repository
More information about the samba-cvs
mailing list