summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_socket.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* * fhandler.h (class fhandler_dev_mem): Remove dup method declaration.Corinna Vinschen2011-07-311-20/+3
| | | | | | | | | | | | * fhandler_clipboard.cc (fhandler_dev_clipboard::dup): Accommodate the fact that the entire fhandler gets copied over to the child in operator =. * fhandler_floppy.cc (fhandler_dev_floppy::dup): Ditto. * fhandler_raw.cc (fhandler_dev_raw::dup): Ditto. * fhandler_serial.cc (fhandler_serial::dup): Ditto. * fhandler_socket.cc (fhandler_socket::dup): Ditto. * fhandler_virtual.cc (fhandler_virtual::dup): Ditto. * fhandler_mem.cc (fhandler_dev_mem::dup): Ditto. Remove entirely.
* Throughout change "WinSock" to "Winsock" in comments.Corinna Vinschen2011-07-291-6/+14
| | | | | | | | * fhandler_socket.cc (fhandler_socket::sendmsg): Add missing call to get_inet_addr to convert AF_LOCAL to AF_INET sockets. * net.cc (cygwin_socket): Workaround UDP Winsock problem. Add comment to explain why. * select.cc: Include winsock2.h rather than winsock.h.
* * fhandler.cc (fhandler_base::open): Don't open file with WRITE_DACCorinna Vinschen2011-07-051-2/+6
| | | | | | | | access on remote filesystem. Explain why. * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Ditto for directories. * fhandler_socket.cc (fhandler_socket::bind): Ditto for sockets. * path.cc (symlink_worker): Ditto for symlinks.
* whitespace eliminationChristopher Faylor2011-06-061-10/+10
|
* * fhandler_socket.cc (get_inet_addr): Rearrange for better readability.Corinna Vinschen2011-05-111-83/+111
| | | | | | | | | | | | | Make waiting loop interruptible and cancelable. Check for SYSTEM DOS flag before reading the file. Change return value to return 0 on success, SOCKET_ERROR on failure. (fhandler_socket::bind): Only set R/O DOS flag on filesystems not supporting ACLs. (fhandler_socket::connect): Accommodate changed return values from get_inet_addr. Use SOCKET_ERROR instead of -1. (fhandler_socket::sendto): Accommodate changed return values from get_inet_addr. * syslog.cc (connect_syslogd): Ditto.
* * fhandler.h (fhandler_socket::read): Declare.Corinna Vinschen2011-05-061-0/+16
| | | | | | | | | | | | | | (fhandler_socket::write): Declare. * fhandler_procsys.cc (fhandler_procsys::read): Add FIXME comment. (fhandler_procsys::write): Ditto. * fhandler_socket.cc (fhandler_socket::read): New method. (fhandler_socket::write): New method. * syscalls.cc: Rearrange order of read/write functions. (read): Call fhandler read method directly instead of just readv. (readv): Remove EINTR loop. This is done in all affected fhandler's now. (write): Call fhandler write method directly instead of just writev. Fix debug output.
* * fcntl.cc (fcntl64): Call pthread_testcancel.Corinna Vinschen2011-04-301-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fhandler_socket.cc (fhandler_socket::connect): Ditto. (fhandler_socket::accept4): Ditto. (fhandler_socket::recvfrom): Ditto. (fhandler_socket::recvmsg): Ditto. (fhandler_socket::sendto): Ditto. (fhandler_socket::sendmsg): Ditto. * flock.cc (lf_setlock): Allow to cancel thread running blocking file lock. Try to make code more readable. (lockf): Call pthread_testcancel. * mmap.cc (msync): Ditto. * posix_ipc.cc (ipc_cond_timedwait): Call pthread::static_cancel_self rather than pthread_testcancel. * select.cc (cygwin_select): Call pthread_testcancel. * syscalls.cc (pread): Ditto. (pwrite): Ditto. (readv): Ditto. (writev): Ditto. (open): Ditto. (close): Ditto. (fsync): Ditto. * termios.cc (tcdrain): Ditto. * thread.cc: Align list of cancellation points with above changes. Mark not-implemented functions, too. (cancelable_wait): Don't set unused object indices to WAIT_FAILED since that could result in wrong behaviour. Set them to the invalid value WAIT_TIMEOUT + 1 instead.
* * fhandler_socket.cc (fhandler_socket::evaluate_events): Handle theCorinna Vinschen2011-04-181-14/+38
| | | | | | | | | FD_CLOSE event specially when called from accept. Explain why. (fhandler_socket::shutdown): Fake success on not-connected socket and trigger socket event if the read side of a socket is affected. Explain why. * poll.cc (poll): Check for saw_shutdown_read on sockets to generate POLLHUP as well.
* * autoload.cc (GetExtendedTcpTable): Remove.Corinna Vinschen2011-04-021-68/+0
| | | | | | | | | | | | | (GetTcpTable): Remove. (CharNextExA): Remove. (FindWindowA): Remove. (ShowWindowAsync): Remove. * dcrt0.cc (disable_dep): Remove unused function. (dll_crt0_0): Drop comment babbling about TS & DEP. * fhandler_socket.cc (address_in_use): Remove unused function. * wincap.cc: Throughout, drop ts_has_dep_problem from wincaps. (wincapc::init): Drop code setting ts_has_dep_problem flag. * wincap.h (struct wincaps): Drop ts_has_dep_problem flags and method.
* * fhandler_socket.cc (get_inet_addr): Make externally available.Corinna Vinschen2011-03-291-1/+1
| | | | | | | | | | * autoload.cc (GetUdpTable): Define. * syslog.cc (connect_syslogd): Use get_inet_addr rather than _stat64 to check for local socket file. Create socket with type returned by get_inet_addr. If connect on UDP socket works, test if there's really a listening peer, otherwise fall back to Windows event log. (try_connect_syslogd): Use syslogd_inited flag to check if syslogd is available.
* * fhandler.cc (fhandler_base::open): When creating a file on aCorinna Vinschen2011-03-081-3/+10
| | | | | | | | | | | | | | | filesystem supporting ACLs, create the file with WRITE_DAC access. Explain why. * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Ditto for directories. * fhandler_socket.cc (fhandler_socket::bind): Ditto for sockets. * path.cc (symlink_worker): Ditto for symlinks. * security.cc (get_file_sd): Always call GetSecurityInfo for directories on XP and Server 2003. Improve comment to explain why. (set_file_attribute): Explicitely cast mode_t value to bool in call to get_file_sd. * wincap.h (wincaps::use_get_sec_info_on_dirs): New element. * wincap.cc: Implement above element throughout.
* * fhandler_socket (fhandler_socket::readv): Call recv_internal directly,Corinna Vinschen2011-02-211-24/+20
| | | | | | | | | | rather than recvmsg. (fhandler_socket::writev): Call send_internal directly, rather than sendmsg. * net.cc (cygwin_recv): Call fhandler_socket::recvfrom directly, rather than cygwin_recvfrom. (cygwin_send): Call fhandler_socket::sendto directly, rather than cygwin_sendto.
* * Throughout fix copyright dates.Corinna Vinschen2011-02-151-1/+1
|
* * fhandler_socket.cc (address_in_use): Improve comment readability.Corinna Vinschen2011-01-311-3/+4
|
* * fhandler_socket.cc (address_in_use): Disable. Add comment.Corinna Vinschen2011-01-301-32/+10
| | | | | | | | | | | (fhandler_socket::bind): Change comment to explain setting the SO_EXCLUSIVEADDRUSE socket option. Remove code which checks for address in use. * net.cc (cygwin_setsockopt): Never set SO_REUSEADDR option. Improve comment to compensate for the deleted comment in fhandler_socket::bind. * wincap.cc: Throughout, drop has_enhanced_socket_security from wincaps. * wincap.h (struct wincaps): Drop has_enhanced_socket_security flags and method.
* * fhandler_socket.cc (fhandler_socket::wait_for_events): CallCorinna Vinschen2011-01-281-0/+2
| | | | | pthread_testcancel in case of timeout to enable pthread_cancel on waiting thread.
* * fhandler_socket.cc (fhandler_socket::bind): Drop has_exclusiveaddruseCorinna Vinschen2010-09-251-44/+39
| | | | | | | | | | | | | | | | | | | | | | condition. Fix comment about availability. Move remaining comment to the right spot. Drop has_ip_helper_lib condition. * net.cc (cygwin_setsockopt): Drop has_disabled_user_tos_setting condition. Fix comment. (get_2k_ifs): Fix comment. (get_nt_ifs): Remove. (getifaddrs): Drop call to get_nt_ifs. (get_ifconf): Ditto. * wincap.cc: Throughout, drop has_ip_helper_lib, has_disabled_user_tos_setting, and has_exclusiveaddruse settings from wincaps. (wincap_unknown): Remove. (wincap_nt4): Remove. (wincap_minimal): New macro, set to wincap_nt4sp4 for now. (wincapc::init): Drop test for pre-SP4 NT4. Just imply at least NT SP4. Replace references to wincap_unknown with references to wincap_minimal. * wincap.h (struct wincaps): Drop has_ip_helper_lib, has_disabled_user_tos_setting, and has_exclusiveaddruse flags and methods.
* * fhandler_socket.cc (get_inet_addr): Only test the file for being aCorinna Vinschen2010-04-131-14/+32
| | | | | | socket after opening it. Retry if opening failed with sharing violation. Explain why we do this. (fhandler_socket::bind): Create file with no sharing allowed.
* * fhandler_socket.cc (fhandler_socket::wait_for_events): Remove call toCorinna Vinschen2010-03-301-4/+1
| | | | sig_dispatch_pending.
* * fhandler_socket.cc (fhandler_socket::evaluate_events): Make eraseCorinna Vinschen2010-03-221-11/+12
| | | | | | | | | | | | | | | | | const in parameter list. (fhandler_socket::wait_for_events): Take a DWORD flags value instead of just a bool. Call evaluate_events with erase flag according to MSG_PEEK value in flags. Replace check for dontwait with check for MSG_DONTWAIT in flags. (fhandler_socket::connect): Call wait_for_events with 0 flags value. (fhandler_socket::accept4): Ditto. (fhandler_socket::recv_internal): Save flags in wait_flags. Drop dontwait variable. Call wait_for_events with wait_flags. (fhandler_socket::send_internal): Save MSG_DONTWAIT flag in wait_flags and call wait_for_events with wait_flags as argument. Drop dontwait variable. * fhandler.h (class fhandler_socket): Change second parameter in declaration of wait_for_events to const DWORD.
* * fhandler_socket.cc (fhandler_socket::accept4): Reset async flagCorinna Vinschen2010-01-161-1/+1
| | | | on accepted socket.
* * fhandler_socket.cc (fhandler_socket::accept4): Set nonblockingCorinna Vinschen2010-01-151-2/+1
| | | | | flag exactly according to flags, as on Linux. * net.cc (cygwin_accept): Maintain BSD semantics here.
* * cygwin.din (accept4): Export.Corinna Vinschen2010-01-151-3/+7
| | | | | | | | | | | | | | | | | | | * fhandler.h (fhandler_socket::accept4): Rename from accept. Take additional flag parameter. * fhandler_socket.cc (fhandler_socket::accept4): Ditto. Handle SOCK_NONBLOCK and SOCK_CLOEXEC flags. * net.cc (cygwin_socket): Handle SOCK_NONBLOCK and SOCK_CLOEXEC flags in type. Check for invalid flag values. (socketpair): Ditto. (cygwin_accept): Accommodate renaming of fhandler_socket::accept function to accept4. (accept4): New function. * posix.sgml: Mention accept4 as GNU extensions. * include/cygwin/socket.h (SOCK_NONBLOCK): Define. (SOCK_CLOEXEC): Define. (_SOCK_FLAG_MASK): Define when building Cygwin. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * include/sys/socket.h (accept4): Declare.
* * fhandler.h (fhandler_socket::wait_for_events): Drop parameter defaultCorinna Vinschen2009-12-281-3/+3
| | | | | | | | value. * fhandler_socket.cc (fhandler_socket::connect): Add false as second parameter to wait_for_events call. (fhandler_socket::accept): Ditto. (fhandler_socket::send_internal): Fix typo in call to wait_for_events.
* Throughout, replace hMainProc with GetCurrentProcess/NtCurrentProcessCorinna Vinschen2009-12-181-5/+7
| | | | | | | | | | | | 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.
* * fhandler_socket.cc (send_internal): Don't split datagram messagesCorinna Vinschen2009-12-021-4/+10
| | | | | | | into pieces. * syslog.cc (vsyslog): Set default facility to LOG_USER if it hasn't been set yet.
* * fhandler_socket.cc (fhandler_socket::fixup_before_fork_exec): AddCorinna Vinschen2009-11-231-3/+4
| | | | | | | | socket handle value to debug output. (fhandler_socket::fixup_after_fork): Ditto. Make new socket handle OVERLAPPED, just as if it has been created with socket(). * net.cc (fdsock): Close duplicated socket and explain why. Disable the entire WSADuplicateSocket test for now and explain why.
* * fhandler_socket.cc (fhandler_socket::set_close_on_exec): Only callCorinna Vinschen2009-11-231-2/+7
| | | | fhandler_base::set_close_on_exec for inheritable sockets.
* Reintegrate socket duplication via WSADuplicateSocket/WSASocket.Corinna Vinschen2009-11-171-6/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * autoload.cc (WSADuplicateSocketW): Define. (WSASocketW): Define. * dtable.cc (dtable::release): Call dec_need_fixup_before if necessary. (dtable::fixup_before_fork): New function. (dtable::fixup_before_exec): New function. * dtable.h (class dtable): Add member cnt_need_fixup_before. Add declarations for above new functions. (dtable::dec_need_fixup_before): New inline method. (dtable::inc_need_fixup_before): New inline method. (dtable::need_fixup_before): New inline method. * fhandler.h (fhandler_base::fixup_before_fork_exec): New virtual method. (fhandler_base::need_fixup_before): New virtual method. (class fhandler_socket): Add member prot_info_ptr. (fhandler_socket::init_fixup_before): Declare. (fhandler_socket::need_fixup_before): New inline method. (fhandler_socket::fixup_before_fork_exec): Declare. (fhandler_socket::fixup_after_exec): Declare. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize prot_info_ptr to NULL. (fhandler_socket::~fhandler_socket): Free prot_info_ptr conditionally. (fhandler_socket::init_fixup_before): New method. (fhandler_socket::fixup_before_fork_exec): Ditto. (fhandler_socket::fixup_after_fork): Use WSASocketW to duplicate socket if necessary. (fhandler_socket::fixup_after_exec): New method. (fhandler_socket::dup): Use fixup_before_fork_exec/fixup_after_fork to duplicate socket if necessary. * fork.cc (frok::parent): Start child suspended if some fhandler needs fixup before fork. If so, call dtable::fixup_before_fork after CreateProcess and resume child. * net.cc (fdsock): Try to find out if socket needs fixup before and initialize socket accordingly. Add HUGE comment to explain what happens and why. * spawn.cc (spawn_guts): Start child suspended if some fhandler needs fixup before exec. If so, call dtable::fixup_before_exec after CreateProcess.
* * sec_helper.cc (security_descriptor::free): If sd_size is 0, callCorinna Vinschen2009-10-301-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | LocalFree instead of ::free. * sec_acl.cc: Throughout replace old ACE flag definitions with current definitions as used in MSDN man pages. * security.cc: Ditto. * fhandler.cc (fhandler_base::open): Make sure file has really been just created before fixing file permissions. Add S_JUSTCREATED attribute to set_file_attribute call. * fhandler_disk_file.cc (fhandler_disk_file::mkdir): Always create dir with default security descriptor and fix descriptor afterwards. Add S_JUSTCREATED flag to set_file_attribute call. * fhandler_socket.cc (fhandler_socket::bind): Ditto for AF_LOCAL socket files. * path.cc (symlink_worker): Ditto for symlinks. * security.cc (get_file_sd): Call GetSecurityInfo rather than NtQuerySecurityObject. Explain why. Change error handling accordingly. (alloc_sd): Skip non-inherited, non-standard entries in ACL if S_JUSTCREATED attribute is set. Explain why. Minor format fixes. * security.h (S_JUSTCREATED): New define. (security_descriptor::operator=): New operator.
* * fhandler_disk_file.cc (fhandler_disk_file::link): Only append .lnkCorinna Vinschen2009-10-121-0/+2
| | | | | | | if the original device had one, too. Add comment. * fhandler_socket.cc (fhandler_socket::fstat): Always return a size of 0 on sockets.
* * fhandler_socket.cc (fhandler_socket::recv_internal): Always callCorinna Vinschen2009-09-291-1/+1
| | | | WSARecv on SOCK_STREAM sockets.
* * autoload.cc (WSARecv): Define.Corinna Vinschen2009-09-221-6/+22
| | | | | * fhandler_socket.cc (fhandler_socket::recv_internal): Call WSARecv instead of WSARecvFrom if no name parameter is given. Explain why.
* * (fhandler_socket::getsockname): Fix length returned for unboundCorinna Vinschen2009-08-141-2/+2
| | | | | | | | AF_LOCAL sockets. (fhandler_socket::getpeername): Ditto. * net.cc (socketpair): Don't set sun_path and peer_sun_path to make sure getsockname and getpeername return the correct values for AF_LOCAL sockets.
* * fhandler_socket.cc (fhandler_socket::accept): Use sizeof ratherCorinna Vinschen2009-08-131-16/+18
| | | | | | | | then constant size. Truncate returned data, but return full address length as per POSIX. (fhandler_socket::getsockname): Truncate returned data, but return full address length as per POSIX. (fhandler_socket::getpeername): Ditto.
* * fhandler.h (class fhandler_socket): Add peer_sun_path member.Corinna Vinschen2009-08-131-24/+69
| | | | | | | | | | | | | | | | | | | (fhandler_socket::set_peer_sun_path): New method. (fhandler_socket::get_peer_sun_path): New method. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize peer_sun_path to NULL. (fhandler_socket::~fhandler_socket): Free peer_sun_path if necessary. (fhandler_socket::dup): Duplicate peer_sun_path. (fhandler_socket::accept): Ditto. Return fake unbound peer content and len in case of AF_LOCAL sockets. (fhandler_socket::getsockname): Always use local sockaddr_storage to store socket address and copy over to incoming address. Handle every namelen correctly per POSIX. (fhandler_socket::getpeername): Ditto. Add code path to return correct value for AF_LOCAL sockets. (fhandler_socket::set_peer_sun_path): New method. * net.cc (socketpair): Set peer_sun_path to empty string, just like sun_path.
* * fhandler_socket.cc (fhandler_socket::accept): Always use localCorinna Vinschen2009-08-121-18/+9
| | | | | | sockaddr_storage to store peer address and copy over to incoming peer address if available. Truncate data as necessary according to POSIX.
* * fhandler_socket.cc (fhandler_socket::send_internal): Just use wmem size ifChristopher Faylor2009-08-041-1/+1
| | | | | | | | the length exceeds it. * net.cc (fdsock): Use 65535 as window size, just like the comment says or we run into problems with DuplicateHandle. * path.cc (patch_conv::check): Use set_path to set invalid filename. * path.h (path_conv::path_conv): Ditto.
* * fhandler_socket.cc (fhandler_socket::recv_internal): Convert wsabufCorinna Vinschen2009-07-061-10/+13
| | | | and wsacnt to references. Fix handling of WSAEMSGSIZE.
* * fhandler.h (class fhandler_socket): Add class members and methodsCorinna Vinschen2009-07-011-4/+13
| | | | | | | | | | | | | | | | to store and retrieve the SO_RCVBUF and SO_SNDBUF sizes. * fhandler_socket.cc (fhandler_socket::dup): Duplicate new members. (fhandler_socket::send_internal): Check for SO_SNDBUF size and restrict send to 1 byte less per KB 823764. Leave loop immediately if WSASendMsg has been used. * net.cc (fdsock): Change comment again. Set buffer sizes to 65536. Store values in fhandler_socket. (cygwin_setsockopt): Store SO_RCVBUF and SO_SNDBUF sizes in fhandler_socket. (cygwin_sendto): Drop call to sig_dispatch_pending. (cygwin_recvfrom): Ditto. (cygwin_recvmsg): Ditto. (cygwin_sendmsg): Ditto.
* * net.cc (fdsock): Set default socket buffer sizes to 65520. ChangeCorinna Vinschen2009-06-301-2/+2
| | | | | | comment accordingly. * fhandler_socket.cc (fhandler_socket::send_internal): Set maximum send size to 65520 as well.
* * fhandler_socket.cc (fhandler_socket::recv_internal): Mark WSARecvMsgCorinna Vinschen2009-06-171-1/+1
| | | | as NO_COPY.
* * fhandler_socket.cc (fhandler_socket::recv_internal): Set namelenCorinna Vinschen2009-06-131-1/+6
| | | | pointer to NULL if name pointer is NULL. Explain why.
* * fhandler.h (fhandler_socket::wait_for_events): Take additionalCorinna Vinschen2009-03-091-13/+13
| | | | | | | | | | | parameter "dontwait". * fhandler_socket.cc (fhandler_socket::wait_for_events): Act as if the socket is non-blocking if dontwait is true. (fhandler_socket::recv_internal): Use incoming MSG_DONTWAIT flag to set the wait_for_events dontwait parameter. (fhandler_socket::send_internal): Ditto. Optimize code slightly. * include/cygwin/socket.h (MSG_DONTWAIT): Define. * include/cygwin/version.h: Bump API minor number.
* * autoload.cc (WSAIoctl): Reintroduce.Corinna Vinschen2009-01-201-59/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (WSASendMsg): Define. * fhandler.h (class fhandler_socket): Change definition of recv_internal and send_internal to take WSAMSG pointer as parameter. * fhandler_socket.cc (WSAID_WSARECVMSG): Define. (LPFN_WSARECVMSG): Define. (WSASendMsg): Declare. (get_ext_funcptr): New function to fetch address of WSARecvMsg. (fhandler_socket::recv_internal): Take just a LPWSAMSG parameter. Change code accordingly. If control information is requested, fetch address of WSARecvMsg and use that instead of WSARecvFrom. (fhandler_socket::recvfrom): Change return type to ssize_t as declared in fhandler.h. Accommodate changes to recv_internal. (fhandler_socket::recvmsg): Ditto. Make sure that control information is only requested if system, address family, and socket type support it. (fhandler_socket::send_internal): Take just a LPWSAMSG parameter and the flags. Change code accordingly. If control information is provided, use WSASendMsg instead of WSASendTo. (fhandler_socket::sendto): Drop useless comment. Accommodate changes to send_internal. (fhandler_socket::sendmsg): Ditto. Make sure that control information is only provided if system, address family, and socket type support it. * wincap.h (wincaps::has_recvmsg): New element. (wincaps::has_sendmsg): New element * wincap.cc: Implement above elements throughout. * include/cygwin/socket.h (CMSG_ALIGN): Phrase in terms of alignment of type struct cmsghdr.
* Remove unneeded whitespace.Christopher Faylor2008-11-261-1/+1
| | | | | | | | | | | | | | | | * 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.
* * cygheap.cc (creturn): Reorganize to avoid a new compiler warning/error.Christopher Faylor2008-09-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * external.cc (cygwin_internal): Call set_security_attribute withCorinna Vinschen2008-08-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | | 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.
* * fhandler_socket.cc (fhandler_socket::send_internal): Send never moreCorinna Vinschen2008-07-271-33/+47
| | | | | | | then 64K bytes at once. For blocking sockets, loop until entire data has been sent or an error occurs. (fhandler_socket::sendto): Drop code which sends on 64K bytes. (fhandler_socket::sendmsg): Ditto.
* Throughout drop allow_ntsec and allow_smbntsec handling.Corinna Vinschen2008-07-141-1/+1
| | | | | | | | | | | | | | | | * 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.