* fhandler.h (executable_states): For now, make dont_care_if_executable

equivalent to not_executable.
* sys/mount.h: Define MOUNT_NOTEXEC.
* path.h (fs_info): New class.
(path_conv): Move fs-specific fields to new 'fs' structure.
(path_conv::update_fs_info): Move to fs_info and rename to just 'update'.
* path.cc (fs_info::update): Ditto.  Return 'true' if successful.
(fillout_mntent): Add ',noexec' to list of reported options.
This commit is contained in:
Christopher Faylor
2002-05-12 03:08:59 +00:00
parent b84621d2e3
commit 29ee580d07
5 changed files with 80 additions and 60 deletions

View File

@ -44,10 +44,10 @@ enum path_types
PATH_SYMLINK = MOUNT_SYMLINK,
PATH_BINARY = MOUNT_BINARY,
PATH_EXEC = MOUNT_EXEC,
PATH_NOTEXEC = MOUNT_NOTEXEC,
PATH_CYGWIN_EXEC = MOUNT_CYGWIN_EXEC,
PATH_ALL_EXEC = (PATH_CYGWIN_EXEC | PATH_EXEC),
PATH_ISDISK = 0x04000000,
PATH_NOTEXEC = 0x08000000,
PATH_HAS_SYMLINKS = 0x10000000,
PATH_HASBUGGYOPEN = 0x20000000,
PATH_SOCKET = 0x40000000,
@ -55,18 +55,22 @@ enum path_types
};
class symlink_info;
struct fs_info
{
char name[MAX_PATH];
char root_dir[MAX_PATH];
DWORD flags;
DWORD serial;
DWORD sym_opt; /* additional options to pass to symlink_info resolver */
DWORD is_remote_drive;
DWORD drive_type;
bool update (const char *);
};
class path_conv
{
char path[MAX_PATH];
char root_dir[MAX_PATH];
char fs_name[MAX_PATH];
DWORD fs_flags;
DWORD fs_serial;
DWORD sym_opt; /* additional options to pass to symlink_info resolver */
fs_info fs;
void add_ext_from_sym (symlink_info&);
void update_fs_info (const char*);
DWORD drive_type;
bool is_remote_drive;
public:
unsigned path_flags;
@ -79,7 +83,7 @@ class path_conv
char *normalized_path;
int isdisk () const { return path_flags & PATH_ISDISK;}
int isremote () const {return is_remote_drive;}
int isremote () const {return fs.is_remote_drive;}
int has_acls () const {return path_flags & PATH_HASACLS;}
int has_symlinks () const {return path_flags & PATH_HAS_SYMLINKS;}
int hasgood_inode () const {return path_flags & PATH_HASACLS;} // Not strictly correct
@ -126,7 +130,9 @@ class path_conv
check (src, opt | PC_NULLEMPTY, suffixes);
}
path_conv (): path_flags (0), known_suffix (NULL), error (0), devn (0), unit (0), fileattr (INVALID_FILE_ATTRIBUTES), normalized_path (NULL) {path[0] = '\0';}
path_conv (): path_flags (0), known_suffix (NULL), error (0), devn (0),
unit (0), fileattr (INVALID_FILE_ATTRIBUTES),
normalized_path (NULL) {path[0] = '\0';}
~path_conv ();
inline char *get_win32 () { return path; }
@ -138,8 +144,8 @@ class path_conv
DWORD get_devn () {return devn == FH_BAD ? (DWORD) FH_DISK : devn;}
short get_unitn () {return devn == FH_BAD ? 0 : unit;}
DWORD file_attributes () {return fileattr;}
DWORD get_drive_type () {return drive_type;}
BOOL fs_fast_ea () {return sym_opt & PC_CHECK_EA;}
DWORD get_drive_type () {return fs.drive_type;}
BOOL fs_fast_ea () {return fs.sym_opt & PC_CHECK_EA;}
void set_path (const char *p) {strcpy (path, p);}
void clear_normalized_path ();
};