summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
Commit message (Collapse)AuthorAgeFilesLines
* * cygheap.h (cwdstuff): Convert to class. Make posix and dir private.Corinna Vinschen2009-05-131-3/+25
| | | | | | | | | | | | | | | | | | (cwdstuff::get_posix): New method. (cwdstuff::reset_posix): New method. * dcrt0.cc (dll_crt0_1): Call setlocale rather than _setlocale_r. * environ.cc (environ_init): Ditto. Prefer "C" locale over current codepage default locale. * path.cc (chdir): Use cwdstuff::get_posix method instead of accessing cwdstuff::posix directly. (cwdstuff::set): Defer creating posix path to first usage. (cwdstuff::get_posix): Create posix path if it's empty, and return it. (cwdstuff::get): Create posix path if it's empty. * strfuncs.cc (sys_cp_wcstombs): Use UTF-8 conversion in the "C" locale. (sys_cp_mbstowcs): Ditto. * syscalls.cc (gen_full_path_at): Fetch CWD posix path locked. (setlocale): Implement here. Reset CWD posix path.
* * sec_auth.cc (str2uni_cat): Move from here...Corinna Vinschen2009-05-091-3/+13
| | | | | | | * path.cc (str2uni_cat): ...to here. Simplify. Make static inline. (get_nt_native_path): Use RtlAppendUnicodeToString rather than str2uni_cat for constant strings for speed. * security.h (str2uni_cat): Drop declaration.
* * path.cc (path_conv::get_wide_win32_path): Allow relative paths.Corinna Vinschen2009-04-151-6/+17
| | | | | | (cygwin_conv_path): In case of CCP_POSIX_TO_WIN_W, convert relative paths to absolute paths if the relative pathname length exceeds MAX_PATH.
* * path.cc (symlink_worker): Write target filename as UTF-16 stringCorinna Vinschen2009-03-261-10/+38
| | | | | | | with leading BOM marker. (symlink_info::check_shortcut): If check for leading BOM marker succeeds, read filename as UTF-16 string. (symlink_info::check_sysfile): Ditto.
* * path.cc (warn_msdos): Don't warn about MS-DOS filenames encountered duringChristopher Faylor2009-03-141-1/+1
| | | | initialization.
* * fhandler_disk_file.cc (path_conv::isgood_inode): Move to be definedCorinna Vinschen2009-03-121-1/+4
| | | | | | | | | | | | | earlier. (get_ino_by_handle): Take additional path_conv argument, accommodate throughout. Only use FileId if isgood_inode check is true. (fhandler_base::open_fs): Simplify setting ino due to above change. (readdir_get_ino): Make sure to return always a non-zero inode number. (fhandler_disk_file::readdir): Always open file in dir with FILE_OPEN_REPARSE_POINT so as not to open wrong file. Drop call to isgood_inode here. * path.cc (symlink_info::check): Call fs.update in case we're fetching file information from call to NtQueryDirectoryFile.
* * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix inode numberCorinna Vinschen2009-01-291-1/+27
| | | | | | | | | | | | | | evaluation for faked "." entry. * mount.cc (fs_info::update): Move setting of is_cdrom after checking for caseinsensitivity. Recognize UDF in is_cdrom case and set caseinsensitive flag according to UDF brokenness determined by OS. Add comment to explain why. * mount.h (class fs_info): Add is_udf status flag. * path.cc (symlink_info::check): Add workaround for UDF bug in terms of casesensitivity on certain OSes. * wincap.h (wincaps::has_broken_udf): New element. (wincaps::has_broken_udf): New element
* * errno.cc (errmap): Set errno to ENOENT instead of ENOSHARE throughout.Corinna Vinschen2009-01-111-4/+4
| | | | | | | * path.cc (path_conv::check): Set to and check for ENOENT instead of ENOSHARE. * path.cc (symlink_info::check): Fix Samba 3.2.x comment.
* * mount.cc (mount_info::from_fstab_line): Always convert driveCorinna Vinschen2009-01-091-24/+21
| | | | | | | | | letter in native path to uppercase. * path.cc (normalize_win32_path): Ditto. (path_prefix_p): Revert previous patch. * path.cc (symlink_info::check): Check for STATUS_INVALID_PARAMETER return code to circumvent weird behaviour of Samba 3.2.x shares.
* * include/sys/cygwin.h (CW_SETERRNO): Define.Christopher Faylor2009-01-091-2/+14
| | | | | | | | | * external.cc (CW_SETERRNO): Implement. * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to reflect the above change. * path.cc (path_prefix_p): Treat X: as equivalent to x:. * mkglobals_h: Remove unneeded #define. * spawn.cc (spawn_guts): Avoid overly wordy initialization to zero.
* * fhandler_disk_file.cc (fhandler_disk_file::link): Only add .exe ifCorinna Vinschen2009-01-071-1/+2
| | | | | | original file has .exe as well. * path.cc (path_conv::is_binary): Only recognize Windows 32 and 64 bit apps as binaries.
* Remove unneeded header files from source files throughout. Update copyrightsChristopher Faylor2009-01-031-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | where appropriate. * globals.cc: New file for generic global variables. * mkglobals_h: New file to generate globals.h. * mkstatic: New Script used to build a (currently non-working) static libcygwin_s.a. * Makefile.in: Add unused rule to build a non-working libcygwin_s.a. (DLL_OFILES): Add globals.o. Make all objects rely on globals.h. (globals.h): New target. Generate globals.h. * cygtls.h: Honor new CYGTLS_HANDLE define to control when the HANDLE operator is allowed in _cygtls. * dcrt0.cc: Move most globals to globals.cc. * init.cc: Ditto. * environ.cc (strip_title_path): Remove now-unneeded extern. * fhandler_serial.cc (fhandler_serial::open): Ditto. * pinfo.cc: Ditto. (commune_process): Ditto. * shared.cc: Ditto. * glob.cc: Ditto. * strace.cc: Ditto. * exceptions.cc: Define CYGTLS_HANDLE before including winsup.h. * path.cc (stat_suffixes): Move here. * security.h: Add forward class path_conv declaration. * smallprint.cc (__small_vsprintf): Make a true c++ function. (__small_sprintf): Ditto. (small_printf): Ditto. (console_printf): Ditto. (__small_vswprintf): Ditto. (__small_swprintf): Ditto. * spawn.cc (spawn_guts): Remove _stdcall decoration in favor of regparm. (hExeced): Move to globals.cc * strfuncs.cc (current_codepage): Ditto. (active_codepage): Ditto. * sync.cc (lock_process::locker): Move here from dcrt0.cc. * syscalls.cc (stat_suffixes): Move to path.cc. * tty.cc (tty::create_master): Uncapitalize fatal warning for consistency. * winsup.h: Include globals.h to declare most of the grab bag list of globals which were previously defined here. * mount.h: Move USER_* defines back to shared_info.h. * speclib: Force temporary directory cleanup.
* * mount.cc: Change comment.Christopher Faylor2008-12-251-195/+0
| | | | | | | | | | | | (smb_extended_info): Move here from path.cc. (fs_info::update): Ditto. (mount_info::create_root_entry): Delay conversion to slashes and use passed in buffer to figure out fs type. * path.cc (smb_extended_info): Move. (fs_info::update): Ditto. * mount.h: New file. Move mount information here. * path.h: (fs_info::update): Move. * shared_info.h (mount_item): Ditto.
* * path.cc (symlink_info::check_shortcut): Ensure that symlink handle is closedChristopher Faylor2008-12-241-2/+1
| | | | on successful return.
* * path.cc (path_conv::check): Handle incoming DOS paths non-POSIXy,Corinna Vinschen2008-12-191-1/+9
| | | | always case-insensitive, always ignoring ACLs.
* * path.cc (symlin_info::check): Set 4th parameter ofCorinna Vinschen2008-12-181-23/+26
| | | | | | | | NtQueryDirectoryFile to NULL instead of 0 since it's a pointer. Simplify label and break from loop handling in symlink evaluation conditional expression. Drop a now useless break statement. Fix behaviour when searching for `foo' and then finding a `foo.lnk' which is no shortcut.
* * fhandler_disk_file.cc (readdir_get_ino): Don't complain about MS-DOS pathsChristopher Faylor2008-12-141-1/+1
| | | | since the function could be fed one by an internal call.
* Remove unneeded whitespace.Christopher Faylor2008-11-261-9/+14
| | | | | | | | | | | | | | | | * 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.
* * mount.cc (mount_info::cygdrive_win32_path): Always upper caseCorinna Vinschen2008-11-111-1/+8
| | | | | | | DOS drive letter to accommodate case sensitivity. (cygdrive_getmntent): Ditto. * path.cc (path_conv::check): Invalidate wide_path after making path relative.
* * path.cc (normalize_win32_path): Don't add a trailing '\' if the cwd returns aChristopher Faylor2008-11-111-1/+2
| | | | path with a trailing '\'.
* * ntdll.h (NtSetAttributesFile): New inline function.Corinna Vinschen2008-10-201-12/+3
| | | | | | | | | * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Use NtSetAttributesFile. * path.cc (symlink_worker): Ditto. * syscalls.cc (unlink_nt): Ditto. (rename): Omit FILE_SHARE_DELETE when opening files on Samba. Add comment to explain why.
* * fhandler_disk_file.cc (fhandler_base::fstat_helper): CheckCorinna Vinschen2008-10-091-11/+0
| | | | | | for executable suffixes here in case we're on a file system not supporting permission. * path.cc (path_conv::check): Drop check for executable suffixes.
* * path.cc (path_conv::is_binary): Always check for GetBinaryType.Corinna Vinschen2008-10-091-5/+2
| | | | | * syscalls.cc (rename): Fix test for just changing case of name on case insensitive filesystems.
* * path.cc (symlink_info::check_shortcut): Don't check for executabilityCorinna Vinschen2008-10-091-18/+3
| | | | | here. (symlink_info::check_sysfile): Ditto.
* * path.cc (path_conv::path_conv): Only assume executability by suffixCorinna Vinschen2008-10-081-1/+2
| | | | on file systems not supporting permissions.
* * cygheap.cc (creturn): Reorganize to avoid a new compiler warning/error.Christopher Faylor2008-09-111-17/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dtable.cc (handle_to_fn): Ditto. * fhandler_console.cc (fhandler_console::read): Ditto. (fhandler_console::scroll_screen): Ditto. (dev_console::set_color): Ditto. * fhandler_dsp.cc (fhandler_dev_dsp::write): Ditto. (fhandler_dev_dsp::read): Ditto. * fhandler_tape.cc (mtinfo_drive::get_status): Ditto. * hookapi.cc (find_first_notloaded_dll): Ditto. * mmap.cc (msync): Ditto. * pipe.cc (pipesync::pipesync): Ditto. * sec_acl.cc (getace): Ditto. * sec_auth.cc (create_token): Ditto. (lsaauth): Ditto. * select.cc (peek_pipe): Ditto. * spawn.cc (av::fixup): Ditto. * syscalls.cc (popen): Ditto. * tty.cc (tty::init_session): Ditto. * uinfo.cc (pwdgrp::load): Ditto. * fhandler.cc (fhandler_base::setup_overlapped): Ditto. (fhandler_base::wait_overlapped): Rename second use of res variable to wres or errors are not returned correctly. * dcrt0.cc: Remove obsolete variable. * dll_init.cc (release_upto): Fix typo involving incorrect use of '|'. * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Avoid a compiler warning regarding coercing type-punned variables. (fhandler_base::fstat_by_name): Ditto. fhandler_fifo.cc (fhandler_fifo::open_nonserver): Fix = vs. == typo. (fhandler_fifo::wait): Add all conditions to switch statement to avoid a compiler warning. * fhandler_process.cc: Avoid unneeded initialization of variables to zero. (fhandler_socket::listen): Add braces around initializer. * flock.cc (inode_t::get_all_locks_list): Reorganize to avoid a compiler warning. Fix problem with EWOULDBLOCK error return. * path.cc (GUID_shortcut): Use braces around struct initializer. (cygwin_conv_path): Reorganize to avoid a compiler warning. * random.cc (dummy): Mark variable as volatile to avoid a "used uninitialized" warning. * libc/getopt.c: Mark some variables as dllexport although gcc doesn't seem to do the right thing with them. * libc/minires-os-if.c (get_registry_dns_items): Coerce some function arguments to avoid a compiler warning.
* * path.cc (symlink_info::check_shortcut): If file can't be opened,Corinna Vinschen2008-08-201-5/+2
| | | | | treat it as non-symlink rather than generating an EIO error. (symlink_info::check_sysfile): Ditto.
* * path.cc (symlink_info::check): Don't use eabuf when trying to openCorinna Vinschen2008-08-151-8/+6
| | | | | file a second time. Call NtOpenFile instead of NtCreateFile in this case.
* * external.cc (cygwin_internal): Call set_security_attribute withCorinna Vinschen2008-08-141-2/+7
| | | | | | | | | | | | | | | | | | | | | | | additional path_conv argument. * fhandler.cc (fhandler_base::open): Ditto. * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Never set DOS R/O attribute when using ACLs. (fhandler_disk_file::mkdir): Ditto. Set security descriptor on remote dirs after creating the dir, same as in fhandler_base::open. * fhandler_socket.cc (fhandler_socket::bind): Ditto for remote AF_LOCAL socket files. * path.cc (symlink_worker): Ditto. for remote symlinks. * security.cc (alloc_sd): Take additional path_conv argument. Accommodate throughout. Drop setting FILE_WRITE_EA/FILE_READ_EA flags unconditionally (was only necessary for "ntea"). Don't set FILE_READ_ATTRIBUTES and FILE_WRITE_ATTRIBUTES unconditionally on Samba. Add comment to explain. Drop useless setting of STANDARD_RIGHTS_WRITE, it's in FILE_GENERIC_WRITE anyway. Remove FILE_READ_ATTRIBUTES bit from FILE_GENERIC_EXECUTE so as not to enforce read permissions on Samba. (set_security_attribute): Take additional path_conv argument. * security.h (set_security_attribute): Change prototype accordingly.
* * path.cc (symlink_info::check): Handle (and explain) a special caseCorinna Vinschen2008-07-311-0/+12
| | | | when accessing files matching DOS device names on SMB shares.
* * fhandler_disk_file.cc (fhandler_base::fstat_by_name): Check forCorinna Vinschen2008-07-301-12/+25
| | | | | | | | | | | | | | | file systems incapable of handling FileIdBothDirectoryInformation correctly. (fhandler_disk_file::opendir): Ditto. * path.cc (fs_info::update): Always clear at the start. Rearrange to make certain tests only on non-Samba, non-NFS remote drives. Add test for file systems known to be incapable of handling FileIdBothDirectoryInformation correctly. Right now that's just "UNIXFS". * path.h (struct fs_info): Add has_buggy_fileid_dirinfo flag and accessor methods. (class path_conv): Add has_buggy_fileid_dirinfo method.
* * dcrt0.cc (dll_crt0_0): Call malloc_init and user_shared_initialize_1Corinna Vinschen2008-07-251-5/+2
| | | | | | | | | | | | | | | | | | | here in case we're dynamically loaded. Explain why. (dll_crt0_1): Call user_shared_initialize_1 from here. * mount.cc (is_native_path): New inline function testing for native and long Win32 path prefix. (is_unc_share): Remove long WIn32 path prefix test. (mount_info::create_root_entry): Use PATH_MAX buffer. (mount_info::init): Ditto. (mount_info::add_item): Test for is_native_path as well. * path.cc (normalize_win32_path): Simplify native path prefix code. * shared.cc (user_shared_initialize_1): New function taking user shared initialization code relying on malloc and cygtls. (user_shared_initialize): Move mountinfo initialization to user_shared_initialize_1. * shared_info.h (user_shared_initialize_1): Declare. * syscalls.cc (seteuid32): Call user_shared_initialize_1 after user changed.
* * shared.cc (user_shared_initialize): Fetch potentially changed CygwinCorinna Vinschen2008-07-241-17/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | username from /etc/passwd before loading mount table. (shared_info::init_installation_root): New function fetching Cygwin's installation root dir and storing as native NT path in global shared memory. (shared_info::initialize): Call init_installation_root exactly once at first startup. * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info. (CURR_SHARED_MAGIC): Ditto. (class shared_info): Add installation_root member. (shared_info::init_installation_root): Declare. * grp.cc (pwdgrp::read_group): Call pwdgrp::load with native WCHAR path. * passwd.cc (pwdgrp::read_passwd): Ditto. Avoid recursion. (etc::init): Take POBJECT_ATTRIBUTES instead of path_conv. * path.h (etc::init): Change prototype accordingly. * pwdgrp.h (class pwdgrp): Store path as UNICODE_STRING/PWCHAR instead of as path_conv. (pwdgrp::load): Accommodate prototype. * uinfo.cc (pwdgrp::load): Change argument type from char to wchar_t. Create native NT path here instead of calling path_conv. * mount.cc (find_root_from_cygwin_dll): Drop in favor of global initializaion in shared_info. (mount_info::init): Fetch native NT root dir from cygwin_shared. (mount_info::from_fstab): Expect native NT path and use native NT functions to access file. Convert username part in user fstab path according to special char transformation rules. * path.cc (tfx_chars): Convert slash to backslash. (transform_chars): Implement for path given as PWCHAR. (transform_chars): PUNICODE_STRING version calls PWCHAR version. Remove useless commented code.
* * path.cc (allow_winsymlinks): Revert default to create system bitCorinna Vinschen2008-07-161-1/+1
| | | | symlinks for speed.
* Add case-sensitivity.Corinna Vinschen2008-07-161-169/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unconditionally handle mount points case-sensitive. Unconditionally handle virtual paths case-sensitive. Unconditionally handle registry paths case-insensitive. Otherwise, accommodate case-sensitivity of given path throughout. * cygheap.cc (cygheap_root::set): Get additional caseinsensitive parameter and store it. * cygheap.h (struct cygheap_root_mount_info): Add member caseinsensitive. * dlfcn.cc (get_full_path_of_dll): Drop PC_NOFULL parameter from call to path_conv::check. * environ.cc (pcheck_case): Remove. (check_case_init): Remove. (known): Drop "check_case" option. * exceptions.cc (open_stackdumpfile): Add comment. * fhandler.cc (fhandler_base::get_default_fmode): Call pathmatch instead of strcasematch. * fhandler_disk_file.cc: Accommodate case-sensitivity of given path throughout. (__DIR_mounts::check_mount): Unconditionally check virtual paths case-sensitive. (fhandler_disk_file::link): Drop case clash handling. (fhandler_disk_file::open): Ditto. (fhandler_disk_file::readdir_helper): Drop managed mount code. * mount.cc: Remove managed mount code and datastructures. (struct opt): Remove "managed" option. Add "posix=0" and "posix=1" options. (fillout_mntent): Remove "managed" output. Add "posix" output. * path.cc (struct symlink_info): Remove case_clash member and case_check method. (pcheck_case): Remove. (path_prefix_p): Take additional bool parameter "caseinsensitive". (pathnmatch): Ditto. (pathmatch): Ditto. (mkrelpath): Ditto. (fs_info::update): Set caseinsensitive flag according to file system name and FILE_CASE_SENSITIVE_SEARCH flag. Add comment. (tfx_chars_managed): Remove. (transform_chars): Drop "managed" parameter. Always use tfx_chars. (get_nt_native_path): Drop "managed" parameter. Make sure drive letters are always upper case. (getfileattr): Change second parameter to denote caseinsensitivity. (path_conv::check): Initialize caseinsensitive to OBJ_CASE_INSENSITIVE. Set caseinsensitive according to global obcaseinsensitive flag, file system case sensitivity and MOUNT_NOPOSIX mount flag. Drop case_clash and all the related code. (symlink_worker): Drop case clash handling. (symlink_info::set): Drop setting case_clash. (symlink_info::case_check): Remove. (cwdstuff::set): Add comment. (etc::init): Take path_conv instead of PUNICODE_STRING as parameter to allow case sensitivity. * path.h (enum pathconv_arg): Drop PC_SYM_IGNORE. (enum case_checking): Remove. (enum path_types): Drop PATH_ENC, add PATH_NOPOSIX flag. (struct fs_info): Add caseinsensitive flag and accessor methods. (class path_conv): Add caseinsensitive member and define objcaseinsensitive method. Drop case_clash member and isencoded method. (pathmatch): Change prototype according to above change. (pathnmatch): Ditto. (path_prefix_p): Ditto. (get_nt_native_path): Ditto. (class etc): Ditto. (fnunmunge): Remove prototype. * shared.cc (shared_info::init_obcaseinsensitive): Initialize obcaseinsensitive flag from obcaseinsensitive registry value. (shared_info::initialize): Call init_obcaseinsensitive here by the first process creating the shared memory. * shared_info.h (mount_item::fnmunge): Remove. (shared_info::obcaseinsensitive): Rename from obcaseinsensitivity. (shared_info::init_obcaseinsensitive): Declare. * syscalls.cc (try_to_bin): Add comment. * include/sys/mount.h (MOUNT_ENC): Remove flag. (MOUNT_NOPOSIX): Add flag.
* Throughout drop allow_ntsec and allow_smbntsec handling.Corinna Vinschen2008-07-141-4/+3
| | | | | | | | | | | | | | | | * environ.cc (set_ntsec): Remove. (set_smbntsec): Remove. (known): Remove ntsec and smbntsec options. * external.cc (check_ntsec): Return true if no filename is given. * mount.cc (oopts): Add "acl" and "noacl" options. Set MOUNT_NOACL flag accordingly. (fillout_mntent): Handle MOUNT_NOACL flag. * path.h (enum path_types): Add PATH_NOACL. * security.cc (allow_ntsec): Remove. (allow_smbntsec): Remove. * security.h (allow_ntsec): Drop declaration. (allow_smbntsec): Drop declaration. * include/sys/mount.h (MOUNT_NOACL): Define.
* * path.cc (path_conv::is_binary): Fix test. Add comment.Corinna Vinschen2008-07-021-2/+4
|
* * path.cc (get_nt_native_path): Drop considerations for DOS devices.Corinna Vinschen2008-06-111-5/+10
| | | | | | Keep relative paths relative. (cygwin_conv_path): Don't try to skip native NT prefixes on relative paths.
* * path.cc (symlink_info::check): Reorder test for nfs symlinks.Corinna Vinschen2008-05-241-1/+1
|
* * fhandler_disk_file.cc (fhandler_disk_file::opendir): Don't try toCorinna Vinschen2008-05-231-4/+5
| | | | | | | use FileIdBothDirectoryInformation on NFS shares. Fix comment to explain why. * path.cc (symlink_info::check): Reinstantiate no_ea. Use in erroneously changed condition.
* * mount.cc (mount_info::from_fstab): Use cygwin_hmodule rather than trying toChristopher Faylor2008-05-231-2/+0
| | | | | find handle based on cygwin1.dll. * path.cc (symlink_info::check): Remove unused variable.
* * path.cc (symlink_info::check): Define eabuf and easize outside ofCorinna Vinschen2008-05-231-3407/+3406
| | | | | loop. Set to NULL on first STATUS_EAS_NOT_SUPPORTED. Align comments. Fix formatting.
* * path.cc (symlink_info::check): Don't pass EaBuffer to NtCreateFile if it hasChristopher Faylor2008-05-231-3432/+3444
| | | | | | indicated that it isn't appropriate. * ntdll.h (STATUS_EAS_NOT_SUPPORTED): Define. * winsup.h: Remove __builtin* defines.
* * path.cc (cygwin_conv_path): Define tp before setting up faul handler.Corinna Vinschen2008-05-221-2/+2
| | | | | | * syscalls.cc: Ditto, throughout. (gen_full_path_at): Add bool parameter to allow NULL pathname. (futimesat): Allow NULL pathname as GLIBC.
* * fhandler_disk_file.cc (get_ino_by_handle): Rename pfai to fai.Corinna Vinschen2008-05-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | (fhandler_base::fstat_by_handle): Drop fai_size and pfai in favor of static struct fai_buf. Restructure. (fhandler_base::fstat_by_name): Drop fvi_size and pfvi. Drop fdi_size and pfdi in favor of static struct fdi_buf. Drop redundant test for existance. Use FileDirectoryInformation class instead of FileBothDirectoryInformation. Drop call to NtQueryVolumeInformationFile in favor of using pc.fs_serial_number (). Fix FileId information given to fstat_helper. (fhandler_disk_file::fstatvfs): Drop fvi_size, pfvi, fai_size and pfai. Drop getting FileFsVolumeInformation and FileFsAttributeInformation in favor of using the related path_conv info. (fhandler_disk_file::opendir): Fix comment. (fhandler_disk_file::readdir): Ditto. Use FileDirectoryInformation class instead of FileBothDirectoryInformation. * path.cc (fs_info::update): Store MaximumComponentNameLength in new member name_len. * path.h (struct fs_info): Use ULONG rather than DWORD. Add member name_len to store MaximumComponentNameLength. Add accessor methods. (path_conv::fs_name_len): New method.
* * fhandler.h (dirent_states): Add dirent_nfs_d_ino state and add it toCorinna Vinschen2008-05-211-2/+3
| | | | | | | | | | | | dirent_info_mask. * fhandler_disk_file.cc (fhandler_disk_file::opendir): Set dirent_nfs_d_ino flag for NFS shares. Explain why. (fhandler_disk_file::readdir): Use FileNamesInformation instead of FileBothDirectoryInformation info class on NFS clients not supporting the FileIdBothDirectoryInformation info class. Use local pointers to accommodate different offsets. * path.cc (symlink_info::check): Don't test directories for symlinks on NFS shares. Enhance comment.
* * path.cc (symlink_worker): Fix EA buffer size info given toCorinna Vinschen2008-05-201-5/+4
| | | | | | NtCreateFile. (symlink_info::check_nfs_symlink): Get 64K buffer for EA buffer. Change EA buffer size info given to NtQueryEaFile accordingly.
* * path.cc (symlink_info::check_shortcut): Minimize requested fileCorinna Vinschen2008-05-201-5/+6
| | | | | | | access flags. (symlink_info::check_sysfile): Ditto. Add missing `else'. (symlink_info::check): Only retry to open file if first try failed with access denied.
* * path.cc (fs_info::update): Re-add opening the unsplitted pathCorinna Vinschen2008-05-201-0/+2
| | | | for fillout_mntent's sake.
* * Makefile.in (DLL_OFILES): Add nfs.o.Corinna Vinschen2008-05-201-145/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fhandler.cc (fhandler_base::open): Open files on NFS shares with correct access flags and EAs. * fhandler.h (fhandler_base::fstat_by_nfs_ea): Declare. * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): New method. (fhandler_base::fstat_by_handle): Call fstat_by_nfs_ea for files on NFS shares. (fhandler_disk_file::fchmod): Use NFS specific method to set mode for files on NFS shares. Don't overrule errno from call to set_file_attribute with errno from NtSetInformationFile call. (fhandler_disk_file::fchown): Add comment. * mount.cc (fillout_mntent): Accommodate change in second parameter to fs_info::update. * nfs.cc: New file. * nfs.h: New file. * path.cc (fs_info::update): Take handle instead of bool as second parameter. Use that handle if it's not NULL. Only close handle if it has been opened here. Use static defined buffers instead of alloca'd buffers. (path_conv::check): Call symlink_info::check with reference to fs. Don't call fs.update here if file exists. (conv_path_list): Prefer tmp_pathbuf buffer over using alloca. (symlink_worker): Use NFS specific method to create symlinks on NFS shares. Prefer tmp_pathbuf buffer over using alloca. (symlink_info::check_shortcut): Reopen file from incoming handle with necessary FILE_GENERIC_READ flag. Prefer tmp_pathbuf buffer over using alloca. (symlink_info::check_sysfile): Ditto. (symlink_info::check_reparse_point): Use tmp_pathbuf buffer to allocate REPARSE_DATA_BUFFER. (symlink_info::check_nfs_symlink): New method. (enum symlink_t): Remove. (symlink_info::check): Don't use NtQueryAttributesFile. Rather, open file with necessary access flags and call NtQueryInformationFile. Fix error handling in case file can't be opened. For existing files, call fs_info::update here. Restructure symlink checking to accommodate the fact that the file is already open. Add case for NFS symlinks. * path.h (fs_info::update): Take handle instead of bool as second parameter.