Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-08-27 * external.cc (sync_wincwd): Remove.Corinna Vinschen
(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.
2010-06-15 * dtable.cc (dtable::dup_worker): Reset path_conv handle in duplicatedCorinna Vinschen
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.
2010-06-02 * ntdll.h (STATUS_BAD_NETWORK_PATH): Define.Corinna Vinschen
(STATUS_BAD_NETWORK_NAME): Define. * path.cc (symlink_info::check): Convert STATUS_BAD_NETWORK_PATH and STATUS_BAD_NETWORK_NAME into an immediate ENOENT.
2010-03-16* shared_info.h (user_info): Add dll_crt0_1 as a friend.Christopher Faylor
(user_info::version): Make LONG to accommodate spinlock use. (user_info::create): New static function renamed from user_info_create. (user_info::initialize): New private function renamed from user_info_initialize. (SHARED_VERSION): Delete. (SHARED_VERSION_MAGIC): Ditto. (USER_VERSION_MAGIC): Ditto. (SHARED_INFO_CB): Ditto. (USER_VERSION): Ditto. (USER_VERSION_MAGIC): Ditto. (CURR_SHARED_MAGIC): Update. (CURR_USER_MAGIC): Ditto. (shared_info::version): Make LONG to accommodate spinlock use. (shared_info::create): New static function mirroring user_info::create. (dll_crt0_1): Accommodate change to user_info::initialize. * spinlock.h (spinlock::setto): New variable member. (spinlock::done): New function. (spinlock::spinlock): Generalize to allow arbitrary values and timeouts. Call done() when lock is not needed. * ntdll.h: Make multiple-inclusion safe. (NtQuerySystemTime): Declare. * shared.cc (installation_root_inited): Rename from shared_mem_inited. (init_installation_root): Make inline. Use a spinlock to ensure that this is initialized only once per session. (user_info::initialize): Rename from user_shared_initialize. Protect with spinlock on sversion and remove other spinlock-like things. Remove reference to user_shared since it is now implicit. Refer to spinlock version of multiple_cygwin_problem to ensure that any spinlock is released. (user_info::create): Rename from user_shared_create. Accommodate change from user_shared_initialize to user_info::initialize. (shared_info::create): New inline function. (shared_info::initialize): Protect with spinlock on sversion. Move heap_init back under specific control of shared_info spinlock. Remove reference to SHARED_INFO_CB and just use sizeof(*this). (memory_init): Move all locking into respective functions where it is needed. Accommodate name changes. Remove call to heap_init(). * syscalls.cc (seteuid32): Accommodate name change to user_info::create(). * mount.cc (mount_info::create_root_entry): Report on errors from add_item since they should be nonexistent. (mount_info::init): Don't initialize nmounts. It should already be zero. Give more verbose error when root_idx < 0. Implicitly use this pointer rather than explicitly referencing mount_table->. (mount_info::add_item): Minor whitespace fix.
2010-01-29 Throughout, use FileBothDirectoryInformation info class rather thanCorinna Vinschen
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.
2009-12-18 Throughout, replace hMainProc with GetCurrentProcess/NtCurrentProcessCorinna Vinschen
according to context. Throughout, replace hMainThread with GetCurrentThread/NtCurrentThread according to context. * dcrt0.cc (dll_crt0_0): Drop duplication of GetCurrentProcess to hMainProc. Drop duplication of GetCurrentThread to hMainThread. * dtable.cc (dtable::stdio_init): Remove useless comment. * globals.cc (hMainProc): Remove. (hMainThread): Remove. * ntdll.h (NtCurrentProcess): Define. (NtCurrentThread: Define.
2009-10-07Support pseudo-reloc version 2Charles Wilson
2009-07-14 Throughout avoid having to initialize constant UNICODE_STRINGs.Corinna Vinschen
* globals.cc: Define constant UNICODE_STRINGs and store in .rdata section. * fhandler_disk_file.cc: Throughout, use readonly UNICODE_STRINGs rather then initializing local UNICODE_STRING variable where applicable. * fhandler_mem.cc (fhandler_dev_mem::open): Ditto. * flock.cc (inode_t::inode_t): Ditto. * mmap.cc: Ditto. * syscalls.cc: Ditto. * mount.cc (fs_info::update): Ditto. * path.cc: Ditto. * ntdll.h (RtlEqualUnicodePathPrefix): Redefine to take prefix as UNICODE_STRING. (RtlEqualUnicodePathSuffix): Redefine to take suffix as UNICODE_STRING. * fhandler_disk_file.cc: Accommodate throughout. * mount.cc (fs_info::update): Ditto. * path.cc (cwdstuff::set): Ditto. * syscalls.cc: Ditto.
2009-07-13* Makefile.in: Don't do anything special with any RCS directories.Christopher Faylor
* ntdll.h (PROCESSINFOCLASS): Remove unneeded trailing comma. * pinfo.cc (_pinfo::dup_proc_pipe): Remove unneeded assignment. * sigproc.cc (sig_send): Don't send signal to myself if this is an exec stub.
2009-04-16 * ntdll.h (STATUS_LOCK_NOT_GRANTED): Define.Corinna Vinschen
* syscalls.cc (unlink_nt): Handle STATUS_LOCK_NOT_GRANTED same as STATUS_SHARING_VIOLATION. Add lengthy comment to explain why.
2009-01-16 * Fix copyright dates.Corinna Vinschen
2009-01-07 * ntdll.h: Reorder NT status flags. Fix a case difference. AddCorinna Vinschen
STATUS_CANNOT_DELETE flag. * syscalls.cc (unlink_nt): Change initial NtOpenFile to request FILE_SHARE_DELETE sharing mode. Change comment accordingly. If setting delete disposition failed with STATUS_CANNOT_DELETE, try to delete using delete-on-close. Explain why. Rearrange setting R/O DOS attribute after trying to delete. Simplify comment.
2008-11-26Remove unneeded whitespace.Christopher Faylor
* 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.
2008-10-20 * ntdll.h (NtSetAttributesFile): New inline function.Corinna Vinschen
* 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.
2008-05-23* path.cc (symlink_info::check): Don't pass EaBuffer to NtCreateFile if it hasChristopher Faylor
indicated that it isn't appropriate. * ntdll.h (STATUS_EAS_NOT_SUPPORTED): Define. * winsup.h: Remove __builtin* defines.
2008-05-15 * autoload.cc (LoadDLLfuncNt): Re-invent.Corinna Vinschen
(NtCreateTransaction): Define. (NtCommitTransaction): Define. (NtRollbackTransaction): Define. (RtlGetCurrentTransaction): Define. (RtlSetCurrentTransaction): Define. * ntdll.h (TRANSACTION_ALL_ACCESS): Define. (NtCreateTransaction): Declare. (NtCommitTransaction): Declare. (NtRollbackTransaction): Declare. (RtlGetCurrentTransaction): Declare. (RtlSetCurrentTransaction): Declare. * syscalls.cc (start_transaction): New static function to start TxF transaction. (stop_transaction): New static function to end TxF transaction. (rename): Call start_transaction and stop_transaction where appropriate on systems supporting transactions. * wincap.h (wincaps::has_transactions): New element. * wincap.cc: Implement above element throughout.
2008-04-28 * autoload.cc (IsWow64Process): Remove.Corinna Vinschen
(Wow64DisableWow64FsRedirection): Remove. (Wow64RevertWow64FsRedirection): Remove. * ntdll.h (enum _PROCESSINFOCLASS): Define ProcessWow64Information. * init.cc (respawn_wow64_process): Use NtQueryInformationProcess to get WOW64 state. * wincap.cc (wincapc::init): Ditto. * wincap.h (wincapc::wow64): Change type to ULONG.
2008-04-21 * Makefile.in (DLL_OFILES): Add kernel32.o.Corinna Vinschen
* autoload.cc (WSACloseEvent): Remove. (WSACreateEvent): Remove. * cygheap.cc (cygheap_init): Drop initializing shared_prefix. * cygheap.h (struct init_cygheap): Drop shared_prefix and shared_prefix_buf members. * fhandler_socket.cc (sock_shared_name): New static function. (search_wsa_event_slot): Convert name buffers to WCHAR. Call NtCreateMutant/NtOpenMutant to create mutexes in session local namespace. (fhandler_socket::init_events): Ditto. Fix debug output. (fhandler_socket::release_events): Close mutexes using NtClose. (fhandler_socket::dup): Ditto. * kernel32.cc: New file, implementing Win32 calls in a Cygwin-specific way. * mmap.cc (MapView): Make static. * ntdll.h: Fix status code sorting. (STATUS_OBJECT_NAME_EXISTS): Define. (SEMAPHORE_QUERY_STATE): Define. (CYG_SHARED_DIR_ACCESS): Define. (CYG_MUTANT_ACCESS): Define. (CYG_EVENT_ACCESS): Define. (CYG_SEMAPHORE_ACCESS): Define. (enum _PROCESSINFOCLASS): Define ProcessSessionInformation. (struct _PROCESS_SESSION_INFORMATION): Define. (NtCreateSemaphore): Declare. (NtOpenSemaphore): Declare. * flock.cc: Use CYG_xxx_ACCESS access masks where appropriate. * posix_ipc.cc (ipc_mutex_init): Use native functions to create mutex. Create in cygwin-shared subdir. (ipc_cond_init): Ditto for event. (ipc_mutex_close): Use NtClose. (ipc_cond_close): Ditto. (mq_open): Drop "cyg" prefix from mqh_uname. * shared.cc (CYG_SHARED_DIR_ACCESS): Drop definition here. (_cygwin_testing): Declare extern on file level. (get_shared_parent_dir): Change name of shared directory. Add name to api_fatal output. (get_session_parent_dir): New function. (shared_name): Simplify. (shared_info::initialize): Call get_session_parent_dir. * shared_info.h (get_session_parent_dir): Declare. * smallprint.cc (__small_vswprintf): Fix bug in multibyte string conversion. * thread.cc (semaphore::semaphore): Align semaphore name to object names in posix IPC functions. * include/cygwin/version.h (CYGWIN_VERSION_SHARED_DATA): Bump.
2008-03-31 * smallprint.cc (__small_vswprintf): Fix uninitialized usage of `w'.Corinna Vinschen
Revamp advisory file locking to avoid cross reference pointers as well as to allow BSD flock semantics. More agressively delete unused nodes and sync objects. * fhandler.h (fhandler_base::ino): Rename from namehash. Fix comment. (fhandler_base::node): Remove. (fhandler_base::unique_id): Add. (fhandler_base::del_my_locks): New method. (get_ino): Rename from get_namehash. Change usage throughout Cygwin. (get_unique_id): New method. * fhandler.cc (fhandler_base::close): Call own del_my_locks method. Fix comment. (fhandler_base::fhandler_base): Accommodate new and changed members. (fhandler_base::fixup_after_fork): Call del_my_locks. (fhandler_base::fixup_after_exec): Ditto for files with close-on-exec flag set. * fhandler_disk_file.cc (get_ino_by_handle): Rename from readdir_get_ino_by_handle. Accommodate throughout. (fhandler_base::open_fs): Fill ino with inode number if FS has good inodes. Allocate a LUID and store in unique_id to recognize file descriptors referencing the same file object. * flock.cc: Drop flock TODO comments. Use explicit types __dev32_t and __ino64_t instead of dev_t and ino_t. (LOCK_OBJ_NAME_LEN): Change to reflect longer lf_id length. (get_obj_handle_count): New method. (lockf_t::lf_id): Change type to long long. (inode_t::get_lock_obj_handle_count): Drop in favor of static function get_obj_handle_count. (inode_t::del_locks): Remove. (inode_t::get): Add create_if_missing flag argument. (inode_t::del_my_locks): Reimplement to handle POSIX and BSD flock locks. Return if node can be deleted or not. (inode_t::~inode_t): Ditto. Close handles to i_dir and i_mtx. (fixup_lockf_after_fork): Remove. (fhandler_base::del_my_locks): New method. (fixup_lockf_after_exec): Check if node can be deleted. (inode_t::get): Only create node if create_if_missing is set. Lock the returned node here before unlocking the node list. (inode_t::get_all_locks_list): Accommodate new lf_id length. (inode_t::create_lock_obj): Ditto. (lockf_t::open_lock_obj): Ditto. Change return type to bool. De-const. Set lf_obj instead of returning a handle. (lockf_t::del_lock_obj): Call SetEvent only if new incoming parameters allow it. Explain how it's supposed to work. (fhandler_disk_file::lock): Only fetch file length in SEEK_END case. Use NtQueryInformationFile(FileStandardInformation) instead of calling fstat_by_handle. Always unlock node before returning. Use fhandler's unique id to create lf_id for BSD flock locks. Rely on node lock from inode_t::get. Call del_lock_obj on removed locks here to allow explicit unlocking. Delete node if no lock exists on the file anymore. (lf_setlock): Get file handle as additional parameter. Handle the fact that lf_getblock now always opens the attached event object. Reactivate erroneously applied patch which deactivates setting thread priority. Additionally handle blocking on BSD flock locks. (lf_clearlock): Get file handle as additional parameter. (lf_getlock): Close event handle opened by lf_getblock. (lf_getblock): Open potentially blocking event object here and check its signal state if it's a BSD flock lock. (lf_wakelock): Get file handle as additional parameter. * fork.cc (frok::child): Drop call to fixup_lockf_after_fork. * ntdll.h (struct _EVENT_BASIC_INFORMATION): Define. (enum _EVENT_INFORMATION_CLASS): Define. (NtQueryEvent): Declare. * fhandler.h (fhandler_base::fs_flags): Remove. (fhandler_base::set_fs_flags): Remove. (fhandler_base::get_fs_flags): Remove. * fhandler.cc (fhandler_base::write): Check for sparse file using pc.fs_flags(). * fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Ditto. The return of the volume serial number in fs_info. * fhandler.h (get_dev): New method. * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop call to NtQueryVolumeInformationFile(FileFsVolumeInformation). Just use get_dev() method. * fhandler_fifo.cc (fhandler_fifo::open) Use device ID and inode number to generate fifo name. * path.h (fs_info::sernum): New member. (fs_info::serial_number): New method. (path_conv::fs_serial_number): New method. * path.cc (fs_info::update): Fetch volume serial number and store in sernum.
2008-03-27 * flock.cc (FLOCK_PARENT_DIR_ACCESS): Define.Corinna Vinschen
(FLOCK_INODE_DIR_ACCESS): Define. (FLOCK_MUTANT_ACCESS): Define. (FLOCK_EVENT_ACCESS): Define. (SD_MIN_SIZE): Define. (everyone_sd): Define to simplify calling _everyone_sd. (_everyone_sd): Replace everyone_sync_sd. Take SECURITY_DESCRIPTOR as argument and allow to specify access mask. (get_lock_parent_dir): Open/Create parent dir with FLOCK_PARENT_DIR_ACCESS. Add text to api_fatal message. (inode_t::inode_t): Open/Create dir with FLOCK_INODE_DIR_ACCESS. Open/Create mutant with FLOCK_MUTANT_ACCESS. Add text to api_fatal message. (lockf_t::create_lock_obj): Create event with FLOCK_EVENT_ACCESS. Add text to api_fatal message. (lockf_t::open_lock_obj): Open event with FLOCK_EVENT_ACCESS. On failure, just return NULL pointer instead of calling api_fatal. (lockf_t::get_lock_obj_handle_count): Replace call to small_printf with call to debug_printf. (lf_setlock): Handle a failure to open the lock event object as EDEADLK. Call system_printf if opening sync objects fail. * ntdll.h (DIRECTORY_TRAVERSE): Define. (DIRECTORY_CREATE_OBJECT): Define. (DIRECTORY_CREATE_SUBDIRECTORY): Define. (EVENT_QUERY_STATE): Define.
2008-03-27* hookapi.cc (find_first_notloaded_dll): New function.Christopher Faylor
* pinfo.cc (status_exit): New function. Issue message when dll not found. Use find_first_notloaded_dll to find a nonexistent dll. (pinfo::maybe_set_exit_code_from_windows): Call status_exit when exit code >= 0xc0000000UL. * sigproc.cc (child_info::proc_retry): Return exit code when STATUS_DLL_NOT_FOUND. * spawn.cc (spawn_guts): Minor cleanup. * syscalls.cc (close_all_files): Don't actually close stderr filehandle. Just make it noninheritable. * winsup.h (find_first_notloaded_dll): Declare new function. * ntdll.h: Add several missing NTSTATUS defines.
2008-03-24 * fhandler.cc (fhandler_base::dup): Drop setting flags in the parent.Corinna Vinschen
Implement advisory file locking. * cygheap.h (struct init_cygheap): Add inode_list member. * cygwin.din (lockf): Export. * dcrt0.cc (child_info_spawn::handle_spawn): Call fixup_lockf_after_exec. * dtable.h (class dtable): Add fhandler_disk_file as friend class. * fhandler.cc (fhandler_base::close): Call del_my_locks if node is set. (fhandler_base::fhandler_base): Initialize node to NULL. (fhandler_base::fixup_after_fork): Ditto. * fhandler.h (class fhandler_base): Add member node. * fhandler_disk_file.cc (fhandler_disk_file::lock): Delete. * flock.cc: Implement all advisory file locking here. (fhandler_disk_file::lock): Implement here. (flock): Call fcntl with F_FLOCK bit set. Remove test main function. (lockf): New function. * fork.cc (frok::child): Call fixup_lockf_after_fork. * ntdll.h (DIRECTORY_ALL_ACCESS): Define. (struct _OBJECT_BASIC_INFORMATION): Define. (enum _EVENT_TYPE): Define. (NtCreateDirectoryObject): Declare. (NtCreateEvent): Declare. (NtCreateMutant): Declare. (NtOpenEvent): Declare. (NtOpenMutant): Declare. * include/cygwin/version.h: Bump API minor number.
2008-02-15Perform whitespace cleanup throughout.Christopher Faylor
* dcrt0.cc (signal_shift_subtract): Eliminate ancient backwards compatibility. (check_sanity_and_sync): Ditto. * winsup.h (SIGTOMASK): Ditto. Just use constant in signal calculation. * include/cygwin/version: Remove backwards signal mask compatibility define. * path.cc (symlink_info::check_sysfile): Cosmetic change. * registry.cc (get_registry_hive_path): Remove unneeded variable. * exceptions.cc (handle_sigsuspend): Eliminate thread signal mask and use either main sigmask or current thread sigmask. (set_process_mask): Ditto. (sighold): Ditto. (sigrelse): Ditto. (sigset): Ditto. (set_process_mask_delta): Ditto. (_cygtls::call_signal_handler): Ditto. * fhandler_process.cc (format_process_status): Ditto. * fhandler_termios.cc (fhandler_termios::bg_check): Ditto. * pinfo.h (class pinfo): Ditto. * select.cc (pselect): Ditto. * signal.cc (sigprocmask): Ditto. (abort): Ditto. (sigpause): Ditto. (sigsend): Ditto. (wait_sig): Ditto. * thread.h (pthread::parent_tls): New member. * thread.cc (pthread::pthread): Record parent_tls here. (pthread::thread_init_wrapper): Initialize sigmask from parent thread.
2008-02-10 * Makefile.in (DLL_OFILES): Add ntea.o.Corinna Vinschen
* cygwin.din (getxattr, listxattr, removexattr, setxattr, lgetxattr, llistxattr, lremovexattr, lsetxattr, fgetxattr, flistxattr, fremovexattr, fsetxattr): Export Linux extended attribute functions. Sort. * errno.cc (errmap): Add mappings for ERROR_EAS_DIDNT_FIT, ERROR_EAS_NOT_SUPPORTED, ERROR_EA_LIST_INCONSISTENT, ERROR_EA_TABLE_FULL, ERROR_FILE_CORRUPT, ERROR_INVALID_EA_NAME. * fhandler.h (class fhandler_base): Declare new fgetxattr and fsetxattr methods. (class fhandler_disk_file): Ditto. * fhandler.cc (fhandler_base::fgetxattr): New method. (fhandler_base::fsetxattr): New method. * fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): New method. (fhandler_disk_file::fsetxattr): New method. * ntdll.h (STATUS_EA_TOO_LARGE): Define. (STATUS_NONEXISTENT_EA_ENTRY): Define. (STATUS_NO_EAS_ON_FILE): Define. * ntea.cc (read_ea): Rewrite for long pathnames and for using with Linux extended attribute functions. (write_ea): Ditto. (getxattr_worker): New static function. (getxattr): New function. (lgetxattr): New function. (fgetxattr): New function. (listxattr): New function. (llistxattr): New function. (flistxattr): New function. (setxattr_worker): New static function. (setxattr): New function. (lsetxattr): New function. (fsetxattr): New function. (removexattr): New function. (lsetxattr): New function. (fsetxattr): New function. * security.h (read_ea): Change declaration according to above changes. (write_ea): Ditto. * include/cygwin/version.h: Bump API minor version.
2008-01-22 * ntdll.h (struct _FILE_FS_OBJECTID_INFORMATION): Define.Corinna Vinschen
* path.cc (struct smb_extended_info): Define. (fs_info::update): Request object id info to get Samba information. Set flags according to new implementation. * path.h (struct fs_info): Add samba_version to status_flags. Implement flags() and samba_version() using IMPLEMENT_STATUS_FLAG.
2007-12-12 * dcrt0.cc: Include string.h.Corinna Vinschen
(initial_env): Use small_printf's %P specifier. * dll_init.cc (dll_list::alloc): Use PATH_MAX instead of CYG_MAX_PATH for path name buffer size. * dll_init.h (struct dll): Ditto. * environ.cc: Include string.h. (win_env::add_cache): Use temporary local buffer for path conversion. (posify): Ditto. * exceptions.cc (try_to_debug): Use CreateProcessW to allow long path names. * miscfuncs.cc: Drop unused implementations of strcasematch and strncasematch. (ch_case_eq): Drop. (strcasestr): Drop. (cygwin_wcscasecmp): New function. (cygwin_wcsncasecmp): New function. (cygwin_strcasecmp): New function. (cygwin_strncasecmp): New function. (cygwin_wcslwr): New function. (cygwin_wcsupr): New function. (cygwin_strlwr): New function. (cygwin_strupr): New function. * ntdll.h (RtlDowncaseUnicodeString): Declare. (RtlUpcaseUnicodeString): Declare. (RtlInt64ToHexUnicodeString): Fix typo in comment. * string.h: Disable not NLS aware implementations of strcasematch and strncasematch. (cygwin_strcasecmp): Declare. (strcasecmp): Define as cygwin_strcasecmp. (cygwin_strncasecmp): Declare. (strncasecmp): Define as cygwin_strncasecmp. (strcasematch):Define using cygwin_strcasecmp. (strncasematch):Define using cygwin_strncasecmp. (cygwin_strlwr): Declare. (strlwr): Define as cygwin_strlwr. (cygwin_strupr): Declare. (strupr): Define as cygwin_strupr. * wchar.h: New file. * wincap.cc (wincapc::init): Use "NT" as fix OS string. * winsup.h (strcasematch): Drop declaration. (strncasematch): Ditto. (strcasestr): Ditto.
2007-10-23 * cygheap.h (struct cwdstuff): Drop hash member. Drop get_hash,Corinna Vinschen
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.
2007-10-15 * fhandler.cc (is_at_eof): Rewrite using NT functions.Corinna Vinschen
(off_current): New static variable. (off_append): Ditto. (fhandler_base::raw_write): Use NtWriteFile. Accommodate O_APPEND here. (fhandler_base::write): Drop O_APPEND hack. Use NT functions. (fhandler_base::lseek): Rewrite using NT functions. * fhandler_disk_file.cc (fhandler_disk_file::fstatvfs): Add space in debug output. (fhandler_disk_file::ftruncate): Ditto. * ntdll.h (STATUS_DISK_FULL): Define. (FILE_USE_FILE_POINTER_POSITION): Define. (FILE_WRITE_TO_END_OF_FILE): Define.
2007-10-13 * ntdll.h (STATUS_END_OF_FILE): Define.Corinna Vinschen
* 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.
2007-09-27 * ntdll.h (struct _FILE_COMPRESSION_INFORMATION): Align with definitionCorinna Vinschen
in w32api / MSDN. * fhandler_disk_file.cc (fhandler_base::fstat_helper): Accommodate change to struct _FILE_COMPRESSION_INFORMATION.
2007-09-20 * ntdll.h (STATUS_OBJECT_NAME_INVALID): Define.Corinna Vinschen
2007-08-23 * ntdll.h (STATUS_NO_SUCH_FILE): Define.Corinna Vinschen
* path.cc (get_nt_native_path): Reset upath.Length to 0 on each invocation. (symlink_info::check): Use NT native functions.
2007-08-21 * ntdll.h (NtNotifyChangeDirectoryFile): Declare.Corinna Vinschen
(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.
2007-08-16 * ntdll.h (RtlAcquirePebLock): Declare.Corinna Vinschen
(RtlReleasePebLock): Declare. * path.cc (cwdstuff::set): Change PEB only while it's locked.
2007-08-16 * ntdll.h (RtlCreateUnicodeStringFromAsciiz): Fix declaration.Corinna Vinschen
(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.
2007-08-15 * fhandler_socket.cc (get_inet_addr): Use NT native functions forCorinna Vinschen
accessing the file representing the local socket. (fhandler_socket::bind): Ditto. * ntdll.h: Declare NtReadFile.
2007-08-13 * devices.in (dev_storage): Use native NT device name for kmsg mailslot.Corinna Vinschen
* 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.
2007-08-12 * ntdll.h: Add descriptive comments to special Rtl functions.Corinna Vinschen
(STATUS_OBJECT_PATH_NOT_FOUND): Define. (STATUS_BUFFER_OVERFLOW): Define. (FILE_SUPERSEDED): Define. (FILE_OPENED): Define. (FILE_CREATED): Define. (FILE_OVERWRITTEN): Define. (FILE_EXISTS): Define. (FILE_DOES_NOT_EXIST): Define. (PIO_APC_ROUTINE): Typedef. (NtFsControlFile): Fix parameter types to use PIO_APC_ROUTINE. (NtWriteFile): Declare. (RtlInt64ToHexUnicodeString): Declare. * strfuncs.cc: Include ntdll.h. (RtlInt64ToHexUnicodeString): New function. * syscalls.cc (try_to_bin): Rewrite using native NT functions. Only try to create recycle bin after unsuccessfully trying to move file. Also try to create special files in recycle bin so that Windows Explorer isn't unnecessarily stampeded.
2007-08-09 * syscalls.cc (rename): Close oldpath file handle immediately afterCorinna Vinschen
trying to rename it. Use nfh handle when checking for non-empty newpath directory. Only change status if check_dir_not_empty really returns STATUS_DIRECTORY_NOT_EMPTY.
2007-08-01 * ntdll.h (STATUS_ACCESS_DENIED): Define.Corinna Vinschen
* syscalls.cc (check_dir_not_empty): New static function. (unlink_nt): Move code checking for non-empty dir to check_dir_not_empty and call check_dir_not_empty instead. (rename): Add fault handler. Check oldpath and newpath for trailing . and .. path components and return EINVAL if so. Check oldpath for being on a vrtual file system. If renaming a dir fails with STATUS_ACCESS_DENIED, check if the target dir is non-empty and return ENOTEMPTY if so.
2007-08-01 * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): DropCorinna Vinschen
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.
2007-08-01 * ntdll.h (RtlFreeAnsiString): Declare.Corinna Vinschen
* ntdll.h (RtlFreeOemString): Declare. * ntdll.h (RtlUnicodeStringToAnsiString): Declare. * ntdll.h (RtlUnicodeStringToOemString): Declare. * smallprint.cc: Renamed from smallprint.c. Drop unnecessary forward declarations. (__small_vsprintf): Add format specifiers 'C' for WCHAR arguments and 'S' for PUNICODE_STRING arguments.
2007-07-31 * fhandler_disk_file.cc (fhandler_disk_file::link): Revert to checkingCorinna Vinschen
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.
2007-07-29 * fhandler_disk_file.cc (fhandler_disk_file::link): Use FILE_ANY_ACCESS.Corinna Vinschen
(fhandler_base::utimes_fs): Fix white space. (fhandler_disk_file::lock): Remove 9x blurb from comment. (fhandler_disk_file::mkdir): Use NtCreateFile/NtClose instead of CreateDirectoryA. (fhandler_disk_file::rmdir): Accommodate changes to unlink_nt. Simplify post-delete SMB-related tests. Use NtQueryAttributesFile instead of GetFileAttributes. * ntdll.h (STATUS_DIRECTORY_NOT_EMPTY): Define. (NtQueryAttributesFile): Declare. * syscalls.cc (unlink_nt): Return NTSTATUS. Drop setattrs parameter. Never use FILE_DELETE_ON_CLOSE, always use NtSetInformationFile(FileDispositionInformation) instead. Check for R/O attributes and open file with FILE_WRITE_ATTRIBUTES access if any of them are set. Remove R/O attributes before marking for delete if necessary. Revert them afterwards if necessary. (unlink): Accommodate changes to unlink_nt.
2007-07-29 * fhandler_disk_file.cc: Use get_handle throughout.Corinna Vinschen
(fhandler_disk_file::fchmod): Always try to open file with required access rights. Use NtSetInformationFile instead of SetFileAttributes. (fhandler_disk_file::facl): Use NtSetInformationFile instead of SetFileAttributes. (fhandler_base::utimes_fs): Change lastaccess and lastwrite to LARGE_INTEGER. Drop 9x directory case. Use NtSetInformationFile instead of SetFileAttributes. Drop temporarily changing R/O attribute since NtSetInformationFile(FileBasicInformation) also works on R/O files. * ntdll.h (STATUS_NOT_SUPPORTED): Define.
2007-07-28 * ntdll.h (RtlEqualUnicodePathPrefix): Rename from RtlEqualPathPrefix.Corinna Vinschen
(RtlEqualUnicodePathSuffix): Rename from RtlEqualPathSuffix. * fhandler_disk_file.cc (fhandler_disk_file::link): Accommodate above change.
2007-07-28 * ntdll.h (RtlInitCountedUnicodeString): Swap order of string and lengthCorinna Vinschen
parameters to be the same as for RtlInitEmptyUnicodeString. (RtlEqualPathPrefix): New inline function. (RtlEqualPathSuffix): New inline function. * fhandler_disk_file.cc: Accommodate parameter order change of RtlInitEmptyUnicodeString throughout. (fhandler_disk_file::link): Do path checking in unicode. Call CopyFileW instead of CopyFileA.
2007-07-27 * autoload.cc (CreateHardLinkA): Remove.Corinna Vinschen
* fhandler_disk_file.cc (fhandler_disk_file::link): Drop GetBinaryType test. Just check exe suffix instead. Tune creating new file name. Implement creating hard link using native NT functions which works on all platforms. * ntdll.h (STATUS_INVALID_DEVICE_REQUEST): Define. (struct _FILE_LINK_INFORMATION): Define.
2007-07-27 * fhandler_disk_file.cc (fhandler_base::fstat_by_name): UseCorinna Vinschen
RtlSplitUnicodePath. (fhandler_disk_file::fstat): Rename oret to opened. Open file using NT functions right here. Try to open parent dir instead of root directory to avoid call to rootdir. Use NtFsControlFile. * ntdll.h (RtlSplitUnicodePath): Define.
2007-07-26 * dir.cc (readdir_worker): Drop dir parameter from call toCorinna Vinschen
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.