[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Fri Sep 9 13:56:02 UTC 2016
The branch, master has been updated
via 754f8ef lib: Avoid a few casts
via 4e9a555 notifyd: Don't trust remote pointers
via 6601b35 notifyd: Trim down the noncluster case
via c5715f8 notifyd: Avoid "includes.h"
via 14c3f67 notifyd: Fix bad comment wording
from 4a8b588 gensec_krb5: Do not leak memory of target_principal
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 754f8eff4840dacd675b36c8b8373341d5b8ba0c
Author: Volker Lendecke <vl at samba.org>
Date: Mon Jul 25 17:05:37 2016 +0200
lib: Avoid a few casts
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Fri Sep 9 15:55:50 CEST 2016 on sn-devel-144
commit 4e9a55536f95bf417e94a5d4d8e9f24700fa72e7
Author: Volker Lendecke <vl at samba.org>
Date: Thu Sep 8 15:18:39 2016 +0200
notifyd: Don't trust remote pointers
Not a security hole IMO: Only root can send us messages, that's at least our
assumption.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 6601b35e840605192a33da2258a6b440f391f44e
Author: Volker Lendecke <vl at samba.org>
Date: Thu Sep 8 15:23:59 2016 +0200
notifyd: Trim down the noncluster case
Without a cluster, notifyd does not have to receive databases
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit c5715f8e0e16383328762577c00f4504be9e2fb6
Author: Volker Lendecke <vl at samba.org>
Date: Thu Sep 8 11:44:36 2016 +0200
notifyd: Avoid "includes.h"
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 14c3f67df59c288297179304d926b4d6f6490ec3
Author: Volker Lendecke <vl at samba.org>
Date: Thu Sep 8 11:44:23 2016 +0200
notifyd: Fix bad comment wording
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source3/lib/messages.c | 12 +++++-------
source3/smbd/notifyd/notifyd.c | 29 +++++++++++++++++------------
2 files changed, 22 insertions(+), 19 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 98bcf82..12e7dbc 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -117,12 +117,12 @@ static void messaging_recv_cb(const uint8_t *msg, size_t msg_len,
size_t i;
if (msg_len < MESSAGE_HDR_LENGTH) {
- DEBUG(1, ("message too short: %u\n", (unsigned)msg_len));
+ DBG_WARNING("message too short: %zu\n", msg_len);
goto close_fail;
}
if (num_fds > INT8_MAX) {
- DEBUG(1, ("too many fds: %u\n", (unsigned)num_fds));
+ DBG_WARNING("too many fds: %zu\n", num_fds);
goto close_fail;
}
@@ -145,11 +145,9 @@ static void messaging_recv_cb(const uint8_t *msg, size_t msg_len,
message_hdr_get(&rec.msg_type, &rec.src, &rec.dest, msg);
- DEBUG(10, ("%s: Received message 0x%x len %u (num_fds:%u) from %s\n",
- __func__, (unsigned)rec.msg_type,
- (unsigned)rec.buf.length,
- (unsigned)num_fds,
- server_id_str_buf(rec.src, &idbuf)));
+ DBG_DEBUG("Received message 0x%x len %zu (num_fds:%zu) from %s\n",
+ (unsigned)rec.msg_type, rec.buf.length, num_fds,
+ server_id_str_buf(rec.src, &idbuf));
messaging_dispatch_rec(msg_ctx, &rec);
return;
diff --git a/source3/smbd/notifyd/notifyd.c b/source3/smbd/notifyd/notifyd.c
index 69d30f7..70f52cd 100644
--- a/source3/smbd/notifyd/notifyd.c
+++ b/source3/smbd/notifyd/notifyd.c
@@ -17,14 +17,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
+#include "replace.h"
+#include <tevent.h>
+#include "lib/util/data_blob.h"
#include "librpc/gen_ndr/notify.h"
#include "librpc/gen_ndr/messaging.h"
#include "librpc/gen_ndr/server_id.h"
#include "lib/dbwrap/dbwrap.h"
#include "lib/dbwrap/dbwrap_rbt.h"
#include "messages.h"
-#include "proto.h"
#include "tdb.h"
#include "util_tdb.h"
#include "notifyd.h"
@@ -32,7 +33,6 @@
#include "lib/util/tevent_unix.h"
#include "ctdbd_conn.h"
#include "ctdb_srvids.h"
-#include "source3/smbd/proto.h"
#include "server_id_db_util.h"
#include "lib/util/iov_buf.h"
#include "messages_util.h"
@@ -61,7 +61,7 @@ struct notifyd_state {
*
* struct notifyd_instance
*
- * to be maintained by parsed by notifyd_entry_parse()
+ * to be maintained and parsed by notifyd_entry_parse()
*/
struct db_context *entries;
@@ -130,11 +130,11 @@ static bool notifyd_trigger(struct messaging_context *msg_ctx,
static bool notifyd_get_db(struct messaging_context *msg_ctx,
struct messaging_rec **prec,
void *private_data);
+
+#ifdef CLUSTER_SUPPORT
static bool notifyd_got_db(struct messaging_context *msg_ctx,
struct messaging_rec **prec,
void *private_data);
-
-#ifdef CLUSTER_SUPPORT
static void notifyd_broadcast_reclog(struct ctdbd_connection *ctdbd_conn,
struct server_id src,
struct messaging_reclog *log);
@@ -240,6 +240,7 @@ struct tevent_req *notifyd_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
}
tevent_req_set_callback(subreq, notifyd_handler_done, req);
+#ifdef CLUSTER_SUPPORT
subreq = messaging_handler_send(state, ev, msg_ctx,
MSG_SMB_NOTIFY_DB,
notifyd_got_db, state);
@@ -247,6 +248,7 @@ struct tevent_req *notifyd_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
return tevent_req_post(req, ev);
}
tevent_req_set_callback(subreq, notifyd_handler_done, req);
+#endif
names_db = messaging_names_db(msg_ctx);
@@ -901,6 +903,8 @@ static bool notifyd_get_db(struct messaging_context *msg_ctx,
return true;
}
+#ifdef CLUSTER_SUPPORT
+
static int notifyd_add_proxy_syswatches(struct db_record *rec,
void *private_data);
@@ -966,8 +970,6 @@ static bool notifyd_got_db(struct messaging_context *msg_ctx,
return true;
}
-#ifdef CLUSTER_SUPPORT
-
static void notifyd_broadcast_reclog(struct ctdbd_connection *ctdbd_conn,
struct server_id src,
struct messaging_reclog *log)
@@ -1169,8 +1171,6 @@ static int notifyd_clean_peers_recv(struct tevent_req *req)
return tevent_req_simple_recv_unix(req);
}
-#endif
-
static int notifyd_add_proxy_syswatches(struct db_record *rec,
void *private_data)
{
@@ -1202,6 +1202,13 @@ static int notifyd_add_proxy_syswatches(struct db_record *rec,
uint32_t subdir_filter = instance->instance.subdir_filter;
int ret;
+ /*
+ * This is a remote database. Pointers that we were
+ * given don't make sense locally. Initialize to NULL
+ * in case sys_notify_watch fails.
+ */
+ instances[i].sys_watch = NULL;
+
ret = state->sys_notify_watch(
db, state->sys_notify_ctx, path,
&filter, &subdir_filter,
@@ -1216,8 +1223,6 @@ static int notifyd_add_proxy_syswatches(struct db_record *rec,
return 0;
}
-#ifdef CLUSTER_SUPPORT
-
static int notifyd_db_del_syswatches(struct db_record *rec, void *private_data)
{
TDB_DATA key = dbwrap_record_get_key(rec);
--
Samba Shared Repository
More information about the samba-cvs
mailing list