summaryrefslogtreecommitdiffstats
path: root/source3/utils/status.c
diff options
context:
space:
mode:
authorChristian Ambach <ambi@samba.org>2013-04-18 17:09:32 +0200
committerVolker Lendecke <vl@samba.org>2013-04-19 13:16:38 +0200
commitde1c833b3a06ce2f7599ef58b26b473ed00ae55f (patch)
treecde5c7fdb54bb00080c926621516b5a463fa94b2 /source3/utils/status.c
parent5aa9e552ec70ffbd48495e0d7c28517e726487bf (diff)
downloadsamba-de1c833b3a06ce2f7599ef58b26b473ed00ae55f.tar.gz
samba-de1c833b3a06ce2f7599ef58b26b473ed00ae55f.tar.xz
samba-de1c833b3a06ce2f7599ef58b26b473ed00ae55f.zip
s3:smbstatus do not print orphaned share entries
Pair-Programmed-With: Volker Lendecke <vl@samba.org> Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/utils/status.c')
-rw-r--r--source3/utils/status.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/utils/status.c b/source3/utils/status.c
index 28a79d60185..f4b5f4e2c3d 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);