summaryrefslogtreecommitdiffstats
path: root/source/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-07-08 04:51:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:58:18 -0500
commitc7fe18761e2c753afbffd3a78abff46472a9b8eb (patch)
treef60b3a473919fe3a6294822226bd950b8d832c70 /source/utils
parent053e892e07936f6b71a6bb5e31be09c1d2a2c837 (diff)
downloadsamba-c7fe18761e2c753afbffd3a78abff46472a9b8eb.tar.gz
samba-c7fe18761e2c753afbffd3a78abff46472a9b8eb.tar.xz
samba-c7fe18761e2c753afbffd3a78abff46472a9b8eb.zip
r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture
tests on this as it's very late NY time (just wanted to get this work into the tree). I'll test this over the weekend.... Jerry - in looking at the difference between the two trees there seem to be some printing/ntprinting.c and registry changes we might want to examine to try keep in sync. Jeremy.
Diffstat (limited to 'source/utils')
-rw-r--r--source/utils/status.c72
1 files changed, 41 insertions, 31 deletions
diff --git a/source/utils/status.c b/source/utils/status.c
index 75e7cb3de71..f3c88616662 100644
--- a/source/utils/status.c
+++ b/source/utils/status.c
@@ -111,37 +111,47 @@ static void print_share_mode(share_mode_entry *e, char *fname)
count++;
if (Ucrit_checkPid(e->pid)) {
- d_printf("%-5d ",(int)e->pid);
- switch (GET_DENY_MODE(e->share_mode)) {
- case DENY_NONE: d_printf("DENY_NONE "); break;
- case DENY_ALL: d_printf("DENY_ALL "); break;
- case DENY_DOS: d_printf("DENY_DOS "); break;
- case DENY_READ: d_printf("DENY_READ "); break;
- case DENY_WRITE:printf("DENY_WRITE "); break;
- case DENY_FCB: d_printf("DENY_FCB "); break;
- }
- d_printf("0x%-8x ",(unsigned int)e->desired_access);
- switch (e->share_mode&0xF) {
- case 0: d_printf("RDONLY "); break;
- case 1: d_printf("WRONLY "); break;
- case 2: d_printf("RDWR "); break;
- }
-
- if((e->op_type &
- (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) ==
- (EXCLUSIVE_OPLOCK|BATCH_OPLOCK))
- d_printf("EXCLUSIVE+BATCH ");
- else if (e->op_type & EXCLUSIVE_OPLOCK)
- d_printf("EXCLUSIVE ");
- else if (e->op_type & BATCH_OPLOCK)
- d_printf("BATCH ");
- else if (e->op_type & LEVEL_II_OPLOCK)
- d_printf("LEVEL_II ");
- else
- d_printf("NONE ");
-
- d_printf(" %s %s",fname,
- asctime(LocalTime((time_t *)&e->time.tv_sec)));
+ d_printf("%-5d ",(int)e->pid);
+ switch (map_share_mode_to_deny_mode(e->share_access,
+ e->private_options)) {
+ case DENY_NONE: d_printf("DENY_NONE "); break;
+ case DENY_ALL: d_printf("DENY_ALL "); break;
+ case DENY_DOS: d_printf("DENY_DOS "); break;
+ case DENY_READ: d_printf("DENY_READ "); break;
+ case DENY_WRITE:printf("DENY_WRITE "); break;
+ case DENY_FCB: d_printf("DENY_FCB "); break;
+ default: {
+ d_printf("unknown-please report ! "
+ "e->share_access = 0x%x, "
+ "e->private_options = 0x%x\n",
+ (unsigned int)e->share_access,
+ (unsigned int)e->private_options );
+ break;
+ }
+ }
+ d_printf("0x%-8x ",(unsigned int)e->access_mask);
+ if (e->access_mask & (FILE_READ_DATA|FILE_WRITE_DATA)) {
+ d_printf("RDWR ");
+ } else if (e->access_mask & FILE_WRITE_DATA) {
+ d_printf("WRONLY ");
+ } else {
+ d_printf("RDONLY ");
+ }
+
+ if((e->op_type & (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) ==
+ (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) {
+ d_printf("EXCLUSIVE+BATCH ");
+ } else if (e->op_type & EXCLUSIVE_OPLOCK) {
+ d_printf("EXCLUSIVE ");
+ } else if (e->op_type & BATCH_OPLOCK) {
+ d_printf("BATCH ");
+ } else if (e->op_type & LEVEL_II_OPLOCK) {
+ d_printf("LEVEL_II ");
+ } else {
+ d_printf("NONE ");
+ }
+
+ d_printf(" %s %s",fname, asctime(LocalTime((time_t *)&e->time.tv_sec)));
}
}