Commit Graph

2211 Commits

Author SHA1 Message Date
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