diff options
author | Christopher Faylor <me@cgf.cx> | 2008-11-26 17:21:04 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2008-11-26 17:21:04 +0000 |
commit | 025c1fac6ee41d7814af7d114791dbf4c22ed617 (patch) | |
tree | 40ed7d77fb6578653e57e1f4693dbe594c13218a /winsup/cygwin/path.cc | |
parent | f43f75a09db3935effc2f56ecd47b55e3b7c9300 (diff) | |
download | cygnal-025c1fac6ee41d7814af7d114791dbf4c22ed617.tar.gz cygnal-025c1fac6ee41d7814af7d114791dbf4c22ed617.tar.bz2 cygnal-025c1fac6ee41d7814af7d114791dbf4c22ed617.zip |
Remove unneeded whitespace.
* fhandler_fifo.cc (fhandler_fifo::open): Rework to cause errno to be set to
ENXIO when opening a fifo write/nonblocking.
* environ.cc (ucreqenv): Rename to ucenv. Move code from old ucenv here and
conditionalize it on create_upcaseenv.
(ucenv): Delete.
(environ_init): Fix compiler warning by moving create_upcaseenv test to ucenv.
Don't bother checking for child_proc_info when calling ucenv since it is
assumed to be NULL at the point where the function is called.
* path.cc (symlink_worker): Turn off MS-DOS path warnings when dealing with
devices since the device handler passes in a translated MS-DOS path.
* sec_auth.cc (lsaprivkeyauth): Avoid variable initialization which causes a
compiler error.
* fhandler_netdrive.cc: Update copyright.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 265712fdb..60708994e 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -1,4 +1,4 @@ - /* path.cc: path support. +/* path.cc: path support. Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Red Hat, Inc. @@ -505,7 +505,7 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol) && FS_IS_SAMBA); if (!is_samba ()) - { + { is_netapp (RtlEqualUnicodeString (&fsname, &testname, FALSE) && FS_IS_NETAPP_DATAONTAP); @@ -515,7 +515,7 @@ fs_info::update (PUNICODE_STRING upath, HANDLE in_vol) if (!is_nfs ()) { /* Known remote file systems which can't handle calls to - NtQueryDirectoryFile(FileIdBothDirectoryInformation) */ + NtQueryDirectoryFile(FileIdBothDirectoryInformation) */ RtlInitUnicodeString (&testname, L"UNIXFS"); has_buggy_fileid_dirinfo (RtlEqualUnicodeString (&fsname, &testname, @@ -1525,6 +1525,7 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym, NTSTATUS status; HANDLE fh; tmp_pathbuf tp; + unsigned check_opt; /* POSIX says that empty 'newpath' is invalid input while empty 'oldpath' is valid -- it's symlink resolver job to verify if @@ -1551,14 +1552,16 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym, set_errno (ENOENT); goto done; } + + check_opt = PC_SYM_NOFOLLOW | PC_POSIX | (isdevice ? PC_NOWARN : 0); /* We need the normalized full path below. */ - win32_newpath.check (newpath, PC_SYM_NOFOLLOW | PC_POSIX, stat_suffixes); + win32_newpath.check (newpath, check_opt, stat_suffixes); if (use_winsym && !win32_newpath.exists () && (isdevice || !win32_newpath.fs_is_nfs ())) { char *newplnk = tp.c_get (); stpcpy (stpcpy (newplnk, newpath), ".lnk"); - win32_newpath.check (newplnk, PC_SYM_NOFOLLOW | PC_POSIX); + win32_newpath.check (newplnk, check_opt); } if (win32_newpath.error) @@ -1621,7 +1624,11 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym, /* The symlink target is relative to the directory in which the symlink gets created, not relative to the cwd. Therefore we have to mangle the path quite a bit before calling path_conv. */ - if (!isabspath (oldpath)) + if (isabspath (oldpath)) + win32_oldpath.check (oldpath, + PC_SYM_NOFOLLOW, + stat_suffixes); + else { len = strrchr (win32_newpath.normalized_path, '/') - win32_newpath.normalized_path + 1; @@ -1630,8 +1637,6 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym, oldpath); win32_oldpath.check (absoldpath, PC_SYM_NOFOLLOW, stat_suffixes); } - else - win32_oldpath.check (oldpath, PC_SYM_NOFOLLOW, stat_suffixes); if (SUCCEEDED (SHGetDesktopFolder (&psl))) { WCHAR wc_path[win32_oldpath.get_wide_win32_path_len () + 1]; @@ -1777,7 +1782,7 @@ symlink_worker (const char *oldpath, const char *newpath, bool use_winsym, } if (win32_newpath.has_acls () && win32_newpath.isremote ()) set_file_attribute (fh, win32_newpath, ILLEGAL_UID, ILLEGAL_GID, - S_IFLNK | STD_RBITS | STD_WBITS); + S_IFLNK | STD_RBITS | STD_WBITS); status = NtWriteFile (fh, NULL, NULL, NULL, &io, buf, cp - buf, NULL, NULL); if (NT_SUCCESS (status) && io.Information == (ULONG) (cp - buf)) { |