summaryrefslogtreecommitdiff
path: root/source3/utils/status.c
diff options
context:
space:
mode:
authorPaul Blackman <ictinus@samba.org>1998-05-30 02:25:11 +0000
committerPaul Blackman <ictinus@samba.org>1998-05-30 02:25:11 +0000
commitc069bd8eea3b41b338a9add7271ab9440d5f1e3c (patch)
treec31790070914069672bb76430c4289421c4e5bb6 /source3/utils/status.c
parent3c77f88d455ca10ec406d3afdb68dcdf458c8760 (diff)
downloadsamba-c069bd8eea3b41b338a9add7271ab9440d5f1e3c.tar.gz
samba-c069bd8eea3b41b338a9add7271ab9440d5f1e3c.tar.bz2
samba-c069bd8eea3b41b338a9add7271ab9440d5f1e3c.zip
This change ensures that only the processes/locked files that
belong to -uUsername are printed when running 'smbstatus -uUsername' PaulB (This used to be commit da08e486871992043c2650e6aac304cd29ba693c)
Diffstat (limited to 'source3/utils/status.c')
-rw-r--r--source3/utils/status.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/source3/utils/status.c b/source3/utils/status.c
index d4753d589d..0a53dee62a 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -71,32 +71,34 @@ static void print_share_mode(share_mode_entry *e, char *fname)
}
count++;
- printf("%-5d ",e->pid);
- switch ((e->share_mode>>4)&0xF) {
- case DENY_NONE: printf("DENY_NONE "); break;
- case DENY_ALL: printf("DENY_ALL "); break;
- case DENY_DOS: printf("DENY_DOS "); break;
- case DENY_READ: printf("DENY_READ "); break;
- case DENY_WRITE:printf("DENY_WRITE "); break;
- }
- switch (e->share_mode&0xF) {
- case 0: printf("RDONLY "); break;
- case 1: printf("WRONLY "); break;
- case 2: printf("RDWR "); break;
- }
+ if (Ucrit_checkPid(e->pid)) {
+ printf("%-5d ",e->pid);
+ switch ((e->share_mode>>4)&0xF) {
+ case DENY_NONE: printf("DENY_NONE "); break;
+ case DENY_ALL: printf("DENY_ALL "); break;
+ case DENY_DOS: printf("DENY_DOS "); break;
+ case DENY_READ: printf("DENY_READ "); break;
+ case DENY_WRITE:printf("DENY_WRITE "); break;
+ }
+ switch (e->share_mode&0xF) {
+ case 0: printf("RDONLY "); break;
+ case 1: printf("WRONLY "); break;
+ case 2: printf("RDWR "); break;
+ }
- if((e->op_type &
- (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) ==
- (EXCLUSIVE_OPLOCK|BATCH_OPLOCK))
+ if((e->op_type &
+ (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) ==
+ (EXCLUSIVE_OPLOCK|BATCH_OPLOCK))
printf("EXCLUSIVE+BATCH ");
- else if (e->op_type & EXCLUSIVE_OPLOCK)
+ else if (e->op_type & EXCLUSIVE_OPLOCK)
printf("EXCLUSIVE ");
- else if (e->op_type & BATCH_OPLOCK)
+ else if (e->op_type & BATCH_OPLOCK)
printf("BATCH ");
- else
+ else
printf("NONE ");
- printf(" %s %s",fname,asctime(LocalTime((time_t *)&e->time.tv_sec)));
+ printf(" %s %s",fname,asctime(LocalTime((time_t *)&e->time.tv_sec)));
+ }
}