summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Change many cygheap allocation routines to their *_abort analogs.Christopher Faylor2007-11-261-8/+8
| | | | | | * cygheap.cc (cmalloc_abort): New function. (crealloc_abort): Ditto. (ccalloc_abort): Ditto.
* revert premature checkinChristopher Faylor2007-11-081-1/+1
|
* * dllfixdbg: Eliminate extra objcopy step.Christopher Faylor2007-11-081-1/+1
|
* * external.cc (get_cygdrive_info): Make inline.Corinna Vinschen2007-10-311-2/+2
| | | | | | | (get_cygdrive_prefixes): Remove. (cygwin_internal): Call get_cygdrive_info with NULL flag parameters instead of get_cygdrive_prefixes. * path.cc (mount_info::get_cygdrive_info): Allow NULL flag parameters.
* * cygheap.h (struct cwdstuff): Drop hash member. Drop get_hash,Corinna Vinschen2007-10-231-176/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | get_initial, and fixup_after_exec declarations. Convert win32 to UNICODE_STRING. (cwdstuff::get_drive): Convert win32 path in current codepage. (cwdstuff::set): Take native NT path. * ntdll.h (struct _TEB): Typedef. * path.cc (mount_info::conv_to_posix_path): Add variant taking wide char DOS paths. (symlink_info::posixify): Simplify concatenating cwd and relative path. (hash_path_name): Drop special relative path handling. (chdir): Drop special "drive only" handling. Call cwdstuff::set with native path. (cwdstuff::get_hash): Remove. (windows_system_directory): Remove. (_upp): Remove. (get_user_proc_parms): Make inline. Get PEB pointer by calling NtCurrentTeb. (cwdstuff::init): Simplify. (cwdstuff::set): Rework to handle incoming native NT path. Workaround a Vista problem with CWD handle in the user process parameter block. (cwdstuff::get): Simplify locking. Accommodate type change of win32. * shared_info.h (mount_info): Add declaration for new conv_to_posix_path method. * strfuncs.cc (sys_wcstombs): Return correct length of created multi-byte string.
* * ntdll.h (STATUS_END_OF_FILE): Define.Corinna Vinschen2007-10-131-18/+32
| | | | | | | * path.cc (symlink_info::check_shortcut): Use NT function to get file size. Reintroduce checking file size before reading it. Eliminiate close_it label. (symlink_info::check_sysfile): Check for EOF condition.
* * path.cc (basename): Return pointer into the path argument itself.Corinna Vinschen2007-10-111-15/+21
| | | | | Shrink buf to 4 bytes. Use buf only for border cases. (dirname): Ditto.
* * path.cc (struct symlink_info): Change size of contents member toCorinna Vinschen2007-10-101-227/+274
| | | | | | | | | | | | | | | | | | | | | | be able to keep SYMLINK_MAX sized strings. (symlink_worker): Rework for long path names. When writing windows shortcuts, store pathname additionally "hidden" after the actual shortcut data to workaround size limitations of the description field. (symlink_info::check_shortcut): Drop file name parameter. Drop max file size check. Use NT functions. Use appended full path if available, description otherwise. Check symlink string length for not exceeding SYMLINK_MAX. Don't close file here. (symlink_info::check_sysfile): Drop file name parameter. Use NT functions. Check symlink string length for not exceeding SYMLINK_MAX. Don't close file here. (symlink_info::check_reparse_point): Drop file name parameter. Drop useless length checks. Allow SYMLINK_MAX length symlink strings. Don't close file here. (symlink_info::posixify): Allow SYMLINK_MAX length symlink strings. (symlink_info::check): Turn around checking for symlink file attributes. Use NT functions. Close symlink file here. * include/limits.h (PATH_MAX): Define as 32760. Change comment. (SYMLINK_MAX): Define as PATH_MAX - 1.
* * path.cc (symlink_info::check): Check for STATUS_OBJECT_NAME_INVALID.Corinna Vinschen2007-09-181-2/+12
| | | | Add comment.
* * ntdll.h (STATUS_NO_SUCH_FILE): Define.Corinna Vinschen2007-08-231-31/+76
| | | | | | * path.cc (get_nt_native_path): Reset upath.Length to 0 on each invocation. (symlink_info::check): Use NT native functions.
* * ntdll.h (NtNotifyChangeDirectoryFile): Declare.Corinna Vinschen2007-08-211-23/+63
| | | | | | | | | | | | | | (NtQueryAttributesFile): Move to maintain alphabetical order of declarations. Add comment to note that timestamp information returned by NtQueryAttributesFile is unreliable. * path.h (etc::changed_h): Move here. (etc::fn): Change type to OBJECT_ATTRIBUTES. (etc::last_modified): Change type to LARGE_INTEGER. (etc::init): Take PUNICODE_STRING as second argument. * path.cc: Accomodate above changes. (etc::test_file_change): Use NT native functions. (etc::dir_changed): Ditto. * uinfo.cc (pwdgrp::load): Call etc::init with NT native path.
* * path.cc (fillout_mntent): Append backslash to drive-only paths beforeCorinna Vinschen2007-08-191-0/+4
| | | | | | calling fs_info::update. * path.h (fs_info::clear): Simplify. (fs_info::fs_info): Add constructor.
* * path.h (path_conv::operator char *): Delete.Corinna Vinschen2007-08-161-11/+12
| | | | | | | | | | | | | (path_conv::operator const char *): Delete. * dlfcn.cc: Throughout, replace path_conv::operator char * and path_conv::operator const char * by call to path_conv::get_win32 for easier transition to UNICODE_PATHs. * fhandler_socket.cc: Ditto. * hookapi.cc: Ditto. * path.cc: Ditto. * spawn.cc: Ditto. * syscalls.cc: Ditto. * uinfo.cc: Ditto.
* * ntdll.h (RtlAcquirePebLock): Declare.Corinna Vinschen2007-08-161-5/+4
| | | | | (RtlReleasePebLock): Declare. * path.cc (cwdstuff::set): Change PEB only while it's locked.
* * ntdll.h (RtlCreateUnicodeStringFromAsciiz): Fix declaration.Corinna Vinschen2007-08-161-45/+35
| | | | | | | | | | | | (RtlUpcaseUnicodeChar): Declare. * path.cc (hash_path_name): Split into three functions, taking the path as char *, PWCSTR, or PUNICODE_STRING. Move implementation into PUNICODE_STRING-based function. Drop old drive-relative path consideration. * winsup.h (iswdirsep): Like isdirsep but for WCHARs. (isabspath_u): Like isabspath, for PUNICODE_STRINGs. (iswabspath): Like isabspath, for PWCHARs. (hash_path_name): Add new declarations.
* * path.cc (get_nt_native_path): Allow to convert special paths whichCorinna Vinschen2007-08-151-4/+6
| | | | | | have no native NT path representation for simplified debug output. * syscalls.cc: Convert debug output to print native NT path. (unlink): Drop redundant debug output.
* * path.cc (symlink_info::check): In case of ERROR_SHARING_VIOLATION andCorinna Vinschen2007-08-141-3/+16
| | | | | ERROR_ACCESS_DENIED, try to get file attributes by using directory functions.
* * path.cc (fs_info::update): Correctly handle the volume root directory.Corinna Vinschen2007-08-141-2/+5
|
* * fhandler.h (fhandler_base::pc): Make public.Corinna Vinschen2007-08-141-6/+0
| | | | | | | | | | | | | | | * fhandler_disk_file.cc (fhandler_disk_file::link): Drop extern declaration of stat_suffixes. Use NT native path in debug output. (fhandler_base::utimes_fs): Simplify closeit case. Use close_fs to close newly opened file handle. (fhandler_base::open_fs): Use NT native path in debug output. * path.cc: Throughout drop extern declaration of stat_suffixes. * path.h (stat_suffixes): Declare. * sec_acl.cc (acl_worker): Drop extern declaration of stat_suffixes. * times.cc (utimes_worker): Take path_conv as parameter instead of single-byte pathnam, drop nofollow argument, accommodate throughout. Compare UNICODE paths when enumerating file descriptors. Fix formatting. Use NT native path in debug output.
* * devices.in (dev_storage): Use native NT device name for kmsg mailslot.Corinna Vinschen2007-08-131-10/+0
| | | | | | | | | | | | | | | * devices.cc: Regenerate. * fhandler.cc (fhandler_base::operator =): Use path_conv assignment operator. (fhandler_base::set_name): Ditto. (fhandler_base::open): Use NT native path in debug output. * fhandler_mailslot.cc: Convert to NT native function calls. * ntdll.h (struct _FILE_MAILSLOT_SET_INFORMATION): Define. (NtCreateMailslotFile): Declare. * path.cc (path_conv::set_normalized_path): Don't set wide_path to NULL. (path_conv::set_name): Remove unused function. * path.h (path_conv::set_name): Drop declaration. (path_conv::operator =): Define.
* * fhandler.cc (fhandler_base::open): Remove HIDDEN_DOT_FILES code.Corinna Vinschen2007-08-121-5/+0
| | | | | * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Ditto. * path.cc (symlink_worker): Ditto.
* * path.cc (fillout_mntent): Fix calculation of unicode buffer size.Corinna Vinschen2007-08-101-1/+2
|
* * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): DropCorinna Vinschen2007-08-011-83/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | usage of path_conv::volser(). (fhandler_base::fstat_by_name): Ditto. * ntdll.h (STATUS_NO_MEDIA_IN_DEVICE): Define. (STATUS_OBJECT_NAME_NOT_FOUND): Define. (FILE_REMOVABLE_MEDIA, FILE_READ_ONLY_DEVICE, FILE_FLOPPY_DISKETTE) (FILE_WRITE_ONCE_MEDIA, FILE_REMOTE_DEVICE, FILE_DEVICE_IS_MOUNTED) (FILE_VIRTUAL_VOLUME, FILE_AUTOGENERATED_DEVICE_NAME) FILE_DEVICE_SECURE_OPEN): Define Device Characteristics. (struct _FILE_FS_DEVICE_INFORMATION): Define. * path.cc (MAX_FS_INFO_CNT): Remove. (fsinfo): Remove. (fsinfo_cnt): Remove. (fs_info::update): Rewrite using native NT functions. Drop fs_info cashing since it's incorrect. (path_conv::fillin): Use NtQueryInformationFile. Drop setting serial number. (path_conv::check): Accommodate new fs_info::update parameters. (fillout_mntent): Ditto. * path.h (fs_info): Drop serial, has_ea and drive_type status flags. (fs_info::update): Declare with new parameters. (path_conf::drive_type): Remove. (path_conf::fs_has_ea): Remove. (path_conf::volser): Remove.
* * fhandler_disk_file.cc (fhandler_disk_file::link): Revert to checkingCorinna Vinschen2007-07-311-0/+10
| | | | | | | | | | for binary in case of .exe files. * ntdll.h (RtlPrefixUnicodeString): Declare. * path.cc (path_conv::is_binary): New method. * path.h (path_conv::is_binary): Declare. * syscalls.cc (rename_append_suffix): New static helper function for rename. (rename): Rewrite. New suffix tests. Use native NT functions.
* * dir.cc (readdir_worker): Drop dir parameter from call toCorinna Vinschen2007-07-261-5/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | readdir_get_ino. * fhandler.h (fhandler_disk_file::readdir_helper): Switch file name parameter to PUNICODE_STRING. * fhandler_disk_file.cc: Drop including ntdef.h. (class __DIR_mounts): Store mount points in UNICODE. Additionally store cygdrive prefix in unicode here. Change methods accordingly. (__DIR_mounts::eval_ino): Call new stat_worker instead of lstat64. (__DIR_mounts::~__DIR_mounts): New destructor to free UNICODE buffers. (path_conv::ndisk_links): Rewrite using native NT functions. (fhandler_base::fstat_by_handle): Use NAME_MAX instead of CYG_MAX_PATH. Always set pfvi->VolumeSerialNumber to non-0. Remove last resort code. (fhandler_base::fstat_by_name): Rewrite using native NT functions. (fhandler_base::fstat_fs): Always call fstat_by_name if fstat_by_handle fails. (fhandler_base::fstat_helper): Rely on dwVolumeSerialNumber. (fhandler_disk_file::facl): Call fstat_by_name if fstat_by_handle fails. (DIR_BUF_SIZE): Define using NAME_MAX instead of CYG_MAX_PATH. (__DIR_cache): Remove __name. (d_dirname): Remove. (fhandler_disk_file::opendir): Drop pathname length check. Remove outdated comment. Use get_name method instead of accessing pc.normalized_path directly. (readdir_get_ino): Drop unused dir parameter. Accomodate throughout. Allocate fname dynamically. Call new stat_worker instead of lstat64. Call NtOpenFile instead of CreateFile. Call NtClose instead of CloseHandle. (fhandler_disk_file::readdir_helper): Use native NT functions. Check for volume mount points and use correct inode number. (fhandler_disk_file::readdir): Simplify slightly. Use get_name instead of pc.normalized_path. (fhandler_disk_file::rewinddir): Use RtlInitUnicodeString. (fhandler_cygdrive::fstat): Ignore floppy drives. Set st_nlink correctly. (fhandler_cygdrive::readdir): Ignore floppy drives. * fhandler_netdrive.cc (fhandler_netdrive::readdir): Accommodate change to readdir_get_ino. * fhandler_proc.cc (PROC_DIR_COUNT): Define. (fhandler_proc::fstat): Evaluate correct link count for /proc. * ntdll.h (struct _FILE_DIRECTORY_INFORMATION): Define. (NtFsControlFile): Declare. (RtlAppendUnicodeToString): Declare. (RtlAppendUnicodeStringToString): Declare. (RtlCompareUnicodeString): Declare. (RtlCopyUnicodeString): Declare. (RtlCreateUnicodeStringFromAsciiz): Declare. (RtlEqualUnicodeString): Declare. (RtlFreeUnicodeString): Declare. (RtlInitEmptyUnicodeString): Declare. (RtlSecondsSince1970ToTime): Declare. (RtlInitEmptyUnicodeString): Define as inline function. (RtlInitCountedUnicodeString): Define as inline function. * path.cc (path_conv::check): New method with PUNICODE_STRING as path, preliminary implementation. (mount_info::get_mounts_here): Change to create UNICODE_STRINGs. Also copy cygpath prefix into UNICODE_STRING. (is_floppy): Drop 9x consideration. * path.h: Drop including ntdef.h. (path_conv::check): Add declaration. (path_conv::path_conv): Add constructor for UNICODE_STRING paths. * shared_info.h (mount_info::get_mounts_here): Change declaration. * syscalls.cc: Drop forward declaration of stat_worker. (stat_worke): Take path_conv as parameter. Drop nofollow flag. (stat64): Create matching path_conv and call stat_worker with it. (lstat64): Ditto. * winsup.h: Include ntdef.h. (stat_worker): Declare. (readdir_get_ino): Change declaration.
* * fhandler.cc (fhandler_base::open): Drop local wpath and upathCorinna Vinschen2007-07-191-2/+41
| | | | | | | | | | | | | | | | | variables. Call pc.get_object_attr to create object attributes. * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto. * syscalls.cc (unlink_nt): Ditto. * path.cc (path_conv::set_normalized_path): Set wide_path to NULL. (path_conv::get_nt_native_path): Drop parameter. Create path in wide_path/uni_path members. (path_conv::get_object_attr): New method to create object attributes. (path_conv::get_wide_win32_path): New method to create Win32 wide path. (path_conv::check): Initialize wide_path to NULL. (path_conv::~path_conv): cfree wide_path. * path.h (class path_conv): New members wide_path and uni_path. Add declarations of get_object_attr and get_wide_win32_path. (path_conv::path_conv): Initialize wide_path to NULL. (path_conv::get_nt_native_path): Drop parameter.
* * path.cc (symlink_info::check_shortcut): Handle device "symlinks" specially -Christopher Faylor2007-07-071-2/+6
| | | | don't posixify them.
* * path.cc (cwdstuff::set): Revert useless acquire check.Corinna Vinschen2007-05-221-2/+1
|
* * path.cc (cwdstuff::set): Avoid double aquiring of cwd_lock.Corinna Vinschen2007-05-221-2/+3
| | | | Open directory with inheriting enabled.
* * path.cc (fs_info::update): Set and use is_cdrom.Christopher Faylor2007-05-151-8/+31
| | | | | | | | | | | * path.cc (fillout_mntent): Set ret.mnt_type to something more Linux-like, based on data from fs_info. Move "system" and "user" strings from mnt_type to mnt_opts. * path.h (struct fs_info): Add is_cdrom field. * path.h (fs_info::clear): Initialize is_cdrom. * path.h (struct fs_info): Add IMPLEMENT_STATUS_FLAG(bool,is_cdrom). * path.h (class path_conv): Add fs_is_cdrom method. Add missing fs_is_netapp method.
* * Makefile (DLL_OFILES): Remove ntea.oChristopher Faylor2007-03-011-4/+0
| | | | | | | | | | | | | | * environ.cc (set_ntea): Delete. (parse_thing): Delete "ntea" setting. * fhandler.cc (fhandler_base::open): Remove allow_ntea considerations. (check_posix_perm): Ditto. * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Ditto. (fhandler_base::open_fs): Ditto. (fhandler_disk_file::mkdir): Ditto. * path.cc (symlink_worker): Ditto. * security.cc (get_file_attribute): Ditto. (set_file_attribute): Ditto. * security.h: Remove allow_ntea declaration.
* * path.cc (close_user_proc_parms_cwd_handle): Remove.Corinna Vinschen2007-02-271-27/+16
| | | | | | | | | (cwdstuff::init): Don't call close_user_proc_parms_cwd_handle. Call set to set cwd with all-sharing handle. (cwdstuff::set): Fix comment. Don't close cwd handle. Set in user parameter block instead and close old cwd handle. * syscalls.cc (rename): Call unlink_nt instead of RemoveDirectory or DeleteFile to allow deleting shared files/directories.
* * cygheap.h (struct cwdstuff): Remove sync member and keep_in_syncCorinna Vinschen2007-02-221-90/+53
| | | | | | | | | | | | | | | accessors. * external.cc (cygwin_internal): Drop call to cygheap->cwd.keep_in_sync. * fhandler_disk_file.cc (fhandler_disk_file::link): Always presume ability to create hard links. * path.cc (cwdstuff::init): Drop 9x considerations. (cwdstuff::keep_in_sync): Remove. (cwdstuff::set): Take NT for granted. * pinfo.h (cygwin_pid): Just return pid. * wincap.cc: Remove has_hard_links, can_open_directories, has_negative_pids, has_named_pipes, has_try_enter_critical_section, cant_debug_dll_entry and detect_win16_exe throughout. * wincap.h: Ditto.
* Throughout replace all usage of wincap.shared with the constantCorinna Vinschen2007-02-221-1/+2
| | | | | | | FILE_SHARE_VALID_FLAGS. * fhandler.cc (fhandler_base::open_9x): Drop local variable shared. * wincap.cc: Remove shared member throughout. * wincap.h: Ditto.
* Remove extraneous whitespace.Christopher Faylor2007-02-201-10/+10
| | | | | | * pinfo.cc (commune_process): Use default argument to lock_process. * sigproc.cc: Update copyright. * select.cc: Ditto.
* * Makefile.in (DLL_OFILES): Add fhandler_procnet.o.Corinna Vinschen2007-01-171-5/+2
| | | | | | | | | | | | | | | | | | | | | | * autoload.cc (GetAdaptersAddresses): Define. * devices.h (FH_PROCNET): Define new device. * devices.in (dev_procnet_storage): Add "/proc/net" entry. * devices.cc: Regenerate. * dir.cc (readdir_worker): Use isproc_dev macro. * dtable.cc (build_fh_pc): Add FH_PROCNET. * fhandler.h (class fhandler_procnet): New class. * fhandler_proc.cc: Add "net" subdirectory handling. * fhandler_procnet.cc: New file handling "/proc/net" directory. * path.cc (isvirtual_dev): Move to path.h. * path.h (isproc_dev): New macro to identify /proc files by device. (isvirtual_dev): Moved here. Define using isproc_dev. * syscalls.cc (unlink): Use isproc_dev macro. * wincap.h (wincapc::has_gaa_prefixes): New element. (wincapc::has_gaa_on_link_prefix): New element. * wincap.cc: Implement above elements throughout. (wincapc::init): Check XP for service pack and set has_gaa_prefixes appropriately. * include/cygwin/in6.h: Include asm/byteorder.h.
* * autoload.cc (RtlAnsiStringToUnicodeString): Define.Corinna Vinschen2007-01-161-15/+74
| | | | | | | | | | | | | | | | | | | | | (RtlOemStringToUnicodeString): Define. * ntdll.h (struct _RTL_USER_PROCESS_PARAMETERS): Define. (struct _PEB): Redefine with a bit of content. (RtlAnsiStringToUnicodeString): Declare. (RtlOemStringToUnicodeString): Declare. * path.cc: Include ntdll.h. (_upp): New global variable pointing to user process parameter block. (get_user_proc_parms): New static function to retrieve user process parameter block. (close_user_proc_parms_cwd_handle): New function to close handle to current working directory in user process parameter block. (cwdstuff::init): Drop redundant declaration of dynamically_loaded. Set current dir only on 9x. Call close_user_proc_parms_cwd_handle on NT instead. (cwdstuff::keep_in_sync): Only on 9x. (cwdstuff::set): Keep behaviour on 9x. On NT write cwd path into user process parameter block and set cwd handle to NULL. Fix comments to reflect new behaviour.
* * environ.cc (set_traverse): Remove.Corinna Vinschen2006-12-121-6/+0
| | | | | | | | | | | (parse_thing): Drop "traverse" option. * path.cc (fs_info::update): Don't request SE_CHANGE_NOTIFY_PRIV privilege. * sec_helper.cc (set_cygwin_privileges): Ditto. * security.cc (allow_traverse): Remove. (alloc_sd): Drop special allow_traverse code. * security.h (allow_traverse): Drop declaration. * syscalls.cc (statvfs): Don't request SE_CHANGE_NOTIFY_PRIV privilege.
* * autoload.cc (SHFileOperationA): Drop definition.Corinna Vinschen2006-12-101-2/+9
| | | | | | | | | | | | | | | | | | | * ntdll.h (struct _FILE_RENAME_INFORMATION): Define. * path.cc (fs_info::update): Note length of rootdir prefix in root_len. (get_nt_native_path): New function, taking over functionality of path_conv::get_nt_native_path. (path_conv::get_nt_native_path): Just call get_nt_native_path. * path.h (get_nt_native_path): Declare. (struct fs_info): New member root_len. (fs_info::length): New inline method returning root_len. (path_conv::rootdir): New inline method returning rootdir prefix. * syscalls.cc (try_to_bin): Rewrite using only system calls. (unlink_nt): Call try_to_bin with additional handle to open file parameter. (statvfs): Use path_conv::rootdir method. * wincap.h: Define has_recycle_dot_bin throughout. * wincap.cc: Ditto.
* * cygheap.h (struct cwdstuff): Add "sync" member and accompanyingCorinna Vinschen2006-12-071-31/+54
| | | | | | | | | | "keep_in_sync" methods. * external.cc (cygwin_internal): Call above keep_in_sync method when CW_SYNC_WINENV is requested. * path.cc (cwdstuff::init): Don't change to windows_system_directory if keep_in_sync is requested. (cwdstuff::keep_in_sync): New method. (cwdstuff::set): Take sync flag into account.
* * path.cc (cwdstuff::init): Don't change to windows_system_directoryCorinna Vinschen2006-12-051-4/+8
| | | | if Cygwin DLL has been loaded dynamically.
* * path.cc (cwdstuff::set): Don't try to open directory on systems notCorinna Vinschen2006-12-051-7/+10
| | | | supporting that.
* * dir.cc (mkdir): Check last path component for "..".Corinna Vinschen2006-11-301-18/+58
| | | | | | | | | | | | | | | | | | | | | (rmdir): Don't check last path component for "..". * fhandler_disk_file.cc (fhandler_disk_file::rmdir): Drop kludge which tries to allow deleting the current working directory. * path.cc (has_dot_last_component): Add parameter to indicate testing for "..". Take trailing slash into account. (symlink_info::posixify): Rely on cygheap->cwd.win32 having a useful value. (cwdstuff::init): Initialize cygheap->cwd with current working directory. Change to windows_system_directory afterwards. (cwdstuff::set): Never call SetCurrentDirectory here. Just check if changing into target directory would be allowed. Add comment to explain why. * path.h (has_dot_last_component): Declare with second parameter. * pinfo.cc (pinfo::zap_cwd): Remove. (pinfo::exit): Drop call to zap_cwd. * pinfo.h (class pinfo): Remove declaration of zap_cwd. * spawn.cc (spawn_guts): Set current working directory for non-Cygwin child applications. Drop call to zap_cwd.
* * path.cc (fs_info::update): Define GETVOLINFO_VALID_MASK and TEST_GVI.Corinna Vinschen2006-11-231-11/+29
| | | | | | | | Change FS_IS_SAMBA and FS_IS_SAMBA_WITH_QUOTA and their usage accordingly. Define FS_IS_NETAPP_DATAONTAP. Recognize NetApp device and store in is_netapp flag. Mark NetApp device as having no good inodes. * path.h (struct fs_info): Add is_netapp flag. Add matching accessors.
* * fhandler.cc (check_posix_perm): Moved here from syscalls.cc.Corinna Vinschen2006-11-071-1/+1
| | | | | | | | | | | | | | | | (fhandler_base::fpathconf): New method implementing (f)pathconf. * fhandler.h (class fhandler_base): Declare fpathconf method. * path.cc (path_conv::check): Replace MAX_LINK_DEPTH with SYMLOOP_MAX. * path.h (MAX_LINK_DEPTH): Delete. * syscalls.cc (check_posix_perm): Move to fhandler.cc. (fpathconf): Call fhandler's fpathconf method. (pathconf): Build fhandler and call fhandler's fpathconf method. * sysconf.cc (sysconf): Reorder switch according to order of flags in sys/unistd.h. Add handling for some missing flags. * include/limits.h: Reorder according to SUSv3 description. Add some missing definitions. Add comments. * include/sys/syslimits.h: New file overriding newlib's syslimits.h file.
* * path.cc (symlink_info::posixify): Fix comment.Corinna Vinschen2006-11-021-2/+2
|
* * path.cc (symlink_info::check): Eliminate PATH_REP bit from pflags.Corinna Vinschen2006-11-021-1/+1
|
* * path.cc (symlink_info::posixify): New mothod converting NT and DOSCorinna Vinschen2006-11-021-27/+77
| | | | | | | | | | | paths in symlinks to POSIX. (symlink_info::check_shortcut): Allocate buf allowing for a trailing 0. Call posixify on the result. (symlink_info::check_sysfile): Read from file into local buffer. Eliminate old b16 considerations. Call posixify on the result. (symlink_info::check_reparse_point): Don't use PrintName but SubstituteName which is relevant for Windows' path handling. Call posixify on the result.
* * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): DropCorinna Vinschen2006-10-311-11/+76
| | | | | | | | | | | | | | directory attribute for reparse points to avoid mistreating. (fhandler_base::fstat_by_name): Ditto. * path.cc (symlink_info::check_reparse_point): New method testing reparse points for symbolic links. (symlink_info::check_shortcut): Move file attribute tesat to calling function. (symlink_info::check): Add handling for reparse points. * path.h (enum path_types): Add PATH_REP to denote reparse point based symlinks. (path_conv::is_rep_symlink): New method. * syscalls.cc (unlink): Handle reparse points.
* * path.cc (path_conv::get_nt_native_path): Properly detect \\?\ paths.Corinna Vinschen2006-10-091-4/+5
| | | | | | (mount_info::conv_to_win32_path): Update comment. * fhandler_disk_file.cc (path_conv::ndisk_links): Use backslashes to make NT kernel functions work for \\?\GLOBALROOT paths.