diff options
-rw-r--r-- | source3/include/proto.h | 8 | ||||
-rw-r--r-- | source3/lib/sessionid_tdb.c | 15 | ||||
-rw-r--r-- | source3/smbd/session.c | 6 |
3 files changed, 16 insertions, 13 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 7aa1b01baf..0fd2281dbf 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1679,10 +1679,10 @@ NTSTATUS sessionid_traverse(int (*fn)(struct db_record *rec, const char *key, struct sessionid *session, void *private_data), void *private_data); -int sessionid_traverse_read(int (*fn)(const char *key, - struct sessionid *session, - void *private_data), - void *private_data); +NTSTATUS sessionid_traverse_read(int (*fn)(const char *key, + struct sessionid *session, + void *private_data), + void *private_data); /* The following definitions come from utils/passwd_util.c */ diff --git a/source3/lib/sessionid_tdb.c b/source3/lib/sessionid_tdb.c index 231ff55489..3ed6523cb9 100644 --- a/source3/lib/sessionid_tdb.c +++ b/source3/lib/sessionid_tdb.c @@ -127,19 +127,22 @@ static int sessionid_traverse_read_fn(struct db_record *rec, state->private_data); } -int sessionid_traverse_read(int (*fn)(const char *key, - struct sessionid *session, - void *private_data), - void *private_data) +NTSTATUS sessionid_traverse_read(int (*fn)(const char *key, + struct sessionid *session, + void *private_data), + void *private_data) { struct db_context *db; struct sessionid_traverse_read_state state; + NTSTATUS status; db = session_db_ctx(); if (db == NULL) { - return -1; + return NT_STATUS_UNSUCCESSFUL; } state.fn = fn; state.private_data = private_data; - return db->traverse(db, sessionid_traverse_read_fn, &state); + status = dbwrap_traverse_read(db, sessionid_traverse_read_fn, &state, + NULL); + return status; } diff --git a/source3/smbd/session.c b/source3/smbd/session.c index 628e5db3ca..6672b64516 100644 --- a/source3/smbd/session.c +++ b/source3/smbd/session.c @@ -263,14 +263,14 @@ static int gather_sessioninfo(const char *key, struct sessionid *session, int list_sessions(TALLOC_CTX *mem_ctx, struct sessionid **session_list) { struct session_list sesslist; - int ret; + NTSTATUS status; sesslist.mem_ctx = mem_ctx; sesslist.count = 0; sesslist.sessions = NULL; - ret = sessionid_traverse_read(gather_sessioninfo, (void *) &sesslist); - if (ret < 0) { + status = sessionid_traverse_read(gather_sessioninfo, (void *) &sesslist); + if (!NT_STATUS_IS_OK(status)) { DEBUG(3, ("Session traverse failed\n")); SAFE_FREE(sesslist.sessions); *session_list = NULL; |