s3:smbstatus do not print orphaned share entries
authorChristian Ambach <ambi@samba.org>
Thu, 18 Apr 2013 15:09:32 +0000 (17:09 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 19 Apr 2013 11:16:38 +0000 (13:16 +0200)
Pair-Programmed-With: Volker Lendecke <vl@samba.org>
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/utils/status.c

index 28a79d6018536388784da6eddb8102795769b270..f4b5f4e2c3d8c4bee782e7c66eb1f319924ba494 100644 (file)
@@ -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);