[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Thu Apr 19 11:14:04 MDT 2012
The branch, master has been updated
via e58f03c s3: Fix the build on FreeBSD
via 0b1f3ae s3: Fix Coverity ID 2682: NULL_RETURNS
via 15c6045 librpc: Make finding newest pidl file more portable
via 7011d7e s3: Fix Coverity ID 2743: CHECKED_RETURN
via f1c90e1 s3: Fix Coverity ID 2744: CHECKED_RETURN
via 85c1e89 s3: Fix Coverity ID 2745 and 2746: FORWARD_NULL
via 8173331 s3: Fix Coverity ID 2747: FORWARD_NULL
via dc3b796 s3: Attempt to fix Coverity ID 2748: INTEGER_OVERFLOW
via ee8d556 s3: Fix Coverity ID 2749: REVERSE_INULL
from e21029a waf: Fix mispelling
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit e58f03c91a6a01a690e4bb0909f6467036add2eb
Author: Volker Lendecke <vl at samba.org>
Date: Thu Apr 19 13:32:14 2012 +0200
s3: Fix the build on FreeBSD
Autobuild-User: Volker Lendecke <vl at samba.org>
Autobuild-Date: Thu Apr 19 19:13:45 CEST 2012 on sn-devel-104
commit 0b1f3aea27280de0436f465346264c2623ba2d3e
Author: Volker Lendecke <vl at samba.org>
Date: Thu Apr 19 11:36:11 2012 +0200
s3: Fix Coverity ID 2682: NULL_RETURNS
commit 15c60456994b57b94da21c5be57d9b798242b42c
Author: Volker Lendecke <vl at samba.org>
Date: Thu Apr 19 09:03:18 2012 +0200
librpc: Make finding newest pidl file more portable
FreeBSD find does not support the -printf argument.
David, please check if this still work for you!
commit 7011d7ef188de916b8428acc40efd5264b268d8d
Author: Volker Lendecke <vl at samba.org>
Date: Thu Apr 19 11:15:46 2012 +0200
s3: Fix Coverity ID 2743: CHECKED_RETURN
commit f1c90e12f500201975ca63f175a48575bc9a7505
Author: Volker Lendecke <vl at samba.org>
Date: Thu Apr 19 10:47:07 2012 +0200
s3: Fix Coverity ID 2744: CHECKED_RETURN
commit 85c1e895a5b4d520481de419aff04c2519198894
Author: Volker Lendecke <vl at samba.org>
Date: Thu Apr 19 10:27:07 2012 +0200
s3: Fix Coverity ID 2745 and 2746: FORWARD_NULL
We can assume that the rbt dbs are around
commit 8173331150482b78e85c005fcea2c7d80f430f65
Author: Volker Lendecke <vl at samba.org>
Date: Thu Apr 19 10:20:27 2012 +0200
s3: Fix Coverity ID 2747: FORWARD_NULL
For the notify cleanup process we have a notify context without a
messaging entry. We will never call notify_add/remove for this, but
the code should protect against this.
commit dc3b79626022e07980be40627b9f2255d58b6e70
Author: Volker Lendecke <vl at samba.org>
Date: Thu Apr 19 10:04:04 2012 +0200
s3: Attempt to fix Coverity ID 2748: INTEGER_OVERFLOW
Not sure this will actually please Coverity, but it fixes a severe bug
commit ee8d55622fa6435ac17befc269daa28f5cfa21dc
Author: Volker Lendecke <vl at samba.org>
Date: Thu Apr 19 09:51:11 2012 +0200
s3: Fix Coverity ID 2749: REVERSE_INULL
-----------------------------------------------------------------------
Summary of changes:
librpc/build_idl.sh | 10 +---------
source3/lib/background.c | 9 ++++++---
source3/lib/dbwrap/dbwrap_cache.c | 26 +++++++++++++++-----------
source3/lib/dbwrap/dbwrap_tdb.c | 7 ++++++-
source3/lib/msg_channel.c | 2 +-
source3/lib/xattr_tdb.c | 2 +-
source3/modules/vfs_scannedonly.c | 4 ++++
source3/smbd/notify_internal.c | 6 ++++--
8 files changed, 38 insertions(+), 28 deletions(-)
Changeset truncated at 500 lines:
diff --git a/librpc/build_idl.sh b/librpc/build_idl.sh
index e028bc6..35acd1f 100755
--- a/librpc/build_idl.sh
+++ b/librpc/build_idl.sh
@@ -28,15 +28,7 @@ fi
## Find newer files rather than rebuild all of them. Also handle the case
## where the pidl compiler itself is newer.
##
-PIDL_NEWEST=`find $PIDL_DIR -type f -printf "%p\0%T@\n" \
- | perl -e '$ts_newest = 0;
- while (<STDIN>) {
- ($f, $ts) = split(/\0/);
- next if ($ts <= $ts_newest);
- $ts_newest = $ts;
- $f_newest = $f;
- }
- print $f_newest'` || exit 1
+PIDL_NEWEST=$(ls -rt $(find $PIDL_DIR -type f) | tail -n -1)
list=""
for f in ${IDL_FILES}; do
diff --git a/source3/lib/background.c b/source3/lib/background.c
index aa2a77d..6a91783 100644
--- a/source3/lib/background.c
+++ b/source3/lib/background.c
@@ -121,9 +121,12 @@ static void background_job_trigger(
struct background_job_state *state = talloc_get_type_abort(
private_data, struct background_job_state);
- if (state->wakeup_req != NULL) {
- tevent_req_set_endtime(state->wakeup_req, state->ev,
- timeval_zero());
+ if (state->wakeup_req == NULL) {
+ return;
+ }
+ if (!tevent_req_set_endtime(state->wakeup_req, state->ev,
+ timeval_zero())) {
+ DEBUG(10, ("tevent_req_set_endtime failed\n"));
}
}
diff --git a/source3/lib/dbwrap/dbwrap_cache.c b/source3/lib/dbwrap/dbwrap_cache.c
index ded8525..e0fced5 100644
--- a/source3/lib/dbwrap/dbwrap_cache.c
+++ b/source3/lib/dbwrap/dbwrap_cache.c
@@ -30,15 +30,17 @@ struct db_cache_ctx {
struct db_context *negative;
};
-static void dbwrap_cache_validate(struct db_cache_ctx *ctx)
+static bool dbwrap_cache_validate(struct db_cache_ctx *ctx)
{
if (ctx->seqnum == dbwrap_get_seqnum(ctx->backing)) {
- return;
+ return true;
}
TALLOC_FREE(ctx->positive);
ctx->positive = db_open_rbt(ctx);
TALLOC_FREE(ctx->negative);
ctx->negative = db_open_rbt(ctx);
+
+ return ((ctx->positive != NULL) && (ctx->negative != NULL));
}
static NTSTATUS dbwrap_cache_parse_record(
@@ -51,16 +53,15 @@ static NTSTATUS dbwrap_cache_parse_record(
TDB_DATA value;
NTSTATUS status;
- dbwrap_cache_validate(ctx);
+ if (!dbwrap_cache_validate(ctx)) {
+ return NT_STATUS_NO_MEMORY;
+ }
- if (ctx->positive != NULL) {
- status = dbwrap_parse_record(
- ctx->positive, key, parser, private_data);
- if (NT_STATUS_IS_OK(status)) {
- return status;
- }
+ status = dbwrap_parse_record(ctx->positive, key, parser, private_data);
+ if (NT_STATUS_IS_OK(status)) {
+ return status;
}
- if ((ctx->negative != NULL) && dbwrap_exists(ctx->negative, key)) {
+ if (dbwrap_exists(ctx->negative, key)) {
return NT_STATUS_NOT_FOUND;
}
@@ -191,7 +192,10 @@ struct db_context *db_open_cache(TALLOC_CTX *mem_ctx,
ctx->seqnum = -1;
ctx->backing = talloc_move(ctx, &backing);
db->private_data = ctx;
- dbwrap_cache_validate(ctx);
+ if (!dbwrap_cache_validate(ctx)) {
+ TALLOC_FREE(db);
+ return NULL;
+ }
db->fetch_locked = dbwrap_cache_fetch_locked;
db->try_fetch_locked = NULL;
diff --git a/source3/lib/dbwrap/dbwrap_tdb.c b/source3/lib/dbwrap/dbwrap_tdb.c
index 2041613..59ed791 100644
--- a/source3/lib/dbwrap/dbwrap_tdb.c
+++ b/source3/lib/dbwrap/dbwrap_tdb.c
@@ -110,7 +110,12 @@ static struct db_record *db_tdb_fetch_locked_internal(
state.mem_ctx = mem_ctx;
state.result = NULL;
- tdb_parse_record(ctx->wtdb->tdb, key, db_tdb_fetchlock_parse, &state);
+ if ((tdb_parse_record(ctx->wtdb->tdb, key, db_tdb_fetchlock_parse,
+ &state) < 0) &&
+ (tdb_error(ctx->wtdb->tdb) != TDB_ERR_NOEXIST)) {
+ tdb_chainunlock(ctx->wtdb->tdb, key);
+ return NULL;
+ }
if (state.result == NULL) {
db_tdb_fetchlock_parse(key, tdb_null, &state);
diff --git a/source3/lib/msg_channel.c b/source3/lib/msg_channel.c
index 9a174c0..65976d1 100644
--- a/source3/lib/msg_channel.c
+++ b/source3/lib/msg_channel.c
@@ -300,7 +300,7 @@ static void msg_channel_trigger(struct tevent_context *ev,
state->rec = talloc_move(state, &channel->msgs[0]);
memmove(channel->msgs, channel->msgs+1,
- sizeof(struct messaging_rec) * (num_msgs-1));
+ sizeof(struct messaging_rec *) * (num_msgs-1));
channel->msgs = talloc_realloc(
channel, channel->msgs, struct messaging_rec *, num_msgs - 1);
diff --git a/source3/lib/xattr_tdb.c b/source3/lib/xattr_tdb.c
index be4f3b2..34afbe2 100644
--- a/source3/lib/xattr_tdb.c
+++ b/source3/lib/xattr_tdb.c
@@ -21,7 +21,7 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "includes.h"
+#include "source3/include/includes.h"
#include "system/filesys.h"
#include "librpc/gen_ndr/xattr.h"
#include "librpc/gen_ndr/ndr_xattr.h"
diff --git a/source3/modules/vfs_scannedonly.c b/source3/modules/vfs_scannedonly.c
index baf7fbe..b43c6df 100644
--- a/source3/modules/vfs_scannedonly.c
+++ b/source3/modules/vfs_scannedonly.c
@@ -945,6 +945,10 @@ static int scannedonly_connect(struct vfs_handle_struct *handle,
struct Tscannedonly *so;
so = SMB_MALLOC_P(struct Tscannedonly);
+ if (so == NULL) {
+ errno = ENOMEM;
+ return -1;
+ }
handle->data = (void *)so;
handle->free_data = free_scannedonly_data;
so->gsendbuffer[0]='\0';
diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c
index 4d78743..aa02e32 100644
--- a/source3/smbd/notify_internal.c
+++ b/source3/smbd/notify_internal.c
@@ -388,17 +388,19 @@ static NTSTATUS notify_add_idx(struct db_record *rec, uint32_t vnn)
NTSTATUS notify_remove(struct notify_context *notify, void *private_data)
{
- struct server_id pid = messaging_server_id(notify->msg);
+ struct server_id pid;
struct notify_list *listel;
struct db_record *notify_rec;
NTSTATUS status;
- if (notify == NULL) {
+ if ((notify == NULL) || (notify->msg == NULL)) {
return NT_STATUS_NOT_IMPLEMENTED;
}
DEBUG(10, ("notify_remove: private_data=%p\n", private_data));
+ pid = messaging_server_id(notify->msg);
+
for (listel=notify->list;listel;listel=listel->next) {
if (listel->private_data == private_data) {
DLIST_REMOVE(notify->list, listel);
--
Samba Shared Repository
More information about the samba-cvs
mailing list