[SCM] Samba Shared Repository - branch master updated
Michael Adam
obnox at samba.org
Wed Feb 12 15:58:03 MST 2014
The branch, master has been updated
via 9abf162 smbXsrv_open.c: Initialize local variable.
via 69594df auth: Make new_server_id_task() static to auth_samba4
via f0a385f smbd: Slightly simplify vfswrap_fsctl
via e4bad92 smbd: Fix an uninitialized read
from e02c94d cmdline: Remove dynconfig hooks in command line processing
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 9abf1623ed2384d529ef3a2442a55fb293dee8b0
Author: Christopher R. Hertel (crh) <crh at samba.org>
Date: Wed Feb 12 14:08:12 2014 -0600
smbXsrv_open.c: Initialize local variable.
Coverity fix. Initialize status to NT_STATUS_OK. Otherwise, there are
code paths that would cause the smbXsrv_open_cleanup() function to
return an uninitialized value.
Cov: 1168008
Signed-off-by: Christopher R. Hertel (crh) <crh at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
Autobuild-User(master): Michael Adam <obnox at samba.org>
Autobuild-Date(master): Wed Feb 12 23:57:05 CET 2014 on sn-devel-104
commit 69594dfb8cfa35612ff9ce96f9669d7ed94ad578
Author: Volker Lendecke <vl at samba.org>
Date: Wed Feb 12 14:47:26 2014 +0000
auth: Make new_server_id_task() static to auth_samba4
This is not used in other parts of source3, so this patch improves
modularity and isolation of features.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit f0a385f35f9528b8f1f0c829065562b2d90b9850
Author: Volker Lendecke <vl at samba.org>
Date: Wed Feb 12 14:22:26 2014 +0000
smbd: Slightly simplify vfswrap_fsctl
We have the MIN macro, so use it :-)
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
commit e4bad9248098c604272eb3e081829402b4d78697
Author: Volker Lendecke <vl at samba.org>
Date: Thu Feb 6 15:40:46 2014 +0000
smbd: Fix an uninitialized read
We have to ship 64 bytes, and we have to initialize the whole thing.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Michael Adam <obnox at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source3/auth/auth_samba4.c | 42 +++++++++++++++++++++++++++++++++++++++++
source3/include/proto.h | 1 -
source3/lib/util.c | 42 -----------------------------------------
source3/modules/vfs_default.c | 4 ++-
source3/smbd/smbXsrv_open.c | 2 +-
5 files changed, 46 insertions(+), 45 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/auth/auth_samba4.c b/source3/auth/auth_samba4.c
index 0c2beac..901acf9 100644
--- a/source3/auth/auth_samba4.c
+++ b/source3/auth/auth_samba4.c
@@ -31,6 +31,48 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH
+static struct idr_context *task_id_tree;
+
+static int free_task_id(struct server_id *server_id)
+{
+ idr_remove(task_id_tree, server_id->task_id);
+ return 0;
+}
+
+/* Return a server_id with a unique task_id element. Free the
+ * returned pointer to de-allocate the task_id via a talloc destructor
+ * (ie, use talloc_free()) */
+static struct server_id *new_server_id_task(TALLOC_CTX *mem_ctx)
+{
+ struct server_id *server_id;
+ int task_id;
+ if (!task_id_tree) {
+ task_id_tree = idr_init(NULL);
+ if (!task_id_tree) {
+ return NULL;
+ }
+ }
+
+ server_id = talloc(mem_ctx, struct server_id);
+
+ if (!server_id) {
+ return NULL;
+ }
+ *server_id = procid_self();
+
+ /* 0 is the default server_id, so we need to start with 1 */
+ task_id = idr_get_new_above(task_id_tree, server_id, 1, INT32_MAX);
+
+ if (task_id == -1) {
+ talloc_free(server_id);
+ return NULL;
+ }
+
+ talloc_set_destructor(server_id, free_task_id);
+ server_id->task_id = task_id;
+ return server_id;
+}
+
/*
* This module is not an ordinary authentication module. It is really
* a way to redirect the whole authentication and authorization stack
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 315f025..28c26a9 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -447,7 +447,6 @@ uint32 get_my_vnn(void);
void set_my_unique_id(uint64_t unique_id);
struct server_id pid_to_procid(pid_t pid);
struct server_id procid_self(void);
-struct server_id *new_server_id_task(TALLOC_CTX *mem_ctx);
#define serverid_equal(p1, p2) server_id_equal(p1,p2)
bool procid_is_me(const struct server_id *pid);
struct server_id interpret_pid(const char *pid_string);
diff --git a/source3/lib/util.c b/source3/lib/util.c
index cddb53c..374bc5d 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1948,48 +1948,6 @@ struct server_id procid_self(void)
return pid_to_procid(getpid());
}
-static struct idr_context *task_id_tree;
-
-static int free_task_id(struct server_id *server_id)
-{
- idr_remove(task_id_tree, server_id->task_id);
- return 0;
-}
-
-/* Return a server_id with a unique task_id element. Free the
- * returned pointer to de-allocate the task_id via a talloc destructor
- * (ie, use talloc_free()) */
-struct server_id *new_server_id_task(TALLOC_CTX *mem_ctx)
-{
- struct server_id *server_id;
- int task_id;
- if (!task_id_tree) {
- task_id_tree = idr_init(NULL);
- if (!task_id_tree) {
- return NULL;
- }
- }
-
- server_id = talloc(mem_ctx, struct server_id);
-
- if (!server_id) {
- return NULL;
- }
- *server_id = procid_self();
-
- /* 0 is the default server_id, so we need to start with 1 */
- task_id = idr_get_new_above(task_id_tree, server_id, 1, INT32_MAX);
-
- if (task_id == -1) {
- talloc_free(server_id);
- return NULL;
- }
-
- talloc_set_destructor(server_id, free_task_id);
- server_id->task_id = task_id;
- return server_id;
-}
-
bool procid_is_me(const struct server_id *pid)
{
if (pid->pid != getpid())
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 815dc43..81a0b1b 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -1054,7 +1054,8 @@ static NTSTATUS vfswrap_fsctl(struct vfs_handle_struct *handle,
DEBUG(10,("FSCTL_CREATE_OR_GET_OBJECT_ID: called on %s\n",
fsp_fnum_dbg(fsp)));
- *out_len = (max_out_len >= 64) ? 64 : max_out_len;
+ *out_len = MIN(max_out_len, 64);
+
/* Hmmm, will this cause problems if less data asked for? */
return_data = talloc_array(ctx, char, 64);
if (return_data == NULL) {
@@ -1065,6 +1066,7 @@ static NTSTATUS vfswrap_fsctl(struct vfs_handle_struct *handle,
push_file_id_16(return_data, &fsp->file_id);
memcpy(return_data+16,create_volume_objectid(fsp->conn,objid),16);
push_file_id_16(return_data+32, &fsp->file_id);
+ memset(return_data+48, 0, 16);
*out_data = return_data;
return NT_STATUS_OK;
}
diff --git a/source3/smbd/smbXsrv_open.c b/source3/smbd/smbXsrv_open.c
index 7e6b54f..b15be28 100644
--- a/source3/smbd/smbXsrv_open.c
+++ b/source3/smbd/smbXsrv_open.c
@@ -1384,7 +1384,7 @@ NTSTATUS smbXsrv_open_global_traverse(
NTSTATUS smbXsrv_open_cleanup(uint64_t persistent_id)
{
- NTSTATUS status;
+ NTSTATUS status = NT_STATUS_OK;
TALLOC_CTX *frame = talloc_stackframe();
struct smbXsrv_open_global0 *op = NULL;
uint8_t key_buf[SMBXSRV_OPEN_GLOBAL_TDB_KEY_SIZE];
--
Samba Shared Repository
More information about the samba-cvs
mailing list