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
2002-08-27* child_info.h: Add _PROC_WHOOPS enum value.Christopher Faylor
(CURR_CHILD_INFO_MAGIC): Update. (child_info::magic): Make 'long'. * cygheap.h: Export _cygheap_start. * cygheap.cc: Don't declare _cygheap_start. * cygmagic: Use cksum to produce checksums. Append 'U' to end of checksum. * dcrt0.cc (initial_env): Calculate sleep ms before reusing buffer. (_dll_crt0): Detect cygheap mismatch as indicative of different cygwin version. Set child_proc_info to NULL when _PROC_WHOOPS. (multiple_cygwin_problem): If child_info specific problem, then set child_proc_info type to _PROC_WHOOPS. * shared_info.h (CURR_MOUNT_MAGIC): Update. (CURR_SHARED_MAGIC): Ditto.
2002-08-07one more changeChristopher Faylor
2002-08-07* cygheap.cc (_csbrk): Avoid !cygheap considerations.Christopher Faylor
(cygheap_init): Deal with unintialized cygheap issues here.
2002-08-07Conrad Scott <conrad.scott@dsl.pipex.comChristopher Faylor
* cygheap.cc (_csbrk): Allocate some slop initially. Don't erroneously add sbrk amount to returned value in initial case.
2002-07-30* dcrt0.cc (dll_crt0_1): Move debug_fixup_after_fork_exec.Christopher Faylor
* cygheap.cc (cygheap_fixup_in_child): Call debug_fixup_after_fork_exec immediately after cygheap has ben set up.
2002-07-14* debug.h (handle_list): Move here from debug.cc. Add "inherit" flagChristopher Faylor
functionality. * cygheap.cc (init_cheap): Move cygheap_max calculation to _csbrk. (_csbrk): Reorganize to not assume first allocation is <= 1 page. (cygheap_setup_for_child): Mark protected handle as inheritable. * cygheap.h (cygheap_debug): New struct. (init_cygheap): Add new structure when debugging. * dcrt0.cc (dll_crt0_1): Remove call to debug_init. Close ppid_handle here, if appropriate. Don't protect subproc_ready, since it is already protected in the parent. Call memory_init prior to ProtectHandle to ensure that cygheap is set up. Call debug_fixup_after_fork_exec when appropriate. (_dll_crt0): Don't close ppid_handle here. * debug.cc: Use cygheap debug structure rather than static elements throughout. (add_handle): Don't issue a warning if attempt to protect handle in exactly the same way from exactly the same place. Add pid info to warning output. Accept additional argument controlling whether handle is to be inherited. Add pid to stored information. (debug_fixup_after_fork_exec): Renamed from debug_fixup_after_fork. Reorganize to avoid erroneously skipping handles. (mark_closed): Add pid info to warning output. (setclexec): Rename from setclexec_pid. * fhandler.cc (fhandler_base::get_default_fmode): Minor reorg. (fhandler_base::fstat): Add debugging output. (fhandler_base::set_inheritance): Call setclexec rather than setclexec_pid. (fhandler_base::fork_fixup): Ditto. * fhandler_console.cc (get_tty_stuff): Mark protected handle as inheritable. * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. * tty.cc (tty::make_pipes): Ditto. (tty::common_init): Ditto. * fork.cc (fork_parent): Ditto. (fork_child): Close protected handles with correct name. Remove debug_fixup_after_fork call. * fhandler_socket.cc (fhandler_socket::create_secret_event): Mark protected handle as inheritable/non-inheritable, as appropriate. * shared.cc (memory_init): Mark protected handle as inheritable. Call debug_init here. * sigproc.cc (wait_sig): Close protected handle with correct name. * spawn.cc (spawn_guts): Rename spr to subproc_ready and mark it as inheritable. * exceptions.cc (debugger_command): Try to run dumper.exe, if found. * syscalls.cc (fstat64): Don't follow symlinks for path_conv lookup since path is already resolved.
2002-07-03* cygheap.cc (init_cheap): Rearrange error message.Christopher Faylor
(cygheap_fixup_in_child): Ditto. * dtable.cc: Remove if 0'ed code. * fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode. * sec_helper.cc (cygsid::get_id): Use system_printf for error message. * tty.cc (tty::common_init): Ditto.
2002-06-29* cygheap.h (cygheap_user): Reorg to accommodate environment caching.Christopher Faylor
(cygheap_user::logsrv): New method. (cygheap_user::winname): Ditto. (cygheap_user::domain): Ditto. (cygheap_user::test_uid): Ditto. * cygheap.cc (cygheap_user::set_name): Reflect name "pwinname" name change. * environ.cc (getwinenveq): New function. (spenv::from_cygheap): Change arguments. (spenv::retrieve): Ditto for call. Use getwinenveq to retrieve info from environment. Always return value from cygwin environment, if it exists. * environ.h (getwinenveq): Declare. * uinfo.cc (cygheap_user::ontherange): Use logsrv() rather than env_logsrv(). (cygheap_user::test_uid): Define new method. (cygheap_user::env_logsrv): Accept environment arguments. Use test_uid to find info. (cygheap_user::env_domain): Ditto. (cygheap_user::env_userprofile): Ditto. (cygheap_user::env_homepath): Ditto. (cygheap_user::env_homedrive): Ditto. (cygheap_user::env_name): Ditto.
2002-06-28* cygheap.cc (cfree_and_set): New function.Christopher Faylor
(cygheap_user::set_name): Use cfree_and_set to reset members. * cygheap.h (cygheap_user): Delete static members. (cygheap_user::puserprof): New member. (cfree_and_set): Declare. * dcrt0.cc (almost_null): Define. * winsup.h (almost_null): Declare. * syscalls.cc (cfree_and_set): Remove unused variable. * uinfo.cc (cygheap_user::homepath_env_buf): Eliminate. (cygheap_user::homedrive_env_buf): Ditto. (cygheap_user::userprofile_env_buf): Ditto. (cygheap_user::ontherange): YA change to try to preserve existing HOMEPATH and HOMEDRIVE. Return almost_null values when variables should not actually exist. (cygheap_user::env_logsrv): Ditto. (cygheap_user::env_domain): Ditto. (cygheap_user::env_userprofile): Ditto.
2002-06-27* cygheap.cc (cygheap_user::set_name): Correct thinko in below change.Christopher Faylor
2002-06-26* cygheap.cc (cygheap_user::set_name): Avoid clearing things when just settingChristopher Faylor
name to itself or during first time initialization. * environ.cc (check_case_init): Make case insensitive.
2002-06-21* uinfo.cc (cygheap_user::ontherange): Use env_name for NetUserGetInfo.Christopher Faylor
(cygheap_user::env_logsrv): Verify env_domain is valid. * environ.cc: Include child_info.h and keep spenvs[] sorted. (environ_init): Check child_proc_info instead of myself->ppid_handle.
2002-06-16* cygheap.h (cygheap_user::winname): New field.Christopher Faylor
* cygheap.cc (cygheap_user::set_name): Clear winname when name changes. * uinfo.cc (cygheap_user::env_logsrv): Avoid calculating server when Windows user == SYSTEM. (cygheap_user::env_domain): Set winname here too. (cygheap_user::env_userprofile): Eliminate superfluous tests. (cygheap_user::env_name): Seed winname by calling env_domain().
2002-06-16* child_info.h (child_proc_info): Declare as base class.Christopher Faylor
(spawn_info): Declare as alias of child_proc_info to aid debugging. (fork_info): Ditto. * cygheap.cc (cygheap_fixup_in_child): Use child_proc_info global rather than parameter. * cygheap.h (cygheap_fixup_in_child): Reflect above change in declaration. * dcrt0.cc (_dll_crt0): Move 'si' definition here. Assign child_proc_info. (dll_crt0_1): Accommodate cygheap_fixup_in_child and *_info changes. * environ.cc (spenv::retrieve): Make regparm. * environ.h (environ_init): Ditto. (win_env::add_cache): Ditto. (build_env): Ditto. (getwinenv): Ditto. * fork.cc (sync_with_parent): Use fork_info global. (fork_child): Ditto.
2002-06-14* cygheap.cc (cygheap_user::set_logsrv): Remove.Christopher Faylor
(cygheap_user::set_domain): Ditto. * cygheap.h (cygheap_user::set_logsrv): Remove declaration. (cygheap_user::set_domain): Ditto. (cygheap_user::env_domain): Declare new method. (cygheap_user::env_name): Ditto. * environ.cc (spenvs): Add two environment variables. * spawn.cc (spawn_guts): Call build_env after RevertToSelf. Always set ciresrv.mount_h. (cygheap_user::ontherange): Recalculate homedrive/homepath if they are empty. Use env_logsrv to get logon server. (cygheap_user::env_logsrv): Calculate server name here rather than relying on it having been previously calculated. (cygheap_user::env_domain): Ditto for domain name. (cygheap-user::env_name): New method. * syscalls.cc (seteuid32): Do not get or set the environment. Do not call LookupAccountSid nor internal_getlogin. Set cygheap->user name and sid from the passwd entry. * uinfo.cc (uinfo_init): Only call internal_getlogin when starting from a non Cygwin process and use the values returned in user. (internal_getlogin): Simplify to case where starting from a non Cygwin process. Store return values in user and return void. Do not set the Windows default environment. * dcrt0.cc (dll_crt0_1): Call uinfo_init only when needed. Do not set myself->uid nor reset user.sid. * spawn.cc (spawn_guts): Get the sid from cygheap->user. Always RevertToSelf(). Don't set uid in impersonated case. * cygheap.cc (cygheap_user::set_sid): Do not set orig_sig. (cygheap_user::set_orig_sid): New. * cygheap.h: Declare cygheap_user::set_sid. * winsup.h: Add argument to uinfo_init().
2002-06-13 * cygheap.cc (cygheap_user::set_name): Revert previous change.Corinna Vinschen
* environ.cc (spenv::retrieve): Check return value of call to cygheap->user.*from_cygheap().
2002-06-13 * cygheap.cc (cygheap_user::set_name): Remove setting homedrive andCorinna Vinschen
homepath to NULL. (cygheap_user::set_logsrv): Fix free'ing of plogsrv. * cygheap.h (cygheap_user::cygheap_user): Initialize homedrive and homepath to NULL.
2002-06-12* cygheap.cc (cygheap_user::set_name): Set homedrive and homepath to NULL onChristopher Faylor
user name change. (cygheap_user::set_logsrv): Allocate enough space for leading \\ so that we can put this in the environment, if needed. * cygheap.h (homebodies): New enum. (cygheap_user::homedrive): New field. (cygheap_user::homepath): Ditto. (cygheap_user::env_logsrv): New method. (cygheap_user::env_homepath): New method. (cygheap_user::env_homedrive): New method. (cygheap_user::env_userprofile): New method. (cygheap_user::ontherange): New method. * environ.cc (envsize): Eliminate debugging argument. (environ_init): Assume that envc counts number of elments not total size. (spenv): New class. (spenvs): New array, renamed from forced_winenv_vars, using spenv. (spenv::retrieve): New method. (build_env): Rename from 'winenv' -- one stop shopping for building new environment blocks for both windows and "unix". * environ.h (build_env: Declare. (winenv): Delete declaration. (envsize): Ditto. * spawn.cc (spawn_guts): Use build_env to build windows and cygwin environment blocks. * uinfo.cc (internal_getlogin): Eliminate environment manipulation. Default to info from GetUserName if it exists. Move HOMEPATH and HOMEDRIVE stuff elsewhere. Move HOME setting elsewhere. Only set HOME environment variable in processes that are not parented by a cygwin process. (cygheap_user::ontherange): Define new method. (cygheap_user::env_logsrv): Ditto. (cygheap_user::env_homepath): Ditto. (cygheap_user::env_homedrive): Ditto. (cygheap_user::env_userprofile): Ditto.
2002-06-05* dtable.cc (handle_to_fn): Attempt to handle "raw" accesses to remote shares.Christopher Faylor
* path.cc (mount_info::conv_to_win32_path): Set flags to binary when mount entry is not found. (mount_info::set_flags_from_win32_path): Ditto.
2002-05-28* autoload.cc (LoadFuncEx): Define via new LoadFuncEx2 macro.Christopher Faylor
(LoadFuncEx2): Adapted from LoadFuncEx. Provides control of return value for nonexistent function. (NtQueryObject): Declare. (IsDebuggerPresent): Declare via LoadFuncEx2 and always return true if not available. * debug.h (being_debugged): Just rely on IsDebuggerPresent return value. * dtable.cc (handle_to_fn): New function. (dtable::init_std_file_from_handle): Attempt to derive std handle's name via handle_to_fn. (dtable::build_fhandler_from_name): Fill in what we can in path_conv structure when given a handle and path doesn't exist. * fhandler.cc (fhandler_base::open): Don't set the file pointer here. Use pc->exists () to determine if file exists rather than calling GetFileAttributes again. * fhandler.h (fhandler_base::exec_state_isknown): New method. (fhandler_base::fstat_helper): Add extra arguments to declaration. (fhandler_base::fstat_by_handle): Declare new method. (fhandler_base::fstat_by_name): Declare new method. * fhandler_disk_file (num_entries): Make __stdcall. (fhandler_base::fstat_by_handle): Define new method. (fhandler_base::fstat_by_name): Define new method. (fhandler_base:fstat): Call fstat_by_{handle,name} as appropriate. (fhandler_disk_file::fstat_helper): Accept extra arguments for filling out stat structure. Move handle or name specific stuff to new methods above. (fhandler_disk_file::open): Use real_path->exists rather than calling GetFileAttributes again. * ntdll.h (FILE_NAME_INFORMATION): Define new structure. (OBJECT_INFORMATION_CLASS): Partially define new enum. (OBJECT_NAME_INFORMATION): Define new structure. (NtQueryInformationFile): New declaration. (NtQueryObject): New declaration. * path.cc (path_conv::fillin): Define new method. * path.h (path_conv::fillin): Declare new method. (path_conv::drive_thpe): Rename from 'get_drive_type'. (path_conv::volser): Declare new method. (path_conv::volname): Declare new method. (path_conv::root_dir): Declare new method. * syscalls.cc (fstat64): Send real path_conv to fstat as second argument.
2002-05-08 * cygheap.h (class cygheap_user): Add member `orig_psid'.Corinna Vinschen
Add method `orig_sid()'. * cygheap.cc (cygheap_user::set_sid): Maintain orig_psid.
2002-02-22* sync.h (new_muto): Just accept an argument which denotes the name of theChristopher Faylor
muto. Use this argument to construct static storage. * cygheap.cc (cygheap_init): Reflect above change. * exceptions.cc (events_init): Ditto. * malloc.cc (malloc_init): Ditto. * path.cc (cwdstuff::init): Ditto. * cygheap.h (cwdstuff): Change name of lock element to make it less generic. * path.cc (cwdstuff::get_hash): Ditto. (cwdstuff::get_initial): Ditto. (cwdstuff::set): Ditto. (cwdstuff::get): Ditto. * sigproc.cc (proc_subproc): Ditto. * debug.cc (lock_debug): Change to method. Use method rather than macro throughout. * tty.h (tty_min::kill_pgrp): Declare new method. * fhandler_termios.cc (tty_min::kill_pgrp): New method. (fhandler_termios::line_edit): Use new method for killing process. * dcrt0.cc (do_exit): Ditto. * dtable.cc (dtable::get_debugger_info): New method for inheriting dtable info from a debugger. * tty.cc (tty_init): Attempt to grab file handle info from parent debugger, if appropriate. # dtable.cc (dtable::stdio_init): Make this a method. (dtable::init_std_file_from_handle): Don't set fd unless it's not open. (dtable::build_fhandler_from_name): Move name setting to dtable::build_fhandler. (dtable::build_fhandler): Add win32 name parameter. * dcrt0.cc (dll_crt0_1): Change to use dtable stdio_init. * dtable.h (dtable): Reflect build_fhandler parameter change. * mmap.cc (mmap_record::alloc_fh): Don't set name parameter in build_fhandler. * net.cc (fdsock): Remove set_name call since it is now handled by build_fhandler. * sigproc.cc (proc_subproc): Release muto as early as possible.
2002-02-17* times.cc (hires::prime): Restore thread priority on failure condition.Christopher Faylor
* uinfo.cc (uinfo_init): Use more robust method for determining if process was invoked from a non-cygwin process. * sync.h (muto::init): Eliminate "inheritance" parameter. (new_muto): Reflect removal of parameter. * sync.cc (muto::init): Ditto. * cygheap.cc (cygheap_init): Ditto. * debug.cc (threadname_init): Ditto. * exceptions.cc (events_init): Ditto. * malloc.cc (malloc_init): Ditto. * path.cc (cwdstuff::init): Ditto. * sigproc.cc (sigproc_init): Ditto. * grp.cc (group_lock): Use different method for locking with static member. (read_etc_group): REALLY ensure that read lock mutex is released. * passwd.cc (passwd_lock): Use different method for locking with static member. (read_etc_passwd): REALLY ensure that read lock mutex is released. * shared.cc (sec_user): Correct reversed inheritance test.
2001-11-05Eliminate excess whitespace.Christopher Faylor
2001-10-16* fhandler.cc (fhandler_base::fork_fixup): Don't protect handle.Christopher Faylor
* dlfcn.cc: Fix to confirm to coding standards. Reorganize includes throughout to accomodate new cygheap.h usage. * cygheap.h (cygheap_fdmanip): New class: simplifies locking and retrieval of fds from cygheap->fdtab. (cygheap_fdget): Ditto. (cygheap_fdnew): Ditto. * fcntl.cc (_fcntl): Use new method to lock fdtab and retrieve info. * ioctl.cc (ioctl): Ditto. * mmap.cc (mmap): Ditto. * net.cc: Ditto, throughout. * passwd.cc (getpass): Ditto. * path.cc (fchdir): Ditto. * pipe.cc (make_pipe): Ditto. * sec_acl.cc (facl): Ditto. * syscalls.cc: Ditto, throughout. * termios.cc: Ditto, throughout.
2001-10-03* cygheap.cc (cfree): Remove malloc debugging probe.Christopher Faylor
* dlmalloc.c (errprint): Remove abort() call which causes interesting error message printing to abort prematurely. * environ.cc: Sprinkle MALLOC_CHECKs liberally throughout. (_addenv): Allocate two empty elements at end of environ to (apparently) work around problems with some buggy applications. (winenv): Avoid calling alloca if no forced environment variable is present. * exceptions.cc (open_stackdumpfile): Don't print "Dumping stack trace to..." when running in a cygwin environment (i.e., the parent is a cygwin process). * dtable.cc (dtable::init_std_file_from_handle): Move device type detection code from build_fhandler here since it is only used by this function. (dtable::build_fhandler_from_name): New method. Renamed from dtable::build_fhandler. (dtable::build_fhandler): Use build_fhandler_from_name. (cygwin_attach_handle_to_fd): Ditto. * syscalls.cc (_open): Ditto. (stat_worker): Ditto. * dtable.h (dtable::build_fhandler_from_name): Rename declaration from dtable::build_fhandler.
2001-10-01Add "path.h" include throughout, where needed. Use new path_conv methods andChristopher Faylor
operators to simplify testing for directory and attributes, throughout. * path.h (path_conv::exists): New method. (path_conv::has_attribute): Ditto. (path_conv::isdir): Ditto. (path_conv::DWORD &): New operator. (path_conv::int &): Ditto. * dir.cc (rmdir): Eliminate a goto. * dtable.cc (dtable::build_fhandler): Accept opt and suffix info for path_conv.check. Return fh == NULL on path_conv error. Pass unit to set_name as appropriate. (dtable::reset_unix_path_name): New method. * dtable.h (dtable): Declare new method. Reflect arg changes to build_fhandler. * fhandler.cc (fhandler_disk_dummy_name): Eliminate. (fhandler_base::set_name): Expect paths to be NULL. Build unix_path_name from win32_path_name when it is a device. (fhandler_base::reset_unix_path_name): New method. (fhandler_base::raw_read): Report EISDIR when ERROR_INVALID_FUNCTION or ERROR_INVALID_PARAMETER and reading a directory. (fhandler_disk_file::fstat): Don't call stat_dev since we should now never be calling fhandler_disk_file methods with devices. (fhandler_base::fhandler_base): Clear {unix,win32}_path_name. (fhandler_base::~fhandler_base): Always free {unix,win32}_path_name. (fhandler_disk_file::fhandler_disk_file): Remove set_no_free_names kludge. (fhandler_disk_file::open): Ditto. * fhandler.h (fhandler_base::no_free_names): Eliminate. (fhandler_base::set_no_free_names): Ditto. * fhandler_tty.cc (fhandler_tty_slave::fhandler_tty_slave): Don't set unix_path_name here. * path.cc (fchdir): Lock fd table throughout. Use new dtable::reset_unix_path_name method to reset path. * syscalls.cc (stat_worker): Reorganize to always call fstat method. Pass path_conv method to fhandler_*::open. (chroot): Elminate a goto.
2001-09-14* cygheap.cc (dup_now): New function.Christopher Faylor
(cygheap_setup_for_child): Accept new argument controlling whether to delay copying of cygheap to shared memory region. (cygheap_setup_for_child_cleanup): Accept new arguments controlling whether to copy cygheap at this point. * cygheap.h: Reflect above changes. * fork.cc (fork_parent): Break copying of cygheap into two parts when fork_fixup is required so that the child can see the parent's changes. (vfork): Do stack cleanup prior to forcing a fork error. * spawn.cc (spawn_guts): Ditto.
2001-09-14* cygheap.cc (ccalloc): Pass correct length to creturn so that cygheap_max isChristopher Faylor
correctly calculated.
2001-09-12 * Makefile.in: Build wincap.o.Corinna Vinschen
* wincap.cc: New file. * wincap.h: Ditto. * autoload.cc: Add dynamic load statement for `CreateHardLinkA'. * dcrt0.cc (os_being_run): Eliminated. (osname): Ditto. (iswinnt): Ditto. (set_os_type): Ditto. (dll_crt0_1): Call wincap.init() instead of set_os_type(). (_dll_crt0): Ditto. * environ.cc (set_chunksize): New function. (parse_thing): `forkchunk' setting now invokes function `set_chunksize'. * fork.cc (chunksize): Eliminated. Moved to be member of wincap. * host_dependent.h: Removed. * syscalls.cc (_link): Try using `CreateHardLinkA' first, if available. * cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc, environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc, fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h, security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc, times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap capability check throughout. * winsup.h: Include wincap.h. Eliminate extern declarations of `os_being_run' and `iswinnt'. Eliminate `os_type" definition. * include/cygwin/version.h: Bump version to 1.3.4.
2001-09-09* cygheap.cc (cygheap_fixup_in_child): Clear cygheap->base so that heap is notChristopher Faylor
forced to start at the same place in execed process. * heap.cc: Remove brk* macros for clarity throughout. * heap.h: Ditto. * shared.cc (shared_info::initialize): Move heap_chunk test into heap_chunk_size(). (heap_chunk_size): Check for chunk size here. Don't go to registry if heap_chunk_in_mb is already set. * smallprint.c (console_printf): Add Windows 95 concessions.
2001-09-09 * cygheap.cc (init_cygheap::etc_changed): New method to signalCorinna Vinschen
a change in /etc. * cygheap.h (struct init_cygheap): Add member `etc_changed_h' and method `etc_changed'. * grp.cc (enum grp_state): Eliminate. (class grp_check): Ditto. (group_state): Define as `class pwdgrp_check'. (parse_grp): Remeber path and modification time of /etc/group file. * passwd.cc (enum_pwd_state): Eliminate. (class pwd_check): Ditto. (passwd_state): Define as `class pwdgrp_check'. (read_etc_passwd): Remember path and modification time of /etc/passwd file. * pwdgrp.h: New file. (enum pwdgrp_state): Substitutes `pwd_state' and `grp_state'. (class pwdgrp_check): Substitutes `pwd_check' and `grp_check'.
2001-09-06* cygheap.cc (cygheap_fixup_in_child): Don't consider a NULL bucket as aChristopher Faylor
candidate for deletion. It is actually the end of a linked list chain. * exceptions.cc (open_stackdumpfile): Default to "unknown" program name if myself->progname hasn't been filled out yet.
2001-09-06* cygheap.h (init_cygheap): Move bucket array here from cygheap.cc.Christopher Faylor
* cygheap.cc: Throughout use bucket array from cygheap. * sigproc.cc (proc_subproc): Dynamically allocate zombie buffer to save DLL space. (sigproc_fixup_after_fork): Free zombie array after a fork. * sigproc.h (sigproc_fixup_after_fork): Declare. * dir.cc (mkdir): Expand buffer for security descriptor to 4K to avoid stack corruption. * fhandler.cc (fhandler_base::open): Ditto. * path.cc (symlink): Ditto.
2001-08-31space reduction.Christopher Faylor
2001-08-31* cygwin.sc: New file -- linker script for building cygwin DLL.Christopher Faylor
* Makefile.in: Use linker script to control location of cygheap. * cygheap.cc (buckets): Make static. (init_cheap): Remove special iswinnt handling. Allocate cygheap at a fixed location. Display more info when allocation fails. (cygheap_fixup_in_child): Try harder to move cygheap to correct location. Display more info when allocation fails. * fhandler.h (fhandler_socket): Add macros for tracking socket shutdown state. * net.cc (cygwin_shutdown): Set appropriate shutdown value for future use. * select.cc (select_stuff::cleanup): New method. (cygwin_select): Call cleanup explicitly to avoid a race. (select_stuff:~select_stuff): Call cleanup chain via cleanup method. (fhandler_socket::select_read): Set *_ready when shutdown has been called on the socket. (fhandler_socket::select_write): Ditto. (fhandler_socket::select_except): Ditto. * winsup.h: Move NO_COPY to "COMMON" section. * autoload.cc (wsock_started): Avoid initializing NO_COPY value. * sigproc.cc: Remove initialization from NO_COPY variables. (sigproc_init): Initialize sig_loop_wait here, rather than via initialization. (subproc_init): Initialize proc_loop_wait here, rather than via initialization.
2001-08-22fix typo.Christopher Faylor
2001-08-20debugChristopher Faylor
2001-08-20* cygheap.cc (init_cheap): Allocate cygheap in shared memory for Windows NT.Christopher Faylor
2001-08-07* cygheap.cc (cygheap_root::set): Avoid treating '/' specially.Christopher Faylor
* fhandler.cc (fhandler_base::fcntl): Only set specific O_NDELAY style flag passed in from application. * fhandler_socket.cc (fhandler_socket::fcntl): Ditto. * fhandler.h: Set constant for future use. * winsup.h: Define OLD_O_NDELAY only for old programs. * include/cygwin/version.h: Define CYGWIN_VERSION_CHECK_FOR_OLD_O_NONBLOCK.
2001-08-05Throughout, change check for running under Windows NT to 'iswinnt'.Christopher Faylor
* dcrt0.cc (set_os_type): Set 'iswinnt' appropriately. * cygheap.cc (init_cheap): Revert to using VirtualAlloc for allocating cygheap. (cygheap_setup_for_child_cleanup): New function. Standard function to call after calling CreateProcess to cleanup cygheap info passed to child. (cygheap_fixup_in_child): Copy cygheap from shared memory into allocated space under Windows 9x or if can't relocate shared space under NT. * cygheap.h: Declare new function. * spawn.cc (spawn_guts): Use cygheap_fixup_in_child. * fork.cc (fork_parent): Ditto. * winsup.h: Declare iswinnt.
2001-07-26Throughout, reorganize header file inclusion to put security.h prior toChristopher Faylor
fhandler.h. * fhandler.h (fhandler_base::get_inheritance): New method. * fhandler_socket.cc (fhandler_socket::create_secret_event): Use proper close-on-exec inheritance when creating. (fhandler_socket::check_peer_secret_event): Create handle as non-inheritable.
2001-07-21* cygheap.cc (cygheap_fixup_in_child): Attempt Win95 workaround.Christopher Faylor
* dtable.cc (dtable::dup_worker): Add debugging output. (dtable::vfork_child_dup): Correctly set close_on_exec. * fhandler.cc (fhandler_base::fork_fixup): Don't mess with handle if there is no need to get it from the parent. * fhandler_tty.cc (fhandler_tty_common::close): Add debugging output.
2001-07-18* cygheap.cc (_cmalloc): Use correct constants for size calculation.Christopher Faylor
* 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.
2001-07-17* child_info.h: Bump magic number.Christopher Faylor
(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.
2001-06-03* cygheap.cc (cygheap_root::cygheap_rot): Remove constructor.Christopher Faylor
(cygheap_root::~cygheap_root): Remove destructor. (cygheap_root::operator =): Remove. (cygheap_root::set): New method. * cygheap.h (cygheap_root): Reflect above changes. Store root info in mount-like structure. (cygheap_root:posix_ok): New method. (cygheap_root::ischroot_native): Ditto. (cygheap_root::unchroot): Ditto. (cygheap_root::exists): Ditto. (cygheap_root::posix_length): Ditto. (cygheap_root::posix_path): Ditto. (cygheap_root::native_length): Ditto. (cygheap_root::native_path): Ditto. * dir.cc (opendir): Remove special chroot test. * path.cc (path_prefix_p): Remove front end. (normalize_posix_path): Reorganize chroot tests to accomodate new convention of allowing paths using posix chroot prefix. (path_conv::check): Pass a "already ran normalize" option to conv_to_win32_path. Return if there is an error from this function. (mount_info::conv_to_win32_path): Add extra argument. Don't call normalize_posix_path if caller has already done so. Substitute chroot setting, if any, for root translation. Add chroot checking to final output step. * shared_info (mount_info): Accomodate additional argument to conv_to_win32_path. * syscalls.cc (chroot): Store both normalized posix path and native path in chroot.
2001-05-08* cygheap.cc (_cfree): Add regparm attribute.Christopher Faylor
(_crealloc): Ditto. * dcrt0.cc (dll_crt0_1): Default to always checking for executable for now. * dtable.cc (dtable::not_open): Move method. * dtable.h (dtable): Here. * exceptions.cc (ctrl_c_handler): Don't expect process group leader to handle a signal if it doesn't exist. * fhandler.h (fhandler_base): Make openflags protected. * localtime.c (tzsetwall): Check for __CYGWIN__ as well as __WIN32__. * path.cc (path_conv::check): Add some comments. Change strcat to assignment. * lib/_cygwin_S_IEXEC.cc (_cygwin_bob__): Eliminate. * fhandler_tty.cc (fhandler_console::dup): Set controlling terminal if necessary. * fhandler_tty.cc (fhandler_tty_slave::dup): Ditto.
2001-05-05* exceptions.cc (ctrl_c_handler): Always send signal to process if it has noChristopher Faylor
tty.
2001-04-25 * autoload.cc: Add LoadDLLfunc statements for SetTokenInformation@16.Corinna Vinschen
* cygheap.cc: Include security.h. * grp.cc (internal_getgrent): New function. (getgroups): Rearranged using `internal_getgrent' and the new `cygsid' class. * passwd.cc (internal_getpwent): New function. * sec_acl.cc: Use new `cygsid' class throughout. (acl_access): Use `internal_getgrent' instead of `getgrent'. * sec_helper.cc: Use new `cygsid' class throughout. (get_id_from_sid): Use `internal_getgrent' instead of `getgrent'. Use `internal_getpwent' instead of `getpwent'. * security.cc: Use new `cygsid' class throughout. * security.h: Move `MAX_SID_LEN' from winsup.h to here. Add extern declarations for `internal_getgrent' and `internal_getpwent'. (class cygsid): New class. * shared.cc (sec_user): Use new `cygsid' class. * syscalls.cc (seteuid): Try to set owner to user and primary group to current group in impersonation token before performing impersonation. (setegid): Try to set primary group in process token to the new group if ntsec is on. * uinfo.cc (internal_getlogin): Use new `cygsid' class. Try to set owner to user and primary group to current group in process token if the process has been started from a non cygwin process. (uinfo_init): Set primary group only if the process has been started from a non cygwin process. * winsup.h: Move define for `MAX_SID_LEN' to security.h.
2001-04-19Throughout, change fdtab references to cygheap->fdtab.Christopher Faylor
* child_info.h (cygheap_exec_info): Eliminate special fdtab stuff. * spawn.cc (spawn_guts): Ditto. * cygheap.cc (cygheap_init): Initialize fdtab, if appropriate. * cygheap.h (CYGHEAPSIZE): Include size of init_cygheap. (_cmalloc_entry): Include fdtab here. * dtable.h (dtable): Declare/define new methods. * dtable.cc (dtable::vfork_child_fixup): New method. (dtable::fixup_after_exec): Remove unneeded extra arguments. * dcrt0.cc (dll_crt0_1): Ditto. * environ.cc (getwinenv): Use case sensitive comparison. (winenv): Make a copy of environment cache to avoid realloc problems when duplicate environment variables exist in the environment. (From Egor Duda) * net.cc (cygwin_socket): Revert Apr 14 change. * include/sys/file.h: Protect against previous X_OK definition. * passwd.cc: Eliminate passwd_sem throughout. * security.cc: Ditto. * cygwin.din: Export New functions. * passwd.cc (read_etc_passwd): Make race safe. (getpwuid_r): New function. (getpwnam_r): New function.