diff --git a/include/ntfs-3g/volume.h b/include/ntfs-3g/volume.h index 67f738b1..a181ccc6 100644 --- a/include/ntfs-3g/volume.h +++ b/include/ntfs-3g/volume.h @@ -43,23 +43,6 @@ #include #endif -/* - * Under Cygwin, DJGPP and FreeBSD we do not have MS_RDONLY, - * so we define them ourselves. - */ -#ifndef MS_RDONLY -#define MS_RDONLY 1 -#endif - -#define MS_EXCLUSIVE 0x08000000 - -#ifndef MS_RECOVER -#define MS_RECOVER 0x10000000 -#endif - -#define MS_IGNORE_HIBERFILE 0x20000000 -#define MS_FORENSIC 0x04000000 /* No modification during mount */ - /* Forward declaration */ typedef struct _ntfs_volume ntfs_volume; @@ -74,13 +57,29 @@ typedef struct _ntfs_volume ntfs_volume; /** * enum ntfs_mount_flags - * + * Flags for the ntfs_mount() function. + */ +enum { + NTFS_MNT_NONE = 0x00000000, + NTFS_MNT_RDONLY = 0x00000001, + NTFS_MNT_FORENSIC = 0x04000000, /* No modification during + * mount. */ + NTFS_MNT_EXCLUSIVE = 0x08000000, + NTFS_MNT_RECOVER = 0x10000000, + NTFS_MNT_IGNORE_HIBERFILE = 0x20000000, +}; +typedef unsigned long ntfs_mount_flags; + +/** + * enum ntfs_mounted_flags - + * * Flags returned by the ntfs_check_if_mounted() function. */ typedef enum { NTFS_MF_MOUNTED = 1, /* Device is mounted. */ NTFS_MF_ISROOT = 2, /* Device is mounted as system root. */ NTFS_MF_READONLY = 4, /* Device is mounted read-only. */ -} ntfs_mount_flags; +} ntfs_mounted_flags; extern int ntfs_check_if_mounted(const char *file, unsigned long *mnt_flags); @@ -284,12 +283,12 @@ extern const char *ntfs_home; extern ntfs_volume *ntfs_volume_alloc(void); extern ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, - unsigned long flags); + ntfs_mount_flags flags); extern ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, - unsigned long flags); + ntfs_mount_flags flags); -extern ntfs_volume *ntfs_mount(const char *name, unsigned long flags); +extern ntfs_volume *ntfs_mount(const char *name, ntfs_mount_flags flags); extern int ntfs_umount(ntfs_volume *vol, const BOOL force); extern int ntfs_version_is_supported(ntfs_volume *vol); diff --git a/libntfs-3g/volume.c b/libntfs-3g/volume.c index cc3d4a05..5bb266ff 100644 --- a/libntfs-3g/volume.c +++ b/libntfs-3g/volume.c @@ -466,7 +466,8 @@ error_exit: * Return the allocated volume structure on success and NULL on error with * errno set to the error code. */ -ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, unsigned long flags) +ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, + ntfs_mount_flags flags) { LCN mft_zone_size, mft_lcn; s64 br; @@ -508,7 +509,7 @@ ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, unsigned long flags) #else NVolClearCompression(vol); #endif - if (flags & MS_RDONLY) + if (flags & NTFS_MNT_RDONLY) NVolSetReadOnly(vol); /* ...->open needs bracketing to compile with glibc 2.7 */ @@ -887,7 +888,7 @@ static int fix_txf_data(ntfs_volume *vol) * @flags is an optional second parameter. The same flags are used as for * the mount system call (man 2 mount). Currently only the following flag * is implemented: - * MS_RDONLY - mount volume read-only + * NTFS_MNT_RDONLY - mount volume read-only * * The function opens the device @dev and verifies that it contains a valid * bootsector. Then, it allocates an ntfs_volume structure and initializes @@ -898,7 +899,7 @@ static int fix_txf_data(ntfs_volume *vol) * Return the allocated volume structure on success and NULL on error with * errno set to the error code. */ -ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags) +ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, ntfs_mount_flags flags) { s64 l; ntfs_volume *vol; @@ -1226,13 +1227,13 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags) * Check for dirty logfile and hibernated Windows. * We care only about read-write mounts. */ - if (!(flags & (MS_RDONLY | MS_FORENSIC))) { - if (!(flags & MS_IGNORE_HIBERFILE) && + if (!(flags & (NTFS_MNT_RDONLY | NTFS_MNT_FORENSIC))) { + if (!(flags & NTFS_MNT_IGNORE_HIBERFILE) && ntfs_volume_check_hiberfile(vol, 1) < 0) goto error_exit; if (ntfs_volume_check_logfile(vol) < 0) { /* Always reject cached metadata for now */ - if (!(flags & MS_RECOVER) || (errno == EPERM)) + if (!(flags & NTFS_MNT_RECOVER) || (errno == EPERM)) goto error_exit; ntfs_log_info("The file system wasn't safely " "closed on Windows. Fixing.\n"); @@ -1321,7 +1322,7 @@ int ntfs_set_ignore_case(ntfs_volume *vol) * @flags is an optional second parameter. The same flags are used as for * the mount system call (man 2 mount). Currently only the following flags * is implemented: - * MS_RDONLY - mount volume read-only + * NTFS_MNT_RDONLY - mount volume read-only * * The function opens the device or file @name and verifies that it contains a * valid bootsector. Then, it allocates an ntfs_volume structure and initializes @@ -1336,7 +1337,7 @@ int ntfs_set_ignore_case(ntfs_volume *vol) * soon as the function returns. */ ntfs_volume *ntfs_mount(const char *name __attribute__((unused)), - unsigned long flags __attribute__((unused))) + ntfs_mount_flags flags __attribute__((unused))) { #ifndef NO_NTFS_DEVICE_DEFAULT_IO_OPS struct ntfs_device *dev; diff --git a/ntfsprogs/ntfscat.c b/ntfsprogs/ntfscat.c index dad83dd2..823250b9 100644 --- a/ntfsprogs/ntfscat.c +++ b/ntfsprogs/ntfscat.c @@ -410,8 +410,8 @@ int main(int argc, char *argv[]) utils_set_locale(); - vol = utils_mount_volume(opts.device, MS_RDONLY | - (opts.force ? MS_RECOVER : 0)); + vol = utils_mount_volume(opts.device, NTFS_MNT_RDONLY | + (opts.force ? NTFS_MNT_RECOVER : 0)); if (!vol) { ntfs_log_perror("ERROR: couldn't mount volume"); return 1; diff --git a/ntfsprogs/ntfsck.c b/ntfsprogs/ntfsck.c index 0964a4de..277beee6 100644 --- a/ntfsprogs/ntfsck.c +++ b/ntfsprogs/ntfsck.c @@ -850,7 +850,7 @@ int main(int argc, char **argv) // at this point we know that the volume is valid enough for mounting. /* Call ntfs_device_mount() to do the actual mount. */ - vol = ntfs_device_mount(dev, MS_RDONLY); + vol = ntfs_device_mount(dev, NTFS_MNT_RDONLY); if (!vol) { ntfs_device_free(dev); return 2; diff --git a/ntfsprogs/ntfsclone.c b/ntfsprogs/ntfsclone.c index 48087601..33312818 100644 --- a/ntfsprogs/ntfsclone.c +++ b/ntfsprogs/ntfsclone.c @@ -2178,7 +2178,7 @@ static s64 open_volume(void) { s64 device_size; - mount_volume(MS_RDONLY); + mount_volume(NTFS_MNT_RDONLY); device_size = ntfs_device_size_get(vol->dev, 1); if (device_size <= 0) @@ -2448,7 +2448,7 @@ int main(int argc, char **argv) FIXME: use mount flags to avoid potential side-effects in future */ opt.force++; ntfs_umount(vol,FALSE); - mount_volume(0 /*MS_NOATIME*/); + mount_volume(0 /*NTFS_MNT_NOATIME*/); } free(lcn_bitmap.bm); diff --git a/ntfsprogs/ntfscluster.c b/ntfsprogs/ntfscluster.c index 9cc3f699..ff16a0f2 100644 --- a/ntfsprogs/ntfscluster.c +++ b/ntfsprogs/ntfscluster.c @@ -491,8 +491,8 @@ int main(int argc, char *argv[]) utils_set_locale(); - vol = utils_mount_volume(opts.device, MS_RDONLY | - (opts.force ? MS_RECOVER : 0)); + vol = utils_mount_volume(opts.device, NTFS_MNT_RDONLY | + (opts.force ? NTFS_MNT_RECOVER : 0)); if (!vol) return 1; diff --git a/ntfsprogs/ntfscmp.c b/ntfsprogs/ntfscmp.c index 08bf8bcd..6cbf77eb 100644 --- a/ntfsprogs/ntfscmp.c +++ b/ntfsprogs/ntfscmp.c @@ -969,7 +969,7 @@ static ntfs_volume *mount_volume(const char *volume) "You must 'umount' it first.\n", volume); } - vol = ntfs_mount(volume, MS_RDONLY); + vol = ntfs_mount(volume, NTFS_MNT_RDONLY); if (vol == NULL) { int err = errno; diff --git a/ntfsprogs/ntfscp.c b/ntfsprogs/ntfscp.c index 77aab8ea..76f2eb42 100644 --- a/ntfsprogs/ntfscp.c +++ b/ntfsprogs/ntfscp.c @@ -346,9 +346,9 @@ int main(int argc, char *argv[]) } if (opts.noaction) - flags = MS_RDONLY; + flags = NTFS_MNT_RDONLY; if (opts.force) - flags |= MS_RECOVER; + flags |= NTFS_MNT_RECOVER; vol = utils_mount_volume(opts.device, flags); if (!vol) { diff --git a/ntfsprogs/ntfsdecrypt.c b/ntfsprogs/ntfsdecrypt.c index d1b80466..6be2b030 100644 --- a/ntfsprogs/ntfsdecrypt.c +++ b/ntfsprogs/ntfsdecrypt.c @@ -1451,8 +1451,8 @@ int main(int argc, char *argv[]) return 1; } /* Mount the ntfs volume. */ - vol = utils_mount_volume(opts.device, MS_RDONLY | - (opts.force ? MS_RECOVER : 0)); + vol = utils_mount_volume(opts.device, NTFS_MNT_RDONLY | + (opts.force ? NTFS_MNT_RECOVER : 0)); if (!vol) { ntfs_log_error("Failed to mount ntfs volume. Aborting.\n"); ntfs_rsa_private_key_release(rsa_key); diff --git a/ntfsprogs/ntfsdump_logfile.c b/ntfsprogs/ntfsdump_logfile.c index f5e1fd02..279ebac2 100644 --- a/ntfsprogs/ntfsdump_logfile.c +++ b/ntfsprogs/ntfsdump_logfile.c @@ -200,7 +200,7 @@ static int logfile_open(BOOL is_volume, const char *filename, /* Porting note: NTFS_MNT_FORENSIC is not needed when we mount * the volume in read-only mode. No changes will be made to the * logfile or anything else when we are in read only-mode. */ - vol = ntfs_mount(filename, MS_RDONLY); + vol = ntfs_mount(filename, NTFS_MNT_RDONLY); if (!vol) log_err_exit(NULL, "Failed to mount %s: %s\n", filename, strerror(errno)); diff --git a/ntfsprogs/ntfsfix.c b/ntfsprogs/ntfsfix.c index 4a2fcac6..375e1527 100644 --- a/ntfsprogs/ntfsfix.c +++ b/ntfsprogs/ntfsfix.c @@ -1419,7 +1419,7 @@ static int fix_startup(struct ntfs_device *dev, unsigned long flags) NVolSetShowSysFiles(vol); NVolSetShowHidFiles(vol); NVolClearHideDotFiles(vol); - if (flags & MS_RDONLY) + if (flags & NTFS_MNT_RDONLY) NVolSetReadOnly(vol); /* ...->open needs bracketing to compile with glibc 2.7 */ @@ -1508,7 +1508,7 @@ static int fix_mount(void) ntfs_log_perror("Failed to allocate device"); return -1; } - flags = (opt.no_action ? MS_RDONLY : 0); + flags = (opt.no_action ? NTFS_MNT_RDONLY : 0); vol = ntfs_volume_startup(dev, flags); if (!vol) { ntfs_log_info(FAILED); @@ -1573,7 +1573,7 @@ int main(int argc, char **argv) ntfs_log_perror("Failed to determine whether %s is mounted", opt.volume); /* Attempt a full mount first. */ - flags = (opt.no_action ? MS_RDONLY : 0); + flags = (opt.no_action ? NTFS_MNT_RDONLY : 0); ntfs_log_info("Mounting volume... "); vol = ntfs_mount(opt.volume, flags); if (vol) { diff --git a/ntfsprogs/ntfsinfo.c b/ntfsprogs/ntfsinfo.c index 6a924955..bbc6b414 100644 --- a/ntfsprogs/ntfsinfo.c +++ b/ntfsprogs/ntfsinfo.c @@ -2334,8 +2334,8 @@ int main(int argc, char **argv) utils_set_locale(); - vol = utils_mount_volume(opts.device, MS_RDONLY | - (opts.force ? MS_RECOVER : 0)); + vol = utils_mount_volume(opts.device, NTFS_MNT_RDONLY | + (opts.force ? NTFS_MNT_RECOVER : 0)); if (!vol) { printf("Failed to open '%s'.\n", opts.device); exit(1); diff --git a/ntfsprogs/ntfslabel.c b/ntfsprogs/ntfslabel.c index 18ea6067..cde594da 100644 --- a/ntfsprogs/ntfslabel.c +++ b/ntfsprogs/ntfslabel.c @@ -432,8 +432,8 @@ int main(int argc, char **argv) opts.noaction++; vol = utils_mount_volume(opts.device, - (opts.noaction ? MS_RDONLY : 0) | - (opts.force ? MS_RECOVER : 0)); + (opts.noaction ? NTFS_MNT_RDONLY : 0) | + (opts.force ? NTFS_MNT_RECOVER : 0)); if (!vol) return 1; diff --git a/ntfsprogs/ntfsls.c b/ntfsprogs/ntfsls.c index fde3e5b5..909e7bb9 100644 --- a/ntfsprogs/ntfsls.c +++ b/ntfsprogs/ntfsls.c @@ -650,8 +650,8 @@ int main(int argc, char **argv) utils_set_locale(); - vol = utils_mount_volume(opts.device, MS_RDONLY | - (opts.force ? MS_RECOVER : 0)); + vol = utils_mount_volume(opts.device, NTFS_MNT_RDONLY | + (opts.force ? NTFS_MNT_RECOVER : 0)); if (!vol) { // FIXME: Print error... (AIA) return 2; diff --git a/ntfsprogs/ntfsmftalloc.c b/ntfsprogs/ntfsmftalloc.c index c665945d..246ab54a 100644 --- a/ntfsprogs/ntfsmftalloc.c +++ b/ntfsprogs/ntfsmftalloc.c @@ -312,7 +312,7 @@ int main(int argc, char **argv) /* Mount the device. */ if (opts.no_action) { ntfs_log_quiet("Running in READ-ONLY mode!\n"); - ul = MS_RDONLY; + ul = NTFS_MNT_RDONLY; } else ul = 0; vol = ntfs_mount(dev_name, ul); diff --git a/ntfsprogs/ntfsmove.c b/ntfsprogs/ntfsmove.c index 8a09dfa9..571808fd 100644 --- a/ntfsprogs/ntfsmove.c +++ b/ntfsprogs/ntfsmove.c @@ -876,9 +876,9 @@ int main(int argc, char *argv[]) utils_set_locale(); if (opts.noaction) - flags |= MS_RDONLY; + flags |= NTFS_MNT_RDONLY; if (opts.force) - flags |= MS_RECOVER; + flags |= NTFS_MNT_RECOVER; vol = utils_mount_volume(opts.device, flags); if (!vol) { diff --git a/ntfsprogs/ntfsresize.c b/ntfsprogs/ntfsresize.c index 441de039..036126b1 100644 --- a/ntfsprogs/ntfsresize.c +++ b/ntfsprogs/ntfsresize.c @@ -529,7 +529,7 @@ static int parse_options(int argc, char **argv) opt.infombonly++; break; case 'n': - opt.ro_flag = MS_RDONLY; + opt.ro_flag = NTFS_MNT_RDONLY; break; case 'P': opt.show_progress = 0; @@ -568,7 +568,7 @@ static int parse_options(int argc, char **argv) err++; } if (opt.info || opt.infombonly) { - opt.ro_flag = MS_RDONLY; + opt.ro_flag = NTFS_MNT_RDONLY; } if (opt.bytes && (opt.expand || opt.info || opt.infombonly)) { @@ -2562,11 +2562,12 @@ static ntfs_volume *check_volume(void) ntfs_volume *myvol = NULL; /* - * Pass MS_FORENSIC so that the mount process does not modify the + * Pass NTFS_MNT_FORENSIC so that the mount process does not modify the * volume at all. We will do the logfile emptying and dirty setting * later if needed. */ - if (!(myvol = ntfs_mount(opt.volume, opt.ro_flag | MS_FORENSIC))) { + if (!(myvol = ntfs_mount(opt.volume, opt.ro_flag | NTFS_MNT_FORENSIC))) + { int err = errno; perr_printf("Opening '%s' as NTFS failed", opt.volume); diff --git a/ntfsprogs/ntfstruncate.c b/ntfsprogs/ntfstruncate.c index 26422dc6..7ac5ae4f 100644 --- a/ntfsprogs/ntfstruncate.c +++ b/ntfsprogs/ntfstruncate.c @@ -737,7 +737,7 @@ int main(int argc, char **argv) /* Mount the device. */ if (opts.no_action) { ntfs_log_quiet("Running in READ-ONLY mode!\n"); - ul = MS_RDONLY; + ul = NTFS_MNT_RDONLY; } else ul = 0; vol = ntfs_mount(dev_name, ul); diff --git a/ntfsprogs/ntfsundelete.c b/ntfsprogs/ntfsundelete.c index 8cbfd927..7e1aa86f 100644 --- a/ntfsprogs/ntfsundelete.c +++ b/ntfsprogs/ntfsundelete.c @@ -2254,8 +2254,8 @@ int main(int argc, char *argv[]) utils_set_locale(); - vol = utils_mount_volume(opts.device, MS_RDONLY | - (opts.force ? MS_RECOVER : 0)); + vol = utils_mount_volume(opts.device, NTFS_MNT_RDONLY | + (opts.force ? NTFS_MNT_RECOVER : 0)); if (!vol) return 1; diff --git a/ntfsprogs/ntfswipe.c b/ntfsprogs/ntfswipe.c index bb4873d0..e4328978 100644 --- a/ntfsprogs/ntfswipe.c +++ b/ntfsprogs/ntfswipe.c @@ -2009,9 +2009,9 @@ int main(int argc, char *argv[]) print_summary(); if (opts.info || opts.noaction) - flags = MS_RDONLY; + flags = NTFS_MNT_RDONLY; if (opts.force) - flags |= MS_RECOVER; + flags |= NTFS_MNT_RECOVER; vol = utils_mount_volume(opts.device, flags); if (!vol) diff --git a/ntfsprogs/utils.c b/ntfsprogs/utils.c index 2836723d..0a97ceca 100644 --- a/ntfsprogs/utils.c +++ b/ntfsprogs/utils.c @@ -273,11 +273,11 @@ ntfs_volume * utils_mount_volume(const char *device, unsigned long flags) * * libntfs-3g only has safety check number 2. The dirty flag is simply * ignored because we are confident that we can handle a dirty volume. - * So we treat MS_RECOVER like NTFS_MNT_FORCE, knowing that the first - * check is always bypassed. + * So we treat NTFS_MNT_RECOVER like NTFS_MNT_FORCE, knowing that the + * first check is always bypassed. */ - if (!utils_valid_device(device, flags & MS_RECOVER)) + if (!utils_valid_device(device, flags & NTFS_MNT_RECOVER)) return NULL; vol = ntfs_mount(device, flags); @@ -303,7 +303,7 @@ ntfs_volume * utils_mount_volume(const char *device, unsigned long flags) * before mount, so we can only warn if the VOLUME_IS_DIRTY flag is set * in VOLUME_INFORMATION. */ if (vol->flags & VOLUME_IS_DIRTY) { - if (!(flags & MS_RECOVER)) { + if (!(flags & NTFS_MNT_RECOVER)) { ntfs_log_error("%s", dirty_volume_msg); ntfs_umount(vol, FALSE); return NULL; diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c index 4f0bcd40..6603a714 100644 --- a/src/lowntfs-3g.c +++ b/src/lowntfs-3g.c @@ -3501,13 +3501,13 @@ static int ntfs_open(const char *device) ntfs_volume *vol; if (!ctx->blkdev) - flags |= MS_EXCLUSIVE; + flags |= NTFS_MNT_EXCLUSIVE; if (ctx->ro) - flags |= MS_RDONLY; + flags |= NTFS_MNT_RDONLY; if (ctx->recover) - flags |= MS_RECOVER; + flags |= NTFS_MNT_RECOVER; if (ctx->hiberfile) - flags |= MS_IGNORE_HIBERFILE; + flags |= NTFS_MNT_IGNORE_HIBERFILE; ctx->vol = vol = ntfs_mount(device, flags); if (!vol) { diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 540ef473..2471cc2f 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -3392,13 +3392,13 @@ static int ntfs_open(const char *device) unsigned long flags = 0; if (!ctx->blkdev) - flags |= MS_EXCLUSIVE; + flags |= NTFS_MNT_EXCLUSIVE; if (ctx->ro) - flags |= MS_RDONLY; + flags |= NTFS_MNT_RDONLY; if (ctx->recover) - flags |= MS_RECOVER; + flags |= NTFS_MNT_RECOVER; if (ctx->hiberfile) - flags |= MS_IGNORE_HIBERFILE; + flags |= NTFS_MNT_IGNORE_HIBERFILE; ctx->vol = ntfs_mount(device, flags); if (!ctx->vol) { diff --git a/src/ntfs-3g.probe.c b/src/ntfs-3g.probe.c index 238210f2..a50b8f97 100644 --- a/src/ntfs-3g.probe.c +++ b/src/ntfs-3g.probe.c @@ -68,7 +68,7 @@ static int ntfs_open(const char *device) int ret = NTFS_VOLUME_OK; if (opts.probetype == PROBE_READONLY) - flags |= MS_RDONLY; + flags |= NTFS_MNT_RDONLY; vol = ntfs_mount(device, flags); if (!vol) diff --git a/src/secaudit.c b/src/secaudit.c index 02553fc2..a0292154 100644 --- a/src/secaudit.c +++ b/src/secaudit.c @@ -331,8 +331,8 @@ #endif /* STSC */ -#define MS_NONE 0 /* no flag for mounting the device */ -#define MS_RDONLY 1 /* flag for mounting the device read-only */ +#define NTFS_MNT_NONE 0 /* no flag for mounting the device */ +#define NTFS_MNT_RDONLY 1 /* flag for mounting the device read-only */ struct CALLBACK; @@ -2869,7 +2869,7 @@ BOOL dorestore(const char *volume, FILE *fd) err = FALSE; if (!getuid()) { if (open_security_api()) { - if (open_volume(volume,MS_NONE)) { + if (open_volume(volume,NTFS_MNT_NONE)) { if (restore(fd)) err = TRUE; close_volume(volume); } else { @@ -5735,7 +5735,7 @@ BOOL backup(const char *volume, const char *root) now = time((time_t*)NULL); txtime = ctime(&now); if (!getuid() && open_security_api()) { - if (open_volume(volume,MS_RDONLY)) { + if (open_volume(volume,NTFS_MNT_RDONLY)) { printf("#\n# Recursive ACL collection on %s#\n",txtime); err = recurseshow(root); count = 0; @@ -5796,7 +5796,7 @@ BOOL listfiles(const char *volume, const char *root) int count; if (!getuid() && open_security_api()) { - if (open_volume(volume,MS_RDONLY)) { + if (open_volume(volume,NTFS_MNT_RDONLY)) { if (opt_r) { printf("\nRecursive file check\n"); err = recurseshow(root); @@ -5840,7 +5840,7 @@ BOOL mapproposal(const char *volume, const char *name) err = FALSE; if (!getuid() && open_security_api()) { - if (open_volume(volume,MS_RDONLY)) { + if (open_volume(volume,NTFS_MNT_RDONLY)) { attrsz = 0; securindex = ntfs_get_file_security(ntfs_context,name, @@ -6567,7 +6567,7 @@ BOOL audit(const char *volume) err = FALSE; if (!getuid() && open_security_api()) { - if (open_volume(volume,MS_RDONLY)) { + if (open_volume(volume,NTFS_MNT_RDONLY)) { if (audit_sds(FALSE)) err = TRUE; if (audit_sds(TRUE)) err = TRUE; if (audit_sii()) err = TRUE; @@ -7508,7 +7508,7 @@ int main(int argc, char *argv[]) pxdesc = encode_posix_acl(p); if (pxdesc) { if (!getuid() && open_security_api()) { - if (open_volume(argv[xarg],MS_NONE)) { + if (open_volume(argv[xarg],NTFS_MNT_NONE)) { if (opt_r) { for (i=0; i<(MAXSECURID + (1 << SECBLKSZ) - 1)/(1 << SECBLKSZ); i++) securdata[i] = (struct SECURITY_DATA*)NULL; @@ -7541,7 +7541,7 @@ int main(int argc, char *argv[]) cmderr = TRUE; } else if (!getuid() && open_security_api()) { - if (open_volume(argv[xarg],MS_NONE)) { + if (open_volume(argv[xarg],NTFS_MNT_NONE)) { if (opt_r) { for (i=0; i<(MAXSECURID + (1 << SECBLKSZ) - 1)/(1 << SECBLKSZ); i++) securdata[i] = (struct SECURITY_DATA*)NULL; diff --git a/src/secaudit.h b/src/secaudit.h index 38a24ad6..ce59d683 100644 --- a/src/secaudit.h +++ b/src/secaudit.h @@ -154,8 +154,8 @@ typedef int BOOL; /* Already defined in windows.h */ typedef u32 DWORD; /* must be 32 bits whatever the platform */ typedef DWORD *LPDWORD; -#define MS_NONE 0 /* no flag for mounting the device */ -#define MS_RDONLY 1 /* flag for mounting the device read-only */ +#define NTFS_MNT_NONE 0 /* no flag for mounting the device */ +#define NTFS_MNT_RDONLY 1 /* flag for mounting the device read-only */ #endif /* WIN32 */