Changeset 2473
- Timestamp:
- 01/25/07 10:51:43 (2 years ago)
- Files:
-
- trunk/src/chxid.c (modified) (3 diffs)
- trunk/src/fstool.c (modified) (2 diffs)
- trunk/src/fstool.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/chxid.c
r1670 r2473 39 39 }; 40 40 41 char const CMDLINE_OPTIONS_SHORT[] = "Rc:x ";41 char const CMDLINE_OPTIONS_SHORT[] = "Rc:xU"; 42 42 43 43 void … … 47 47 WRITE_STR(fd, cmd); 48 48 WRITE_MSG(fd, 49 " -c <ctx|vserver> [-Rx ] [--] <file>+\n\n"49 " -c <ctx|vserver> [-RxU] [--] <file>+\n\n" 50 50 " Options:\n" 51 51 " -R ... recurse through directories\n" 52 52 " -c ... assign the given context/vserver to the file(s)\n" 53 " -x ... do not cross filesystems\n\n" 53 " -x ... do not cross filesystems\n" 54 " -U ... skip unified files\n\n" 54 55 "Please report bugs to " PACKAGE_BUGREPORT "\n"); 55 56 exit(res); … … 67 68 } 68 69 70 static inline bool 71 isUnified(char const *filename) 72 { 73 uint_least32_t const V = VC_IATTR_IUNLINK|VC_IATTR_IMMUTABLE; 74 75 uint_least32_t flags; 76 uint_least32_t mask = V; 77 78 if (vc_get_iattr(filename, 0, &flags, &mask)==-1 || (mask & V) != V) 79 return false; 80 81 return (flags & V)==V ? true : false; 82 } 83 69 84 bool 70 85 handleFile(char const *name, char const * display_name) 71 86 { 72 int rc = vc_set_iattr(name, global_args->ctx, 0, VC_IATTR_XID); 87 if (!global_args->no_unified || !isUnified(name)) { 88 int rc = vc_set_iattr(name, global_args->ctx, 0, VC_IATTR_XID); 73 89 74 if (rc==-1) { 75 perror(display_name); 76 return false; 90 if (rc==-1) { 91 perror(display_name); 92 return false; 93 } 77 94 } 78 95 trunk/src/fstool.c
r2431 r2473 183 183 .do_unset = false, 184 184 .local_fs = false, 185 .set_mask = 0, 186 .del_mask = 0 185 .set_mask = 0, 186 .del_mask = 0, 187 .no_unified = false, 187 188 }; 188 189 … … 218 219 case 'c' : args.ctx_str = optarg; break; 219 220 case 'x' : args.local_fs = true; break; 221 case 'U' : args.no_unified = true; break; 220 222 default : 221 223 WRITE_MSG(2, "Try '"); trunk/src/fstool.h
r2431 r2473 56 56 bool do_unset; 57 57 bool local_fs; 58 bool no_unified; 58 59 59 60 uint32_t set_mask;
