summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* * environ.cc (env_win32_to_posix_path_list): Declare.Christopher Faylor2006-08-021-1/+16
| | | | | | | | | | (conv_envvars): Use env_win32_to_posix_path_list rather than cygwin_win32_to_posix_path_list. (posify): Translate back to win32 path if errno is EIDRM. * environ.h: Update copyright. Define ENV_CVT. * path.cc (conv_path_list): If converting for the environment and removed an element set errno to ENV_CVT. (env_win32_to_posix_path_list): New function.
* * environ.cc (dos_file_warning): Declare.Christopher Faylor2006-08-011-6/+35
| | | | | | | | | | | | (parse_thing): Add "dosfilewarning". Alphabetize. * path.cc (normalize_posix_path): Return -1 when MS-DOS path detected. (warn_msdos): New function. (path_conv::check): Call if !PC_NOWARN and MS-DOS path detected. (cygwin_conv_to_win32_path): Set PC_NOWARN when calling path_conv. (cygwin_conv_to_full_win32_path): Ditto. * path.h (pathconv_arg::PC_NOWARN): Define. * shared_info.h (user_info::warned_msdos): New field. (CURR_USER_MAGIC): Reset.
* * path.cc (symlink_worker): Return EEXIST if newpath exists.Corinna Vinschen2006-07-191-1/+2
|
* * path.cc (path_conv::check): Ignore has_ea setting, it's always unsetCorinna Vinschen2006-07-051-39/+1
| | | | | | | | | at this point anyway. (get_symlink_ea): Remove. (set_symlink_ea): Remove. (symlink_worker): Drop writing symlink into NTFS extended attributes. (symlink_info::check): Drop reading symlinks from NTFS extended attributes.
* * autoload.cc (NtQueryEaFile): Define.Corinna Vinschen2006-07-031-20/+19
| | | | | | | | | | | | | | | | | | | | | | | (NtSetEaFile): Define. * fhandler.cc (fhandler_base::open): Use appropriate open flags in query case when allow_ntea is set. * ntdll.h (struct _FILE_GET_EA_INFORMATION): Define. (struct _FILE_FULL_EA_INFORMATION): Define. (NtQueryEaFile): Declare. (NtSetEaFile): Declare. * ntea.cc (read_ea): Rename from NTReadEA and rewrite using NtQueryEaFile. (write_ea): Rename from NTWriteEA and rewrite using NtSetEaFile. * path.cc (get_symlink_ea): Make static. Add handle parameter to accomodate new read_ea call. (set_symlink_ea): Make static. Add handle parameter to accomodate new write_ea call. (symlink_worker): Call set_symlink_ea while file is still open. (symlink_info::check): Call get_symlink_ea after file has been opened. * security.cc (get_file_attribute): Accomodate new read_ea call. (set_file_attribute): Accomodate new write_ea call. * security.h (read_ea): Change declaration accordingly. (write_ea): Ditto.
* white spaceChristopher Faylor2006-05-281-8/+8
|
* * fhandler.h (fhandler_base): Change fstat_helper prototypeCorinna Vinschen2006-04-261-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | to take file size and inode number as 64 bit values. * fhandler_disk_file.cc (FS_IS_SAMBA): Move to path.cc (FS_IS_SAMBA_WITH_QUOTA): Ditto. (path_conv::hasgood_inode): Delete. (path_conv::is_samba): Delete. (path_conv::isgood_inode): Centralized function to recognize a good inode number. (fhandler_base::fstat_by_handle): Constify fvi_size and fai_size. Accomodate argument change in fstat_helper. (fhandler_base::fstat_by_name): Ditto. (fhandler_base::fstat_helper): Accomodate argument change. Call path_conv::isgood_inode to recognize good inodes. (fhandler_disk_file::opendir): Explain Samba weirdness here. Call path_conv::fs_is_samba instead of path_conv::is_samba. (fhandler_disk_file::readdir): Add STATUS_INVALID_INFO_CLASS as valid return code from NtQueryDirectoryFile to indicate that FileIdBothDirectoryInformation is not supported. Call path_conv::isgood_inode to recognize good inodes. * ntdll.h (STATUS_INVALID_INFO_CLASS): Define. * path.cc (fs_info::update): Rework file system recognition and set appropriate flags. * path.h (struct fs_info): Add is_ntfs, is_samba and is_nfs flags. Constify pure read accessors.
* * include/sys/dirent.h (struct __DIR): Rename __d_unused toCorinna Vinschen2006-03-011-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | __d_internal. * fhandler_disk_file.cc (struct __DIR_cache): Remove useless "typedef". (d_dirname): Remove useless "struct". (d_cachepos): Ditto. (d_cache): Ditto. (class __DIR_mounts): New class, implementing mount point tracking for readdir. (d_mounts): New macro for easy access to __DIR_mounts structure. (fhandler_disk_file::opendir): Allocate __DIR_mounts structure and let __d_internal element of dir point to it. (fhandler_disk_file::readdir_helper): Add mount points in the current directory, which don't have a real directory backing them. Don't generate an inode number for /dev. Add comment, why. (fhandler_disk_file::readdir): Move filling fname to an earlier point. Check if current entry is a mount point and evaluate correct inode number for it. (fhandler_disk_file::readdir_9x): Ditto. (fhandler_disk_file::rewinddir): Set all mount points in this directory to "not found" so that they are listed again after calling rewinddir(). (fhandler_disk_file::closedir): Deallocate __DIR_mounts structure. * path.cc (mount_info::get_mounts_here): New method to evaluate a list of mount points in a given parent directory. * shared_info.h (class mount_info): Declare get_mounts_here.
* * path.cc (conv_path_list): Eat empty paths when converting to POSIX.Christopher Faylor2006-02-171-16/+38
| | | | | (cygwin_conv_to_win32_path): Deal with Cygwin's necessity of adding a '/' to the end of a path ending in '.'.
* * environ.cc (struct parse_thing): Add transparent_exe option.Corinna Vinschen2006-02-051-5/+11
| | | | | | | | | | | | | | | | | * fhandler_disk_file.cc (fhandler_disk_file::link): Accomodate transparent_exe option. Add .exe suffix for links to executable files, if transparent_exe is set. * fhandler_process.cc (fhandler_process::fill_filebuf): Remove .exe suffix if transparent_exe option is set. * path.cc (symlink_worker): Accomodate transparent_exe option. (realpath): Don't tack on .exe suffix if transparent_exe is set. * syscalls.cc (transparent_exe): New global variable. (unlink): Accomodate transparent_exe option. (open): Ditto. (link): Ditto. (rename): Ditto. Maybe add .exe suffix when renaming executable files. (pathconf): Accomodate transparent_exe option. * winsup.h: Declare transparent_exe.
* * path.cc (suffix_scan::lnk_match): Return true beginning withCorinna Vinschen2006-02-031-8/+6
| | | | | | | | | SCAN_APPENDLNK. (suffix_scan::next): Rearrange code to make .lnk append order slightly more deterministic. * spawn.cc (exe_suffixes): Try no suffix before .exe suffix to align evaluation with stat_suffixes. (dll_suffixes): Ditto.
* * spawn.cc (find_exec): Only return files with execute permission setCorinna Vinschen2006-01-311-1/+1
| | | | | | | if ntsec is on. Don't check execute permission of Windows batch files. (av::fixup): Handle empty files gracefully. Drop execute permission test here. * path.cc (suffix_scan::next): Don't skip any suffix on first run.
* * path.cc (cwdstuff::set): Don't set win32 error, only POSIX errno.Corinna Vinschen2006-01-311-2/+3
|
* * path.cc (cwdstuff::set): When SetCurrentDirectory returnsCorinna Vinschen2006-01-311-0/+4
| | | | | ERROR_INVALID_FUNCTION, bend it over to ERROR_FILE_NOT_FOUND. Add comment to explain why.
* * fhandler_process.cc (fhandler_process::fill_filebuf): DisableCorinna Vinschen2006-01-241-2/+15
| | | | | | stripping the .exe suffix from the link target in PROCESS_EXE and PROCESS_EXENAME case. * path.cc (realpath): Tack on .exe suffix if necessary.
* * path.cc (dot_special_chars): Add ", <, >, and |.Christopher Faylor2006-01-041-3/+3
|
* * path.cc (path_conv::check): Rework loop removing trailing dotsCorinna Vinschen2005-12-271-9/+17
| | | | | | and spaces. * syslog.cc (vklog): Set facility to LOG_KERN if not set.
* whitespace cleanup to force snapshot.Christopher Faylor2005-12-221-6/+6
|
* * devices.h (_minor): Coerce argument to proper type before manipulating.Christopher Faylor2005-12-011-20/+16
| | | | | | | | | | | | | | | | | | | | | (_major): Ditto. (device::is_fs_special): New function. * fhandler_disk_file.cc (fhandler_base::fstat_helper): Set the size to 0 for devices rather than reporting the size of the symlink. (fhandler_disk_file::readdir): Use is_fs_special to determine if .lnk should be stripped. * path.cc: Rename symlink_info::is_symlink to symlink_info::issymlink throughout. (symlink_info::isdevice): New field. (path_conv::check): Use 'isdevice' to determine if just-parsed entity is a device rather than relying on non-zero major/minor. (symlink_info::parse_device): Set isdevice to true if we've discovered a device. (symlink_info::check): Clear isdevice field prior to processing. Use isdevice to control debugging output. (symlink_info::set): Set isdevice to false. * path.h (path_conv::is_fs_special): New function. * devices.cc: Regenerate.
* * dir.cc (mkdir): Abandon use of PC_WRITABLE.Christopher Faylor2005-10-121-8/+1
| | | | | | | (rmdir): Ditto. * path.h (PC_WRITABLE): Delete. * path.cc (path_conv::check): Remove PC_WRITABLE accommodations. Revisit later.
* * (symlink_info::set_error): Change to return bool if input error should beChristopher Faylor2005-10-111-7/+18
| | | | | ignored. (symlink_info::check): Treat path as a normal file if set_error returns false.
* * dir.cc (mkdir): Check for trailing /. or /.. component.Corinna Vinschen2005-09-291-0/+18
| | | | | | (rmdir): Ditto. * path.cc (has_dot_last_component): New function. * path.h (has_dot_last_component): Add declaration.
* Revert erroneous checkin.Corinna Vinschen2005-09-281-20/+15
|
* * fhandler.h (class fhandler_dev_raw): Delete current_position andCorinna Vinschen2005-09-281-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | eof_detected status flag. Delete is_eom and is_eof methods. Move drive_size, bytes_per_sector, eom_detected status flag, as well as the methods read_file, write_file, raw_read and raw_write to ... (class fhandler_dev_floppy): ... here. Remove is_eom and is_eof methods. Add dup method. * fhandler_floppy.cc (IS_EOM): New macro. (fhandler_dev_floppy::is_eom): Remove. (fhandler_dev_floppy::is_eof): Remove. (fhandler_dev_floppy::fhandler_dev_floppy): Initialize status flags. (fhandler_dev_floppy::get_drive_info): Only call EX functions on systems supporting them and stop suffering strange delays. (fhandler_dev_floppy::read_file): Move here, drop setting current_position. (fhandler_dev_floppy::write_file): Move here, drop setting current_position. (fhandler_dev_floppy::open): Rearrange comment. (fhandler_dev_floppy::dup): New method. (fhandler_dev_floppy::get_current_position): New inline method. Use instead of former current_position were appropriate. (fhandler_dev_floppy::raw_read): Move here. Drop EOF handling. (fhandler_dev_floppy::raw_write): Move here. Drop EOF handling. (fhandler_dev_floppy::lseek): Remove useless conditions. Convert sector_aligned_offset to LARGE_INTEGER to improve SetFilePointer call. (fhandler_dev_floppy::ioctl): Move blocksize check in RDSETBLK case to here. * fhandler_raw.cc (fhandler_dev_raw::is_eom): Remove. (fhandler_dev_raw::is_eof): Remove. (fhandler_dev_raw::write_file): Remove. (fhandler_dev_raw::read_file): Remove. (fhandler_dev_raw::raw_read): Remove. (fhandler_dev_raw::raw_write): Remove. (fhandler_dev_raw::dup): Drop copying removed members. (fhandler_dev_raw::ioctl): Drop blocksize testing. * wincap.h: Implement has_disk_ex_ioctls throughout. * wincap.cc: Ditto. (wincap_vista): Preliminary wincaps for Windows Vista/Longhorn. (wincapc::init): Add Vista/Longhorn handling.
* * cygthread.cc (cygthread::cygthread): Add more info to fatal error.Christopher Faylor2005-09-121-0/+2
| | | | | | * fhandler_disk_file.cc (fhandler_disk_file::readdir): Temporarily remove insertion of /dev into root directory. * path.cc (path_conv::check): Ditto.
* * path.cc (normalize_posix_path): Keep two leading slashesCorinna Vinschen2005-08-261-7/+26
| | | | | | | | intact throughout. (normalize_win32_path): Revert to only checking for slash. (realpath): Convert drive letters to cygdrive paths before doing anything else. * shared_info.h (mount_info::cygdrive_posix_path): Make public.
* * path.cc (realpath): Drop call to mount_info::conv_to_posix_pathCorinna Vinschen2005-08-251-11/+30
| | | | | | in favor of calling path_conv with PC_POSIX flag. Align error handling closer to POSIX. As on Linux, return user space allocated memory if second parameter is NULL.
* * path.cc (normalize_win32_path): Honor network paths. Fold moreCorinna Vinschen2005-08-251-8/+19
| | | | | than two leading dir separators into one. Check for dir separator instead of just slashes to handle incoming Win32 paths correctly.
* * path.cc (path_conv::check): Fill in fileattr for /dev, defaulting toChristopher Faylor2005-08-241-3/+7
| | | | | | directory if /dev doesn't actually exist. (win32_device_name): Don't consider FH_DEV to be a device since it's really a directory which should go through mount processing.
* * cygheap.h (cygheap_types): Add HEAP_COMMUNE.Christopher Faylor2005-08-241-1/+7
| | | | | | | | | | | | | | | | | | | | | * fhandler_proc.cc: Use cygheap rather than user heap for allocation of filebuf throughout. * fhandler_registry.cc: Ditto. * fhandler_virtual.cc: Ditto. * fhandler_process.cc: Ditto. (get_mem_values): Use malloc/realloc/free rather than new. * pinfo.cc (_pinfo::commune_send): Allocate on cygwin heap rather than user heap. Avoid calling ReadFile when correct number of characters have been read or suffer buffer corruption. (_pinfo::fd): Allocate on cygwin heap rather than user heap. (_pinfo::fds): Ditto. (_pinfo::root): Ditto. (_pinfo::cwd): Ditto. (_pinfo::cmdline): Ditto. * devices.h (FH_DEV): New define. * devices.in: Detect lone /dev. * devices.cc: Regenerate. * path.cc (path_conv::check): Treat FH_DEV as a special case.
* * path.cc (mount): Only check win32_path when we know we need it.Christopher Faylor2005-07-091-1/+3
|
* Eliminate (void) cast on standalone function calls throughout.Christopher Faylor2005-07-061-4/+4
|
* * cygtls.h (_cygtls): Perform minor reformatting.Christopher Faylor2005-07-051-38/+38
| | | | | | | | | | | | | | * winsup.h (close_all_files): Reflect argument change. * dtable.cc (close_all_files): Ditto. * dtable.h: Ditto. * fhandler.h: Ditto. * spawn.cc (spawn_guts): Move close_all_files back to its original location in first P_OVERLAY test but use argument denoting that handles are only supposed to be closed, not released (more work to be done here). * syscalls.cc (close_all_files): Take an argument denoting whether to release closed files or not. * path.cc (symlink): Change argument names to reflect linux man page. (symlink_worker): Ditto. Also appropriately set ENOENT for empty strings.
* Replace valid memory checks with new myfault class "exception handling", almostChristopher Faylor2005-07-031-12/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | everywhere. Leave some thread.cc stuff alone for now. * cygtls.h: Kludge some definitions to avoid including a problematic windows header. (_cygtls::_myfault): New entry. (_cygtls::_myfault_errno): Ditto. (_cygtls::fault_guarded): New function. (_cygtls::setup_fault): Ditto. (_cygtls::return_from_fault): Ditto. (_cygtls::clear_fault): Ditto. (myfault): New class. * exceptions.cc (handle_exceptions): Handle case of guarded fault in system routine. * gendef: Add another entry point for setjmp that the compiler doesn't know about and won't complain about. * gentls_offsets: Just include windows.h rather than kludging a HANDLE def. * miscfuncs.cc (check_null_str): Delete. (check_null_empty_str): Ditto. (check_null_empty_str_errno): Ditto. (check_null_str_errno): Ditto. (__check_null_invalid_struct): Ditto. (__check_null_invalid_struct_errno): Ditto. (__check_invalid_read_ptr): Ditto. (__check_invalid_read_ptr_errno): Ditto. (dummytest): New function. (check_iovec_for_read): Delete. (chec_iovec): Rename from check_iovec_for_write. Take a read/write parameter. * tlsoffsets.h: Regenerate. * winsup.h: Remove check_* declarations. (check_iovec_for_read): Delete declaration. Turn into a define instead. (check_iovec_for_write): Ditto. (check_iovec): New declaration. * thread.h: Use ifdef guard name consistent with other header files.
* * path.cc (path_conv::check): Don't strip trailing dots and spacesCorinna Vinschen2005-06-241-1/+1
| | | | at the start of the path.
* * path.cc (path_conv::check): Always reset to FH_FS when component != 0 andChristopher Faylor2005-06-141-14/+11
| | | | FH_NETDRIVE to fix problems with strict case checking.
* * path.cc (symlink_info::check): If GetFileAttributes returnsCorinna Vinschen2005-06-061-2/+11
| | | | with ERROR_SHARING_VIOLATION, the file exists.
* * path.cc (path_conv::check): Move component to function scope. SetCorinna Vinschen2005-05-291-4/+18
| | | | | PATH_RO only on *real* FH_NETDRIVEs or on non-FH_NETDRIVE virtual paths. Allow non-retrievable shares to be handled as files.
* white spaceChristopher Faylor2005-05-171-1/+1
|
* * path.cc (path_conv::check): Remove embedded dots before slashes.Christopher Faylor2005-05-171-2/+2
|
* * path.cc (normalize_posix_path): Do normalization on . and .. after a '//'.Christopher Faylor2005-05-131-5/+1
|
* Remove PC_FULL from path_conv usage throughout.Christopher Faylor2005-05-131-8/+8
| | | | | | * 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.
* * cygtls.cc (_cygtls::remove): Eliminate compiler warning.Christopher Faylor2005-05-131-5/+12
| | | | | | | | | | | | | | | * dir.cc (mkdir): Check path for writability. (rmdir): Ditto. Remove check for special directories. * path.cc (path_conv::check): Set PATH_RO for virtual devices. Set error if read-only and asked for writability. * path.h (pathconv_arg): Add PC_WRITABLE. (path_types): Add PATH_RO. (path_conv::isro): Add (currently unused) check for read-only filesystem. Return "ENOSHARE" when we know a share doesn't exist. * include/sys/mount.h: Add MOUNT_RO flag. * autoload.cc (WNetGetResourceInformationA): Import. * fhandler_netdrive.cc (fhandler_netdrive::exists): Detect actual existence of remote system rather than always assuming that it exists.
* * path.cc (path_conv::check): Set correct file attributes for socketCorinna Vinschen2005-05-101-1/+1
| | | | files.
* 2005-05-09 Pierre Humblet <pierre.humblet@ieee.org>Pierre Humblet2005-05-091-1/+15
| | | | | | | | | | | | | * fhandler.h (class fhandler_netdrive): New class. * fhandler_netdrive.cc (fhandler_netdrive::fhandler_netdrive): New constructor. (fhandler_netdrive::exists): New method. (fhandler_netdrive::fstat): Ditto. (fhandler_netdrive::readdir): Ditto. (fhandler_netdrive::open): Ditto. * dtable.cc (build_fh_pc): Handle case FH_NETDRIVE. * path.cc (isvirtual_dev): Add FH_NETDRIVE. (mount_info::conv_to_win32_path): Detect netdrive device and bypass mount search for network paths.
* * path.cc (normalize_posix_path): Don't treat '//' specially since newerChristopher Faylor2005-05-071-1/+1
| | | | versions of bash now get this right.
* move commentChristopher Faylor2005-05-061-2/+2
|
* white space and minor comment cleanup.Christopher Faylor2005-05-021-15/+15
|
* revert erroneous checkinChristopher Faylor2005-04-201-13/+0
|
* * sigproc.cc (proc_subproc): Fix handling of waiting for pids with zero value.Christopher Faylor2005-04-201-0/+13
| | | | * strace.cc (strace::hello): Report parent pid of executing process.