summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
Commit message (Collapse)AuthorAgeFilesLines
* 2003-02-23 Pierre Humblet <pierre.humblet@ieee.org>Pierre Humblet2003-02-232-3/+5
| | | | | * syslog.cc (syslog): Do not unlock the file before closing it and remove debug_printf about stream errors.
* whitespaceChristopher Faylor2003-02-221-1/+1
|
* * cygmalloc.h: Remove MORECORE_CANNOT_TRIM. It's not true. # cygwin.din:Christopher Faylor2003-02-224-1/+25
| | | | Export mallinfo. # malloc_wrapper.cc (mallinfo): New function.
* * syslog.cc (syslog): Do not print the Windows pid. Print the Cygwin pid as anChristopher Faylor2003-02-224-12/+29
| | | | | unsigned decimal. On Win95 print a timestamp and attempt to lock the file up to four times in 3 ms.
* * fhandler_socket.cc (fhandler_socket::fhandler_socket): Fix compilerCorinna Vinschen2003-02-212-11/+13
| | | | | | warning. (fhandler_socket::fstat): Simplify. Set st_uid/st_gid to effective uid/gid of current process in case of open sockets.
* * dtable.cc (dtable::build_fhandler_from_name): Set some fhandlerCorinna Vinschen2003-02-2111-85/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data on sockets to evaluate AF_LOCAL sockets correctly. (dtable::build_fhandler): Set unit number on sockets. * fhandler.h (fhandler_socket): Add unit number. (fhandler_socket::get_unit): New method. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Set unit number. (fhandler_socket::fstat): Reorganize to return more Linux-like values. * net.cc: include ctype.h. (fdsock): Set unit number when building fhandler. * path.cc (path_conv::check): Set device type to FH_SOCKET if file is a AF_UNIX socket. (get_devn): Evaluate unit for virtual socket devices. (win32_device_name): Set windows path for sockets to unix_path with just backslashes to keep the different names. * syscalls.cc (fstat64): Don't override st_ino, st_dev and st_rdev for sockets. (stat_worker): Ditto. From Pierre Humblet: * autoload.cc (AccessCheck): Add. (DuplicateToken): Add. * security.h (check_file_access): Declare. * syscalls.cc (access): Convert path to Windows, check existence and readonly attribute. Call check_file_access instead of acl_access. * security.cc (check_file_access): Create. * sec_acl (acl_access): Delete.
* * fhandler.cc (fhandler_base::open): Move some filesystem specific stuff.Christopher Faylor2003-02-214-27/+38
| | | | | | (fhandler_disk_file::open): Accept some filesystem specific stuff. * sigproc.cc (wait_for_sigthread): Become slightly more thread safe. (sig_send): Don't assume that signal thread is ready.
* * wincap.h (wincap): Remove unnecessary definition ofCorinna Vinschen2003-02-203-24/+17
| | | | | supports_sparse_files. * wincap.cc: Ditto.
* * fhandler_disk_file.cc (fhandler_disk_file::opendir): Check descriptorCorinna Vinschen2003-02-205-159/+197
| | | | | | | | | | | | created by cygheap_fdnew constructor. * fhandler_virtual.cc (fhandler_virtual::opendir): Ditto. * fhandler_socket.cc (fhandler_socket::accept): Ditto and move creation of file descriptor behind blocking OS call. * net.cc (cygwin_socket): Ditto. (cygwin_rcmd): Ditto. (cygwin_rresvport): Ditto. (cygwin_rexec): Ditto. (socketpair): Ditto.
* * autoload.cc (GetCompressedFileSize): Add.Corinna Vinschen2003-02-203-1/+21
| | | | | * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Compute st_blocks value from GetCompressedFileSize() if available.
* w32api:Corinna Vinschen2003-02-205-11/+59
| | | | | | | | | | | | | | | | | | | | | | | | * include/winioctl.h (FSCTL_SET_SPARSE): Define. cygwin: * wincap.h (wincaps::supports_sparse_files): New flag. (wincapc::supports_sparse_files): New method. * wincap.cc (wincap_unknown): Define value for the new flag. (wincap_95): Ditto. (wincap_95osr2): Ditto. (wincap_98): Ditto. (wincap_98se): Ditto. (wincap_me): Ditto. (wincap_nt3): Ditto. (wincap_nt4): Ditto. (wincap_nt4sp4): Ditto. (wincap_2000): Ditto. (wincap_xp): Ditto. * path.h (path_conv::fs_flags): New method. * fhandler_disk_file.cc: Include winioctl.h for DeviceIoControl. (fhandler_disk_file::open): Set newly created and truncated files as sparse on platforms that support it.
* * grp.cc (internal_getgroups): Handle properly tokens withCorinna Vinschen2003-02-182-3/+6
| | | | no groups. Fix bug introduced on 2003-02-04.
* * cygwin.din: Export all appropriate newlibc libm functions. Sort.Christopher Faylor2003-02-163-448/+481
| | | | * include/cygwin/version.h: Bump API minor number.
* * cygwin.din: Export all appropriate newlib functions.Christopher Faylor2003-02-153-3/+82
| | | | * include/cygwin/version.h: Bump API minor number.
* * mmap.cc (mprotect): Add missing break.Corinna Vinschen2003-02-142-0/+5
|
* * exceptions.cc (try_to_debug): Don't reset priority when returning fromChristopher Faylor2003-02-142-3/+6
| | | | non-waitloop call.
* * fhandler_console.cc (fhandler_console::write_normal): Use MessageBeep forChristopher Faylor2003-02-133-1/+10
| | | | | bell sound. * autoload.cc (MessageBeep): Add.
* * include/cygwin/types.h: Use correct ifdef guard for u_ definitions.Christopher Faylor2003-02-132-8/+12
|
* * environ.cc (environ_init): Use strechr.Christopher Faylor2003-02-131-0/+4
|
* oops.Christopher Faylor2003-02-131-1/+1
|
* * include/cygwin/in.h (sockaddr_in): Fix typo.Christopher Faylor2003-02-133-3/+95
|
* * path.h (path_conv): Reorganize slightly.Christopher Faylor2003-02-132-2/+8
|
* * fhandler_tty.cc (process_input): Add sanity check to ensure that consoleChristopher Faylor2003-02-131-0/+5
| | | | typeahead is cleared on signal.
* * spawn.cc (linebuf::~linebuf): Resurrect commented out (for debugging?) code.Christopher Faylor2003-02-134-3/+10
|
* * include/cygwin/in.h (in_attr_t): Define new type.Christopher Faylor2003-02-108-84/+233
| | | | | | | | | | | | | | | | | | * include/arpa/inet.h (inet_addr): Change return type to in_addr_t. (inet_lnaof): Ditto. (inet_netof): Ditto. (inet_network): Ditto. * include/cygwin/types.h: Move many *_t typedefs here. Protect them with ifdefs. * fhandler_disk_file.cc (fhandler_disk_file::fstat): Change ntsec_atts to mode_t. * security.cc (get_attribute_from_acl): Accept mode_t attribute. (get_nt_attribute): Ditto. (get_file_attribute): Ditto. (get_nt_object_attribute): Ditto. (get_object_attribute): Ditto. * security.h: Reflect above changes. * syscalls.cc (chown_worker): Change attrib to mode_t.
* clarifyChristopher Faylor2003-02-081-1/+1
|
* * include/cygwin/version.h: Bump DLL minor number.Christopher Faylor2003-02-083-2/+11
| | | | | * malloc.cc (DEFAULT_MMAP_THRESHOLD): Bump down to 16MB thanks to below changes.
* * mmap.cc (mmap_record::alloc_map): De-inline. Add offset and lengthCorinna Vinschen2003-02-072-104/+121
| | | | | | | | | | | | | | | | parameter. Only protect pages actually unused currently. Do job of map_map() when initializing a map. (mmap_record::map_map): Reduce functionality for the reuse case of private anonymous mapping. (mmap_record::fixup_map): Format change. (list::add_record): Add offset and length parameter to call mmap_record::alloc_map() correctly. (mmap64): Rename `l' variable to `map_list'. Accomodate above changes. (munmap): Rename `l' variable to `map_list'. (msync): Ditto. (fhandler_disk_file::mmap): Streamline code. (mprotect): Ditto. (fixup_mmaps_after_fork): Rename `l' variable to `map_list'.
* Christopher Faylor <cgf@redhat.com>Christopher Faylor2003-02-072-4/+14
| | | | | | * exceptions.cc (try_to_debug): Set priority of current thread rather than the main thread. Make busy waiting loop less busy. Restore priority when function returns.
* * malloc.cc (DEFAULT_MMAP_THRESHOLD): Set high to avoid mmaps.Christopher Faylor2003-02-073-0/+11
| | | | * pipe.cc (fhandler_pipe::close): Avoid extraneous this->.
* * pipe.cc (fhandler_pipe::close): Avoid extraneous this->.Christopher Faylor2003-02-071-1/+1
|
* * heap.cc (heap_init): Remove debugging code.Christopher Faylor2003-02-072-15/+5
|
* * security.h: Introduce names UNKNOWN_UID and UNKNOWN_GID and deleteCorinna Vinschen2003-02-066-47/+18
| | | | | | | | | | declaration of is_grp_member. * uinfo.cc (internal_getlogin): Use UNKNOWN_GID. * passwd.cc (pwdgrp::read_passwd): Use UNKNOWN_UID. * grp.cc (pwdgrp::read_group): Change group name to provide better feedback. (getgrgid): Use gid16togid32. * sec_helper.cc (is_grp_member): Delete.
* * path.cc: Change 'to_posix_p' to 'to_posix' throughout.Christopher Faylor2003-02-052-15/+29
| | | | (conv_path_list_buf_size): Accommodate relative paths.
* * path.cc (etc::dir_changed): Fix debug printf.Christopher Faylor2003-02-052-2/+5
|
* * sec_acl.cc (setacl): Move all permission settings to beginning ofCorinna Vinschen2003-02-053-99/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | loop. Set default rights to same values as in alloc_sd(). Set DELETE for owner and default owner only if S_IWOTH is given. * sec_acl.cc: Change all __aclent16_t to __aclent32_t except in wrapper function definitions. Replace call to the aclXYZ functions by calls aclXYZ32. (searchace): Change type of third argument to __uid32_t and use ILLEGAL_UID instead of -1; (setacl): Remove some initializations. Only give STANDARD_RIGHTS_WRITE for S_IWOTH. Replace -1 by ILLEGAL_UID. (getacl): Change type of owner_sid, group_sid and ace_sid to cygpsid. In last else clause, suppress second call to ace_sid.get_id and use TRUE in first call. Replace EqualSid by ==. (acl_access): Call internal_getgroups in USER and GROUP cases. (acecmp: Define static. (acl32): Create from 16 bit type. (facl32): Ditto. (lacl32): Ditto. (aclcheck32): Ditto. (aclsort32): Ditto. (acltomode32): Ditto. (aclfrommode32): Ditto. (acltopbits32): Ditto. (aclfrompbits32): Ditto. (acltotext32): Ditto. (aclfromtext32): Ditto, and use strechr. (acl16to32): Create. (acl): Make it a wrapper function. (facl): Ditto. (lacl): Ditto. (aclcheck): Ditto. (aclsort): Ditto. (acltomode): Ditto. (aclfrommode): Ditto. (acltopbits): Ditto. (aclfrompbits): Ditto. (acltotext): Ditto. (aclfromtext): Ditto. * security.cc (write_sd): Call set_process_privilege and check ownership. (alloc_sd): Remove call to set_process_privilege and the owner check.
* * include/sys/cygwin.h: Use C-style comments.Christopher Faylor2003-02-052-21/+25
|
* * sec_helper.cc (get_sids_info): New function.Corinna Vinschen2003-02-053-24/+72
| | | | | | | | | | | * security.cc (extract_nt_dom_user): Simplify with strechr. (get_user_groups): Initialize glen to MAX_SID_LEN. (get_user_local_groups): Ditto. (get_attribute_from_acl): Define ace_sid as cygpsid. (get_nt_attribute): Define owner_sid and group_sid as cygpsid. Call get_sids_info instead of cygsid.get_{u,g}id and is_grp_member. (get_nt_object_attribute): Ditto. (alloc_sd): Define ace_sid as cygpsid.
* * syscalls.cc (struct system_cleanup_args): New struct.Thomas Pfaff2003-02-042-8/+31
| | | | | | (system_cleanup): New function. (system): Use pthread_cleanup_push and _pop to save and restore signal handlers and sigprocmask.
* * path.cc (symlink): Create security attributes so that only theCorinna Vinschen2003-02-043-5/+8
| | | | | | user can modify the symlink. * security.cc (set_security_attribute): Remove symlink special handling.
* * grp.cc (internal_getgroups): Do not return without closingCorinna Vinschen2003-02-042-20/+26
| | | | the process handle.
* * security.h (class cygpsid): New class.Corinna Vinschen2003-02-046-91/+123
| | | | | | | | | | | | | | | | | (class cygsid): Use cygpsid as base. Remove members psid, get_id, get_uid, get_gid, string, debug_printf and the == and != operators. (cygsidlist::clear_supp): Only do work if setgroups has been called. * sec_helper.cc: Define sid_auth NO_COPY. (cygpsid::operator==): New operator. (cygpsid::get_id): New function. (cygpsid::string): New function. (cygsid::string): Delete. (cygsid::get_id): Delete. * pwdgrp.h: Change arguments of internal_getpwsid, internal_getgrsid and internal_getgroups to cygpsid. * passwd.cc (internal_getpwsid): Change argument from cygsid to cygpsid. * grp.cc (internal_getgrsid): Ditto. (internal_getgroups): Ditto.
* Eliminate most unneeded this-> pointers throughout.Christopher Faylor2003-02-0414-33/+37
|
* * security.h: Add third argument to set_process_privilege.Corinna Vinschen2003-02-035-8/+33
| | | | | | | | | * autoload.cc: Add OpenThreadToken. * sec_helper.cc (set_process_privilege): Add and use use_thread argument. * security.cc (alloc_sd): Modify call to set_process_privilege. Remember the result in each process. If failed and file owner is not the user, fail.
* * fhandler_socket.cc (fhandler_socket::recvfrom): Return bufferCorinna Vinschen2003-02-032-1/+18
| | | | | length and don't set errno in case of WSAEMSGSIZE error. (fhandler_socket::recvmsg): Ditto.
* * grp.cc (getgrent32): Only refresh group entries when at beginning.Christopher Faylor2003-02-014-11/+21
| | | | | | | | | | (internal_getgrsid): Only refresh if uninitialized. (internal_getgrent): Ditto. * passwd.cc (getpwent): Only refresh passwd entries when at beginning. (pwdgrp::read_passwd): linebuf *cannot* be NO_COPY. (internal_getpwsid): Only refresh if uninitialized. (getpass): No need to refresh passwd data here. * pwdgrp.h (refresh): Eliminate default.
* * dlfcn.cc (dlerror): Only report load errors once per error.Christopher Faylor2003-02-012-4/+13
|
* * fhandler_serial.cc (fhandler_serial::open): Avoid extraneous setting of res.Christopher Faylor2003-02-013-161/+187
| | | | | | | | | | | * termios.cc (tcsetattr): Correctly record errno after tcsetattr call. * fhandler_serial.cc (fhandler_serial::tcsetattr): Add error-checking so that if any Win32 SetComm*() calls fail, errno gets set to EINVAL and tcsetattr() returns -1. Catch invalid bitrates, mostly. If baud rate setting is B0, just drop DTR and leave Win32 DCB bitrate as-is since 0 is not a valid Win32 setting. (fhandler_serial::tcgetattr): If DTR is low, populate the bitrate as B0, otherwise get it from the DCB.
* * passwd.cc (pwdgrp::read_passwd): linebuf *must* be static (from PierreChristopher Faylor2003-01-313-4/+12
| | | | | | Humblet). * pwdgrp.h (pwdgrp::refresh): Avoid calling read function if we already have lock since that means we are in the process of reading the file.
* * shared.cc (shared_info::heap_chunk_size): Use correct variable when readingChristopher Faylor2003-01-312-1/+6
| | | | HKLM.