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
2014-12-02 * autoload.cc (CreateEnvironmentBlock): Import.Corinna Vinschen
(DestroyEnvironmentBlock): Import. * environ.cc (env_compare): New static bsearch comparison function. (build_env): Add parameter taking a user token. If token is non-NULL, fetch user's default Windows environment and merge it into the resulting environment. Explain what we do in preceeding comment. * environ,h (build_env): Align prototype to above change. * external.cc (create_winenv): Call build_env with NULL token. * spawn.cc (child_info_spawn::worker): When spawning new process under another user account, call build_env with new token to allow merging user's default Windows environment. * winlean.h (_USERENV_): Define to override dllimport.
2014-11-12 * cygheap.h (cygheap_pwdgrp): Remove constants NSS_FILES and NSS_DB.Corinna Vinschen
Use NSS_SRC_FILES and NSS_SRC_DB throughout instead. (cygheap_pwdgrp::nss_pwd_src): New inline method. (cygheap_pwdgrp::nss_grp_src): Ditto. * external.cc (cygwin_internal): Add CW_GETNSS_PWD_SRC and CW_GETNSS_GRP_SRC cases. * uinfo.cc: Use NSS_SRC_FILES and NSS_SRC_DB throughout. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GETNSS_PWD_SRC and CW_GETNSS_GRP_SRC. (NSS_SRC_FILES): Define. (NSS_SRC_DB): Define.
2014-11-06 * dcrt0.cc (cygwin_atexit): Change preceeding comment to reflectCorinna Vinschen
API version numbers. * external.cc (cygwin_internal): disable setting cxx_malloc on 64 bit. Add CW_FIXED_ATEXIT case. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_FIXED_ATEXIT. * lib/atexit.c (atexit): Test running Cygwin version by checking return value of cygwin_internal (CW_FIXED_ATEXIT).
2014-05-16 * external.cc (cygwin_internal): Use local name buffer instead ofCorinna Vinschen
allocated one in CW_CYGNAME_FROM_WINNAME.
2014-05-15 * external.cc (cygwin_internal): Implement CW_CYGNAME_FROM_WINNAME.Corinna Vinschen
Add lengthy comment to explain what we do and why. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_CYGNAME_FROM_WINNAME.
2014-02-27 * autoload.cc (CheckTokenMembership): Import.Corinna Vinschen
* external.cc (cygwin_internal): Call get_uid/get_gid instead of get_id. * grp.cc (internal_getgrsid): Take additional cyg_ldap pointer. Forward to pwdgrp::add_group_from_windows. (internal_getgrnam): Ditto. (internal_getgrgid): Ditto. (gr_ent::enumerate_local): Drop ugid_caching bool from call to pwdgrp::fetch_account_from_windows. (getgroups32): Rename from internal_getgroups and drop getgroups32 stub. Drop srchsid parameter and code handling it. Add local cyg_ldap instance and forward to internal_getgrXXX. (getgroups): Call getgroups32. (get_groups): Add local cyg_ldap instance and forward to internal_getgrXXX. (getgrouplist): Ditto. (setgroups32): Ditto. * ldap.cc (cyg_ldap::open): Don't call close. Return true if connection is already open. (cyg_ldap::remap_uid): Forward this to internal_getpwsid. (cyg_ldap::remap_gid): Forward this to internal_getgrsid. * passwd.cc (internal_getpwsid): Take additional cyg_ldap pointer. Forward to pwdgrp::add_user_from_windows. (internal_getpwnam): Ditto. (internal_getpwuid): Ditto. (pg_ent::enumerate_builtin): Drop ugid_caching bool from call to pwdgrp::fetch_account_from_windows. (pg_ent::enumerate_sam): Ditto. (pg_ent::enumerate_ad): Ditto. Forward local cldap instead. * pwdgrp.h (internal_getpwsid): Align declaration to above change. (internal_getpwnam): Ditto. (internal_getpwuid): Ditto. (internal_getgrsid): Ditto. (internal_getgrgid): Ditto. (internal_getgrnam): Ditto. (internal_getgroups): Drop declaration. (pwdgrp::add_account_from_windows): Align declaration to below change. (pwdgrp::add_user_from_windows): Ditto. (pwdgrp::add_group_from_windows): Ditto. * sec_acl.cc (setacl): Add local cyg_ldap instance and forward to internal_getpwuid and internal_getgrgid. (getacl): Add local cyg_ldap instance and forward to cygpsid::get_id. (aclfromtext32): Add local cyg_ldap instance and forward to internal_getpwnam and internal_getgrnam. * sec_helper.cc (cygpsid::get_id): Take additional cyg_ldap pointer. Forward to internal_getgrsid and internal_getpwsid. (get_sids_info): Drop ldap_open. Forward local cldap to internal_getpwsid and internal_getgrXXX. Call CheckTokenMembership rather than internal_getgroups. * security.h (cygpsid::get_id): Add cyg_ldap pointer, drop default parameter. (cygpsid::get_uid): Add cyg_ldap pointer. Call get_id accordingly. (cygpsid::get_gid): Ditto. * uinfo.cc (internal_getlogin): Add local cyg_ldap instance and forward to internal_getpwXXX and internal_getgrXXX calls. (pwdgrp::add_account_from_windows): Take additional cyg_ldap pointer. Forward to pwdgrp::fetch_account_from_windows. (fetch_posix_offset): Drop ldap_open argument and handling. Get cyg_ldap instance as pointer. (pwdgrp::fetch_account_from_windows): Take additional cyg_ldap pointer. Use it if it's not NULL, local instance otherwise. Drop ldap_open. Drop fetching extended group arguments from AD for speed.
2014-02-22 * external.cc (cygwin_internal): Add cases for CW_GETNSSSEP,Corinna Vinschen
CW_GETPWSID and CW_GETGRSID. * grp.cc (internal_getgrsid_from_db): New function. * passwd.cc (internal_getpwsid_from_db): New function. (pg_ent::setent): Add special case for call from mkpasswd/mkgroup. * pwdgrp.h (internal_getpwsid_from_db): Declare. (internal_getgrsid_from_db): Declare. (enum nss_enum_t): Move to include/sys/cygwin.h. (class pg_ent): Add comment. * uinfo.cc (pwdgrp::fetch_account_from_windows): Fix typo in comment. Change "UNIX" to "Unix" in domain name. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GETNSSSEP, CW_GETPWSID and CW_GETGRSID. (enum nss_enum_t): Define here.
2014-02-18 * external.cc (cygwin_internal): Handle new CW_SETENT, CW_GETENT andCorinna Vinschen
CW_ENDENT info types. * grp.cc (setgrent_filtered): New function, called from cygwin_internal. (getgrent_filtered): Ditto. (endgrent_filtered): Ditto. * passwd.cc (pg_ent::setent): Set state explicitely to from_cache. (pg_ent::getent): Handle the fact that a DC has no SAM and enumerating local accounts is equivalent to enumerating domain accounts. (setpwent_filtered): New function, called from cygwin_internal. (getpwent_filtered): Ditto. (endpwent_filtered): Ditto. * pwdgrp.h (setpwent_filtered): Declare. (getgrent_filtered): Ditto. (endgrent_filtered): Ditto. (setpwent_filtered): Ditto. (getpwent_filtered): Ditto. (endpwent_filtered): Ditto. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_SETENT, CW_GETENT, and CW_ENDENT.
2013-12-18* external.cc (fillout_pinfo): Remove nonsensical loop.Christopher Faylor
* fork.cc (frok::parent): When initializing pinfo for child new PID_NEW flag + actual defined constant rather than raw number. Don't set start_time here. * pinfo.cc (pinfo::thisproc): Use PID_NEW when initializing pinfo. Avoid checking h for NULL multiple times. Don't set start_time here. (pinfo_init): Aways set ppid last. Tweak strace output. (pinfo::init): Handle new PID_NEW flag. Wait for shared memory to contain useful information. Set start_time if PID_NEW. (_onreturn:h): Define as HANDLE rather than HANDLE *. (_onreturn::~onreturn): Accommodate h definition change. (_onreturn::no_close_handle): Rename from no_close_p_handle. Take a pinfo arg and set hProcess to h before zeroing. (winpids::add): Don't open a handle to our own process. Change logic associated with when a handle gets closed. Accommodate no_close_handle changes. (winpids::enum_processes): Simplify process enumeration loop. (winpids::set): Eliminate ill-considered malloc locking. * sigproc.cc (proc_subproc): Always set ppid last.
2013-10-24* external.cc (fillout_pinfo): If start_time is 0, wait a while beforeChristopher Faylor
returning the pinfo structure. * fhandler.cc (fhandler_base::open_setup): Convert from inline. * fhandler.h (fhandler_base::open_setup): Declare. * fhandler_console.cc (fhandler_console::open_setup): Always call fhandler_base::open_setup. * fhandler_tty.cc (fhandler_pty_slave::open_setup): Ditto. (fhandler_pty_master::open_setup): Ditto.
2013-04-23 * Merge in cygwin-64bit-branch.Corinna Vinschen
2013-01-21Throughout, update copyrights to reflect dates which correspond to main-branchChristopher Faylor
checkins. Regularize copyright format.
2012-07-02* external.cc (fillout_pinfo): Return NULL rather than 0.Christopher Faylor
(exit_process): Guard against NULL pointer dereference found by Clang.
2012-02-26 * environ.cc (enum settings): Add setbool. Rename justset to setdwordCorinna Vinschen
to avoid future problems. (struct parse_thing): Change all justset to setbool for bool variables. (parse_options): Add a case for setbool setting for bool variables since justset (now setdword) always writes a DWORD value, thus potentially overwriting adjacent memory locations. * external.cc (cygwin_internal): Drop extern declaration.
2012-02-14 * cygheap.cc (init_cygheap::init_installation_root): Convert functionCorinna Vinschen
init_installation_root into a cygheap method. * cygheap.h (struct init_cygheap): Move installation_root, installation_key, and installation_key_buf from shared .cygwin_dll_common DLL section to cygheap. Declare new method init_installation_root. * dtable.cc (handle_to_fn): Accommodate the move of installation strings to the cygheap. * external.cc (cygwin_internal): Ditto. * fhandler_console.cc (fhandler_console::open_shared_console): Ditto. * fhandler_mailslot.cc (fhandler_mailslot::get_object_attr): Ditto. * fhandler_tty.cc: Ditto, throughout. * mount.cc (mount_info::init): Ditto. * pipe.cc (fhandler_pipe::create): Ditto. * shared.cc: Ditto, throughout. (installation_root): Remove. (installation_key): Move to cygheap. (installation_key_buf): Ditto. (installation_root_inited): Remove. (SPIN_WAIT): Remove. (init_installation_root): Move to cygheap. (memory_init): Call cygheap->init_installation_root right after cygheap->user.init. Drop call of init_installation_root function. * shared_info.h (init_installation_root): Drop declaration. (installation_root): Ditto. (installation_key): Ditto. * uinfo.cc (pwdgrp::load): Accommodate the move of installation strings to the cygheap.
2011-12-22 * external.cc (cygwin_internal): Implement CW_ALLOC_DRIVE_MAP,Corinna Vinschen
CW_MAP_DRIVE_MAP, CW_FREE_DRIVE_MAP. * fhandler_process.cc: Include mount.h. (get_volume_path_names_for_volume_name): Move to mount.cc. (struct dos_drive_mappings): Ditto. * mount.cc (get_volume_path_names_for_volume_name): Move here. (dos_drive_mappings::dos_drive_mappings): Ditto. (dos_drive_mappings::fixup_if_match): Ditto. (dos_drive_mappings::~dos_drive_mappings): Ditto. * mount.h (class dos_drive_mappings): Declare her. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_ALLOC_DRIVE_MAP, CW_MAP_DRIVE_MAP, CW_FREE_DRIVE_MAP. * include/cygwin/version.h: Bump API minor number.
2011-12-22 Throughout use wincap.allocation_granularity instead of getpagesize.Corinna Vinschen
Throughout use wincap.page_size instead of getsystempagesize. Throughout use "status" as variable name to hold NTSTATUS values. * fhandler_mem.cc: Check for NT_SUCCESS rather than for STATUS_SUCCESS. Fix debug_printf output. Rectify long statements. Fix comment formatting. * fhandler_proc.cc: Ditto. (format_proc_swaps): Drop useless test for ERROR_PROC_NOT_FOUND. * fhandler_process.cc: Ditto as in fhandler_mem.cc. (get_process_state): Rearrange allocation loop. Use malloc/realloc. (get_mem_values): Fix potential NULL pointer usage. Drop unused variable. * pinfo.cc (winpids::enum_processes): Handle low memory gracefully. * sec_auth.cc (get_priv_list): Drop local variable ret. * shared.cc (memory_init): Drop outdated call to getpagesize. * syscalls.cc (getsystempagesize): Remove. * sysconf.cc: Check for NT_SUCCESS rather than for STATUS_SUCCESS. (sysinfo): Constify sizeof_stodi. Drop useless test for ERROR_PROC_NOT_FOUND. * thread.cc (pthread_getattr_np): Cast pointers to uintptr_t rather than to int for pointer arithmetic. * winsup.h (getsystempagesize): Drop declaration.
2011-11-28 * external.cc (fillout_pinfo): Store program name as POSIX path inCorinna Vinschen
ep.progname_long.
2011-10-05 * external.cc (create_winenv): Rename from sync_winenv. TakeCorinna Vinschen
environment pointer as parameter and return pointer to corresponding win32 environment block if != NULL. Otherwise just sync as before. (cygwin_internal): Add CW_CVT_ENV_TO_WINENV case. * include/cygwin/version.h: Bump API minor number. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_CVT_ENV_TO_WINENV.
2011-06-01* external.cc (fillout_pinfo): Don't truncate ctty if it's < 0.Christopher Faylor
* select.cc (pipe_data_available): Avoid printing debug info by default or suffer very large strace files.
2011-05-28* autoload.cc: Call _api_fatal in asm.Christopher Faylor
* child_info.h: Redefine CURR_CHILD_INFO_MAGIC. (child_info_fork::abort): Rename from handle_failure. Change arguments. * cygtls.h (_local_storage::ttybuf): New field. * dcrt0.cc (vapi_fatal): Split api_fatal. Add "in forked process" to message when appropriate. (api_fatal): Use vapi_fatal. * devices.h: Make multiple inclusion safe. (fh_devices): Add FH_CONS* stuff. Reorder slightly. (device): Eliminate anonymous union. Add more ways to access minor/major. (device::setunit): Accommodate no-longer-anonymous union. (device::is_fs): Ditto. (device::is_fs_special): Ditto. (device::major): New function. (device::minor): Ditto. (device::is_device): New function. (device::not_device): Ditto. (device::operator int): New operator. (device::operator fh_devices): Ditto. (device::operator bool): Ditto. (device::operator DWORD): Ditto. (device::operator =): Ditto. (isproc_dev): New function. (isprocsys_dev): Ditto. (iscons_dev): Ditto. (istty_slave_dev): Ditto. * devices.in: Add new "/dev/cons*" strings. Accommodate no-longer-anonymous union throughout. (BRACK): Use more precise method for initialization. * devices.cc: Regenerate. * dtable.cc (dtable::stdio_init): Use get_cttyp instead of get_tty. (dtable::find_archetype): Use new DWORD operator in device to test archetypes. (dtable::init_std_file_from_handle): Use different method to initialize 'dev'. Adapt to different ctty handling and accommodate /dev/cons*. (fh_alloc): Accommodate no-longer-anonymous union. Adapt to new /dev/cons*. (build_fh_pc): Make debugging output more useful. * exceptions.cc (ctrl_c_handler): Use get_cttyp instead of get_tty. * external.cc (fillout_pinfo): Accommodate new cons* stuff. * fhandler.cc (fhandler_base::read): Eliminate is_slow() test. * fhandler.h (fhandler_base::*): Adapt to changes in device.h. (fhandler_*::is_slow): Delete. ( fhandler_proc::get_proc_fhandler): Return fh_devices type. * fhandler_console.cc (open_shared_console): New function. (console_unit): New class. (console_unit::console_unit): New constructor. (enum_windows): New function. Declare as friend to console_unit. (fhandler_console::set_unit): New function. (fhandler_console::get_tty_stuff): Call set_unit to set the unit number and determine if initialization is needed. Eliminate flags parameter. (tty_list::get_cttyp): Rename (sorta) from get_tty. Return pointer to correct tty_min. (fhandler_console::open): Adapt to elimination of argument to get_tty_stuff. (fhandler_console::output_tcsetattr): Properly detect error condition. (fhandler_console::fixup_after_fork_exec): Adapt to get_tty_stuff() setting tc automatically. * fhandler_proc.cc: Use FH_BAD rather than 0 throughout where using fh_devices enum. (fhandler_proc::get_proc_fhandler): Return fh_devices. Adapt to devices.h changes. * fhandler_process.cc: Adapt to devices.h changes. Use FH_BAD rather than 0 throughout where using fh_devices enum. * fhandler_procnet.cc: Ditto. * fhandler_procsys.cc: Ditto. * fhandler_procsysvipc.cc: Ditto. * fhandler_tape.cc (fhandler_dev_tape::fhandler_dev_tape): Ditto. * fhandler_termios.cc (handler_termios::bg_check): Use tc->ttyname() rather than assuming that we can construct a tty. * fhandler_tty.cc (fhandler_tty_master::fhandler_tty_master): Just return get_minor() of dev. (fhandler_pty_master::process_slave_output): Add slightly more debugging info. (fhandler_tty_slave::fhandler_tty_slave): Change name from ntty to unit. (fhandler_pty_master::open): Ditto. (fhandler_tty_slave::ioctl): Adapt to change which causes ctty to represent a complete device. (fhandler_tty_master::init_console): Add debugging for failure path. (fhandler_pty_master::setup): Use get_unit() to retrieve unit number rather than relying on raw ntty. (fhandler_pty_master::setup): Ditto. * fhandler_virtual.h (virt_tab_t): Redefine fhandler as fh_devices. * fork.cc: Remove obsolete vfork stuff. (frok::child): Don't assume that a ctty == 0 is valid. * mount.cc (mount_info::conv_to_win32_path): Adapt to device struct changes. (mount_info::conv_to_win32_path): Ditto. * path.cc (path_conv::check): Retrive major/minor numbers via a method rather than accessing them directly from device. Rely on dev operators to set/retrieve device information as required by device struct change. * path.h (isproc_dev): Move to devices.h. (isprocsys_dev): Ditto. (isvirtual_dev): Ditto. (path_conv:{isdevice,isfifo,isspecial,iscygdrive,issocket,get_devn,get_unitn}): Use device methods to access/manipulate devices. * pinfo.cc (pinfo::exit): Don't assume that ctty == 0 is valid. Use iscons_dev to determine if a device is a console. (_pinfo::_ctty): Use device::parse to generate tty/cons name. (_pinfo::set_ctty): Don't assume that ctty == 0 is valid. Remove redundant info from debugging. * shared.cc (offsets): Remove console offset. * shared_info.h (shared_locations): Ditto. * syscalls.cc (umask): Use device methods to manipulate device information. (ctermid): Use device::parse to generate term device name. * tlsoffsets.h: Regenerate. * tty.cc (ttyslot): Return minor number of ctty since ctty now represents a full device. (tty::create_master): Set ctty to a complete device. (tty_list::attach): Rework to detect new /dev/cons* stuff. (tty_list::terminate): Adapt to changes to ctty. (tty_list::init): Adapt to change to setntty - pass in device major number. (tty::exists): Use get_unit() to retrive tty unit number. (tty::open_mutex): Ditto. (tty::open_inuse): Ditto. (tty::create_inuse): Ditto. (tty::get_event): Ditto. (tty_min::ttyname): Define new function. * tty.h (tty_min::ntty): Redefine as fh_devices. (tty::exists): Use get_unit() to retrive tty unit number. (tty::open_mutex): Ditto. (tty::open_inuse): Ditto. (tty::create_inuse): Ditto. (tty::get_event): Ditto. (tty_min::ttyname): Declare new function. (tty::getntty): Declare as const. (tty_list::operator []): Assure that only minor part of argument is used. * dll_init.cc (dll_list::alloc): Detect mismatch of data segments early issuing an explicit error message if necessary. * heap.cc (heap_init): Adapt to changes from fork->handle_failure to fork->abort. * pinfo.h (EXITCODE_FORK_FAILED): New enum. (from Ryan Johnson) * sigproc.cc (child_info_fork::abort): Rename from handle_failure. Change arguments to allow passing in a printf-like message. * winsup.h (api_fatal): Delete macro definition. (api_fatal): Redefine from __api_fatal. (vapi_fatal): Declare new function. * include/sys/strace.h (strace_vprintf): Define new macro. * ntdll.h (_SYSTEM_INFORMATION_CLASS): Add SystemHandleInformation.
2011-04-04 * cygserver_setpwd.h (setlsapwd): Add username parameter to declaration.Corinna Vinschen
* external.cc (cygwin_internal): In the CW_SET_PRIV_KEY case, fetch additional username parameter. * setlsapwd.cc (setlsapwd): Add username parameter. Allow admin to set the hidden password for other users.
2010-08-27 * external.cc (sync_wincwd): Remove.Corinna Vinschen
(cygwin_internal): Drop CW_SYNC_WINCWD case. * globals.cc (ro_u_pipedir): New R/O unicode string. * ntdll.h (RtlSetCurrentDirectory_U): Declare. * path.cc (cwdstuff::set): Improve comments. Drop setting Win32 CWD to \\?\PIPE\ on init. Keep Win32 CWD in sync, if possible. Set to \\?\PIPE\ otherwise. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Revert to 230. * include/sys/cygwin.h (cygwin_getinfo_types): Remove CW_SYNC_WINCWD.
2010-08-24 * external.cc (cygwin_internal): In CW_CVT_MNT_OPTS case, initializeCorinna Vinschen
flags with *pflags to restore original behaviour.
2010-08-19 * external.cc (sync_wincwd): New function.Corinna Vinschen
(cygwin_internal): Rename CW_SETCWD to CW_SYNC_WINCWD. Call sync_wincwd from here. * include/sys/cygwin.h (cygwin_getinfo_types): Rename CW_SETCWD to CW_SYNC_WINCWD.
2010-08-18* external.cc (CW_SETCWD): New option.Christopher Faylor
* include/cygwin/version.h: Bump api minor to 231. * include/sys/cygwin.h (CW_SETCWD): Define.
2010-07-04* path.cc (path_conv::check): Move fs-specific settings to a point where weChristopher Faylor
know that we have filled out the filesystem information. * path.h (path_conv::path_conv): Use consistent initialization for constructors. * include/sys/cygwin.h: Define CW_STRERROR. * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 228. * include/external.h: Implement CW_STRERROR.
2010-05-18* environ.cc (regopt): Change the first argument to wide char string.Christopher Faylor
(environ_init): Accommodate change to the first argument of regopt. * exception.cc (open_stackdumpfile): Accommodate change to the type of progname in _pinfo. * external.cc (fillout_pinfo): Ditto. * fhandler_process.cc (format_process_winexename): Ditto. (format_process_stat): Ditto. * fork.cc (fork::parent): Ditto. * pinfo.cc (pinfo_basic::pinfo_basic): Call GetModuleFileNameW instead of GetModuleFileName. (pinfo::thisproc): Accommodate change to the type of progname in _pinfo. (pinfo_init): Ditto. * pinfo.h (_pinfo): Change the type of progname to a wide char array. * registry.h (reg_key::get_int): Change the first argument from constant point to pointer to constant. (reg_key::get_string): Ditto. Change the last argument likewise. * registry.cc (reg_key::get_int): Accommodate change to the declaration. (reg_key::get_string): Ditto. * strace.cc (strace::hello): Accommodate change to the type of progname in _pinfo. (strace::vsprntf): Ditto.
2010-04-29 * external.cc (cygwin_internal): Add CW_CVT_MNT_OPTS to allow mountCorinna Vinschen
flag parsing. Add CW_LST_MNT_OPTS case to allow mount flag listing. * mount.cc (fstab_read_flags): Rename from read_flags. Make externally available. Change input string to char ** to allow returning faulty option. Add flag for avoiding debug output. (fstab_list_flags): New function to create list of options. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_CVT_MNT_OPTS and CW_LST_MNT_OPTS.
2010-02-08 * external.cc (cygwin_internal): Add CW_INT_SETLOCALE case toCorinna Vinschen
allow to call internal_setlocale(). * nlsfuncs.cc (internal_setlocale): Make externally available. * include/cygwin/version.h: Bump API minor number. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_INT_SETLOCALE. * nlsfuncs.cc (lc_mbstowcs): Fix call to f_mbtowc. (__set_locale_from_locale_alias): Ignore "@cjknarrow" modifier.
2009-10-31 * cygprops.h: New file.Corinna Vinschen
* dtable.cc (handle_to_fn): Add check for correct installation_key string in object name for pipes and ttys. * external.cc (cygwin_internal): Add CW_GET_INSTKEY to allow fetching the installation_key from cygserver. * fhandler_fifo.cc (fhandler_fifo::fifo_name): Add installation_key to fifo name. * globals.cc: Include cygprops.h. (_RDATA): Move slightly and add comment. (cygwin_props): Define. * mount.cc (mount_info::init): Accommodate the fact that installation_root is now a global variable in DLL common shared memory, rather than a member of cygwin_shared. * pipe.cc (fhandler_pipe::create_selectable): Add installation_key to pipe name. * shared.cc (installation_root): Define here for storage in DLL common shared memory. (installation_key): Ditto. (installation_key_buf): Ditto. (init_installation_root): Convert from shared_info method to ordinary function. Add initializing installation_key. Invalidate installation_key depending of value of disable_key property. Add comment to explain. (get_shared_parent_dir): Add installation_key to directory name. (get_session_parent_dir): Ditto. (shared_info::initialize): Move call to init_installation_root from here... (memory_init): ...to here. Add debug output to print installation root and installation key. Add comment to explain why. * shared_info.h (SHARED_INFO_CB): Recalculate. (CURR_SHARED_MAGIC): Ditto. (class shared_info): Remove definition of installation_root and declaration of init_installation_root. (init_installation_root): Declare. (installation_root): Declare. (installation_key): Declare. * uinfo.cc (pwdgrp::load): Accommodate the fact that installation_root is now a global variable in DLL common shared memory. * include/cygwin/version.h: Bump API minor number. (CYGWIN_INFO_INSTALLATIONS_NAME): Add. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_GET_INSTKEY.
2009-10-14Consistently use va_end.Eric Blake
* external.cc (cygwin_internal): Use va_end. * fork.cc (child_copy): Likewise. * libc/bsdlib.cc (warn, warnx, err, errx): Likewise. * pinfo.cc (commune_request): Likewise. * strace.cc (strace::prntf, strace_printf): Likewise.
2009-10-13 * include/sys/cygwin.h: Add new cygwin_getinfo_typeCorinna Vinschen
CW_SET_EXTERNAL_TOKEN. Add new enum CW_TOKEN_IMPERSONATION, CW_TOKEN_RESTRICTED. * cygheap.h (cyguser): New flags ext_token_is_restricted, curr_token_is_restricted and setuid_to_restricted. * external.cc (cygwin_internal): Add CW_SET_EXTERNAL_TOKEN. * sec_auth.cc (set_imp_token): New function. (cygwin_set_impersonation_token): Call set_imp_token (). * security.h (set_imp_token): New prototype. * spawn.cc (spawn_guts): Use CreateProcessAsUserW if restricted token was enabled by setuid(). Do not create new window station in this case. * syscalls.cc (seteuid32): Add handling of restricted external tokens. Set HANDLE_FLAG_INHERIT for primary token. (setuid32): Set setuid_to_restricted flag. * uinfo.cc (uinfo_init): Do not reimpersonate if restricted token was enabled by setuid (). Initialize user.*_restricted flags.
2009-10-12 * external.cc (cygwin_internal): Return 0 in CW_SET_DOS_FILE_WARNINGCorinna Vinschen
and CW_SETERRNO cases.
2009-10-07Add cygwin wrapper for ExitProcess and TerminateProcess.Charles Wilson
2009-09-21* external.cc (cygwin_internal): Add hack to always reset cxx_malloc to properChristopher Faylor
value. * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Relocate wayward comment.
2009-01-16 * Fix copyright dates.Corinna Vinschen
2009-01-09* include/sys/cygwin.h (CW_SETERRNO): Define.Christopher Faylor
* external.cc (CW_SETERRNO): Implement. * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to reflect the above change. * path.cc (path_prefix_p): Treat X: as equivalent to x:. * mkglobals_h: Remove unneeded #define. * spawn.cc (spawn_guts): Avoid overly wordy initialization to zero.
2008-11-26 * Makefile.in (DLL_OFILES): Add setlsapwd.o.Corinna Vinschen
* cygserver.h (CYGWIN_SERVER_VERSION_API): Bump. (request_code_t): Define CYGSERVER_REQUEST_SETPWD request type. * cygserver_msg.h (client_request_msg::retval): Use default value of -1 for retval if msglen is 0. * cygserver_sem.h (client_request_sem::retval): Ditto. * cygserver_shm.h (client_request_shm::retval): Ditto. * cygserver_setpwd.h: New file. * external.cc (cygwin_internal): Implement new CW_SET_PRIV_KEY type. * sec_auth.cc (open_local_policy): Make externally available. Get ACCESS_MASK as argument. (create_token): Accommodate change to open_local_policy. (lsaauth): Ditto. (lsaprivkeyauth): New function fetching token by retrieving password stored in Cygwin or Interix LSA private data area and calling LogonUser with it. * security.h (lsaprivkeyauth): Declare. (open_local_policy): Declare. * setlsapwd.cc: New file implementing setting LSA private data password using LsaStorePrivateData or by calling cygserver if available. * syscalls.cc (seteuid32): Add workaround to get the original token when switching back to the original privileged user, even if setgroups group list is still active. Add long comment to explain why. Call lsaprivkeyauth first, only if that fails call lsaauth or create_token. * include/cygwin/version.h: Bump API minor number. * include/sys/cygwin.h (cygwin_getinfo_types): Add CW_SET_PRIV_KEY.
2008-08-14 * external.cc (cygwin_internal): Call set_security_attribute withCorinna Vinschen
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.
2008-07-30 * sec_auth.cc (extract_nt_dom_user): Return domain and user name asCorinna Vinschen
WCHAR. (cygwin_logon_user): Accommodate above change. Convert password to WCHAR and call LogonUserW. * external.cc (cygwin_internal): Accommodate above change. * security.h (extract_nt_dom_user): Change prototype accordingly.
2008-07-15 Throughout drop allow_ntsec and allow_smbntsec handling.Corinna Vinschen
* 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.
2008-04-07Remove unneeded header files from source files throughout.Christopher Faylor
2008-04-01 * Fix copyright dates.Corinna Vinschen
2008-03-07 * Makefile.in (DLL_OFILES): Add tls_pbuf.o.Corinna Vinschen
* autoload.cc (CreateDesktopW): Replace CreateDesktopA. (CreateWindowStationW): Replace CreateWindowStationA. (GetUserObjectInformationW): Replace GetUserObjectInformationA. * cygheap.h (cwdstuff::get): Assume default buffer size NT_MAX_PATH. * cygtls.cc (_cygtls::remove): Free temporary TLS path buffers. * cygtls.h (TP_NUM_C_BUFS): Define. (TP_NUM_W_BUFS): Define. (class tls_pathbuf): New class to store pointers to thread local temporary path buffers. (_local_storage::pathbufs): New member. * environ.cc (win_env::add_cache): Use temporary TLS path buffer instead of stack based buffer. (posify): Get temporary outenv buffer from calling function. (environ_init): Create temporary TLS path buffer for posify. (build_env): Create Windows environment block as WCHAR buffer. * environ.h (build_env): Change declaration accordingly. * external.cc (sync_winenv): Accommodate build_env change. * fhandler_console.cc (fhandler_console::need_invisible): Use GetUserObjectInformationW and CreateWindowStationW. * fhandler_process.cc (format_process_maps): Use temporary TLS path buffer instead of stack based buffer. * fork.cc (frok::parent): Convert to use CreateProcessW. * path.cc: Throughout use temporary TLS path buffers instead of stack based buffer. Replace checks for CYG_MAX_PATH by checks for NT_MAX_PATH. (getfileattr): New function to replace GetFileAttributesA. (normalize_win32_path): Remove Win32 and NT long path prefixes. (getwd): Assume PATH_MAX + 1 buffer per SUSv3. * path.h (class path_conv): Set path buffer to size NT_MAX_PATH. (iswdrive): Define. * pinfo.cc (commune_process): Use temporary TLS path buffer instead of stack based buffer. * registry.cc (get_registry_hive_path): Ditto. (load_registry_hive): Ditto. * spawn.cc (spawn_guts): Convert to use CreateProcessW and CreateProcessAsUserW. (av::fixup): Open/close file using NtOpenFile/NtClose. * syscalls.cc (mknod_worker): Allow PATH_MAX file name. (mknod32): Ditto. (getusershell): Ditto. * tls_pbuf.cc: New file implementing tls_pathbuf and tmp_pathbuf methods. * tls_pbuf.h: New header for files using tmp_pathbuf. * tlsoffsets.h: Regenerate. * winsup.h (NT_MAX_PATH): Define as 32767 to avoid USHORT overflow.
2008-02-16 * include/sys/cygwin.h (__INT_MAX_PATH): Remove.Corinna Vinschen
(external_pinfo): Convert program_long to pointer. * external.cc (fillout_pinfo): Add buffer for program_long value.
2007-12-06 * dcrt0.cc (initial_env): Use PATH_MAX instead of CYG_MAX_PATH for pathCorinna Vinschen
name buffer size. (dll_crt0_1): Allocate new_argv0 with PATH_MAX size. * exceptions.cc (debugger_command): Set size to 2 * PATH_MAX + 20; (error_start_init): Use PATH_MAX instead of CYG_MAX_PATH for path name buffer size. * external.cc (fillout_pinfo): Always fill out ep.progname 0-terminated. Fill out ep.progname_long. * fhandler_process.cc (fhandler_process::fill_filebuf): Allocate buffer for executable filename with PATH_MAX size. * pinfo.cc: Throughout use PATH_MAX instead of CYG_MAX_PATH. * pinfo.h (class _pinfo): Set progname size to PATH_MAX. * smallprint.cc: Include limits.h. Use PATH_MAX instead of CYG_MAX_PATH for path name buffer size. * strace.cc (strace::vsprntf): Ditto. * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION_32_LP): Define. (EXTERNAL_PINFO_VERSION): Set to EXTERNAL_PINFO_VERSION_32_LP. (struct external_pinfo): Add progname_long member. * include/sys/dirent.h: Correctly include limits.h instead of sys/limits.h.
2007-10-31 * external.cc (get_cygdrive_info): Make inline.Corinna Vinschen
(get_cygdrive_prefixes): Remove. (cygwin_internal): Call get_cygdrive_info with NULL flag parameters instead of get_cygdrive_prefixes. * path.cc (mount_info::get_cygdrive_info): Allow NULL flag parameters.
2007-03-30* cygwin/external.cc (cygwin_internal): Implement CW_SET_DOS_FILE_WARNING.Christopher Faylor
* cygwin/include/sys/cygwin.h: Define CW_SET_DOS_FILE_WARNING. * utils/mount.cc (main): Turn dos file warnings off since we know what we're doing.
2007-02-23 * exceptions.cc (dummy_ctrl_c_handler): Remove.Corinna Vinschen
(init_console_handler): Drop has_null_console_handler_routine checks. * fhandler_raw.cc (fhandler_dev_raw::open): Drop has_raw_devices check. * fhandler_serial.cc (fhandler_serial::open): Drop .supports_reading_modem_output_lines check. * miscfuncs.cc (low_priority_sleep): Drop has_switch_to_thread check. * shared.cc (open_shared): Drop needs_memory_protection checks. * spawn.cc (spawn_guts): Drop start_proc_suspended check. * uname.cc (uname): Drop has_valid_processorlevel check. * wincap.cc: Remove has_raw_devices, has_valid_processorlevel, supports_reading_modem_output_lines, needs_memory_protection, has_switch_to_thread, start_proc_suspended and has_null_console_handler_routine throughout. * wincap.h: Ditto.