Commit Graph

2459 Commits

Author SHA1 Message Date
Corinna Vinschen d183515c9f * mkgroup.c: Add function pointers for functions from advapi32.dll.
(load_netapi): Load used functions from advapi32.dll.
	(main): Use function pointers instead of statically linked functions
	from advapi32.dll.
2002-07-02 12:59:43 +00:00
Corinna Vinschen b7e51146bf * include/cygwin/version.h: Bump API minor version. 2002-07-02 09:40:07 +00:00
Corinna Vinschen 891bb974f9 * security.cc (get_logon_server): Interpret a zero length
domain as the local domain.
	(get_group_sidlist): Add authenticated users SID to SYSTEM's group
	list instead of SYSTEM itself.
	(verify_token): Accept the primary group sid if it equals
	the token user sid.
2002-07-02 09:02:53 +00:00
Corinna Vinschen aeed87e86e * cygwin.din (__fpclassifyd): Add symbol.
(__fpclassifyf): Ditto.
	(__signbitd): Ditto.
	(__signbitf): Ditto.
2002-07-02 08:44:54 +00:00
Corinna Vinschen 654bad37a6 * security.h (DONT_INHERIT): Eliminate definition.
(INHERIT_ALL): Ditto.
	(INHERIT_ONLY): Ditto.
	* sec_acl.cc: Use appropriate defines from accctrl.h instead of the
	above throughout.
	* security.cc: Ditto.
2002-07-02 08:11:15 +00:00
Danny Smith b23a38b29e 2002-07-02 Danny Smith <dannysmith@users.sourceforge.net>
* include/commctrl.h (WC_*): Remove some duplicate defines.

2002-07-02  Ken Fitlike  <kenfitlike@hotmail.com>

	* include/commctrl.h (WC_IPADDRESS[AW]): Add defines and
	UNICODE mappings.
	(IPM*): Add defines.
	(IPN_*): Add defines.
	(NMIPADDRESS): Add structure and typedefs.
	(MAKEIPADDRESS): Add macro.
	(MAKEIPRANGE): Add macro.
	(FIRST_IPADDRESS): Add macro.
	(SECOND_IPADDRESS): Add macro.
	(THIRD_IPADDRESS): Add macro.
	(FOURTH_IPADDRESS): Add macro.
2002-07-02 05:50:10 +00:00
Christopher Faylor e968058fed * syscalls.c (seteuid32): Return immediately if the program is not impersonated
and both uid and gid are original.
(setegid32): Return immediately if the new gid is the current egid.
2002-07-02 03:06:32 +00:00
Christopher Faylor 3434e0c857 * syscalls.cc (seteuid32): Fix incorrect placement of Pierre's patch below. 2002-07-02 01:53:58 +00:00
Christopher Faylor 3557bbc1ea * syscalls.cc (seteuid32): Fix incorrect use of system_printf. 2002-07-02 01:42:41 +00:00
Christopher Faylor 74fcdaec20 * autoload.cc (GetSecurityInfo): Define new autoload function.
(RegQueryInfoKeyA): Ditto.
* fhandler.h (fhandler_virtual::fill_filebuf): Change return type to bool.
(fhandler_proc::fill_filebuf): Ditto.
(fhandler_registry::fill_filebuf): Ditto.
(fhandler_process::fill_filebuf): Ditto.
(fhandler_registry::value_name): Add new member.
(fhandler_registry::close): Add new method.
(fhandler_process::p): Remove member.
* fhandler_proc.cc (fhandler_proc::open): Add set_nohandle after calling
superclass method.  Check return value of fill_filebuf.
(fhandler_proc::fill_filebuf): Change return type to bool.  Add return
statement.
* fhandler_process.cc (fhandler_process::open): Add set_nohandle after calling
superclass method.  Remove references to p.  Check return value of
fill_filebuf.
(fhandler_process::fill_filebuf): Change return type to bool.  Don't use
dereference operator on p.  Add return statement.
(fhandler_process::format_process_stat): Fix typo.
* fhandler_registry.cc: Add static open_key declaration.
(fhandler_registry::exists): Assume path is already normalised.  Try opening
the path as a key in its own right first, before reverting to enumerating
subkeys and values of the parent key.
(fhandler_registry::fstat): Add additional code to return more relevant
information about the registry key/value.
(fhandler_registry::readdir): Explicitly set desired access when opening
registry key.  Remove output of buf from debug_printf format string.
(fhandler_registry::open): Use set_io_handle to store registry key handle.  Set
value_name member.  Move code to read a value from the registry to
fill_filebuf.  Add call to fill_filebuf.
(fhandler_registry::close): New method.
(fhandler_registry::fill_filebuf): Change return type to bool.  Add code to
read a value from registry.
(fhandler_registry::open_key): Make function static.  Use KEY_READ as desired
access unless this is the last path component.  Check the return value of
RegOpenKeyEx for an error instead of hKey.
* fhandler_virtual.cc (fhandler_virtual::lseek): Check the return value of
fill_filebuf.
(fhandler_virtual::open): Remove call to set_nohandle.
(fhandler_virtual::fill_filebuf): Change return type to bool.  Add return
statement.
* security.cc (get_nt_object_attribute): New function.
(get_object_attribute): New function.
* security.h (get_object_attribute): New function declaration.
2002-07-02 01:36:15 +00:00
Christopher Faylor 96edd0a9da * syscalls.c (seteuid32): Do not return an error when the token cannot be
created only because of a problem with the gid.
2002-07-01 23:42:05 +00:00
Christopher Faylor 1050e57c9a * mount.cc (main): Ensure that mount_already_exists() also gets default flag
that is passed to do_mount.
* cygpath.cc (long_options): Add "dos" and "mixed", correct "close", "file" and
"type" to use NULL flag.
(usage): Clean up usage output (more), accomodate new options.
(main): Add --dos and --mixed options; accomodate all output forms in --type.
Make UNIXy output default.
2002-07-01 20:54:35 +00:00
Christopher Faylor 1bc9effd28 * fhandler_clipboard.c (fhandler_dev_clipboard::open): Force text mode.
* fhandler_console.cc (fhandler_console::open): *Really* force binary mode
rather than make it optional.
* fhandler_proc.cc (fhandler_proc::open): Ditto.
* fhandler_process.cc (fhandler_process::open): Ditto.
* fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto.
* fhandler_raw.cc (fhandler_dev_raw::open): Ditto.
* fhandler_registry.cc (fhandler_registry::open): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
* fhandler_virtual.cc (fhandler_virtual::open): Ditto.
* fhandler_windows.cc (fhandler_windows::open): Ditto.
* fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
* net.cc (fdsock): Ditto.
* path.cc (set_flags): Add more debugging.
2002-07-01 19:03:26 +00:00
Christopher Faylor b5e1ec7632 * debug.cc (threads): Avoid initialization.
* uinfo.cc (cygheap_user::ontherange): (from Corinna Vinschen) Actually make
below changes work.
2002-07-01 16:37:46 +00:00
Christopher Faylor db57a36336 * uinfo.cc (cygheap_user::ontherange): Make cygwin root the last resort for
HOMEPATH/HOMEDRIVE for consistency with HOME.
2002-07-01 15:50:02 +00:00
Corinna Vinschen 73d97618a7 * shared.cc (sec_none): Move to sec_helper.cc.
(sec_none_nih): Ditto.
	(sec_all): Ditto.
	(sec_all_nih): Ditto.
	(get_null_sd): Ditto.
	(sec_acl): Ditto.
	(__sec_user): Ditto.
	* sec_helper.cc (sec_none): Move from shared.cc to here.
	(sec_none_nih): Ditto.
	(sec_all): Ditto.
	(sec_all_nih): Ditto.
	(get_null_sd): Ditto.
	(sec_acl): Ditto.
	(__sec_user): Ditto.
2002-07-01 14:31:28 +00:00
Christopher Faylor 8297bda005 * uinfo.cc (cygheap_user::ontherange): Potentially set HOME from existing
homepath and homedrive cygheap_user fields (not currently used yet).  Set HOME
to / if no other alternative.
(cygheap_user::test_uid): Simplify.
2002-07-01 03:57:17 +00:00
Christopher Faylor fad1c3a8e0 white space 2002-07-01 02:36:04 +00:00
Christopher Faylor 8a2ce995f1 * environ.cc (parse_options): Use setenv to potentially replace CYGWIN value on
export.  Fixes broken behavior since November 2000 changes.
(regopt): Return indication of whether or not something has been parsed from
the registry.
(environ_init): Only attempt to export CYGWIN variable when values were set
from the registry.  It is exported automatically otherwise.
2002-07-01 02:11:30 +00:00
Christopher Faylor fdf0b5de28 * fhandler.h (fhandler_process::pid): New field.
(fhandler_process::fstat): Remove unneeded array.  Set pid element.
(fhandler_process::open): Ditto.
(fhandler_process::fill_filebuf): Handle case where 'p' field is NULL.
2002-06-30 23:02:58 +00:00
Christopher Faylor ccacec81db * fhandler.h (fhandler_process::p): New field.
(fhandler_process:fill_filebuf): Revert to same definition as virtual in parent
class.
(fhandler_process::open): Fill out p field rather than passing as an argument.
(fhandler_process::fill_filebuf): Use p pointer rather than argument.
2002-06-30 17:05:48 +00:00
Corinna Vinschen c6d90e842c * security.cc (extract_nt_dom_user): Check for all buffer overflows.
Call LookupAccountSid after trying to get domain & user from passwd.
	(get_group_sidlist): Obtain the domain and user by calling
	extract_nt_dom_user instead of LookupAccountSid.
2002-06-30 13:08:59 +00:00
Christopher Faylor 839b294201 * uinfo.cc (cygheap_user::test_uid): Use standard issetuid test. 2002-06-29 23:45:07 +00:00
Christopher Faylor efc1575ecd * autoload.cc (NetGetDCName): Change to make this an optional load function.
* cygheap.h (cygheap_user::logsrv): Return NULL when operation fails.
(cygheap_user::winname): Ditto.
(cygheap_user::domain): Ditto.
* uinfo.cc (cygheap_user::env_logsrv): Save results in temp variable.
(cygheap_user::env_userprofile): Ditto.
2002-06-29 22:05:30 +00:00
Christopher Faylor 638180f51f * environ.cc (spenv::retrieve): Detect return of env_dontadd from cygheap_user
methods.
(build_env): Avoid incrementing environment pointer if not actually adding to
the environment.  That could result in garbage in the environment table.  Be
more defensive when reallocing envblock.
2002-06-29 17:26:13 +00:00
Christopher Faylor 38bc119696 * uinfo.cc (cygheap_user::test_uid): Return NULL or further tests are sorta
useless.
(cygheap_user::env_domain): Recalculate if name is missing.
2002-06-29 06:50:17 +00:00
Christopher Faylor 664075a3bb * environ.cc (spenv::from_cygheap): Still need to take setuid into
consideration.
2002-06-29 06:40:19 +00:00
Christopher Faylor e97962b92a * uinfo.cc (cygheap_user::env_logsrv): Return "almost_null" in case where no
domain or username is "SYSTEM".
2002-06-29 03:14:12 +00:00
Christopher Faylor 094d519311 * cygheap.h (cygheap_user): Reorg to accommodate environment caching.
(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-29 02:36:08 +00:00
Christopher Faylor bf75aae8b3 Add missing entry. 2002-06-27 20:45:54 +00:00
Christopher Faylor 179cae11d7 * cygheap.cc (cfree_and_set): New function.
(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 20:44:27 +00:00
Conrad Scott d3c260c334 Delete extraneous comment from my previous change. 2002-06-27 20:08:33 +00:00
Corinna Vinschen eba23038af * dcrt0.cc (dll_crt0_1): Let __progname point to the applications
basename.  Move eliminating ".exe" suffix from argv[0] so that it
	always also affects __progname.
2002-06-27 16:01:38 +00:00
Christopher Faylor 196cdd45f6 * thread.cc (pthread::create): Added trace printf to get CreateThread
LastError.
2002-06-27 14:19:30 +00:00
Corinna Vinschen 5b509758a0 * mmap.cc (list::match): Check using pagesize aligned size. 2002-06-27 13:01:35 +00:00
Christopher Faylor 75c6a983c6 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Force
FindFirstFile on first file of directory when asking for x:\ .
2002-06-27 03:06:44 +00:00
Christopher Faylor b3e2d035bb * cygheap.cc (cygheap_user::set_name): Correct thinko in below change. 2002-06-27 02:29:57 +00:00
Christopher Faylor c99902b9b0 * cygheap.cc (cygheap_user::set_name): Avoid clearing things when just setting
name to itself or during first time initialization.
* environ.cc (check_case_init): Make case insensitive.
2002-06-26 19:39:05 +00:00
Corinna Vinschen be5007aa52 * fhandler.h (fhandler_socket::bind): Add method definition.
(fhandler_socket::connect): Ditto.
	(fhandler_socket::listen): Ditto.
	(fhandler_socket::accept): Ditto.
	(fhandler_socket::getsockname): Ditto.
	(fhandler_socket::getpeername): Ditto.
	(fhandler_socket::recvfrom): Ditto.
	(fhandler_socket::recvmsg): Ditto.
	(fhandler_socket::sendto): Ditto.
	(fhandler_socket::sendmsg): Ditto.
	(fhandler_socket::shutdown): Ditto.
	* fhandler_socket.cc (get_inet_addr): Move here from net.cc.
	(fhandler_socket::bind): New method.
	(fhandler_socket::connect): Ditto.
	(fhandler_socket::listen): Ditto.
	(fhandler_socket::accept): Ditto.
	(fhandler_socket::getsockname): Ditto.
	(fhandler_socket::getpeername): Ditto.
	(fhandler_socket::recvfrom): Ditto.
	(fhandler_socket::recvmsg): Ditto.
	(fhandler_socket::sendto): Ditto.
	(fhandler_socket::sendmsg): Ditto.
	(fhandler_socket::shutdown): Ditto.
	* net.cc: Various formatting cleanups throughout.
	(get_inet_addr): Move to fhandler_socket.cc.
	(cygwin_bind): Move base functionality to appropriate fhandler_socket
	method.
	(cygwin_connect): Ditto.
	(cygwin_listen): Ditto.
	(cygwin_accept): Ditto.
	(cygwin_getsockname): Ditto.
	(cygwin_getpeername): Ditto.
	(cygwin_recvfrom): Ditto.
	(cygwin_recvmsg): Ditto.
	(cygwin_sendto): Ditto.
	(cygwin_sendmsg): Ditto.
	(cygwin_shutdown): Ditto.
2002-06-26 19:25:09 +00:00
Corinna Vinschen 303af15742 * pwdgrp.h (pwdgrp_read::~pwdgrp_read): Avoid compiler warning. 2002-06-26 14:59:22 +00:00
Christopher Faylor 8698edb8ae * dcrt0.cc (_dcrt0): Be more defensive when reserved block is used and it's not
cygwin info.
2002-06-26 05:37:29 +00:00
Christopher Faylor f279e522b0 * autoload (noload): Avoid clobbering bx register.
* environ.cc (codepage_init): Use case insensitive match.
* fhandler_console.cc (cp_get_internal): Delete.
(con_to_str): Use get_cp to derive code page.
(str_to_con): Ditto.
* miscfuncs.cc (get_cp): New function.
(sys_wcstombs): New function.  Converted from macro.
(sys_mbstowcs): Ditto.
* winsup.h: Reflect above changes.
2002-06-26 05:29:41 +00:00
Christopher Faylor 109e482278 * winsup.h: Minor cleanup.
* path.h (path_conv::[]): New operator.
* syscalls.cc (_link): Use path_conv operators rather than methods, where
appropriate.  Minor white space cleanup.
* include/cygwin/version.h: Bump DLL minor number.
* dcrt0.cc (sm): Make NO_COPY.
2002-06-26 04:21:01 +00:00
Conrad Scott b4b15309b7 * include/winbase.h (FILE_FLAG_FIRST_PIPE_INSTANCE): Add constant. 2002-06-25 21:16:46 +00:00
Danny Smith 8e8a913ff1 2002-06-26 Casper S. Hornstrup <chorns@users.sourceforge.net>
* include/winbase.h (WINBASEAPI): Don't define if prior
	definition.

	* include/winioctl.h (PARTITION_FAT32, PARTITION_FAT32_XINT13,
	PARTITION_XINT13, PARTITION_XINT13_EXTENDED, PARTITION_LDM,
	PARTITION_UNIX): Add defines.
	(PDRIVE_LAYOUT_INFORMATION): Add typedef.
	(IsRecognizedPartition): Also check for PARTITION_FAT32,
	PARTITION_FAT32_XINT13 and PARTITION_XINT13.
	(IsContainerPartition): Add macro.
2002-06-25 21:05:19 +00:00
Corinna Vinschen 6331b65843 * syscalls.cc (chown): Convert uid to 32 bit.
(lchown): Ditto.
	(fchown): Ditto.
2002-06-25 08:06:29 +00:00
Danny Smith e85e106d88 2002-06-25 Ken Fitlike <kenfitlike@hotmail.com>
* include/commctrl.h: (CBEIF_*): Add defines.
	(CBEN_*): Add defines and UNICODE mappings
	(WC_COMBOBOXEX[AW]): Add defines and UNICODE mappings.
	(CBEMAXSTRLEN): Add define.
	(COMBOBOXEXITEM[AW]): Add structures and typedefs.
	(NMCOMBOBOXEX[AW]): Add structures and typedefs.
	(NMCBEDRAGBEGIN[AW]): Add structure and typedefs.
	(NMCBEENDEDIT[AW]): Add structure and typedefs.
2002-06-25 03:26:21 +00:00
Christopher Faylor 0914e17db5 Update from Joshua Daniel Franklin 2002-06-25 01:16:23 +00:00
Christopher Faylor e773b7cf30 * dtable.cc (dtable::find_unused_handle): Avoid coercion. 2002-06-24 21:14:04 +00:00
Christopher Faylor 4c78be52df * dtable.cc (fhandler_base::dup2): Cleanup. Ensure that lock is turned off in
error condition.
2002-06-24 20:05:52 +00:00
Corinna Vinschen 1fd072b6e4 * uinfo.cc (internal_getlogin): Set myself->uid and myself->gid instead
of user.real_uid and user.real_gid.
	(uinfo_init): Evaluate orig_uid and real_uid from myself->uid.  Ditto
	for gid.
2002-06-24 15:40:57 +00:00
Christopher Faylor de0557f7a3 * security.cc (get_group_sidlist): Add pw argument and use pw->pw_name in call
to get_supplementary_group_sidlist.
(create_token): Add pw argument and use it in call to get_group_sidlist.
* security.h: Add pw argument in declaration of create_token.
* syscalls.cc (seteuid32): Add pw argument in call to create_token.
2002-06-24 13:01:50 +00:00
Corinna Vinschen 76093a9b7e * ntsec.sgml: Clean up text for examples of /etc/passwd and /etc/group.
Add examples with SIDs.  Warn about changing them crudely.
2002-06-24 09:30:02 +00:00
Danny Smith f8f2ad211f * include/objidl.h (struct tagPROPVARIANT): Kill obsolete
union member _VARIANT_BOOL bool.
2002-06-24 04:51:34 +00:00
Danny Smith e106f92bfc * include/winioctl.h (FILE_SPECIAL_ACCESS): Add define. 2002-06-24 02:49:47 +00:00
Danny Smith 7c00c9bd40 2002-06-24 Casper S. Hornstrup <chorns@users.sourceforge.net>
* include/winnt.h (PCCHAR, FCHAR, FSHORT, FLONG,
	PLUID_AND_ATTRIBUTES,PSECURITY_IMPERSONATION_LEVEL,
	PSID_AND_ATTRIBUTES, PTOKEN_TYPE, PTOKEN_STATISTICS):
	Add typedefs.
	(CCHAR): Correct typedef.
	(PROCESS_SET_SESSIONID, SECURITY_*,SECTION_MAP_EXECUTE):
	Add defines.


	* README.w32api: Correct spelling error.
2002-06-24 02:46:38 +00:00
Christopher Faylor 035bfbddf5 * fhandler.cc (fhandler_base::fstat): Set S_IFIFO for pipes.
* fhandler_socket.cc (fhandler_socket.cc::fstat): Set S_IFSOCK.
2002-06-24 02:23:14 +00:00
Christopher Faylor eecef29f50 * lib/_cygwin_S_IEXEC.cc: Remove obsolete file. 2002-06-24 02:08:41 +00:00
Christopher Faylor 85b995d4f1 Use cygwin_{shm,ipc}.h instead of /sys/{shm,ipc}.h throughout.
* sys/ipc.h: Remove.
* sys/shm.h: Remove.
* cygwin_ipc.h: New file.
* cygwin_shm.h: New file.
2002-06-23 22:56:58 +00:00
Christopher Faylor 6bda8defe9 * cygwin.sc: Add recent changes from ld sources.
* winsup.h: Move #ifdef EXPCGF code into "winbase.h".
* winbase.h: #ifdef EXPCGF code moved here from "winsup.h".
2002-06-23 18:55:23 +00:00
Robert Collins f6709c07db 2002-06-12 Thomas Pfaff <tpfaff@gmx.net>
* thread.h (pthread::cleanup_stack): Renamed cleanup_handlers to
	cleanup_stack.
	* thread.cc (pthread::pthread): Ditto.
	(pthread::create): Fixed mutex verification.
	(pthread::push_cleanup_handler): Renamed cleanup_handlers to
	cleanup_stack.
	Mutex calls removed, used InterlockedExchangePointer instead.
	(pthread::pop_cleanup_handler): Renamed cleanup_handlers to
	cleanup_stack.
	(pthread::pop_all_cleanup_handlers): Ditto.
	(__pthread_once): Check state first and return if already done.
	(__pthread_join): DEADLOCK test reverted to __pthread_equal
	call.
	(__pthread_detach): Unlock mutex before deletion.
2002-06-23 07:36:21 +00:00
Christopher Faylor 0278e3a33f * Makefile.in (cygrun.exe): Move -lgcc where it will do some good. 2002-06-22 02:56:56 +00:00
Christopher Faylor 0094fa046c * Makefile.in (cygrun.exe): Use -lgcc when linking. 2002-06-22 02:50:01 +00:00
Christopher Faylor cd6df12137 * what.texinfo: Fix typo. 2002-06-21 15:28:06 +00:00
Corinna Vinschen 1a7cb557b0 * syscalls.cc (stat64_to_stat32): Correctly evaluate st_rdev.
(fstat64): Set st_rdev to same value as st_dev.
	(stat_worker): Ditto.
2002-06-21 15:01:19 +00:00
Corinna Vinschen 49056987f1 * security.cc (alloc_sd): Carefully check owner_sid again after trying
SIDs from cygheap.
2002-06-21 12:57:19 +00:00
Corinna Vinschen dd0208eb34 * security.cc (alloc_sd): Remove unnecessary retrieval of owner name.
Check uid for current user first and use SIDs from cygheap if so.
	Set errno to EINVAL if user SID isn't retrievable.  Just print user SID
	as debug output.
	Don't bail out if group SID isn't retrievable.  Change debug output
	appropriately.
2002-06-21 12:37:51 +00:00
Christopher Faylor d7c2bd8ee7 * errno.cc: Change text description for EBADF throughout. 2002-06-21 05:47:09 +00:00
Christopher Faylor d70b993fe2 remove unneeded white space 2002-06-21 05:01:56 +00:00
Christopher Faylor 7c02f861e3 * uinfo.cc (cygheap_user::ontherange): Use env_name for NetUserGetInfo.
(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-21 05:01:17 +00:00
Christopher Faylor c25ebbaf55 * fhandler.cc (fhandler_base::set_flags): Change priority of "linked in"
default binmode setting so that it has priority over optional setting.
2002-06-20 00:36:40 +00:00
Christopher Faylor 03a2ce9a36 Use hMainProc where appropriate, throughout.
* environ.cc (spenv::retrieve): Add debugging statements.
* pinfo.cc (set_myself): Don't call strace.hello if already stracing.
* strace.cc (strace): Move NO_COPY keyword so that it will actually take
effect.
2002-06-19 15:27:27 +00:00
Corinna Vinschen 834224ab85 * uinfo.cc (cygheap_user::ontherange): Call NetUserGetInfo() only with
non-NULL logserver parameter.
2002-06-19 13:56:34 +00:00
Danny Smith e1164b684d 2002-06-19 Casper S. Hornstrup <chorns@users.sourceforge.net>
* include/winuser.h (FLASHW_*,INPUT_MOUSE,INPUT_KEYBOARD,
	INPUT_HARDWARE): Add defines.
	(HDEVNOTIFY): Add typedef.
	(FLASHWINFO,tagMOUSEMOVEPOINT,tagMOUSEINPUT,tagKEYBDINPUT,
	tagHARDWAREINPUT,tagINPUT,tagGUITHREADINFO): Define structs and
	typedefs.
	(CreateDesktop[AW],CreateMDIWindow[AW],GetClassInfo[AW],
	GetClassInfoEx[AW],GetKeyboardLayoutList,
	MessageBoxIndirect[AW],MsgWaitForMultipleObjects,
	MsgWaitForMultipleObjectsEx, RegisterClass[AW],
	RegisterClassEx[AW]): Correct prototypes.


Remove duplicate ChangeLog entry of 2001-12-07
2002-06-19 12:32:06 +00:00
Christopher Faylor 33bd2d1268 * cygpath.cc (usage): Clean up usage output.
(dowin): Correct output of -t mixed for -ADHPSW options.
2002-06-19 02:09:41 +00:00
Danny Smith 7c1d8db987 2002-06-19 Casper S. Hornstrup <chorns@users.sourceforge.net>
* include/ddeml.h (DdeCreateStringHandle{AW]:Correct
	prototypes.
	* include/winsvc.h (StartServiceW): Correct prototype.
	* include/winbase.h (BackupRead,BackupSeek,BackupWrite,
	FileTimeToLocalFileTime, GetAce,GetPrivateProfileStruct[AW],
	GetTickCount,InterlockedExchangeAdd,
	WritePrivateProfileStruct[AW]: Correct prototypes.
	(GetEnvironmentStrings): Correct mapping to
	GetEnvironmentStringsA.
	* include/winver.h (VerQueryValueA,VerQueryValueW):
	Correct prototypes.
	* include/wincon.h (CreateConsoleScreenBuffer): Correct
	prototype.
	* include/winreg.h (RegQueryMultipleValues[AW],
	RegQueryValueEx[AW]):Correct prototypes.
	* include/wingdi.h (PXFORM, PLOGBRUSH, PLOGPEN, PPOLYTEXTA,
	PPOLYTEXTW): Add typedefs.
	(_DESIGNVECTOR,COLOR16, _TRIVERTEX, _DISPLAY_DEVICE): Add
	structures and typedefs.
	(MM_MAX_NUMAXES): Add define.
	(EnumFontsW,GetEnhMetaFilePixelFormat,wglGetLayerPaletteEntries):
	Correct prototypes.
	* include/winerror.h (RPC_X_INVALID_PIPE_OBJECT,
	RPC_X_WRONG_PIPE_ORDER,RPC_X_WRONG_PIPE_VERSION,
	RPC_S_SEND_INCOMPLETE): Add defines.
2002-06-19 01:15:45 +00:00
Danny Smith 97858a2641 * include/tchar.h (_getts): Define as _getws for _UNICODE.
(_putts): Define as _putws for _UNICODE.
	Thanks to: Tomasz Pona  <cochisek@poczta.onet.pl>  for report.
2002-06-18 20:48:57 +00:00
Danny Smith 8cb1442e10 * include/float.h: #include_next<float.h> before header guard. 2002-06-18 04:20:14 +00:00
Danny Smith 9fe2a2157b 2002-06-18 Casper S. Hornstrup <chorns@users.sourceforge.net>
* include/_mingw.h (__MINGW_IMPORT): Check for prior definition before
	defining.
	* include/excpt.h (): Include windef.h not windows.h.
	* include/fcntl.h (_O_SHORT_LIVED): Add define.
	(_chmod): Add prototype.
        (_creat): Correct prototype.
	(SH_DENY*): Rename defines to _SH_DENY*.
	(SH_DENY*): Add Non-ANSI names for _SH_DENY*.
	include/stdio.h (_IOMYBUF, _IOEOF, _IOERR, _IOSTRG,
	_IOAPPEND): Add defines.
	(_wfindfirst): Correct prototype.
	(_wfdopen): Add prototype.
	* include/stdlib.h (_rotl, _rotr, _lrotl, _lrotr): Add
	prototypes.
	* include/string.h (_mbschr, _mbstok, _mbsncat): Remove
	 prototypes.
	(_wcsdup): Correct prototype.
	* include/mbstring.h: Remove comments about _mbschr, _mbstok,
	 _mbsncat being in string.h.
	* include/wchar.h (_wfindfirst): Correct prototype.
	* include/tchar.h (_tfdopen): Add _UNICODE mappings.
2002-06-18 04:13:18 +00:00
Danny Smith 6cde27195c 2002-06-17 Casper S. Hornstrup <chorns@users.sourceforge.net>
* include/windef.h (_fastcall, __fastcall, FASTCALL):
	Add defines.
2002-06-17 08:22:02 +00:00
Christopher Faylor 00a9e8a063 reword 2002-06-16 23:38:50 +00:00
Christopher Faylor e40670ee48 * cygheap.h (cygheap_user::issetuid): New method.
* dtable.cc (dtable::vfork_child_dup): Use new method to determine if we are in
"setuid mode."
* fork.cc (fork_parent): Ditto.
* spawn.cc (spawn_guts): Ditto.
* syscalls.cc (seteuid32): Ditto.
(setegid32): Ditto.
* environ.cc (spenv::retrieve): (Suggested by Pierre Humblet) Do potential
recalculation of cygheap_user stuff when in setuid mode.  Return special value
when environment variable exists but should not be added.
(build_env): Don't add retrieved value to dstp if it is 'dont_add'.
2002-06-16 23:34:43 +00:00
Egor Duda 45e9463a38 * include/ntdll.h: New file.
* lib/ntdll.def: Add NtShutdownSystem.
2002-06-16 13:21:43 +00:00
Danny Smith 1464d11b4b 2002-06-16 Steven Edwards <Steven_Ed4153@yahoo.com>
* lib/dinput.def (DirectInputCreateEx): Add stub.
	* lib/ntdll.def: New file.
2002-06-16 07:19:34 +00:00
Christopher Faylor a05a9e0123 Changes suggested by Pierre Humblet.
* environ.cc (NL): New macro.
(conv_envvars): Use NL macro to fill in name and namelen.
(spenv::namelen): New field.
(spenvs): Use NL to fill in name and namelen.
(spenv::retrieve): Eliminate length argument.  Instead, use namelen throughout.
(build_env): Don't calculate length of initial FOO= part of environment.
Accommodate spenv::retrive argument change.
2002-06-16 05:45:37 +00:00
Christopher Faylor 5f25e1d11a * cygheap.h (cygheap_user::winname): New field.
* 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 05:26:14 +00:00
Christopher Faylor 5c8bce24b3 * spawn.cc (spawn_guts): Revert removal of ciresrv.moreinfo->uid = ILLEGAL_UID. 2002-06-16 04:25:54 +00:00
Christopher Faylor 6ea3e429df * child_info.h (child_proc_info): Declare as base class.
(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-15 21:59:32 +00:00
Earnie Boyd 5ae611458b * include/_mingw.h: Increment to version 2.1.
* Makefile.in: Ditto.
2002-06-15 15:56:58 +00:00
Earnie Boyd 00f55bc3a9 * Makefile.in (conf_prefix): New variable.
(dist_prefix): Ditto. Conditionally set to $(conf_prefix).
	(bindist): Use dist_prefix.
2002-06-15 14:06:21 +00:00
Christopher Faylor cff111a6bf * uinfo.cc (cygheap_user::ontherange): Don't set HOMEDRIVE or HOMEPATH unless
one or the other is specified.
2002-06-15 01:17:45 +00:00
Christopher Faylor 6d171b4482 * cygheap.h (cygheap_user::userprofile_env_buf): New static member.
* environ.cc (build_env): Add debugging statement.
(spenvs): Switch functions for USERDOMAIN and USERNAME.
* spawn.cc (spawn_guts): Move environment initialization prior to
cygheap_setup_for_child or environment info will never be copied to child.
2002-06-14 21:46:19 +00:00
Christopher Faylor a77d35f7d2 * cygheap.h (cygheap_user): Add static members to hold home{drive,path} info.
* uinfo.cc (cygheap_user::ontherange): Use static class members for local HOME*
storage.
2002-06-14 20:36:42 +00:00
Christopher Faylor 9a771b2961 * cygheap.cc (cygheap_user::set_logsrv): Remove.
(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-14 18:01:21 +00:00
Corinna Vinschen 470e8c460d * environ.cc (build_env): If realloc moves envblock, move s with it. 2002-06-14 14:08:07 +00:00
Earnie Boyd ced1e577b7 * include/w32api.h: Change to version 2.0 to reflect the change
in the license.
	* README: Renamed.
	* README.w32api: Renamed from README.  Modified license to remove
	the restriction of notifying the author based on the fact that the
	author is unreachable at the notified address.
	* Makefile.in (VERSION): Change to 2.0.
2002-06-14 13:46:12 +00:00
Earnie Boyd 687da29f13 * Makefile.in (bindist): Correct the MinGW distribution. 2002-06-14 12:36:26 +00:00
Corinna Vinschen 93b0828bfc Add pthread calls 2002-06-14 11:33:30 +00:00
Corinna Vinschen 94a23f4860 * passwd.c: Rearrange includes to avoid unnecessary warnings.
(GetPW): Add parameter to (dis)allow printing of Windows username.
	Use defines instead of numerical constants where possible.
	Try avoiding impersonation problem.  Rearrange to print Windows
	username only if it's different from Cygwin username.
	(ChangePW): Use defines instead of numerical constants where possible.
	(main): Call GetPW with additional parameter.  Change error text.

	* passwd.c (GetPW): Handle case of user-edited /etc/passwd
	with cygwin_internal (CW_EXTRACT_DOMAIN_AND_USER, ...).
2002-06-14 11:31:33 +00:00
Earnie Boyd d61bc7aad8 * include/wingdi.h (GetEnhMetaFileBits): Correct typo. 2002-06-14 10:29:28 +00:00
Earnie Boyd 04229a06ac * include/wingdi.h: (GetEnhMetaFileBits): Define prototype. 2002-06-13 18:29:37 +00:00
Christopher Faylor 7bbed70832 fix typo 2002-06-13 17:28:50 +00:00
Christopher Faylor 39be53dc4c * winver.rc: Add more words to copyright. 2002-06-13 17:28:11 +00:00
Corinna Vinschen 0e6d80e4fa * cygheap.cc (cygheap_user::set_name): Revert previous change.
* environ.cc (spenv::retrieve): Check return value of call to
	cygheap->user.*from_cygheap().
2002-06-13 16:30:18 +00:00
Earnie Boyd bb1085295a * include/winuser.h (MOUSEHOOKSTRUCT): Define structure. 2002-06-13 11:35:30 +00:00
Corinna Vinschen 5682a6dd3d * cygheap.cc (cygheap_user::set_name): Remove setting homedrive and
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-13 11:35:11 +00:00
Danny Smith dc8971488e * include/_mingw.h: Increment version to 2.0.
* Makefile.in: Ditto.
	Merge in mingwex branch.
2002-06-13 10:20:48 +00:00
Christopher Faylor 5f74ae83e5 * security.cc (get_logon_server): Use strcasematch rather than strcasecmp. 2002-06-13 05:30:49 +00:00
Christopher Faylor 4863867ab9 * path.cc (chdir): Minor cleanup. 2002-06-13 03:04:50 +00:00
Christopher Faylor 12a2ef4462 * environ.cc (build_env): Correctly fill out windows environment block with
win32 paths rather than posix paths.
2002-06-13 01:28:51 +00:00
Danny Smith b89a2aac33 2002-06-13 John K. Hohm <jhohm@acm.org>
* include/comcat.h: New file.
2002-06-13 00:13:34 +00:00
Christopher Faylor 325268e1c1 Add dumper.exe words from Egor Duda. 2002-06-12 16:06:10 +00:00
Christopher Faylor da086d020c * cygheap.cc (cygheap_user::set_name): Set homedrive and homepath to NULL on
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-12 05:13:54 +00:00
Christopher Faylor 09c95bb14f fix comment 2002-06-11 23:30:48 +00:00
Christopher Faylor 077d8b23c8 * spawn.cc (spawn_guts): More hToken removal cleanup. 2002-06-11 16:06:16 +00:00
Christopher Faylor d5377829a8 * spawn.cc (spawn_guts): Define sec_attribs and call sec_user_nih() only once. 2002-06-11 02:22:02 +00:00
Christopher Faylor 380aaf2d2c * Makefile.in: Ensure that -MD gets added to CFLAGS regardless of CFLAGS
command-line setting.
* cygwin.din: Export sexec* functions as function which returns ENOSYS
(i.e., sexec* is deprecated).
* dtable.cc (dtable::vfork_child_dup): Ensure that impersonation is restored
even on failure.
* exec.cc: Throughout, remove references to sexec* and _spawnve.
* pinfo.h: Remove _spawnve declaration.
* spawn.cc: Rename _spawnve to spawnve and use throughout.
(spawn_guts): Eliminate hToken argument and processing of same.  Just perform
special actions if impersonating.
(spawnve): Rename from _spawnve.
2002-06-11 02:08:00 +00:00
Christopher Faylor 85a238e1e8 revert erroneous checkin 2002-06-10 19:59:19 +00:00
Christopher Faylor b01cbd5de2 * include/sys/strace.h (strace): Avoid use of constructor. 2002-06-10 19:58:21 +00:00
Christopher Faylor fe4283af7a * dcrt0.cc (dll_crt0_1): Initialize wincap and check for sanity before running
global ctors.
* wincap.h (wincap): Eliminate constructor.  Default is to zero memory, anyway.
* wincap.cc (wincap): Copy this on fork to avoid initialization in forked
processes.
2002-06-10 17:08:09 +00:00
Corinna Vinschen 3d78e129b7 * fhandler.h (fhandler_socket::fixup_after_fork): Revert patch from
2002-06-04.
	* fhandler_socket.cc (fhandler_socket::fixup_after_fork): Ditto.
	(fhandler_socket::dup): Ditto.
	* net.cc (fdsock): Make sockets explicitely noninheritable on NT.
2002-06-10 11:07:44 +00:00
Robert Collins 43c3c4e37c /tmp/cvs610a0a90.1 2002-06-10 02:40:13 +00:00
Christopher Faylor c2102631fc * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Correctly set
number of links for directory, if appropriate.
2002-06-10 01:25:47 +00:00
Robert Collins 007276b30e 2002-06-10 Robert Collins <rbtcollins@hotmail.com>
* cygwin.din: Add _pthread_cleanup_push and _pthread_cleanup_pop.
        * pthread.cc: Change __pthread_self to pthread::self() thruoghout.
        (_pthread_cleanup_push): New function.
        (_pthread_cleanup_pop): Ditto.
        * thread.cc: Thanks to Thomas Pfaff for the pthread cleanup_push,_pop
        patch, this work is derived from that.
        Change __pthread_self to pthread::self() thruoghout.
        (__pthread_self): Rename to pthread::self.
        (pthread::self): New method.
        (pthread::pthread): Initialize new member.
        (pthread::push_cleanup_handler): New method.
        (pthread::pop_cleanup_handler): New method.
        (pthread::pop_all_cleanup_handlers): New method.
        (__pthread_exit): Pop all cleanup handlers.
        * thread.h (pthread::push_cleanup_handler): Declare.
        (pthread::pop_cleanup_handler): Ditto.
        (pthread::pop_all_cleanup_handlers): Ditto.
        (pthread::self): New static method.
        (__pthread_exit): Give C++ linkage.
        (__pthread_join): Ditto.
        (__pthread_detach): Ditto.
        (__pthread_self): Remove.

2002-04-24  Thomas Pfaff  <tpfaff@gmx.net>

        * include/pthread.h (__pthread_cleanup_handler): New structure
        (pthread_cleanup_push): Rewritten .
        (pthread_cleanup_pop): Ditto.
        (_pthread_cleanup_push): New prototype.
        (_pthread_cleanup_pop) Ditto.

2002-04-24  Thomas Pfaff  <tpfaff@gmx.net>

        * thread.cc (thread_init_wrapper): Check if thread is already joined.
        (__pthread_join): Set joiner first.
        (__pthread_detach): Ditto.
2002-06-10 01:10:45 +00:00
Robert Collins fec98ec993 2002-06-10 Robert Collins <rbtcollins@hotmail.com>
* cygserver_transport.cc (create_server_transport): Finish the split
        out of sockets code from transport_layer_base. Thanks to Nicholas
        Wourms and Conrad Scott for catching this.
2002-06-09 23:02:00 +00:00
Christopher Faylor 548e0dad4b * path.cc (cygpath): Change MOUNT_AUTO to MOUNT_CYGDRIVE.
(getmntent): Ditto.
2002-06-09 05:08:44 +00:00
Danny Smith 3c1736432d 2002-06-09 Gunnar Degnbol <gdegnbol@users.sourceforge.net>
* include/richedit.h (EM_*, TM_*, GT_*): Add new defines.
	(GETTEXTEX): Add structure definition.
2002-06-09 05:02:01 +00:00
Christopher Faylor 94cc482c64 * mount.cc (main): Use default system/user flag for cygdrive stuff, too.
(change_cygdrive_prefix): Change MOUNT_AUTO to MOUNT_CYGDRIVE.
* umount.cc (remove_cygdrive_prefix): Ditto.
(main): Use default system/user flag for cygdrive stuff, too.
2002-06-09 04:54:32 +00:00
Christopher Faylor 7ac66bdda0 * pinfo.cc (pinfo_dummy): Initialize to correct size. 2002-06-09 03:54:07 +00:00
Danny Smith 63f4c63a19 * include/windows.h (ole2.h): #include if !__OBJC__ and
__GNUC__ >=3 and !WIN32_LEAN_AND_MEAN.
2002-06-09 03:37:20 +00:00
Christopher Faylor a004a5b8fb * path.cc: Change MOUNT_AUTO to MOUNT_CYGDRIVE throughout.
* shared_info.h (CURR_MOUNT_MAGIC): Update.
2002-06-09 00:48:38 +00:00
Christopher Faylor 60a3d46123 * mount.cc (opts): Remove '-i' option.
(usage): Ditto.
(main): Ditto.
(longopts): Remove --import-old-mounts option.
2002-06-09 00:33:27 +00:00
Christopher Faylor 50484e8e36 * external.cc (cygwin_internal): Make v1 mount table access invalid.
* path.cc (mount_info::init): Remove had_to_create_mount_areas initialization.
(mount_info::from_registry): Remove v1 table import.
(mount_info::read_v1_mounts): Eliminate.
(mount_info::import_v1_mounts): Ditto.
* shared_info.h (mount_info): Ditto for both of above.
* sys/mount.h (MOUNT_DEVFS): New enum.
(MOUNT_PROC): Ditto.
2002-06-09 00:31:03 +00:00
Christopher Faylor 2e2dcba320 * include/wchar.h: Define __need_size_t. 2002-06-08 16:55:47 +00:00
Christopher Faylor f61563846d coerce 2002-06-08 01:35:54 +00:00
Christopher Faylor 9cde3cf3b5 * fhandler_socket.cc (fhandler_socket::fstat): Don't assume that socket is
unix-domain socket.
* times.cc (hires_ms::prime): Set init flag.
* times.cc (hires_ms::prime): Adjust epoch of initime_us from 1601 to 1970.
2002-06-08 01:24:58 +00:00
Christopher Faylor 2bd6505b39 * cygpath.cc: Add option to output windows paths in different formats: "dos"
and "mixed".
(main): Process options.
(doit): Check new options flags.
2002-06-07 19:25:26 +00:00
Corinna Vinschen 381fb8baa1 * regtool.cc (Fail): Be more verbose.
(find_key): Add support for remote registry access.
	(usage): Document it.
	* utils.sgml: Document it.
2002-06-07 11:12:16 +00:00
Christopher Faylor 9d0efbb3ae * autoload.cc (timeGetDevCaps): Define new autoload function.
(timeGetTime): Ditto.
(timeBeginPeriod): Ditto.
(timeEndPeriod): Ditto.
* hires.h (hires_base): New class.  Renamed from hires.
(hires_us): New class.
(hires_ms): New class.
* strace.cc (strace::microseconds): Use hires_us class.
* times.cc (gettimeofday): Use hires-ms class.
(hires_us::prime): Renamed from hires::prime.
(hires_us::usecs): Renamed from hires:usecs.
(hires_ms::prime): New method.
(hires_ms::usecs): New method.
(hires_ms::~hires_ms): New destructor.
2002-06-07 03:44:33 +00:00
Christopher Faylor b841df7954 * strace.cc (main): Make toggle a local variable. 2002-06-07 01:37:20 +00:00
Christopher Faylor 80082f1ec4 * strace.cc (toggle): New global variable.
(error): Use exit instead of ExitProcess so that stdio buffers get flushed.
(create_child): Remove command line error checking.
(dostrace): Ditto.
(dotoggle): New function.
(usage): Add entry for new option -T|--toggle.  Alphabetize.
(longopts): Add new option -T|--toggle.
(opts): Ditto.
(main): Handle new -T|--toggle option.  Move all command line checking here
from other functions.
* utils.sgml: Update section for strace.
2002-06-07 01:36:17 +00:00
Danny Smith a579a11b57 2002-06-07 Gunnar Degnbol <gdegnbol@users.sourceforge.net>
* include/mapi.h: Change LPTSTR to LPSTR throughout.
2002-06-07 00:30:17 +00:00
Christopher Faylor 46b941fcf9 * autoload.cc (noload): Correctly save argument count register. 2002-06-06 23:53:45 +00:00
Corinna Vinschen c4e6ff484c * fhandler.cc (fhandler_base::fstat): Initialise tv_nsec member of
st_atim, st_mtim, and st_ctim fields.
	* fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Ditto.
	* fhandler_process.cc (fhandler_process::fstat): Ditto.
	* glob.c (stat32_to_STAT): Copy across the whole st_atim,
	st_mtime, and st_ctim fields.
	* syscalls.cc (stat64_to_stat32): Ditto.
	* times.cc (to_timestruc_t): New function.
	(time_as_timestruc_t): New function.
	* winsup.h: Add to_timestruc_t and time_as_timestruc_t functions.
	* include/cygwin/stat.h: Replace time_t with timestruc_t
	throughout for all file times, removing the st_spare1, st_spare2,
	and st_spare3 fields in the process. Add macros to access tv_sec
	fields by old names.
	* include/cygwin/types.h: Typedef timespec_t and timestruc_t as
	struct timespec.
2002-06-06 15:35:09 +00:00
Corinna Vinschen 2e8abfc1c5 * sec_helper.cc (lookup_name): Suppress.
* security.cc (alloc_sd): Remove logsrv argument.
	Remove two calls to lookup_name.
	(set_security_attribute): Remove logsrv argument.
	Remove logsrv argument in call to alloc_sd.
	(set_nt_attribute): Remove logsrv argument.
	Remove logsrv argument in call to set_security_attribute.
	(set_file_attribute): Remove logsrv argument.
	Remove logsrv argument in call to set_nt_attribute.
	(set_file_attribute): Remove logsrv argument.
	Remove logsrv argument in call to set_file_attribute.
	* syscalls.cc (chown_worker): Remove logserver argument in
	call to set_file_attribute.
	(chmod): Ditto.
	* shm.cc (shmget): Remove logsrv argument in call to alloc_sd.
	* uinfo.cc (internal_getlogin): Replace calls to
	lookup_name by call to LookupAccountName.
	* security.h: Remove logsrv in declarations of set_file_attribute
	and alloc_sd. Remove declaration of lookup_name.
2002-06-06 11:17:51 +00:00
Corinna Vinschen ae1ebb81dc Fix ChangeLog entry. 2002-06-06 08:37:24 +00:00
Christopher Faylor ba692ae9c0 * strace.cc (version): New global variable.
(usage): Accomodate stdout output.
(print_version): New function.
2002-06-06 02:55:10 +00:00
Christopher Faylor f7a7cc9067 * child_info.h (CHILD_INFO_MAGIC): Oops. Revert previous change. gcc 3.1 bug? 2002-06-06 01:49:56 +00:00
Christopher Faylor 784e340c03 * child_info.h (CHILD_INFO_MAGIC): Update. 2002-06-06 01:31:16 +00:00
Christopher Faylor 58fcd93ae3 * strace.cc (strace::hello): Set inited, when appropriate. 2002-06-06 01:26:33 +00:00
Christopher Faylor c240a7fcde * ssp.c (version): New global variable.
(longopts): Ditto.
(opts): Ditto.
(run_program): Correct cmd_line typos to cmdline.
(usage): New function.  Standardize usage output.  Add ssp.txt to --help
output.
(print_version): New function.
(main): Accommodate getopt.
2002-06-06 00:36:12 +00:00
Christopher Faylor ee964e2f97 * cygwin.din: Eliminate some newlib wrappers.
* path.cc (get_devn): Only consider first 99 potential com devices.
(get_device_number): Ditto.
* times.cc (_times): Eliminate.
(_times): Renamed from times().
2002-06-06 00:09:55 +00:00
Christopher Faylor ea4e6ec8f9 * dir.cc (rmdir): Streamline. Detect attempts to remove directories from
"read-only" virtual devices.  (Suggested by Pavel Tsekov)
* syscalls.cc (unlink): Detect attempts to remove directories from "read-only"
virtual devices.  (From Pavel Tsekov)
2002-06-05 16:01:55 +00:00
Christopher Faylor 2bb6b3e506 * dtable.cc (handle_to_fn): Check error return value from NtQueryObject first
before seeing if name buffer is NULL.
* grp.cc (read_etc_group): Fix gcc warning regarding snprintf format.
* passwd.cc (read_etc_passwd): Ditto.
2002-06-05 15:43:49 +00:00
Robert Collins e9259cb240 /tmp/cvs610a0efc.1 2002-06-05 12:39:55 +00:00
Corinna Vinschen eceee297d5 * grp.cc (read_etc_group): When emulating nonexisting group file on
NT systems, read primary group SID from process token.  Use that info
	to create correct group entry.  On error or on 9x systems fallback
	to emulating Administrators group as before.
	(read_etc_passwd): When emulating nonexisting passwd file on NT systems,
	read user and primary group SID from process token.  Use that info to
	create correct passwd entry.  On error or on 9x systems fallback to
	emulating user with Administrator user id and Administrators group
	as before.
2002-06-05 11:56:56 +00:00
Corinna Vinschen 38f3936889 * grp.cc (etc_group): Removed.
(parse_grp): Make line parameter nonconst.  Don't copy data into new
	allocated memory.  Check for CR instead of LF to accomodate new
	read method.
	(add_grp_line): Make line parameter nonconst.
	(read_etc_group): Rearrange using new pwdgrp_read class.
	* passwd.cc (parse_pwd): Don't copy data into new allocated memory.
	Check for CR instead of LF to accomodate new read method.
	(read_etc_passwd): Rearrange using new pwdgrp_read class.
	* pwdgrp.h (pwdgrp_check::set_last_modified):  Use different
	parameters.
	(class pwdgrp_read): New class for opening and reading passwd and
	group files.
2002-06-05 11:10:15 +00:00
Christopher Faylor ce006ffa7f * dtable.cc (handle_to_fn): Attempt to handle "raw" accesses to remote shares.
* 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-06-05 04:01:43 +00:00
Christopher Faylor 147d2ab494 * dtable.cc (handle_to_fn): Correct placement and length of name buffer.
(Suggested by Pavel Tsekov)
2002-06-05 02:42:15 +00:00
Christopher Faylor e35f391fa5 Remove fcntl.h includes throughout.
* fhandler.h: Move fcntl.h include here.
(fhandler_base::set_flags): Accept supplied_bin argument.  Make non-inlined.
* dtable.cc (dtable::init_std_file_from_handle): Just use binmode from pc.
(reset_to_open_binmode): Use set_flags.
* cygwin.din (open): Avoid newlib wrapper.
(read): Ditto.
(unlink): Ditto.
(write): Ditto.
* fhandler.cc (fhandler_base::set_flags): Accept supplied_bin argument.  Make
binmode decisions here.
(fhandler_base::open): Avoid using pc if it is NULL.  Eliminate binmode logic.
Just call set_flags with binmode argument.
(fhandler_base::init): Call set_flags with binmode argument.
* fhandler_clipboard.cc (fhandler_dev_clipboard::open): Ditto.
* fhandler_console.cc (fhandler_console::open): Ditto.
(fhandler_console::init): Force binary on open.
* fhandler_disk_file.cc (fhandler_disk_file::open): Don't set binmode here.
Let it happen in base class.
* fhandler_dsp.cc (fhandler_dev_dsp::open): Force binmode open.  Set return
value appropriately if unable to open.
* fhandler_proc.cc (fhandler_proc::open): Make sure flags are set before
open_status.
* fhandler_process.cc (fhandler_process::open): Ditto.
* fhandler_registry.cc (fhandler_registry::open): Ditto.
* fhandler_random.cc (fhandler_dev_random::fhandler_dev_random): Ditto.
* fhandler_raw.cc (fhandler_dev_raw::open): Force O_BINARY by default.
* fhandler_serial.cc (fhandler_serial::init): Ditto.
* fhandler_tty.cc (fhandler_tty_slave::open): Ditto.
(fhandler_pty_master::open): Ditto.
* fhandler_virtual.cc (fhandler_virtual::open): Ditto.
* fhandler_windows.cc (fhandler_windows::open): Ditto.
* fhandler_zero.cc (fhandler_dev_zero::open): Ditto.
* net.cc (fdsock): Ditto.
* path.cc (path_conv::check): Avoid checking for extension when error or
directory.
(set_flags): Set PATH_TEXT explicitly, when appropriate.
(mount_info::conv_to_win32_path): Use set_flags() to set path flags.
* path.h (PATH_TEXT): New enum.
(path_conv::binmode): Return appropriate constant based on binmode.
* pipe.cc (make_pipe): Set binmode to O_TEXT xor O_BINARY.
* syscalls.cc (setmode_helper): Make debugging message a little clearer.
(setmode): Set binmode via set_flags.
2002-06-05 01:42:28 +00:00
Danny Smith 915d66ce9e * include/winnt.h (PACE_HEADER, PACCESS_ALLOWED_ACE,
PACCESS_DENIED_ACE): Add typedefs.
2002-06-04 22:41:50 +00:00
Corinna Vinschen 4e1388472d * fhandler.h (class fhandler_socket): Add private method
fixup_after_fork (bool, HANDLE).
	* fhandler_socket.cc (fhandler_socket::fixup_after_fork): Move
	functionality to new private method.  Add closing parent socket
	if not called from dup().  Create method new calling private method
	with appropriate parameter.
	(fhandler_socket::fixup_after_exec): Call private method
	fixup_after_fork with appropriate parameter.
	(fhandler_socket::dup): Ditto.
2002-06-04 16:38:13 +00:00
Corinna Vinschen 6bfca3cca5 * fhandler_dsp.cc (fhandler_dev_dsp::open): Set errno to EACCES if
requested mode isn't supported.
2002-06-04 11:18:46 +00:00
Christopher Faylor e02f1e9c81 * fhandler.cc (fhandler_base::open): Don't set binmode if already set. Don't
check for file.  Files should already be set.  Report on binary mode for
debugging.
(fhandler_base::fhandler_base): Don't set default binmode here.  That's for
later.
* fhandler_console.cc (fhandler_console::output_tcsetattr): Don't set binmode,
ever, for console.
* fhandler_disk_file.cc (fhandler_disk_file::open): Always set the binary mode
to the value derived from mount table.
* path.cc (mount_info::conv_to_win32_path): Default to binmode if path does not
translate into anything in the mount table.
2002-06-04 01:40:53 +00:00
Christopher Faylor e6cd2312d6 * umount.cc (version): New global variable.
(longopts): Accommodate new --version option.
(opts): Ditto.
(usage): Standardize usage output.
(print_version): New function.
(main): Accommodate --help, --version options.
2002-06-04 01:31:28 +00:00
Corinna Vinschen 31b98a623c * external.cc (cygwin_internal): Add CW_EXTRACT_DOMAIN_AND_USER
handling to call extract_nt_dom_user() from applications.
	* include/sys/cygwin.h (cygwin_getinfo_types): Add
	CW_EXTRACT_DOMAIN_AND_USER.
2002-06-03 17:56:10 +00:00
Corinna Vinschen b3c2973142 * syscalls.cc (stat64_to_stat32): Transform st_dev correctly.
(fstat64): Add evaluating st_ino and st_dev.
	(stat_worker): Evaluate st_dev as 32 bit value.
	* include/cygwin/stat.h: Use new dev_t definition throughout.
	* include/cygwin/types.h: Define __dev16_t and __dev32_t.  Define
	dev_t according to __CYGWIN_USE_BIG_TYPES__ setting.
	* include/sys/sysmacros.h: Define major, minor and makedev
	according to __CYGWIN_USE_BIG_TYPES__ setting.
2002-06-03 17:44:09 +00:00
Corinna Vinschen 656c31920b * syscalls.cc (setegid32): Verify the correctness of the gid
of the group returned by getgrgid32.
2002-06-03 17:11:14 +00:00
Corinna Vinschen 1eb934b7c5 * security.cc (lsa2wchar): Suppressed.
(get_lsa_srv_inf): Suppressed.
	(get_logon_server_and_user_domain): Suppressed.
	(get_logon_server): Essentially new.
	(get_user_groups): Add "domain" argument. Only lookup the
	designated server and use "domain" in LookupAccountName.
	(is_group_member): Simplify the arguments.
	(get_user_local_groups): Simplify the arguments. Do only a
	local lookup. Use "BUILTIN" and local domain in LookupAccountName.
	(get_user_primary_group). Only lookup the designated server.
	(get_group_sidlist): Remove logonserver argument. Do not lookup
	any server for the SYSTEM account.
	(create_token): Delete logonserver and call to get_logon_server.
	Adjust arguments of get_group_sidlist, see above.
	* security.h: Delete declaration of get_logon_server_and_user_domain
	and add declaration of get_logon_server.
	* uinfo.cc (internal_get_login): Call get_logon_server instead of
	get_logon_server_and_user_domain.
2002-06-03 17:04:03 +00:00
Christopher Faylor 9bd0241009 * regtool.cc (prog_name): New global variable.
(longopts): Ditto.
(opts): Ditto.
(usage): Standardize usage output.  Rearrange/add descriptions.
(print_version): New function.
(main): Accomodate longopts and new --help, --version options.  Add check for
(_argv[optind+1] == NULL).
2002-06-03 02:57:55 +00:00
Danny Smith 56c0639f59 * lib/thunk32.def (LIBRARY): Change to KERNEL32.dll.
* lib/kernel32.def (ConvertToGlobalHandle): Add stub.
2002-06-02 22:54:40 +00:00
Christopher Faylor 37be5a67c9 * dtable.cc (handle_to_fn): Use largest match for device. Correctly
(?) deal with remote drive weirdness.
2002-06-02 17:48:05 +00:00
Christopher Faylor f69af9b3d2 * strace.cc (forkdebug): Make true by default.
(attach_process): Use window pid if cygwin pid isn't available (yet).
(create_child): Use either DEBUG_ONLY_THIS_PROCESS or DEBUG_PROCESS,
exclusively.  (Suggested by Conrad.Scott@dsl.pipex.com)
2002-06-02 17:46:38 +00:00
Christopher Faylor 97478fe6b4 * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Check specifically
for non-existent file, first.
(fhandler_disk_file::fstat): Perform fd open on files with funny characters.
2002-06-02 16:53:29 +00:00
Christopher Faylor 47413f8473 * fhandler_process.cc (fhandler_process::open): Set fileid. 2002-06-02 16:42:02 +00:00
Christopher Faylor afc15fdf49 * how-programming.texinfo: Add more words to the "how to build". 2002-06-02 06:18:53 +00:00
Christopher Faylor 6b7cd251c7 Remove unneeded sigproc.h includes throughout.
* fhandler.h (fhandler_proc::fill_filebuf): Take a pinfo argument.
* fhandler_proc.cc (fhandler_proc::get_proc_fhandler): Simplify search for
given pid.
(fhandler_proc::readdir): Assume that pid exists if it shows up in the winpid
list.
* fhandler_process.cc (fhandler_process::open): Simplify search for given pid.
Call fill_filebuf with pinfo argument.
(fhandler_process::fill_filebuf): Pass pinfo here and assume that it exists.
* pinfo.h (pinfo::remember): Define differently if sigproc.h is not included.
* dll_init.cc (dll_list::detach): Don't run destructor on exit.
2002-06-02 06:07:01 +00:00
Christopher Faylor a673eba664 * configure.in: Complain about lack of w32api directory.
* configure: Regenerate.
2002-06-02 05:54:33 +00:00
Christopher Faylor e065a187ab * fhandler.cc (fhandler_base::fstat): Move dev and ino calculation into caller.
* syscalls.cc (stat_worker): Calculate dev and ino calculation here, if zero.
* fhandler_proc.cc (fhandler_proc::fhandler_proc): Minor reorg for debugging.
* fhandler_process.cc (fhandler_process::exists): Return 0 on nonexistence.
(fhandler_process::fstat): Simplify pid logic.
* fhandler_tape.cc (fhandler_dev_tape::fstat): Minor reformatting.
2002-06-02 03:13:22 +00:00
Danny Smith 2843ca56e7 * include/windef.h: Fix typo in last change. 2002-06-01 21:09:29 +00:00
Danny Smith 748bc82966 * include/windef.h: Add no-op __try, __except, __finally
defines from ...
	* include/excpt.h: Remove file.
	* include/windows.h: Don't include excpt.h.
2002-06-01 20:38:33 +00:00
Christopher Faylor 60abf1c4b8 * path.cc (chdir): Don't allow cd'ing to a non-directory virtual path. 2002-06-01 18:20:51 +00:00
Christopher Faylor 28af03faed * fhandler_disk_file.cc (readdir): Move inode calculation into caller.
(fhandler_cygdrive::readdir): Add "." and "..".
* dir.cc (readdir): Move inode calculation here so that fhandler readdirs can
benefit.
2002-06-01 02:45:38 +00:00
Christopher Faylor 548e208b82 remove accidentally checked in test version. 2002-06-01 02:31:53 +00:00
Christopher Faylor dd892d50a2 oops 2002-05-31 23:00:18 +00:00
Christopher Faylor 30478f15d4 (add the rest of the ChangeLog)
* dtable.cc (dtable::init_std_file_from_handle): Default to using binmode
derived from path_conv, when required.
* fhandler.h (fhandler_base::get_w_binary): Default to binmode if nothing else
is specified.
* fhandler.h (fhandler_base::get_r_binary): Ditto.
* fhandler_disk_file.cc (fhandler_disk_file::fstat_by_handle): Work around g++
warning.
* path.cc (path_conv::check): Remove a debugging statement.
2002-05-31 22:59:57 +00:00
Christopher Faylor 8e74c3207f * fhandler_console.cc (fhandler_console::open): Reinstate setting of flags. 2002-05-31 22:53:25 +00:00
Christopher Faylor de86e35bc4 * fhandler_console.cc (fhandler_console::open): Always default to binmode.
(fhandler_console::write_normal): Don't honor binmode setting.  There is
already a termios setting for this.
(fhandler_console::init): Correct argument order in init call.
2002-05-31 22:35:57 +00:00
Christopher Faylor 8461f41ec0 * fhandler.cc (fhandler_base::open): Make default open mode == binmode.
(fhandler_base::init): Set open flags based on derived binmode argument.
2002-05-31 20:48:14 +00:00
Christopher Faylor bcd0ed9f6a * dll_init.cc (dll_list::init): Eliminate unneeded debugging statement. 2002-05-31 20:34:40 +00:00
Christopher Faylor 18c04cc4b2 * fhandler_proc.cc (fhandler_proc::readdir): Set errno when no more files.
* fhandler_process.cc (fhandler_process::readdir): Ditto.
* fhandler_registry.cc (fhandler_registry::readdir): Ditto.
2002-05-31 20:30:36 +00:00
Christopher Faylor 69be001cea * path.cc (path_conv::check): Set fileattr to INVALID_FILE_ATTRIBUTES for
nonexistent virtual device path.
(chdir): Set correct errno when attempt is made to cd to nonexistent virtual
device path.
2002-05-31 03:11:21 +00:00
Christopher Faylor 5d8c7a56c2 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Always call fstat_by_name
if fd is not opened to allow fstat_by_name to properly set errno.
* fhandler.cc (binmode): Default to binmode when mode is not known.
2002-05-31 00:15:22 +00:00
Christopher Faylor dfe569334a * mkpasswd.cc (main): Don't reset to binmode if stdout is a terminal. 2002-05-30 19:35:51 +00:00
Corinna Vinschen 5fe3a988af * include/ntdef.h (ANSI_STRING, PANSI_STRING, OEM_STRING, POEM_STRING):
Add missing typedefs.
2002-05-30 08:20:52 +00:00
Corinna Vinschen d74eced5d5 * autoload.cc: Replace autoload statments for ZwXXX by NtXXX.
Drop ZwQuerySystemInformation since NtQuerySystemInformation was
	already available.
	* fhandler_proc.cc (format_proc_uptime): Replace call to
	ZwQuerySystemInformation by call to NtQuerySystemInformation.
	(format_proc_stat): Ditto.
	* fhandler_process.cc (format_process_stat): Replace call to
	ZwQueryInformationProcess by call to NtQueryInformationProcess.
	(get_process_state): Ditto.
	(get_mem_values): Ditto.  Replace call to ZwQueryVirtualMemory by
	call to NtQueryVirtualMemory.
	* ntdll.h: Cleanup.  Drop ZwQuerySystemInformation since
	NtQuerySystemInformation was already available.  Replace declarations
	of ZwXXX functions by declarations of NtXXX.
	* pinfo.cc (winpids::enumNT): Replace call to ZwQuerySystemInformation
	by call to NtQuerySystemInformation.
2002-05-30 07:45:30 +00:00
Christopher Faylor b050246c00 * mount.cc (main): Make -b the default. 2002-05-30 03:42:19 +00:00
Christopher Faylor d4000bc4c6 speling fxi 2002-05-30 03:14:04 +00:00
Christopher Faylor 186637a508 * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION): Reinstate.
* external.cc (fillout_pinfo): Use it.
2002-05-29 21:00:55 +00:00
Corinna Vinschen 50674f2dc3 * ps.cc (main): Use uid or uid32 member of struct external_pinfo
dependent of the value of the struct's version member.
2002-05-29 20:10:27 +00:00
Corinna Vinschen 3a571063b3 * external.cc (fillout_pinfo): Use new version define.
* include/sys/cygwin.h (external_pinfo): Define
	EXTERNAL_PINFO_VERSION_16_BIT and EXTERNAL_PINFO_VERSION_32_BIT
	instead of just EXTERNAL_PINFO_VERSION.
2002-05-29 20:07:54 +00:00
Christopher Faylor 9fef0139c2 * external.cc (fillout_pinfo): Set new version field in external_pinfo
structure.
* include/sys/cygwin.h (external_pinfo): Replace strace_file with version
field.
2002-05-29 17:12:07 +00:00
Corinna Vinschen 642745443f * ps.cc (main): Change print format for uid to unsigned. Use uid32
member of struct external_pinfo instead of uid.
2002-05-29 15:07:14 +00:00
Corinna Vinschen a8d7ae61e7 Change internal uid datatype from __uid16_t to __uid32_t
throughout.
	* cygwin.din: Export new symbols getpwuid32, getpwuid_r32, getuid32,
	geteuid32, setuid32, seteuid32.
	* passwd.cc (getpwuid32): New function.
	(getpwuid_r32): Ditto.
	* syscalls.cc (seteuid32): Ditto.
	(setuid32): Ditto.
	* uinfo.cc (getuid32): Ditto.
	(geteuid32): Ditto.
	* winsup.h (uid16touid32): New macro, correclt casting from __uid16_t
	to __uid32_t.
	(gid16togid32): Ditto fir gids.
	(getuid32): Declare.
	(geteuid32): Ditto.
	(getpwuid32): Ditto.
	* include/sys/cygwin.h (struct external_pinfo): Add members uid32 and
	gid32.
2002-05-29 15:04:29 +00:00
Corinna Vinschen 9854c44c43 * include/cygwin/socket.h: Protect some symbols against multiple
definition.
	* include/netinet/ip.h: Ditto.
	* include/netinet/tcp.h: Ditto.

	* include/netinet/ip.h: Replace by BSD derived version of the file.
	* include/netinet/tcp.h: Ditto.
	* include/netinet/udp.h: New file.
	* include/cygwin/ip.h: Remove.
2002-05-29 07:38:54 +00:00
Corinna Vinschen f59faec485 * passwd.c (prog_name): New global variable.
(longopts): Ditto.
	(opts): Ditto.
	(usage): Standardize output. Accomodate new options.
	(print_version): New function.
	(main): Accomodate longopts and new --help, --version options.
2002-05-29 07:13:09 +00:00
Christopher Faylor cef6955910 * dtable.cc (dtable::init_std_file_from_handle): Attempt stronger detection of
invalid handle.
(handle_to_fn): Detect pathological condition where NT resets the buffer
pointer to NULL on an invalid handle.
2002-05-29 05:15:43 +00:00
Christopher Faylor 654783b62f clarify changelog 2002-05-29 03:42:12 +00:00
Christopher Faylor a761ad8200 * fhandler_disk_file.cc (fhandler_disk_file::fstat_helper): Properly check for
whether we should be opening the file to search for #! characters.  Set
path_conv structure execability, too, if found.
2002-05-29 03:06:37 +00:00
Corinna Vinschen 6c5e0401d4 * ps.cc (usage): Fix typo. 2002-05-28 14:59:36 +00:00
Corinna Vinschen 7ea70e9970 * security.cc (set_security_attribute): Call getegid32() instead of
getegid().
	* include/cygwin/grp.h: Declare getegid32().
2002-05-28 14:58:13 +00:00
Corinna Vinschen 5719640581 Change internal gid datatype from __gid16_t to __gid32_t
throughout.
	* cygwin.din: Export new symbols chown32, fchown32, getegid32,
	getgid32, getgrgid32, getgrnam32, getgroups32, initgroups32, lchown32,
	setgid32, setegid32, getgrent32.
	* grp.cc (grp32togrp16): New static function.
	(getgrgid32): New function.
	(getgrnam32): Ditto.
	(getgrent32): Ditto.
	(getgroups32): Change name of internal function from getgroups.
	(getgroups32): New function.
	(initgroups32): Ditto.
	* syscalls.cc (chown32): Ditto.
	(lchown32): Ditto.
	(fchown32): Ditto.
	(setegid32): Ditto.
	(setgid32): Ditto.
	* uinfo.cc (getgid32): Ditto.
	(getegid32): Ditto.
	* include/cygwin/grp.h: Remove declaration of getgrgid() and getgrnam().
	Declare getgrgid32() and getgrnam32() instead.  Declare getgid32().
2002-05-28 14:10:55 +00:00
Earnie Boyd d4cf003fa0 * include/w32api.h: Increment version to 1.5
* Makefile.in: Ditto.
2002-05-28 13:24:26 +00:00
Earnie Boyd 0c6190694d Merging MinGW changes 2002-05-28 13:20:28 +00:00
Earnie Boyd 4ad1e6fedb Merging MinGW changes 2002-05-28 13:13:45 +00:00
Christopher Faylor ad39fa8cb0 * ps.cc (prog_name): New global variable.
(longopts): Ditto.
(opts): Ditto.
(usage): New function.
(print_version): New function.
(main): Accomodate longopts and new --help, --version options.
2002-05-28 03:38:36 +00:00
Christopher Faylor 0c12979b72 * autoload.cc (noload): Properly mask low order word for determining number of
bytes to pop.
2002-05-28 02:09:15 +00:00
Christopher Faylor 57e2ae682c * fhandler_disk_file.cc (fhandler_disk_file::fstat): Minor logic cleanup. 2002-05-28 02:00:55 +00:00
Christopher Faylor 2402700d07 * autoload.cc (LoadFuncEx): Define via new LoadFuncEx2 macro.
(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-28 01:55:40 +00:00
Corinna Vinschen 74b2f73ea4 * security.cc (lsa2str): New function.
(get_priv_list): Call lsa2str instead of sys_wcstombs.
2002-05-27 11:58:49 +00:00
Corinna Vinschen 75bf293153 * syscalls.cc (seteuid): Do not take allow_ntsec into account.
Attempt to use an existing or new token even when the uid
	matches orig_uid, but the gid is not in the process token.
	Major reorganization after several incremental changes.
	(setegid): Do not take allow_ntsec into account. Minor
	reorganization after several incremental changes.
2002-05-27 11:48:15 +00:00
Danny Smith 31be924314 2002-05-27 Ren� M�ller Fonseca <fonseca@users.sourceforge.net>
* include/winreg.h: (RegConnectRegistry[AW]): Replace
	LP[W]STR with LPC[W]STR.
	(REG_QWORD, REG_QWORD_LITTLE_ENDIAN): Add defines.
	Clean up whitespace.
2002-05-27 09:44:17 +00:00
Danny Smith a440dc9527 2002-05-27 Rick Rankin <rick_rankin@yahoo.com>
* include/winnls.h: Add #define for LOCALE_RETURN_NUMBER.
2002-05-27 08:49:26 +00:00
Christopher Faylor 918a268c80 * debug.h (being_debugged): New macro.
* dtable.cc (dtable::extend): Use new macro.
* exceptions.cc (try_to_debug): Ditto.
* strace.cc (strace::hello): Only output debugging info when we think we're
being debugged.
2002-05-27 02:25:28 +00:00
Christopher Faylor 0cfbfc249f * winsup.h: Remove duplicate declarations of malloc_lock and malloc_unlock. 2002-05-27 02:09:19 +00:00
Christopher Faylor 149965f73c update comment 2002-05-27 02:06:16 +00:00
Christopher Faylor d73f9745f1 * strace.cc (attach_process): Don't tell process to start stracing here.
(proc_child): Do it here, instead, after first debug event.  This should work
around inexplicable races with DebugActiveProcess.
(dostrace): Pass any pid argument to proc_child.
2002-05-27 01:49:08 +00:00
Christopher Faylor d7b4a30001 Remove unneeded sync.h, where appropriate, throughout. Remove unneeded heap.h,
where appropriate, throughout.  Remove unneeded exceptions.h, where
appropriate, throughout.  Remove unneeded perprocess.h, where appropriate,
throughout.
2002-05-25 02:22:50 +00:00
Christopher Faylor 8b3e5e2d6e Fix typos. 2002-05-24 21:11:43 +00:00
Corinna Vinschen 908f9b653b * security.cc (create_token): Call __sec_user() instead of
sec_user() to remove dependence on allow_ntsec. Verify that
	the returned sd is non-null.
2002-05-24 14:44:05 +00:00
Corinna Vinschen f1b53fa94c * setfacl.c (usage): Standardize usage output. Change return type to
static void.
        (print_version): New function.
        (longopts): Added longopts for all options.
        (main): Accommodate changes in usage function and new version option.
2002-05-24 14:40:14 +00:00
Robert Collins a6247be998 2002-05-25 Robert Collins <rbtcollins@hotmail.com>
* gmon.c (fake_sbrk): Correctly return -1 on failed malloc's.
2002-05-24 14:24:33 +00:00
Christopher Faylor ff93854697 * dtable.cc (dtable::build_fhandler_from_name): Just pass posix path along to
set_name via return_and_clear_normalized_path.
(dtable::build_fhandler): New method with const char * argument.
(dtable::reset_unix_path_name): Eliminate.
(dtable::dup_worker): Use correct build_fhandler method.
* mmap.cc (mmap_record::alloc_fh): Ditto.
* dtable.h (dtable::build_fhandler): New method.
(dtable::reset_unix_path_name): Eliminate.
* fhandler.cc (fhandler_base::set_name): Assume that unix_name has already been
cmalloced.
(fhandler_base::reset_unix_path_name): Eliminate.
(fhandler_base::~fhandler_base): Coercion for cfree.
* fhandler.h (fhandler_base::unix_path_name): Make const char *.
(fhandler_base::win32_path_name): Ditto.
(fhandler_base::reset_unix_path_name): Eliminate.
* fhandler_disk_file.cc (fhandler_cygdrive::set_drives): Accommodate const char
*ness of win32_path_name.
* fhandler_socket.cc (fhandler_socket::fstat): Accommodate new set_name
requirements.
* path.cc (path_conv::return_and_clear_normalized_path): New method.
(path_conv::clear_normalized_path): Eliminate.
(path_conv::~path_conv): Ditto.
(path_conv::check): Accommodate new build_fhandler method.
* path.h (path_conv::~path_conv): Eliminate.
(path_conv::clear_normalized_path): Ditto.
(path_conv::return_and_clear_normalized_path): Declare new method.
2002-05-24 05:44:10 +00:00
Christopher Faylor b4bb31ad55 * path.cc (path_conv::check): Make sure any trailing path component is part of
potential normalized posix path.
2002-05-23 20:01:46 +00:00
Corinna Vinschen 82d178a405 * getfacl.c (usage): Standardize usage output. Change return type to
static void.
	(print_version): New function.
	(longopts): Added longopts for all options.
	(main): Accommodate new help and version options.
2002-05-23 10:56:57 +00:00
Christopher Faylor b2f338e9a9 * smallprint.c (__small_vsprintf): Implement '%o' after all these years. 2002-05-23 06:00:49 +00:00
Christopher Faylor ff7b1ed927 fix typo. 2002-05-23 04:48:03 +00:00
Christopher Faylor 8704ad9da9 * mount.cc (version) New global variable.
(usage) Standardize usage output.  Accomodate new version option.
(print_version) New function.
(longopts) Accomodate new version option.
(opts) Ditto.
(main) Ditto.
2002-05-23 04:19:07 +00:00
Christopher Faylor fc240f584b * fhandler.h (fhandler_virtual::exists): Eliminate path argument.
(fhandler_proc::exists): Ditto.
(fhandler_registry::exists): Ditto.
(fhandler_process::exists): Ditto.
* fhandler_proc.cc (fhandler_proc::exists): Ditto.  Use built-in name.
* fhandler_process.cc (fhandler_process::exists): Ditto.
(fstat): Ditto.
* fhandler_registry.cc (fhandler_registry::exists): Ditto.
(fhandler_registry::fstat): Ditto.
* fhandler_virtual.cc (fhandler_virtual::opendir): Ditto.
* path.cc (path_conv::check): Ditto.  Add debugging.
* syscalls.cc (dup): Always call dup2 for error handling.
2002-05-22 22:09:58 +00:00
Corinna Vinschen 1d2b71d6a3 * include/cygwin/types.h: Revert previous patch. 2002-05-22 12:47:54 +00:00
Corinna Vinschen 36f86a5537 * include/cygwin/types.h: Define pthread stuff only if _POSIX_THREADS
is defined.
2002-05-22 10:33:39 +00:00
Corinna Vinschen 5bb52de4e2 * cygpath.cc (usage): Change usage output slightly.
* cygpath.cc (main): Add option l to support conversion to
	Windows long file names.  Refactured code for capital options.
	Support of options from file for capital options.
	(dowin): New function.  Refactured from main.
	(doit): Call long path conversion.
	(get_long_name): New function.
	(get_long_paths): New function.
	(get_long_path_name_w32impl): New function.  Reimplementation
	of Windows API function GetLongPathName (only 98/Me/2000/XP or
	higher).
	(get_short_name): Call GetShortPathName only once.
	(get_short_paths): Fix calculating buffer size.
	* utils.sgml: Update cygpath section for l option.
2002-05-22 10:05:41 +00:00
Earnie Boyd 382df84bda * Makefile.in: Increment VERSION to 1.4.
(conf_prefix): New variable.
	(bindist): Modify target to use $(conf_prefix).
2002-05-21 16:50:13 +00:00
Corinna Vinschen 2d6ce5c228 * security.cc (open_local_policy): Initialize lsa to
INVALID_HANDLE_VALUE instead of NULL.
	(get_logon_server_and_user_domain): Test for INVALID_HANDLE_VALUE
	instead of NULL.
	(create_token): Both of the above.
2002-05-21 14:50:26 +00:00
Danny Smith 130e7349a5 2002-05-20 Philip Aston <philipa@mail.com>
* include/pbt.h (PBT_APMRESUMESUSPEND): Correct value is 7.
2002-05-20 00:57:18 +00:00
Danny Smith a110a2ad4d 2002-05-20 Ren� M�ller Fonseca <fonseca@users.sourceforge.net>
* include/lmaccess.h: (NetAccess*, NetGroup*,
	NetLocalGroup*, NetUser*, NetGet*, INetLogonControl[2],
	NetQueryDisplayInfotmationIndex): Replace LPWSTR with LPCWSTR.
2002-05-20 00:52:06 +00:00
Christopher Faylor 9ded8bd8b2 * fhandler_disk_file.cc (fhandler_disk_file::fstat): Make handling of nlink
consistent for remote files.
2002-05-18 21:07:18 +00:00
Christopher Faylor cf737d6b32 * strace.cc (add_child): Use calloc since new requires working libstdc++.a.
(fhandler_disk_file::fstat): Ditto for delete/free.
2002-05-18 21:05:10 +00:00
Christopher Faylor 2701126aaf * path.cc (path_conv::check): Always set executable bit for executable
extension.
2002-05-18 20:27:49 +00:00
Christopher Faylor 197f807736 remove white space 2002-05-18 06:10:16 +00:00