diff options
author | Christopher Faylor <me@cgf.cx> | 2005-05-13 19:46:07 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-05-13 19:46:07 +0400 |
commit | 063f1df2aa2689d45fd7fd7bd8445031338ec9cb (patch) | |
tree | d1dc01f28241869f35ad8c728ccaae9e0732d3c5 /winsup | |
parent | eb6cd95fecef02c261ef266161f8dff6924efa4d (diff) |
Remove PC_FULL from path_conv usage throughout.
* path.h (enum pathconv_arg): Change PC_FULL to PC_NOUILL.
* path.cc (path_conv::check): Test for PC_NOFULL rather than !PC_FULL.
(cygwin_conv_to_win32_path): Use PC_NOFULL to force non-absolute path.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/dir.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/dtable.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/external.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 16 | ||||
-rw-r--r-- | winsup/cygwin/path.h | 2 | ||||
-rw-r--r-- | winsup/cygwin/sec_acl.cc | 3 | ||||
-rw-r--r-- | winsup/cygwin/spawn.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 20 |
10 files changed, 34 insertions, 28 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0aff5fccb..c53384ab5 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,12 @@ 2005-05-13 Christopher Faylor <cgf@timesys.com> + Remove PC_FULL from path_conv usage throughout. + * path.h (enum pathconv_arg): Change PC_FULL to PC_NOUILL. + * path.cc (path_conv::check): Test for PC_NOFULL rather than !PC_FULL. + (cygwin_conv_to_win32_path): Use PC_NOFULL to force non-absolute path. + +2005-05-13 Christopher Faylor <cgf@timesys.com> + * fhandler_netdrive.cc (fhandler_netdrive::exists): Assert that "//" exists. diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc index cb49d3a94..df0515220 100644 --- a/winsup/cygwin/dir.cc +++ b/winsup/cygwin/dir.cc @@ -45,7 +45,7 @@ opendir (const char *name) fhandler_base *fh; DIR *res; - fh = build_fh_name (name, NULL, PC_SYM_FOLLOW | PC_FULL); + fh = build_fh_name (name, NULL, PC_SYM_FOLLOW); if (!fh) res = NULL; else if (fh->exists ()) @@ -264,7 +264,7 @@ rmdir (const char *dir) { int res = -1; - path_conv real_dir (dir, PC_SYM_NOFOLLOW | PC_FULL | PC_WRITABLE); + path_conv real_dir (dir, PC_SYM_NOFOLLOW | PC_WRITABLE); if (real_dir.error) set_errno (real_dir.error); diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index ecbfdb2cb..24a88ce26 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -338,7 +338,7 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle) fhandler_base * build_fh_name (const char *name, HANDLE h, unsigned opt, suffix_info *si) { - path_conv pc (name, opt | PC_NULLEMPTY | PC_FULL | PC_POSIX, si); + path_conv pc (name, opt | PC_NULLEMPTY | PC_POSIX, si); if (pc.error) { fhandler_base *fh = cnew (fhandler_nodevice) (); diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc index 60997f8a2..5268b86b8 100644 --- a/winsup/cygwin/external.cc +++ b/winsup/cygwin/external.cc @@ -294,7 +294,7 @@ cygwin_internal (cygwin_getinfo_types t, ...) case CW_GET_BINMODE: { const char *path = va_arg (arg, const char *); - path_conv p (path, PC_SYM_FOLLOW | PC_FULL | PC_NULLEMPTY); + path_conv p (path, PC_SYM_FOLLOW | PC_NULLEMPTY); if (p.error) { set_errno (p.error); diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 65fbb8320..ff14a053a 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -681,7 +681,7 @@ fhandler_disk_file::ftruncate (_off64_t length) int fhandler_disk_file::link (const char *newpath) { - path_conv newpc (newpath, PC_SYM_NOFOLLOW | PC_FULL | PC_POSIX); + path_conv newpc (newpath, PC_SYM_NOFOLLOW | PC_POSIX); extern bool allow_winsymlinks; if (newpc.error) @@ -711,7 +711,7 @@ fhandler_disk_file::link (const char *newpath) strcpy (new_lnk_buf, newpath); strcat (new_lnk_buf, ".lnk"); newpath = new_lnk_buf; - newpc.check (newpath, PC_SYM_NOFOLLOW | PC_FULL); + newpc.check (newpath, PC_SYM_NOFOLLOW); } query_open (query_write_attributes); diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 09382daff..1bdf75c8b 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -956,7 +956,7 @@ out: devn = FH_SOCKET; #endif - if (!(opt & PC_FULL)) + if (opt & PC_NOFULL) { if (is_relpath) mkrelpath (this->path); @@ -2679,7 +2679,7 @@ symlink_worker (const char *topath, const char *frompath, bool use_winsym, strcpy (w32topath, reltopath); if (use_winsym) { - win32_topath.check (topath, PC_FULL | PC_SYM_NOFOLLOW); + win32_topath.check (topath, PC_SYM_NOFOLLOW); strcpy (w32topath, win32_topath); } if (cp) @@ -2690,7 +2690,7 @@ symlink_worker (const char *topath, const char *frompath, bool use_winsym, } else { - win32_topath.check (topath, PC_FULL | PC_SYM_NOFOLLOW); + win32_topath.check (topath, PC_SYM_NOFOLLOW); strcpy (w32topath, win32_topath); } create_how = CREATE_NEW; @@ -3433,7 +3433,7 @@ chdir (const char *in_dir) /* Convert path. First argument ensures that we don't check for NULL/empty/invalid again. */ - path_conv path (PC_NONULLEMPTY, in_dir, PC_FULL | PC_SYM_FOLLOW | PC_POSIX); + path_conv path (PC_NONULLEMPTY, in_dir, PC_SYM_FOLLOW | PC_POSIX); if (path.error) { set_errno (path.error); @@ -3518,7 +3518,7 @@ fchdir (int fd) extern "C" int cygwin_conv_to_win32_path (const char *path, char *win32_path) { - path_conv p (path, PC_SYM_FOLLOW | PC_NO_ACCESS_CHECK); + path_conv p (path, PC_SYM_FOLLOW | PC_NO_ACCESS_CHECK | PC_NOFULL); if (p.error) { win32_path[0] = '\0'; @@ -3533,7 +3533,7 @@ cygwin_conv_to_win32_path (const char *path, char *win32_path) extern "C" int cygwin_conv_to_full_win32_path (const char *path, char *win32_path) { - path_conv p (path, PC_SYM_FOLLOW | PC_FULL | PC_NO_ACCESS_CHECK); + path_conv p (path, PC_SYM_FOLLOW | PC_NO_ACCESS_CHECK); if (p.error) { win32_path[0] = '\0'; @@ -3571,7 +3571,7 @@ realpath (const char *path, char *resolved) extern suffix_info stat_suffixes[]; int err; - path_conv real_path (path, PC_SYM_FOLLOW | PC_FULL, stat_suffixes); + path_conv real_path (path, PC_SYM_FOLLOW, stat_suffixes); if (real_path.error) err = real_path.error; @@ -3624,7 +3624,7 @@ conv_path_list_buf_size (const char *path_list, bool to_posix) int i, num_elms, max_mount_path_len, size; const char *p; - path_conv pc(".", PC_FULL | PC_POSIX); + path_conv pc(".", PC_POSIX); /* The theory is that an upper bound is current_size + (num_elms * max_mount_path_len) */ diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index 1c6310326..a502e8629 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -35,7 +35,7 @@ enum pathconv_arg PC_SYM_NOFOLLOW = 0x0002, PC_SYM_IGNORE = 0x0004, PC_SYM_CONTENTS = 0x0008, - PC_FULL = 0x0010, + PC_NOFULL = 0x0010, PC_NULLEMPTY = 0x0020, PC_CHECK_EA = 0x0040, PC_POSIX = 0x0080, diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 268f378db..70c6c3c23 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -412,8 +412,7 @@ acl_worker (const char *path, int cmd, int nentries, __aclent32_t *aclbufp, { extern suffix_info stat_suffixes[]; int res = -1; - fhandler_base *fh = build_fh_name (path, NULL, fmode | PC_FULL, - stat_suffixes); + fhandler_base *fh = build_fh_name (path, NULL, fmode, stat_suffixes); if (fh->error ()) { debug_printf ("got %d error from build_fh_name", fh->error ()); diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 8cb8b7dc1..b65e00320 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -59,7 +59,7 @@ perhaps_suffix (const char *prog, path_conv& buf) char *ext; debug_printf ("prog '%s'", prog); - buf.check (prog, PC_SYM_FOLLOW | PC_FULL, std_suffixes); + buf.check (prog, PC_SYM_FOLLOW, std_suffixes); if (!buf.exists () || buf.isdir ()) ext = NULL; diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 4f8352f37..c67bc3799 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -134,7 +134,7 @@ unlink (const char *ourname) int res = -1; DWORD devn; - path_conv win32_name (ourname, PC_SYM_NOFOLLOW | PC_FULL); + path_conv win32_name (ourname, PC_SYM_NOFOLLOW); if (win32_name.error) { @@ -267,7 +267,7 @@ unlink (const char *ourname) extern "C" int _remove_r (struct _reent *, const char *ourname) { - path_conv win32_name (ourname, PC_SYM_NOFOLLOW | PC_FULL); + path_conv win32_name (ourname, PC_SYM_NOFOLLOW); if (win32_name.error) { @@ -282,7 +282,7 @@ _remove_r (struct _reent *, const char *ourname) extern "C" int remove (const char *ourname) { - path_conv win32_name (ourname, PC_SYM_NOFOLLOW | PC_FULL); + path_conv win32_name (ourname, PC_SYM_NOFOLLOW); if (win32_name.error) { @@ -1128,7 +1128,7 @@ rename (const char *oldpath, const char *newpath) int res = 0; char *lnk_suffix = NULL; - path_conv real_old (oldpath, PC_FULL | PC_SYM_NOFOLLOW); + path_conv real_old (oldpath, PC_SYM_NOFOLLOW); if (real_old.error) { @@ -1137,7 +1137,7 @@ rename (const char *oldpath, const char *newpath) return -1; } - path_conv real_new (newpath, PC_FULL | PC_SYM_NOFOLLOW); + path_conv real_new (newpath, PC_SYM_NOFOLLOW); /* Shortcut hack. */ char new_lnk_buf[CYG_MAX_PATH + 5]; @@ -1146,7 +1146,7 @@ rename (const char *oldpath, const char *newpath) strcpy (new_lnk_buf, newpath); strcat (new_lnk_buf, ".lnk"); newpath = new_lnk_buf; - real_new.check (newpath, PC_FULL | PC_SYM_NOFOLLOW); + real_new.check (newpath, PC_SYM_NOFOLLOW); } if (real_new.error || real_new.case_clash) @@ -1460,7 +1460,7 @@ pathconf (const char *file, int v) case _PC_POSIX_PERMISSIONS: case _PC_POSIX_SECURITY: { - path_conv full_path (file, PC_SYM_FOLLOW | PC_FULL); + path_conv full_path (file, PC_SYM_FOLLOW); if (full_path.error) { set_errno (full_path.error); @@ -1719,7 +1719,7 @@ statvfs (const char *fname, struct statvfs *sfs) return -1; } - path_conv full_path (fname, PC_SYM_FOLLOW | PC_FULL); + path_conv full_path (fname, PC_SYM_FOLLOW); if (!rootdir (full_path, root)) return -1; @@ -1910,7 +1910,7 @@ mknod32 (const char *path, mode_t mode, __dev32_t dev) if (strlen (path) >= CYG_MAX_PATH) return -1; - path_conv w32path (path, PC_SYM_NOFOLLOW | PC_FULL); + path_conv w32path (path, PC_SYM_NOFOLLOW); if (w32path.exists ()) { set_errno (EEXIST); @@ -2247,7 +2247,7 @@ setregid (__gid16_t rgid, __gid16_t egid) extern "C" int chroot (const char *newroot) { - path_conv path (newroot, PC_SYM_FOLLOW | PC_FULL | PC_POSIX); + path_conv path (newroot, PC_SYM_FOLLOW | PC_POSIX); int ret = -1; if (path.error) |