From de1c833b3a06ce2f7599ef58b26b473ed00ae55f Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Thu, 18 Apr 2013 17:09:32 +0200 Subject: [PATCH] s3:smbstatus do not print orphaned share entries Pair-Programmed-With: Volker Lendecke Signed-off-by: Christian Ambach Reviewed-by: Volker Lendecke --- source3/utils/status.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source3/utils/status.c b/source3/utils/status.c index 28a79d601853..f4b5f4e2c3d8 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -43,6 +43,7 @@ #include "smbd/smbd.h" #include "librpc/gen_ndr/notify.h" #include "lib/conn_tdb.h" +#include "serverid.h" #define SMB_MAXPIDS 2048 static uid_t Ucrit_uid = 0; /* added by OH */ @@ -132,6 +133,11 @@ static void print_share_mode(const struct share_mode_entry *e, } count++; + if (do_checks && !serverid_exists(&e->pid)) { + /* the process for this entry does not exist any more */ + return; + } + if (Ucrit_checkPid(e->pid)) { d_printf("%-11s ",procid_str_static(&e->pid)); d_printf("%-9u ", (unsigned int)e->uid); -- 2.34.1