summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
...
* * Makefile.in (DLL_OFILES): Rearrange with one file per line.Corinna Vinschen2014-10-162-25/+155
|
* * fhandler_proc.cc (format_proc_partitions): Extend output to printCorinna Vinschen2014-10-162-6/+32
| | | | the windows mount points the device is mounted on.
* * fhandler_socket.cc (fhandler_socket::connect): Don't change stateCorinna Vinschen2014-10-142-2/+8
| | | | on WSAEALREADY error. Change comment accordingly.
* * cygheap.cc (init_cygheap::init_installation_root): Install Cygwin'sCorinna Vinschen2014-10-144-5/+65
| | | | | | | | | | | installation dir as DLL search path, instead of ".". * cygheap.h (class cwdstuff): Add parameter names in function declarations for readability. (cwdstuff::get): Ad inline implementation fetching the CWD as wide char string. * dlfcn.cc (dlopen): Add searching for dependent DLLs in DLL installation dir or CWD, if all else failed. Add comment to explain scenarios this is accommodating.
* * fhandler_socket.cc (fhandler_socket::connect): Init connect_state toCorinna Vinschen2014-10-142-4/+29
| | | | | | | connect_pending only on unconnected socket. Set connect_state to connected on WSAEISCONN error. Set connect_state to connect_failed on any other error except WSAEWOULDBLOCK if connect is still pending. Add lots of comment to explain why all of the above.
* * net.cc (cygwin_setsockopt): Drop redundant test for AF_LOCAL andCorinna Vinschen2014-10-132-3/+6
| | | | SOCK_STREAM in SO_PEERCRED case, as in the original patch.
* * dlfcn.cc (gfpod_helper): Only check for POSIX dir separator, same asCorinna Vinschen2014-10-122-1/+6
| | | | in get_full_path_of_dll.
* * dlfcn.cc (set_dl_error): Drop useless __stdcall.Corinna Vinschen2014-10-122-14/+23
| | | | | | | | | (check_path_access): Ditto. Drop FE_CWD from call to find_exec. (gfpod_helper): Call path_conv::check for all paths containing a dir separator to more closely follow the Linux search algorithm. (get_full_path_of_dll): Drop useless __stdcall. (dlopen): Simplify RTLD_NOLOAD case by calling GetModuleHandleEx instead of GetModuleHandle/LoadLibrary.
* Add setsockopt(sd, SOL_SOCKET, SO_PEERCRED, NULL, 0) to disableCorinna Vinschen2014-10-115-4/+74
| | | | | | | | | | | | | | | initial handshake on AF_LOCAL sockets. * fhandler.h (class fhandler_socket): Add no_getpeereid status flag. (fhandler_socket::af_local_set_no_getpeereid): New prototype. * fhandler_socket.cc (fhandler_socket::af_local_connect): Skip handshake if no_getpeereid is set. Add debug output. (fhandler_socket::af_local_accept): Likewise. (fhandler_socket::af_local_set_no_getpeereid): New function. (fhandler_socket::af_local_copy): Copy no_getpeereid. (fhandler_socket::getpeereid): Fail if no_getpeereid is set. * net.cc (cygwin_setsockopt): Add SO_PEERCRED for AF_LOCAL/SOCK_STREAM sockets. Add comment to explain why we need it. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
* * fhandler_socket.cc (fhandler_socket::af_local_connect): Drop outdatedCorinna Vinschen2014-10-112-12/+31
| | | | | | | | comment. (fhandler_socket::evaluate_events): Only set connect_state and call af_local_connect if connect_state is connect_pending. Explain why. Drop redundant test for socket family and type. (fhandler_socket::connect): Extend comment.
* * fhandler_socket.cc (fhandler_socket::evaluate_events): HandleCorinna Vinschen2014-10-114-57/+71
| | | | | | | | | | | | connect_state and af_local_connect connect call here, once, independent of FD_CONNECT being requested. Add comment to explain why. (fhandler_socket::connect): Drop connect_state handling and calling af_local_connect. Move remaining AF_LOCAL stuff prior to calling ::connect and explain why. Simplify error case. * poll.cc (poll): Handle connect state independently of POLLOUT being requested for the descriptor to allow setting POLLIN if connect failed. Add comment. * select.cc (set_bits): Drop connect_state and AF_LOCAL handling here.
* * fhandler_socket.cc (fhandler_socket::evaluate_events): SlightlyCorinna Vinschen2014-10-112-3/+8
| | | | rearrange code. Rephrase a comment.
* * dlfcn.cc (dlopen): Disable old 32 bit code on 64 bit.Corinna Vinschen2014-10-104-1/+13
| | | | | * dcrt0.cc (check_sanity_and_sync): Ditto. * dll_init.cc (dll_dllcrt0_1): Fix typo in comment.
* * fhandler_procsys.cc (fhandler_procsys::readdir): Just testCorinna Vinschen2014-10-093-30/+42
| | | | | | | | ObjectTypeName for object types rather than calling lstat to avoid performance hit. * globals.cc (ro_u_natdir): Define. (ro_u_natsyml): Define. (ro_u_natdev): Define.
* * fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Set d_typeCorinna Vinschen2014-10-092-1/+7
| | | | for virtual directories.
* * fhandler_proc.cc (fhandler_proc::readdir): Set dirent d_type.Corinna Vinschen2014-10-097-8/+61
| | | | | | | | | * fhandler_process.cc (fhandler_process::readdir): Ditto. * fhandler_procnet.cc (fhandler_procnet::readdir): Ditto. * fhandler_procsys.cc (fhandler_procsys::readdir): Ditto. * fhandler_procsysvipc.cc (fhandler_procsysvipc::readdir): Ditto. * fhandler_virtual.h (virt_ftype_to_dtype): Define new inline function to generate dirent d_type from virtual_ftype_t.
* Add accidentally missing ChangeLog for latest change.Corinna Vinschen2014-10-091-0/+9
|
* * common.din (ffsl): Export.Corinna Vinschen2014-10-083-17/+17
| | | | | | | | (ffsll): Export. * syscalls.cc (ffs): Implement using GCC intrinsic. (ffsl): Ditto. (ffsll): Ditto. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
* * syscall.cc (ffs): Fix crash of ffs (0x80000000) on 64 bit.Corinna Vinschen2014-10-082-3/+6
|
* * fhandler_process.cc (format_process_statm): Fix output of dirtyCorinna Vinschen2014-10-082-2/+7
| | | | pages. Add linefeed.
* Fix typoCorinna Vinschen2014-10-081-1/+1
|
* * fhandler_proc.cc (proc_tab): Add entry for cygdrive symlink.Corinna Vinschen2014-09-053-0/+21
| | | | (format_proc_cygdrive): New function to implement /proc/cygdrive.
* * exception.h (class exception): Remove unnecessary #ifdef.Corinna Vinschen2014-09-054-11/+28
| | | | | | | | * uinfo.cc (client_request_pwdgrp::client_request_pwdgrp): Fix length counter to include trailing NUL. * sec_auth.cc (get_user_groups): Add experimental exception handler. (get_user_local_groups): Ditto.
* * uinfo.cc (pwdgrp::fetch_account_from_windows): Handle APPLICATIONCorinna Vinschen2014-09-053-7/+26
| | | | | PACKAGE AUTHORITY SIDs. * winlean.h (DNLEN): Raise to 31. Explain why.
* * sec_acl.cc (aclcheck32): Check for required default entries as well.Corinna Vinschen2014-09-032-8/+14
| | | | | Enable check for missing CLASS_OBJ entries, now that setfacl creates them.
* * sec_acl.cc (aclsort32): Set errno to EINVAL if aclcheck32 failed.Corinna Vinschen2014-09-022-1/+8
|
* * uinfo.cc (pwdgrp::fetch_account_from_windows): Disallow user accountsCorinna Vinschen2014-08-312-0/+12
| | | | as groups. Add comment.
* * uinfo.cc (cygheap_pwdgrp::init): Fix comment. Rearrange code forCorinna Vinschen2014-08-312-19/+33
| | | | | | | | | style. (cygheap_pwdgrp::nss_init_line): Disable db_prefix and db_separator settings. Add comment. (pwdgrp::fetch_account_from_windows): Drop outdated comment. Fix code fetching primary group gid of group setting in SAM description field. Change comment accordingly.
* * uinfo.cc (pwdgrp::fetch_account_from_windows): Disallow creating anCorinna Vinschen2014-08-312-3/+8
| | | | entry for "NULL SID".
* * sec_acl.cc (setacl): Add comment. Handle NULL ACE for SUID, SGID,Corinna Vinschen2014-08-312-26/+133
| | | | | | and VTX bits. Create owner, group, other and NULL entries in the same way and in the same order as alloc_sd. (getacl): Skip NULL ACE.
* * fhandler.cc (fhandler_base::facl): Drop CLASS_OBJ entry.Corinna Vinschen2014-08-286-27/+78
| | | | | | | | | | | | * fhandler_disk_file.cc (fhandler_disk_file::facl): Ditto in noacl case. * sec_acl.cc (getacl): Compute useful fake CLASS_OBJ and DEF_CLASS_OBJ permission bits based on how these values are generated on Linux. Add commants to explain what the code is doing. * security.cc (get_attribute_from_acl): Compute group permission based on the actual primary group permissions and all secondary user and group ACCESS_ALLOWED_ACEs to emulate Linux' behaviour more closely. (check_access): Fix typos im comment. * include/cygwin/acl.h (MIN_ACL_ENTRIES): Redefine as 3.
* * fhandler_disk_file.cc (fhandler_disk_file::fstatvfs): Try theCorinna Vinschen2014-08-282-0/+26
| | | | | FileFsSizeInformation information class on filesystems choking on FileFsFullSizeInformation (I see you Netapp!)
* * fhandler.h (fhandler_pty_slave::fch_open_handles): Add bool parameterCorinna Vinschen2014-08-275-11/+26
| | | | | | | | | | | | | | | | | | | to declaration. * fhandler_tty.cc (fhandler_pty_slave::fch_open_handles): Add bool parameter "chown". Only request WRITE_OWNER access when opening pty synchronization objects if "chown" is set. (fhandler_pty_slave::fchmod): Call fch_open_handles with new bool parameter set to false. (fhandler_pty_slave::fchown): Call fch_open_handles with new bool parameter set to true. * kernel32.cc (CreateFileMappingW): Fix default standard rights for file mappings from READ_CONTROL to STANDARD_RIGHTS_REQUIRED to allow changing the DACL (fixes "access denied" error in pinfo::set_acl). * fhandler_disk_file.cc (fhandler_base::fstat_helper): Change debug output to print mode bits in octal. * security.cc (alloc_sd): Ditto. (set_file_attribute): Ditto.
* * kernel32.cc (CreateFileMappingW): Fix default standard rights forCorinna Vinschen2014-08-272-2/+9
| | | | | file mappings from READ_CONTROL to STANDARD_RIGHTS_REQUIRED to allow changing the DACL (fixes "access denied" error in pinfo::set_acl).
* * ntea.cc (read_ea): Change left-over return to __leave. FixCorinna Vinschen2014-08-273-15/+26
| | | | | | | | | condition to close handle. Call NtClose rather than CloseHandle. (write_ea): Fix condition to close handle. Call NtClose rather than CloseHandle. * security.cc (get_file_sd): Call pc.init_reopen_attr if a valid incoming handle was given, pc.get_object_attr otherwise. (set_file_sd): Ditto.
* * path.h (path_conv::init_reopen_attr): Change from void to returningCorinna Vinschen2014-08-266-21/+36
| | | | | | | | | | | | | POBJECT_ATTRIBUTES. Take OBJECT_ATTRIBUTES reference as argument, not pointer. * fhandler_disk_file.cc: Throughout accommodate above change. * syscalls.cc: Ditto. * ntea.cc (read_ea): Don't set hdl to NULL if it's already NULL. Set attr with pc.init_reopen_attr before trying to reopen file. (write_ea): Ditto. * security.cc (get_file_sd): Use pc.init_reopen_attr rather than pc.get_object_attr when trying to reopen file. (set_file_sd): Ditto.
* * cygtls.cc (san::leave/x86_64): Implement.Corinna Vinschen2014-08-253-17/+41
| | | | | | | | | | | | | * cygtls.h (class tls_pathbuf): Move counter variables into a union. Add 64 bit element _counters covering both counter variables to optimize save and restore operations. (class san/x86_64): Only store single 64 bit value. (san::san/x86_64): Implement. (san::leave/x86_64): Only declare here, as returns_twice function. Explain why. (class san/i686): Change type of _c_cnt and _w_cnt to uint32_t. (__try/x86_64): Move definition of __sebastian after the first memory barrier. Drop __sebastian.setup call.
* * cygtls.cc (_cygtls::remove): Revert previous patch.Corinna Vinschen2014-08-259-178/+206
| | | | | | | | | | | | | | | | | * cygtls.h (struct _local_storage): Move pathbufs back here. (class san/x86_64): Revert class. Save and restore pathbufs counters only. (class san/i686): Revert saving and restoring pathbufs counters. (__try/x86_64): Add a san variable and call it's setup method. (__except/x86_64): Call san::leave to restore pathbufs counters. * gendef (_sigbe): Revert previous change. * thread.cc (verifyable_object_state): Remove gcc 4.7 workaround in forward declaration as well. * tls_pbuf.cc (tls_pbuf): Revert previous change. * tls_pbuf.h (class tmp_pathbuf): Accommodate reverting pathbufs to locals structure. * tlsoffsets.h: Regenerate. * tlsoffsets64.h: Regenerate.
* * Throughout, use __try/__except/__endtry blocks, rather than myfaultCorinna Vinschen2014-08-2241-5678/+6137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handler. * cygtls.cc (_cygtls::remove): Accommodate the fact that pathbufs has been moved from _local_storage to _cygtls. * cygtls.h (class tls_pathbuf): Add comment to hint to gendef usage of counters. Change type of counters to uint32_t for clarity. Remove _cygtls as friend class. (struct _local_storage): Move pathbufs from here... (struct _cygtls): ...to here, allowing to access it from _sigbe. (class san): Only define on 32 bit. Remove errno, _c_cnt and _w_cnt members. (san::setup): Drop parameter. Don't initialize removed members. (san::leave): Don't set removed members. (class myfault): Only define on 32 bit. (myfault::faulted): Only keep implementation not taking any parameter. Drop argument in call to sebastian.setup. (__try/__leave/__except/__endtry): Implement to support real SEH. For now stick to SJLJ on 32 bit. * dcrt0.cc (dll_crt0_0): Drop 64 bit call to exception::install_myfault_handler. * exception.h (exception_handler): Define with EXCEPTION_DISPOSITION as return type. (PDISPATCHER_CONTEXT): Define as void * on 32 bit. Define as pointer to _DISPATCHER_CONTEXT on 64 bit. (class exception): Define separately for 32 and 64 bit. (exception::myfault): Add handler for myfault SEH handling on 64 bit. (exception::exception): Fix mangled method name to account for change in type of last parameter. (exception::install_myfault_handler): Remove. * exceptions.cc (exception::myfault_handle): Remove. (exception::myfault): New SEH handler for 64 bit. * gendef (_sigbe): Set tls_pathbuf counters to 0 explicitely when returning to the caller. * ntdll.h: Move a comment to a better place. (struct _SCOPE_TABLE): Define on 64 bit. * thread.cc (verifyable_object_isvalid): Remove gcc 4.7 workaround. * tls_pbuf.cc (tls_pbuf): Fix to accommodate new place of pathbufs. (tls_pathbuf::destroy): Change type of loop variables to uint32_t. * tls_pbuf.h (class tmp_pathbuf): Change type of buffer counters to uint32_t. Accommodate new place of pathbufs. * tlsoffsets.h: Regenerate. * tlsoffsets64.h: Regenerate.
* * miscfuncs.cc (__import_address): Cover the first dereference to impCorinna Vinschen2014-08-212-2/+7
| | | | under the fault handler.
* * net.cc (if_freenameindex): Don't catch a SEGV from free to failCorinna Vinschen2014-08-212-3/+5
| | | | loudly on double free.
* * dir.cc (rmdir): Don't skip deleting fh in the ENOTEMPTY case.Corinna Vinschen2014-08-212-4/+5
|
* * tls_pbuf.h (tmp_pathbuf::tmp_pathbuf): Convert to inline method.Corinna Vinschen2014-08-203-13/+18
| | | | | | (tmp_pathbuf::~tmp_pathbuf): Ditto. * tls_pbuf.cc (tmp_pathbuf::tmp_pathbuf): Remove here. (tmp_pathbuf::~tmp_pathbuf): Ditto.
* * dir.cc (dirfd): Per POSIX, return EINVAL on invalid directory stream.Corinna Vinschen2014-08-193-3/+13
| | | | | | (telldir): Per POSIX, return -1 and set errno to EBADF, rather than just returning 0, on invalid directory stream. * signal.cc (sigwaitinfo): Return -1, not EFAULT, when SEGV was catched.
* * fhandler.h (enum conn_state): Add "connect_credxchg" state.Corinna Vinschen2014-08-193-9/+31
| | | | | | | | | | (class fhandler_socket): Grant another bit to connect_state flag. * fhandler_socket.cc (fhandler_socket::af_local_connect): Rearrange variable definition. Set connect_state to connect_credxchg. (fhandler_socket::af_local_accept): Ditto. (fhandler_socket::recv_internal): Accept connect_credxchg on connection oriented AF_LOCAL sockets as well to allow the credential exchange. Extend comment to explain.
* * autoload.cc: Replace WNet[...]A with WNet[...]W imports.Corinna Vinschen2014-08-194-50/+78
| | | | | | | * dcrt0.cc (initial_env): Drop strlwr calls. Call strcasestr instead. * fhandler_netdrive.cc: Throughout, convert to calling WNet UNICODE functions. Use tmp_pathbuf rather than alloca. Replace call to strlwr with call to RtlDowncaseUnicodeString.
* * fhandler.h (fhandler_serial::is_tty): Reinstantiate.Corinna Vinschen2014-08-192-0/+6
|
* * miscfuncs.cc (strlwr): Rename from cygwin_strlwr. Drop __stdcallCorinna Vinschen2014-08-183-11/+14
| | | | | | | decoration. (strupr): Rename from cygwin_strupr. Drop __stdcall decoration. * string.h (strlwr): Remove override macro. Simply declare. (strupr): Ditto.
* *** empty log message ***Corinna Vinschen2014-08-181-0/+7
|
* * dtable.cc (dtable::init_std_file_from_handle): Mention that consoleCorinna Vinschen2014-08-185-20/+55
| | | | | | | | | | | | | | | handles are kernel objects since Windows 8. * fhandler.h (enum conn_state): Add "listener" state. (class fhandler_socket): Drop listener status flag. (fhandler_socket::lseek): Return -1 and errno ESPIPE. (fhandler_serial::lseek): Ditto. * fhandler_socket.cc (fhandler_socket::listen): Set connect_state to listener. Add comment. (fhandler_socket::accept4): Explicitely check if the socket is listening and fail with EINVAL, if not. Explain why we have to do that. (fhandler_socket::recv_internal): Explicitely check if the socket is connected if it's a stream socket. Explain why we have to do that. (fhandler_socket::getpeereid): Drop now redundant test.