summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* * path.cc (path_conv::check): Don't generate ENOENT for non-existantCorinna Vinschen2010-12-061-1/+8
| | | | CYGDRIVE and NETDRIVE paths. Add comment.
* * path.cc (symlink_info::check): Don't use FileNetworkOpenInformationCorinna Vinschen2010-11-231-10/+23
| | | | | on Netapps. Relax condition for workaround. Always request size information via FileStandardInformation info class in workaround.
* * dcrt0.cc (do_exit): Don't set thread termination until all fds have beenChristopher Faylor2010-10-241-3/+0
| | | | | | | | | closed since an fd may rely on a thread. * fhandler_tty.cc: Reformat comment. (fhandler_pty_master::pty_master_thread): Refuse ERROR_PIPE_CONNECTED state as an error. * globals.cc (exit_states): Reorder ES_THREADTERM. * path.cc (find_fast_cwd_pointers): Remove excessively wordy DEBUGGING output.
* * cygheap.h (cwdstuff::override_win32_cwd): Declare.Corinna Vinschen2010-10-091-20/+296
| | | | | | | | | | | | | | | | | | | | | | | | | | | * ntdll.h (struct _PEB): Add members accessed by the fast cwd method starting with Vista. (struct _KUSER_SHARED_DATA): Define with only the DismountCount. (RtlAllocateHeap): Declare. (RtlEnterCriticalSection): Declare. (RtlFreeHeap): Declare. (RtlLeaveCriticalSection): Declare. * path.cc (get_user_proc_parms): Remove. (struct _FAST_CWD): New structure. (fast_cwd_ptr): Define. (SharedUserData): Define. (peek32): Define. (find_fast_cwd_pointers): New function to find the global pointer to the current FAST_CWD structure. (copy_cwd_str): New helper function. (cwdstuff::override_win32_cwd): New method to set the Win32 CWD. (cwdstuff::init): Just call override_win32_cwd from here when started from native Win32 parent. (cwdstuff::set): Access Win32 CWD via PEB reference instead of using get_user_proc_parms function. Memorize old DismountCount before opening directory handle. Call override_win32_cwd to set up Win32 CWD. Be more verbose in comments. * wincap.h (wincaps::has_fast_cwd): New element. * wincap.cc: Implement has_fast_cwd element throughout.
* * fhandler.h (fhandler_base::get_stat_access): Delete.Corinna Vinschen2010-10-071-78/+73
| | | | | | | | | | | | | | | | | | | | * fhandler_disk_file.cc (fhandler_base::fstat_helper): Always check executable suffix to get x-bits for .exe files also in notexec case. Always reopen file when checking for file header. * ntdll.h (wait_pending): Delete. * path.cc (symlink_info::check_shortcut): Drop call to wait_pending since file is always opened for sync IO. (symlink_info::check_sysfile): Ditto. (MIN_STAT_ACCESS): Remove. (FULL_STAT_ACCESS): Remove. (symlink_info::check): Drop access flag. Revert to open file with just read attributes access. Reorder symlink check to check for reparse points first. Don't check reparse points for anything else, even on remote drives. Open file for GENERIC_READ when trying to read shortcuts or system-bit symlinks. Accommodate dropped access flag in call to path_conv_handle::set. * path.h (class path_conv_handle): Drop access flag and accommodate all related methods.
* * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Simplify.Corinna Vinschen2010-10-021-22/+3
| | | | | | | | | Just call nfs_fetch_fattr3 if called via fstat. * nfs.cc (nfs_fetch_fattr3): New function to fetch NFS fattr3 info from file handle. * nfs.h (nfs_fetch_fattr3): Declare. * path.cc (symlink_info::check): Simplify NFS case. Just call nfs_fetch_fattr3.
* * fhandler.cc: Drop including nfs.h.Corinna Vinschen2010-09-301-13/+30
| | | | | | | | | | | | | | | | | | * fhandler_disk_file.cc: Ditto. (fhandler_base::fstat_by_nfs_ea): Use fattr3 from path_conv member, unless called from fstat. * path.cc: Drop including nfs.h. (symlink_info::check): Rearrange definition of file info buffers. Fetch fattr3 info for files on NFS and store in conv_hdl for later use in fhandler_base::fstat_by_nfs_ea. Use fattr3 file type to recognize symlink on NFS and try to fetch symlink target only for actual symlinks. * path.h: Include nfs.h. (class path_conv_handle): Change file info storage to union of FILE_NETWORK_OPEN_INFORMATION and fattr3 structures. (path_conv_handle::fnoi): Align to aforementioned change. (path_conv_handle::nfsattr): New method. (path_conv::nfsattr): New method.
* * path.cc (symlink_info::check): Remove erroneous assumption aboutCorinna Vinschen2010-09-301-4/+1
| | | | required permissions when reading NFS symlinks.
* * errno.cc (errmap): Map ERROR_BAD_NET_RESP to ENOSYS.Corinna Vinschen2010-09-241-0/+17
| | | | | | | | | | | * fhandler_disk_file.cc (fhandler_disk_file::facl): Handle ENOSYS and point to the explanation. * ntdll.h (STATUS_NOT_IMPLEMENTED): Define. * path.cc (symlink_info::check): Handle the inability of NT4 to use FileNetworkOpenInformation on share root dirs in either direction. * path.h (slash_unc_prefix_p): Remove unused declaration. * security.cc (get_info_from_sd): Handle ENOSYS from get_file_sd. Explain when this happens.
* * path.cc (cwdstuff::set): Replace constant 2 with sizeof(WCHAR) whereCorinna Vinschen2010-09-211-4/+6
| | | | appropriate.
* * mount.h (class fs_info): Add has_buggy_reopen flag and accessorCorinna Vinschen2010-09-211-12/+0
| | | | | | | | | | | | | | | | methods. * mount.cc (fs_info::update): Set has_buggy_reopen flag for NWFS. Add comment. * path.h (path_conv::get_object_attr) Make inline method. (path_conv::init_reopen_attr): New inline method. * path.cc (path_conv::get_object_attr): Remove. * fhandler_disk_file.cc (fhandler_base::fstat_helper): Use path_conv::init_reopen_attr method to initialize OBJECT_ATTRIBUTE for reopening file. (fhandler_disk_file::fchmod): Ditto. (fhandler_base::utimens_fs): Ditto. (fhandler_disk_file::rewinddir): Ditto. * syscalls.cc (unlink_nt): Ditto.
* * fhandler.cc (fhandler_base::open): Always open NFS files withCorinna Vinschen2010-09-211-3/+4
| | | | | | | | | | | FILE_READ_EA, even when opening with O_WRONLY to allow fstat. * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Call FlushFileBuffers if file has been opened for writing. Explain why. (fhandler_base::fstat_by_handle): Renew content of pc.fnoi if called via fstat. Explain why. Fix formatting. * path.cc (symlink_info::check): Try to open file the second time with FILE_READ_EA permissions since it's needed in later calls to fhandler_base::fstat_by_nfs_ea.
* * path.cc (symlink_info::check): Make sure AllocationSize and EndOfFileCorinna Vinschen2010-09-141-0/+8
| | | | | are stored in the right order when fetching the info from the NtQueryDirectoryFile result.
* * fhandler.h (class fhandler_base): Change inheritance of fstat_helperCorinna Vinschen2010-09-131-10/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | and fstat_by_... methods to private. (fhandler_base::fstat_helper): Drop all redundant arguments. * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop call to fstat_by_nfs_ea here. Drop fetching basic file information. Drop setting file attributes. Accommodate change in fstat_helper call. (fhandler_base::fstat_by_name): Simplify. Only fetch directory information to get the inode number. Drop setting file attributes. Accommodate change in fstat_helper call. (fhandler_base::fstat_fs): Call fstat_by_nfs_ea if on NFS. (fhandler_base::fstat_helper): Drop all redundant arguments. Use information already collected in the fhandler. Move heading comment into code and drop dwFileAttributes comment. * mmap.cc (mmap64): Call fstat_fs rather than fstat_by_handle. * mount.cc (fs_info::update): Note that has_buggy_basic_info is unused. * path.cc (symlink_info::check_reparse_point): Add comment. (symlink_info::check): Fetch FileNetworkOpenInformation rather than FileBasicInformation throughout, except on NFS. Explain why. Store FILE_NETWORK_OPEN_INFORMATION in conv_hdl. Remove FILE_ATTRIBUTE_DIRECTORY attribute in conv_hdl for reparse point symlinks. * path.h (class path_conv_handle): Add FILE_NETWORK_OPEN_INFORMATION member _fnoi. (path_conv_handle::fnoi): New accessor method for _fnoi. (path_conv::fnoi): New accessor method for cubv_hdl._fnoi. * fhandler_tty.cc (fhandler_tty_slave::init): Use tty::setpgid method.
* * Makefile.in (DLL_OFILES): Add fhandler_procsys.o.Corinna Vinschen2010-09-061-11/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * devices.h (enum fh_devices): Add FH_PROCSYS. * devices.in (dev_procsys_storage): New device. * devices.cc: Regenerate. * dtable.cc (build_fh_pc): Add code to allocate fhandler_procsys. * fhandler.h (proc_len): Convert to size_t. (procsys): Declare. (procsys_len): Declare. (enum virtual_ftype_t): Move here from fhandler_virtual.h. Add members supported by fhandler_procsys. (fhandler_virtual::exists): Return virtual_ftype_t. Change in all derived classes. (class fhandler_procsys): New class. (fhandler_union): Add fhandler_procnet and fhandler_procsys members. * fhandler_disk_file.cc (__DIR_mounts::check_missing_mount): Use ro_u_proc. (fhandler_base::fstat_by_handle): Don't copy attributes if file is an NT device. (fhandler_base::fstat_by_name): Ditto. * fhandler_netdrive.cc (fhandler_netdrive::exists): Return virtual_ftype_t. * fhandler_proc.cc (proc_tab): Sort alphabetically. Use _VN macro to store length. (proc_len): Change to size_t. (proc_tab_cmp): New static function. (virt_tab_search): New function to search entry in virt_tab_t arrays. Use throughout in /proc and sibling classes instead of loop. (fhandler_proc::exists): Return virtual_ftype_t. * fhandler_process.cc (process_tab): Sort alphabetically. Use _VN macro to store length. (fhandler_process::exists): Return virtual_ftype_t. (fhandler_process::open): Simplify code. * fhandler_procnet.cc (procnet_tab): Sort alphabetically. Use _VN macro to store length. (fhandler_procnet::exists): Return virtual_ftype_t. (fhandler_procnet::open): Simplify. * fhandler_procsys.cc: New file. * fhandler_registry.cc (fhandler_registry::exists): Return virtual_ftype_t. * fhandler_virtual.cc (fhandler_virtual::exists): Ditto. * fhandler_virtual.h (enum virtual_ftype_t): Move to fhandler.h. (virt_tab_t): Add name_len member. (_VN): New macro. (virt_tab_search): Declare. * mount.cc (mount_info::conv_to_win32_path): Fix comment. Backslashify isprocsys_dev paths. * ntdll.h (STATUS_OBJECT_TYPE_MISMATCH): Define (STATUS_INSTANCE_NOT_AVAILABLE): Define. (STATUS_PIPE_NOT_AVAILABLE): Define. (STATUS_INVALID_PIPE_STATE): Define. (STATUS_PIPE_BUSY): Define. (SYMBOLIC_LINK_QUERY): Define. (NtOpenSymbolicLinkObject): Declare. (NtQuerySymbolicLinkObject): Declare. * path.cc (path_conv::check): Accommodate fact that exists method returns virtual_ftype_t now. Add cases for new virtual_ftype_t types. (cygwin_conv_path): Add GLOBALROOT prefix to native device paths. Make sure to strip \\?\ prefix only for actual filesystem-based paths, not for all paths. * path.h (isproc_dev): Add FH_PROCSYS. (isprocsys_dev): Define.
* * path.cc (normalize_posix_path): Preserve //./ and //?/ prefixes.Corinna Vinschen2010-08-311-0/+15
| | | | | (path_conv::check): Allow access to root directory of native NT disk devices.
* * external.cc (sync_wincwd): Remove.Corinna Vinschen2010-08-271-23/+36
| | | | | | | | | | | (cygwin_internal): Drop CW_SYNC_WINCWD case. * globals.cc (ro_u_pipedir): New R/O unicode string. * ntdll.h (RtlSetCurrentDirectory_U): Declare. * path.cc (cwdstuff::set): Improve comments. Drop setting Win32 CWD to \\?\PIPE\ on init. Keep Win32 CWD in sync, if possible. Set to \\?\PIPE\ otherwise. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Revert to 230. * include/sys/cygwin.h (cygwin_getinfo_types): Remove CW_SYNC_WINCWD.
* * path.cc (path_conv::check): Close handle in conv_handle if we'reCorinna Vinschen2010-08-201-0/+3
| | | | following a symlink.
* * fhandler_disk_file.cc (readdir_check_reparse_point): Rename fromCorinna Vinschen2010-08-201-0/+5
| | | | | | | | | | | | | | | is_volume_mountpoint. Return valid d_type value for underlying reparse point type. (readdir_get_ino): Don't rely on the handle set in pc.check. Open file here if pc.handle() is NULL. (fhandler_disk_file::readdir_helper): Try to set a correct d_type value more diligent. (fhandler_disk_file::readdir): Don't reset dirent_set_d_ino unless we're really sure it's due to an untrusted FS. Simplify usage of FileAttributes, which is 0 if buf is NULL, anyway. Set d_type correctly for faked "." and ".." entries. Improve debug output. * path.cc (symlink_info::check): Don't keep handle to volume mount point open. Explain why.
* * exceptions.cc (open_stackdumpfile): Don't try to open file if weCorinna Vinschen2010-08-181-12/+5
| | | | | | have no filesystem based CWD. Add comment. * path.cc (cwdstuff::set): Set CWD handle to NULL if CWD is a virtual path. Simplify matching comment.
* * cygheap.h (class cwdstuff): Make drive_length private.Corinna Vinschen2010-08-131-153/+191
| | | | | | | | | | | | | | | | | | | | | | | | | Add "error" member. (cwdstuff::get_error): New inline method. (cwdstuff::get_error_desc): Declare. (cwdstuff::set): Change first parameter to pointer to path_conv. * path.cc (chdir): Drop doit. Align call to cwdstuff::set to new arguments. (cwdstuff::init): Only call cwdstuff::set if it's not already initialized. Add comment. Drop third parameter in call to cwdstuff::set. (cwdstuff::set): Partially rewrite. Add lots of comments to explain everything. Drop "doit" since it's not used anymore. Always create new handle to CWD if not in a virtual path. Drop PEB locking when reading PEB values in init phase. Check for accessibility to set correct error code. Drop Vista workaround. Never write back into PEB. Set Win32 CWD to \\?\PIPE\ on init. Simplify creation of win32 path. Set new error member to a meaningful value. (cwdstuff::get_error_desc): New method to generate error message from cwd error code. * spawn.cc (spawn_guts): Call cwdstuff::get_error_desc to create more meaningful error message when not being able to start native Win32 app due to CWD restrictions. When starting native Win32 app, lock cwd and use in calls to CreateProcessW/CreateProcessAsUserW.
* * path.cc (cygwin_conv_path): Rearrange test for "." in POSIX toCorinna Vinschen2010-08-041-9/+31
| | | | | | relative DOS path conversion. Simplify fixing the path. In CCP_POSIX_TO_WIN_W conversion, always drop long path prefix if path fits into MAX_PATH. Explain why.
* * path.cc (path_conv::check): Move fs-specific settings to a point where weChristopher Faylor2010-07-041-10/+10
| | | | | | | | | know that we have filled out the filesystem information. * path.h (path_conv::path_conv): Use consistent initialization for constructors. * include/sys/cygwin.h: Define CW_STRERROR. * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 228. * include/external.h: Implement CW_STRERROR.
* * dtable.cc (dtable::dup_worker): Reset path_conv handle in duplicatedCorinna Vinschen2010-06-151-69/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fhandler. * fhandler.cc (fhandler_base::fstatvfs): Keep handle in created path_conv. * fhandler.h (fhandler_base::get_stat_access): New method. (fhandler_base::get_stat_handle): New method. * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Use handle returned by get_stat_handle. Only request inode from system if it isn't already set in the fhandler, and only for filesystems supporting them. (fhandler_base::fstat_fs): Use handle returned by get_stat_handle. Change the way open_fs is called. Explain why. (fhandler_base::fstat_helper): Use handle returned by get_stat_handle. Never use 0 inode number. Simplify executable recognition by re-using get_stat_handle if file could be opened with sufficient rights. (fhandler_disk_file::fstatvfs): Use handle returned by get_stat_handle. (fhandler_disk_file::facl): Use handle returned by get_stat_handle in GETACL and GETACLCNT cases. (fhandler_disk_file::link): Use handle returned by get_stat_handle instead of opening file here again. Add comment. (readdir_get_ino): Keep handle in created path_conv and drop opening file. * ntdll.h (wait_pending): New helper function. * path.cc (symlink_info::check): Drop unused 'opt' parameter from declaration. Add path_conv_handle argument. (path_conv::check): Make sure conv_handle is closed. Keep PC_KEEP_HANDLE flag in pflags_or. Accommodate call to sym.check to new args. (path_conv::~path_conv): Close conv_handle. (symlink_info::check_shortcut): Don't re-open file here, just use incoming handle. Drop goto's and label out. (symlink_info::check_sysfile): Don't re-open file here, just use incoming handle. Keep track of file position to accommodate the fact that file has been opened asynchronously in calling function. (symlink_info::check_nfs_symlink): Don't re-open file here, just use incoming handle. (symlink_info::check): Drop unused 'opt' parameter. Add path_conv_handle argument. Always try to open file with GENERIC_READ rights first to allow reading file content w/o having to re-open the file. Drop back to READ_CONTROL | FILE_READ_ATTRIBUTES otherwise. Call symlink test functions (except for check_reparse_point) only if file could be opened with GENERIC_READ. Keep file handle open if PC_KEEP_HANDLE is set in pflags. * path.h (enum pathconv_arg): Add PC_KEEP_HANDLE flag. (class path_conv_handle): New class. (class path_conv): Add conv_handle member. (path_conv::operator =): Duplicate conv_handle. (path_conv::handle): New method. (path_conv::access): New method. (path_conv::reset_conv_handle): New method. (path_conv::close_conv_handle): New method.
* * path.cc (path_conv::check): Return with ENOTDIR if component is aCorinna Vinschen2010-06-141-0/+5
| | | | device.
* * path.cc (symlink_info::check_shortcut): Use ro_u_empty rather thanCorinna Vinschen2010-06-091-6/+4
| | | | | | | local UNICODE_STRING object. (symlink_info::check_sysfile): Ditto. Return immediately if NtOpenFile failed to avoid closing random handle. Improve debug output in case NtReadFile failed.
* * path.cc (symlink_info::check): Set h to NULL after closing handleCorinna Vinschen2010-06-081-3/+3
| | | | | | in udf check. Remove overagressive bracketing. Don't set h to NULL without closing the handle. Fix using wrong handle in checking file system when using parent directory handle.
* * ntdll.h (STATUS_BAD_NETWORK_PATH): Define.Corinna Vinschen2010-06-021-0/+2
| | | | | | (STATUS_BAD_NETWORK_NAME): Define. * path.cc (symlink_info::check): Convert STATUS_BAD_NETWORK_PATH and STATUS_BAD_NETWORK_NAME into an immediate ENOENT.
* * path.cc (symlink_info::check): Don't try to handle remote reparseCorinna Vinschen2010-05-261-2/+8
| | | | points as symlinks. Explain why.
* * path.cc (path_conv::check): Drop setting sym.pflags before callingCorinna Vinschen2010-05-061-6/+7
| | | | | | | mount_info::conv_to_win32_path since the flag value is overwritten by mount_info::conv_to_win32_path anyway. Set flags for DOS paths before calling symlink_info::check so they can be used in that function already.
* * mount.cc (struct opt): Add "dos" and "ihash" options.Corinna Vinschen2010-04-291-10/+14
| | | | | | | | | | | | | | | | | | | | | (fillout_mntent): Ditto. * path.cc (path_conv::get_nt_native_path): Use path_conv's has_dos_filenames_only method. (path_conv::check): Add PATH_IHASH flag if FS has unreliable inode numbers. (symlink_info::check_shortcut): Or symlink flags to pflags. (symlink_info::check_sysfile): Ditto. Change test accordingly. (symlink_info::check_reparse_point): Ditto. (symlink_info::check_nfs_symlink): Ditto. (symlink_info::check): Check PATH_DOS flag in call to get_nt_native_path to utilize mount flag. Ditto in test for potential restarting. Set PATH_DOS if FS only allows DOS filename rules. * path.h (enum path_types): Add PATH_DOS and PATH_IHASH. (path_conv::hasgood_inode): Check PATH_IHASH instead of fs.hasgood_inode. (path_conv::has_dos_filenames_only): New method. * include/sys/mount.h (MOUNT_DOS): New mount flag. (MOUNT_IHASH): Ditto.
* * mount.h (fs_info::inited): New inline method.Corinna Vinschen2010-04-261-24/+29
| | | | | | | | | * path.cc (path_conv::check): Clear filesystem info if following a symlink. Use new fs_info::inited method to check if FS info is already available. (symlink_info::check): Drop fs_update_called. Use fs_info::inited method instead. Streamline test for leading space and trailing dot or space. Add comments.
* * path.h (get_nt_native_path): Add third parameter to declaration andCorinna Vinschen2010-04-231-28/+46
| | | | | | | | | | | | | | | | | | | | declare with regparms. * path.cc (get_nt_native_path): Add third parameter to allow conversion of leading and trailing dots and spaces on filesystems only supporting filenames following DOS rules. (path_conv::get_nt_native_path): Call get_nt_native_path according to fs.has_dos_filenames_only flag. (getfileattr): Accommodate new parameter to get_nt_native_path. (symlink_info::check): Revamp fs_update_called handling to call fs.update only once per call. Call get_nt_native_path according to fs.has_dos_filenames_only flag. Streamline filesystem dependent code not to be called more than once unnecessarily. Drop code tweaking incoming path for broken filesystems only allowing DOS pathnames. Rely on changed get_nt_native_path instead. * mount.cc (fillout_mntent): Accommodate new parameter to get_nt_native_path. * strfuncs.cc (tfx_rev_chars): New conversion table with comment. (sys_cp_wcstombs): Use tfx_rev_chars rather than tfx_chars.
* * path.cc (symlink_info::check): Make sure to restart only once.Corinna Vinschen2010-04-221-1/+3
|
* * mount.cc (GETVOLINFO_VALID_MASK): Drop FILE_SEQUENTIAL_WRITE_ONCECorinna Vinschen2010-04-221-38/+83
| | | | | | | | | | | | | | | | | from mask. Expand the comment a bit. (WIN_FAT_FLAGS): New define. (FS_IS_WINDOWS_FAT): New macro. (fs_info::update): Handle remote FS faking to be FAT. Subsume under CIFS. Check for NWFS and has_buggy_basic_info only for remote filesystems. Add check for has_dos_filenames_only. * mount.h (class fs_info): Add has_dos_filenames_only status flag. Implement accessors. * path.cc (symlink_info::check): Rearrange variable definitions to clear them up. Add a restart label to allow a clean restart within the method. Add a check for broken filesystems only allowing DOS pathnames in case we encounter a STATUS_OBJECT_NAME_NOT_FOUND status. If all checks point to one of that, restart method with tweaked incoming path. Add lengthy comments to explain what we do.
* * path.cc (symlink_info::check): Fix a comment.Corinna Vinschen2010-04-221-5/+5
|
* * path.cc (cygwin_create_path): Free memory on error.Christopher Faylor2010-04-201-4/+7
|
* * path.cc (path_conv::set_normalized_path): Use crealloc_abort to avoid aChristopher Faylor2010-04-091-1/+1
| | | | | | memory leak. * path.h (path_conv::operator =): Just use cstrdup to allocate normalized_path, avoiding attempt to free a pointer which is allocated in another pc.
* * spawn.cc (find_exec): Enable finding paths in backslash notation,Corinna Vinschen2010-03-291-0/+10
| | | | | | | especially for the exec[vl]p functions. * path.cc (symlink_info::check): Disable returning directories with suffix appended here.
* * path.cc (warn_msdos): Enforce extended hex printing of multibyteCorinna Vinschen2010-02-201-2/+2
| | | | pathnames.
* * path.cc (path_conv::check): Treat native DOS paths as "noacl".Corinna Vinschen2010-02-151-5/+7
|
* * path.cc (symlink_info::check_nfs_symlink): Reopen file withCorinna Vinschen2010-02-061-0/+7
| | | | | FILE_READ_EA access since, surprisingly, you need it to read EAs even on NFS.
* Throughout, use FileBothDirectoryInformation info class rather thanCorinna Vinschen2010-01-291-15/+19
| | | | | | | | | | | | | | | | | | FileDirectoryInformation info class to avoid problems with incomplete filesystem implementations. Fix comments accordingly. * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Set fname->Length to 0 in error case to avoid potential crash in debug output. (fhandler_disk_file::readdir): Try to speed up the working default case. Check for STATUS_INVALID_NETWORK_RESPONSE as potential status value returned by filesystems not implementing FileIdBothDirectoryInformation. * ntdll.h (STATUS_INVALID_NETWORK_RESPONSE): Define. (FILE_BOTH_DIRECTORY_INFORMATION): Rename to official name. * path.cc (symlink_info::check): Don't request FILE_READ_EA access, it's not required for NFS. Try to speed up the working default case. Check for STATUS_INVALID_NETWORK_RESPONSE as potential status value returned by filesystems not supporting non-NULL EA parameters. Fix the way fs.update is called. Improve debug output.
* * globals.cc (ro_u_nwfs): New R/O unicode string.Corinna Vinschen2010-01-121-7/+9
| | | | | | | | | | | | | * mount.cc (fs_info::update): Check for NWFS filesystem. Set has_buggy_basic_info, if so. Add comment to explain why. (fillout_mntent): Add "nwfs" string to fs_names array. * mount.h (enum fs_info_type): Add nwfs. (class fs_info): Add has_buggy_basic_info status flag. Add accessors for has_buggy_basic_info and is_nwfs. * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Accommodate filesystems with broken FileBasicInformation handling. * path.cc (symlink_info::check): Ditto. * path.h (path_conv::has_buggy_basic_info): Add method.
* * dtable.cc (build_fh_name_worker): Remove. Move all functionalityCorinna Vinschen2010-01-121-15/+2
| | | | | | | | | | | | | | | | | | back into build_fh_name. (build_fh_name): Drop unused HANDLE parameter. Drop call to pc.fillin. Remove disabled build_fh_name with UNICODE_STRING name parameter. * dtable.h (build_fh_name): Drop HANDLE parameter from declaration. Remove declaration for build_fh_name with UNICODE_STRING name parameter. * path.cc (path_conv::fillin): Remove. (symlink_info::check): Fix comment. * path.h (path_conv::fillin): Remove declaration. * dir.cc: Accommodate change in build_fh_name parameters throughout. * sec_acl.cc: Ditto. * syscalls.cc: Ditto. * ntea.cc (getxattr_worker): Fix debug output. (setxattr_worker): Ditto. * times.cc (utimens_worker): Ditto.
* * path.cc (symlink_info::check): Set fileattr toCorinna Vinschen2009-12-241-1/+6
| | | | FILE_ATTRIBUTE_DIRECTORY in a certain error condition. Explain why.
* * path.cc (cygwin_conv_path): Add band-aid including comment to avoidCorinna Vinschen2009-12-211-1/+20
| | | | conversion from POSIX "." to Win32 ".\\".
* * fhandler_disk_file.cc (is_volume_mountpoint): Align check withCorinna Vinschen2009-11-101-14/+18
| | | | | | symlink_info::check_reparse_point(). * path.cc (symlink_info::check_reparse_point): Rearrange slightly. Add code path for unrecognized repare point types. Add comment.
* * path.cc (symlink_info::check_reparse_point): Always checkCorinna Vinschen2009-11-091-6/+3
| | | | | | | SubstituteName for volume string to recognize volume mount points. Reuse subst when calling sys_wcstombs. * syscalls.cc (rename): Set errno to EBUSY when trying to rename volume mount points. Explain why.
* * miscfuncs.h (transform_chars): Declare. Define inline variation here.Corinna Vinschen2009-11-021-57/+0
| | | | | | | | | | | | | * mount.cc (mount_info::from_fstab): Remove extern declaration of transform_chars. * path.cc (tfx_chars): Move to strfuncs.cc. (transform_chars): Ditto. * strfunc.cc (tfx_chars): Moved here from path.cc. (transform_chars): Ditto. (sys_cp_wcstombs): Make UNICODE private use area conversion roundtrip save for all characters. (sys_cp_mbstowcs): Ditto, by removing special case for UTF-8 sequences representing U+f0XX UNICODE chars. Fix typo in comment.