* cygheap.cc (_cmalloc): Use correct constants for size calculation.
* dcrt0.cc (dll_crt0_1): Move uid initialization earlier.
* fork.cc (fork_parent): Move cygheap_setup_in_child to just prior to
CreateProcess so that all contents of cygheap are copied.
* spawn.cc (spawn_guts): Ditto.
* security.cc (get_user_groups): Call Net function with NULL server
name under specific error conditions.
(is_group_member): Ditto.
(get_user_local_groups): Ditto.
(get_user_primary_group): Ditto.
* child_info.h: Bump magic number.
(class child_info): Add an element.
* cygheap.cc (init_cheap): Allocate cygwin heap in shared memory area.
(cygheap_fixup_in_child): Map cygwin heap, passed from parent via shared memory
into correct address.
(cygheap_setup_for_child): New function.
* cygheap.h: Declare new functions.
* dcrt0.cc (dll_crt0_1): Accomodate new cygheap_fixup_in_child arguments.
Avoid protecting subproc_ready unless it is spawn/nowait.
* fork.cc (fork_parent): Use new cygheap_setup_for_child function to setup
cygwin heap info. Close passed cygheap shared memory handle.
* spawn.cc (spawn_guts): Ditto. Also, reorganize to avoid synchronization
between parent and child in non-P_OVERLAY case.
* sigproc.cc (wait_sig): Only signal subproc_ready when execing.
Change well_known_admin_sid to well_known_admins_sid throughout.
* sec_acl.cc (setacl): Never set DELETE permission. Set
FILE_DELETE_CHILD only on readable and executable directories.
* sec_helper.cc: Add constructor for `well_known_null_sid'.
* security.cc (get_nt_attribute): Set S_ISVTX for directories if
FILE_WRITE_DATA and FILE_EXECUTE but not FILE_DELETE_CHILD is set.
Add evaluation of S_ISVTX, S_ISGID and S_ISUID from NULL ACE.
(alloc_sd): Never set DELETE permission. Set FILE_DELETE_CHILD
only on readable and executable directories.
Add creation of NULL ACE for S_ISVTX, S_ISGID and S_ISUID permissions.
* security.h: Add extern declaration for `well_known_null_sid'.
* syscalls.cc (_unlink): Correct (?) logic which determines when to report an
access violation and when to queue file for eventual deletion.
(stat_worker): Check for invalid buf argument.
* some support for funny-endian 16/32-bit insn sets
[cgen/ChangeLog]
2001-07-11 Frank Ch. Eigler <fche@redhat.com>
* desc-cpu.scm (-gen-mach-table-defns): Emit fourth field: the
mach->cpu insn-chunk-bitsize.
(-gen-cpu-open): In @arch@_cgen_rebuild_tables, process above new
field toward CGEN_CPU_TABLE->insn_chunk_bitsize.
* mach.scm (<cpu>): New field insn-chunk-bitsize.
(-cpu-parse, -cpu-read): Parse/initialize it.
* doc/rtl.texi (define-cpu): Document it.
[opcodes/ChangeLog]
2001-07-11 Frank Ch. Eigler <fche@redhat.com>
* cgen-dis.in (print_insn): Use cgen_get_insn_value instead of
bfd_get_bits.
* cgen-opc.c (cgen_get_insn_value, cgen_put_insn_value): Respect
non-zero CGEN_CPU_DESC->insn_chunk_bitsize.
[include/opcode/ChangeLog]
2001-07-11 Frank Ch. Eigler <fche@redhat.com>
* mmap.cc (fhandler_disk_file::mmap): Try to open file mappings
by a unified name when running under 9x/ME. If that failes, create
the file mapping using the unified name.
Change check_null_empty_path* to check_null_empty_str* throughout.
* path.cc (path_conv::check): Add signal protection here since retrieving info
about remote shares can take some time.
* path.h (check_null_empty_str_errno): Convert to a function prototype.
* path.cc (check_null_empty_str): Move to miscfuncs.cc.
* miscfuncs.cc (check_null_empty_str_errno): New function.
(__check_null_invalid_struct): Ditto.
(__check_null_invalid_struct_errno): Ditto.
(check_null_empty_str): Change from VirtualQuery to IsBadWritePtr.
* thread.cc (check_valid_pointer): Ditto.
* resource.cc (getrlimit): Use check_null_invalid_struct macro for checking
validity of pointer.
(setrlimit): Ditto.
* fhandler.cc (fhandler_disk_file::fstat): Don't rely on exactly 3 characters
being read for executable test since we could be checking for less than that.
* syscalls.cc (stat_worker): Try opening the file the "correct" way first so
that #! processing can potentially happen. If that fails, then use "query
open" method.
* spawn.cc (spawn_guts): Delay processing of signal until after we've notified
parent about reparenting.
* mmap.cc: Clean up *ResourceLock calls throughout.
* thread.cc (pthread_cond::TimedWait): Check for WAIT_TIMEOUT as well as
WAIT_ABANDONED.
(__pthread_cond_timedwait): Calculate a relative wait from the abstime
parameter.
* exceptions.cc (interrupt_setup): Move actions from setup_handler to here.
(setup_handler): Move actions after a successful interrupt to interrupt_setup.
* fork.cc (vfork): Augment debugging output.
* sigproc.cc (proc_subproc): Ditto.
* spawn.cc (spawn_guts): Ditto. Correctly fill out progname when spawn
NO_WAIT. Call signal handler when a signal arrives.
* sigproc.h: Declare a function.
Robert Collins [Thu, 21 Jun 2001 22:27:20 +0000 (22:27 +0000)]
2001-06-22 Robert Collins rbtcollins@hotmail.com
* thread.cc (__pthread_cond_timedwait): Lock the waiting mutex before
the condition protect mutex to avoid deadlocking. (Found by Greg Smith).
(__pthread_cond_wait): Ditto.
Egor Duda [Wed, 20 Jun 2001 07:44:33 +0000 (07:44 +0000)]
* fhandler.cc (fhandler_base::open): Work around windows bug when
CreateFile() with dwDesiredAccess == 0 called on remote share returns
valid handle even if file doesn't exist.
Egor Duda [Wed, 20 Jun 2001 06:50:13 +0000 (06:50 +0000)]
* fhandler_socket.cc (fhandler_socket::signal_secret_event): New
function.
* fhandler.h: Declare it.
* fhandler_socket.cc (fhandler_socket::create_secret_event): Don't
signal secret event immediately.
(fhandler_socket::check_peer_secret_event): Do it after peer event
was opened.
* net.cc (cygwin_connect): Or if socket is non-blocking.
(cygwin_accept): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::init): Revert 2001-06-16 change.
* fork.cc (fork_copy): Print more debugging info.
(fork_parent): Change order of arguments to accomdate buggy gcc.
(fork): Ditto.
* syscalls.cc (_unlink): Reorganize to try harder to delete file with
DeleteFile and to recover more gracefully if FILE_FLAG_DELETE_ON_CLOSE doesn't
work properly.
* exceptions.cc (sig_handle_tty_stop): Reset PID_STOPPED if not actually
stopping.
* fhandler_console.cc (fhandler_console::fixup_after_fork): Don't set
controlling terminal if just inheriting a handle.
(fhandler_console::fixup_after_exec): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::init): Ditto.
* signal.cc (kill_worker): Set appropriate errno if proc_exists determines that
process does not really exist.
Per Bothner [Fri, 15 Jun 2001 19:53:18 +0000 (19:53 +0000)]
* dwarf2.h: Partial merge with gcc version.
(enum dwarf_descrim_list): Fix typo -> dwarf_discrim_list.
(DW_LANG_Java): Use value from dwarf 2.1 draft (also used in gcc).
* mkpasswd.c (main): Output passwd file in binary mode so that there are no CRs
in the file.
* umount.cc (remove_all_user_mounts): Don't try to remove /cygdrive mounts.
* fhandler.cc (fhandler_disk_file::fstat): Properly set executable bits for
directory when !ntsec && !ntea. Also move common code prior to call to
get_attributes.
* cgen-asm.c (cgen_parse_keyword): When looking for the
boundaries of a keyword, allow any special characters
that are actually in one of the allowed keyword.
* cgen-opc.c (cgen_keyword_add): Add any special characters
to the nonalpha_chars field.
Egor Duda [Thu, 14 Jun 2001 18:21:17 +0000 (18:21 +0000)]
* fhandler.cc (fhandler_base::open): Set win32 access flags
to 0, when requested.
* fhandler.h: New status flag FH_QUERYOPEN.
(fhandler::get_query_open): New function.
(fhandler::set_query_open): Ditto.
* syscalls.cc (stat_worker): Request query-only open mode.
Egor Duda [Tue, 12 Jun 2001 11:31:05 +0000 (11:31 +0000)]
* environ.cc (set_file_api_mode): New function. Move setting
of file APIs mode (OEM/ANSI) here.
(codepage_init): From here.
* winsup.h (set_file_api_mode): Declare it.
* fork.cc (fork_child): Set file APIs mode in forkee.
Jeff Johnston [Mon, 11 Jun 2001 19:25:59 +0000 (19:25 +0000)]
2001-06-11 Egor Duda <deo@logos-m.ru>
* libc/ctype/ctype_.c: When compiled with gcc on platforms
with signed char, make _ctype_[-128] ... _ctype[-1] refer to
initialized memory region. Platform can define COMPACT_CTYPE
to avoid allocation of the additional 128 bytes of data.
Add pointer to _ctype_ array. Always initialize all _ctype_
array elements.
* path.cc (path_conv::update_fs_info): Don't consider remote drives to be NTFS.
Set root_dir before invoking GetDriveType (from Kazuhiro Fujieda
<fujieda@jaist.ac.jp>). Eliminate extra checks for rootdir.
* exceptions.cc (sigdelayed): Ensure that signal is cleared as the last
operation or suffer races.
* sigproc.cc (proc_subproc): Deal with zombie array overflow.
Corinna Vinschen [Sun, 10 Jun 2001 10:00:21 +0000 (10:00 +0000)]
* cygwin.din: Add fchdir symbols.
* path.cc (chdir): Guard against invalid parameter.
(fchdir): New function.
* include/cygwin/version.h: Bump API minor version to 40.
* uinfo.cc (internal_getlogin): Remove unused variable.
* syscalls.cc (seteuid): Set environment variables USERNAME and
USERDOMAIN before impersonation to workaround a LookupAccountSid()
misbehaviour.
* uinfo.cc (internal_getlogin): Revert most of the previous change.
Don't set environment variables USERNAME and USERDOMAIN. That's
the job of seteuid() now. Try to get logon server from Lsa
only if logon server isn't already known.
* fhandler_console.cc (fhandler_console::dup): Allocate space for
savebuf on Cygwin heap.
(fhandler_console::char_command): Ditto. Use correct values for size.
Egor Duda [Tue, 5 Jun 2001 10:45:52 +0000 (10:45 +0000)]
* security.h (NTWriteEA): Change prototype.
* ntea.cc (NTReadEA): Don't check for global ntea setting, now
it's caller responsibility.
(NTWriteEA): Ditto.
* security.cc (get_file_attribute): Read attribute from EA only
if 'ntea' is enabled.
(set_file_attribute): Ditto.
* path.h: (class path_conv): Add members to store file system
information.
(path_conv::get_drive_type): New function.
* syscalls.cc (stat_worker): Use it.
* path.cc (path_conv::update_fs_info): New functions.
(path_conv::check): Get file system information from device where
file resides. On NTFS, try to read symlink contents from EA.
(get_symlink_ea): New function.
(set_symlink_ea): Ditto.
(symlink): Store symlink in extended attribute, if possible.