Commit Graph

2933 Commits

Author SHA1 Message Date
Thomas Pfaff 5ae9331a32 * syscalls.cc (struct system_cleanup_args): New struct.
(system_cleanup): New function.
(system): Use pthread_cleanup_push and _pop to save and restore
signal handlers and sigprocmask.
2003-02-04 19:49:39 +00:00
Thomas Pfaff 53c384f206 * winsup.api/pthread/cancel11.c: New test.
* winsup.api/pthread/cancel12.c: Ditto.
2003-02-04 19:34:21 +00:00
Corinna Vinschen 3dbafd873e * path.cc (symlink): Create security attributes so that only the
user can modify the symlink.
	* security.cc (set_security_attribute): Remove symlink special
	handling.
2003-02-04 19:26:01 +00:00
Corinna Vinschen 0daf256192 * grp.cc (internal_getgroups): Do not return without closing
the process handle.
2003-02-04 17:53:08 +00:00
Corinna Vinschen 4a21c2d5c8 * security.h (class cygpsid): New class.
(class cygsid): Use cygpsid as base. Remove members psid, get_id,
	get_uid, get_gid, string, debug_printf and the == and != operators.
	(cygsidlist::clear_supp): Only do work if setgroups has been called.
	* sec_helper.cc: Define sid_auth NO_COPY.
	(cygpsid::operator==): New operator.
	(cygpsid::get_id): New function.
	(cygpsid::string): New function.
	(cygsid::string): Delete.
	(cygsid::get_id): Delete.
	* pwdgrp.h: Change arguments of internal_getpwsid,
	internal_getgrsid and internal_getgroups to cygpsid.
	* passwd.cc (internal_getpwsid): Change argument from cygsid to cygpsid.
	* grp.cc (internal_getgrsid): Ditto.
	(internal_getgroups): Ditto.
2003-02-04 14:58:04 +00:00
Christopher Faylor 335556d58b Eliminate most unneeded this-> pointers throughout. 2003-02-04 03:01:17 +00:00
Corinna Vinschen 153e83c605 * security.h: Add third argument to set_process_privilege.
* autoload.cc: Add OpenThreadToken.
	* sec_helper.cc (set_process_privilege): Add and use use_thread
	argument.
	* security.cc (alloc_sd): Modify call to set_process_privilege.
	Remember the result in each process. If failed and file owner is not
	the user, fail.
2003-02-03 15:55:20 +00:00
Corinna Vinschen f0f3ea68f3 * fhandler_socket.cc (fhandler_socket::recvfrom): Return buffer
length and don't set errno in case of WSAEMSGSIZE error.
	(fhandler_socket::recvmsg): Ditto.
2003-02-03 15:34:52 +00:00
Joshua Daniel Franklin 46c1de5bf7 * cygwinenv.sgml: Add section for 'CYGWIN codepage:[ansi|oem]' 2003-02-03 00:30:45 +00:00
Christopher Faylor 6688a0618e * grp.cc (getgrent32): Only refresh group entries when at beginning.
(internal_getgrsid): Only refresh if uninitialized.
(internal_getgrent): Ditto.
* passwd.cc (getpwent): Only refresh passwd entries when at beginning.
(pwdgrp::read_passwd): linebuf *cannot* be NO_COPY.
(internal_getpwsid): Only refresh if uninitialized.
(getpass): No need to refresh passwd data here.
* pwdgrp.h (refresh): Eliminate default.
2003-02-01 18:41:29 +00:00
Danny Smith 05d2a9a4fb * include/commctrl.h (TCM_*): Add missing defines. 2003-02-01 11:38:31 +00:00
Danny Smith 93dfea5667 2003-02-01 Jesus Alvarez <jesus_alvarez@users.sourceforge.net>
Danny Smith  <dannysmith@users.sourceforge.net>

	* include/prsht.h (PSP_*, PSH_*): Add missing defines.
	(PROPSHEETPAGE[AW]): Add pszHeaderTitle, pszHeaderSubTitle
	for (_WIN32_IE >= 0x0400).
	(PROPSHEETHEADER[AW]): Add hplWatermark and anonymous union
	fields for (_WIN32_IE >= 0x0400).
2003-02-01 08:53:17 +00:00
Christopher Faylor a5a93a62b2 * dlfcn.cc (dlerror): Only report load errors once per error. 2003-02-01 05:00:15 +00:00
Christopher Faylor b0a82a859d * fhandler_serial.cc (fhandler_serial::open): Avoid extraneous setting of res.
* termios.cc (tcsetattr): Correctly record errno after tcsetattr call.
* fhandler_serial.cc (fhandler_serial::tcsetattr): Add error-checking so that
if any Win32 SetComm*() calls fail, errno gets set to EINVAL and tcsetattr()
returns -1.  Catch invalid bitrates, mostly.  If baud rate setting is B0, just
drop DTR and leave Win32 DCB bitrate as-is since 0 is not a valid Win32
setting.
(fhandler_serial::tcgetattr): If DTR is low, populate the bitrate as B0,
otherwise get it from the DCB.
2003-02-01 04:48:03 +00:00
Christopher Faylor 949c3da11a * passwd.cc (pwdgrp::read_passwd): linebuf *must* be static (from Pierre
Humblet).
* pwdgrp.h (pwdgrp::refresh): Avoid calling read function if we already have
lock since that means we are in the process of reading the file.
2003-01-31 17:00:42 +00:00
Christopher Faylor 485d85bfa7 * shared.cc (shared_info::heap_chunk_size): Use correct variable when reading
HKLM.
2003-01-31 15:02:40 +00:00
Danny Smith 28c098e3f4 2003-01-31 Danny Smith <dannysmith@users.sourceforge.net>
* include/winbase.h (CreateFiber): Change first parameter
	to SIZE_T.
	(CreateJobObject[AW], CreateHardLink[AW]): Guard with
	(_WIN32_WINNT >= 0x0500).

2003-01-31  Bang Jun-Young  <junyoung@netbsd.org>

	* include/winbase.h (PWIN32_FIND_DATAA, PWIN32_FIND_DATAW):
	Add missing typedefs.
	(CreateFiberEx, CreateJobObjectA,CreateJobObjectW): Add missing
	prototypes.
	(CreateHardLinkA, CreateHardLinkW): Return BOOL, not HANDLE.
2003-01-31 08:28:44 +00:00
Christopher Faylor 704ce46198 * fhandler_registry.cc (fhandler_registry::exists): Fix off-by-one error when
inspecting path.
2003-01-30 23:15:15 +00:00
Christopher Faylor ba6e108396 * lib/getopt.c: Allow environment variable control of POSIXLY_INCORRECT behavior. 2003-01-30 01:14:30 +00:00
Corinna Vinschen 01e3c89709 * fhandler_socket.cc (fhandler_socket::accept): On successful execution
set connection state of returned socket to CONNECTED.
2003-01-28 15:33:50 +00:00
Danny Smith 500acc57eb 2003-01-27 Krzysztof Nikiel <kni@poczta.onet.pl>
* include/mmsystem.h (MIXERCONTROL_CONTROLF_MULTIPLE): Correct
	define.
	* lib/largeint.c (LargeIntegerAdd): Add, don't multiply.
2003-01-27 23:11:13 +00:00
Christopher Faylor dfb366da5a * passwd.cc (pwdgrp::parse_passwd): Be more unforgiving about non-numeric
fields.
2003-01-27 17:00:17 +00:00
Christopher Faylor ca6018a0d3 fix typo 2003-01-27 15:58:15 +00:00
Danny Smith d2f9f641d9 2003-01-27 Danny Smith <dannysmith@users.sourceforge.net>
* include/rpcnterr.h (RPC_X_INVALID_PIPE_OPERATION): Add
	define.
	* include/winbase.h (WAIT_TIMEOUT): Guard against prior
	definition.
	(WAIT_FAILED): Cast to DWORD.
	* include/winerror.h (WAIT_TIMEOUT): Guard against prior
	definition.

2003-01-27  Bang Jun-Young  <junyoung@netbsd.org>

	* include/winerror.h: Protect against multiple
	definition of WSA* error codes.
	* include/winsock.h: Likewise.
	* include/winsock2.h: Likewise.

2003-01-27  Bang Dong-Heui
	    Bang Jun-Young  <junyoung@netbsd.org>

	* include/winerror.h (ERROR_*, SEC_E_*,RPC_S_*, FRS_ERR_*,
	DNS_*, WSA*, WAIT_TIMEOUT): Add missing error codes.
	(RPC_X_INVALID_PIPE_OPERATION): Remove define.
2003-01-27 07:15:17 +00:00
Christopher Faylor 03dba1defa * uinfo.cc (pwdgrp::next_num): Remove check for NULL since it is no longer a
valid return from next_str.
(pwdgrp::add_line): Duh.  Revert to use strchr.
2003-01-27 00:31:30 +00:00
Christopher Faylor fea48988ea * strings.h (strechr): New function.
* uinfo.cc (pwdgrp::next_str): Search only for input char in string.  Return
EOS on failure.  Don't check for NULL since it shouldn't be possible.
(pwdgrp::add_line): Revert to replacing '\n' in input line with '\0'.
(pwdgrp::next_num): Pass explicit separator character to next_str.
* grp.cc (pwdgrp::parse_group): Ditto.
* passwd.cc (pwdgrp::parse_passwd): Ditto.  Revamp test for garbage input.
* pwdgrp.h (pwdgrp::next_str): Don't use default parameter.
2003-01-27 00:16:01 +00:00
Danny Smith 232cca6b0c * include/math.h (tgamma): Correct typo in comment. 2003-01-26 07:04:04 +00:00
Christopher Faylor 9a75162166 * uinfo.cc (pwdgrp::load): Regularize strace output. Add warning for
CreateFile failure.
2003-01-26 06:42:40 +00:00
Danny Smith 989c97fe14 * mingwex/mingw-fseek.c (INLINE): Remove define.
(__mingw_is_win9x): Remove static inline function.
	(_mingw_fwrite): Use _osver instead of __mingw_is_win9x.
2003-01-26 06:38:43 +00:00
Christopher Faylor 5da947eaca Fix typo. 2003-01-26 06:27:26 +00:00
Christopher Faylor bdbd7fb6b9 * passwd.cc (pwdgrp::parse_passwd): Eliminate use of memset. The structure
should always be completely filled out.
* grp.cc (pwdgrp::parse_group): Ditto.
* grp.cc (pwdgrp::parse_group): Fix off-by-one problem in allocating
2003-01-26 06:02:34 +00:00
Christopher Faylor c913339563 * pwdgrp.cc (pwdgrp::parse_group): Fix off-by-one problem in allocating gr_mem. 2003-01-26 05:55:29 +00:00
Christopher Faylor 6503705696 * include/sys/strace.h (paranoid_printf): Define as not being part of "all"
output.
* pwdgrp.h (pwdgrp::next_num): Rename from next_int.  Returns true/false if
parse operation succeeded.
(pwdgrp::reparse): Remove.
(pwdgrp::raw_ptr): New function.  Returns pointer in line.
(pwdgrp::next_num): New functions for parsing other than unsigned long.
* grp.cc (pwdgrp::parse_group): Reinstate previous parsing behavior.  Don't
fill in fields with NULL and assign empty gr_mem to known pointer rather than
doing a pointless calloc.  Streamline gr_mem parsing.  Don't increment
curr_lines here.
* passwd.cc (pwdgrp::parse_passwd): Use new behavior of next_num.  Don't
increment curr_lines here.
* uinfo.cc (pwdgrp::next_str): Keep returning EOL if out of data.
(pwdgrp::reparse): Remove.
(pwdgrp::next_num): Rename from next_int.  Return bool indicating success of
parse, argument returns value parsed.
(pwdgrp::add_line): Increment curr_lines here on successful parse.
(pwdgrp::load): (from Pierre Humblet) Don't return status.  Just report it
here.
2003-01-26 05:38:38 +00:00
Christopher Faylor c9b99d0d2a clarify 2003-01-25 16:38:56 +00:00
Christopher Faylor a53ddfe6c2 * pwdgrp.cc (pwdgrp::reparse): Declare.
* uinfo.cc (pwdgrp::reparse): Define.
* grp.cc (pwdgrp::parse_group): Use.
2003-01-25 16:34:32 +00:00
Corinna Vinschen 4f7e12dd26 * syscalls.cc (seteuid32): On Win95 get the pw entry. If it exists
update the euid and call cygheap->user.set_name. Remove special
	handling of ILLEGAL_UID.
	(setgid32): Add a debug_printf. On Win95, always set the egid.
	Remove special handling of ILLEGAL_GID. Do not compare gid and gr_gid.
	* child_info.h (class cygheap_exec_info): Remove uid.
	* spawn.cc (spawn_guts): Do not set ciresrv.moreinfo->uid.
	* dcrto.cc (dll_crt0_1): Always call uinfo_init.
	* uinfo.cc (uinfo_init): Reorganize and close handle if needed.
	(cygheap_user::ontherange): Do not call internal_getpwnam if pw is NULL.
2003-01-25 10:36:46 +00:00
Christopher Faylor 45dbfc2611 * fhandler_console.cc (fhandler_console::send_winch_maybe): Reset scroll region
if size changes.
2003-01-25 01:17:51 +00:00
Danny Smith 81632e9e55 * include/ras.h (RASCONN[AW]): Add dwSessionId for
(WINVER >= 0x501).
2003-01-25 00:47:25 +00:00
Danny Smith bb9f07bc54 * include/ras.h (RASCONN[AW]): Guard szDeviceType,
szDeviceName fields with WINVER >= 0x400. Add dwFlags, luid
	fields for WINVER >= 0x501.
2003-01-25 00:41:45 +00:00
Corinna Vinschen 7d33eefa7b * cygwin.din: Export setreuid32, setreuid, setregid32, setregid.
* syscalls.cc (setreuid32): New function.
	(setreuid): Ditto.
	(setregid32): Ditto.
	(setregid): Ditto.
	* include/cygwin/version.h: Bump API minor number.
2003-01-24 15:23:15 +00:00
Christopher Faylor ac4133746e * pwdrp.h (pwdgrp::refresh): Lock entire test prior to reading.
* grp.cc (pwdgrp::parse_group): Eliminate arg and use class member instead.
Use next_str and next_int to parse arguments.
* passwd.cc (pwdgrp::parse_passwd): Ditto.
(grab_string): Eliminate.
(grab_int): Ditto.
* pwdgrp.h (pwdgrp::parse): Eliminate input arg.
(pwdgrp::parse_passwd): Reflect above change.
(pwdgrp::parse_group): Reflect above change.
(pwdgrp::next_str): New function.
(pwdgrp::next_int): Ditto.
(pwdgrp::gets): Eliminate.
* uinfo.cc (pwdgrp::next_str): New function.
(pwdgrp::next_int): Ditto.
(pwdgrp::add_line): Subsume gets.
(pwdgrp::gets): Eliminate.
(pwdgrp::load): Just call add_line to parse input buffer.
2003-01-24 03:53:46 +00:00
Christopher Faylor 09a8842674 Add missing entry. 2003-01-24 02:41:28 +00:00
Christopher Faylor b831fc4446 * libltp/include/usctest.h: Add externs to some variables that need it.
* winsup.api/ltp/mmap05.c (main): Make file_content volatile to avoid
optimization glitch.
2003-01-24 01:51:39 +00:00
Christopher Faylor 8e61c0495e * winsup.api/mmaptest03.c (main): Mark variables as volatile to avoid
optimization induced problems.
2003-01-24 01:41:30 +00:00
Christopher Faylor 23a30ba8d9 * Makefile (check): Add cygrun.exe dependency. 2003-01-24 01:30:43 +00:00
Christopher Faylor 31d7abadfe Perform more C warning fixup on all C source files and headers. 2003-01-24 01:09:40 +00:00
Christopher Faylor 9b978ffe8b * libltp/include/test.h: Fix C warnings.
* winsup.api/checksignal.c: Ditto.
* winsup.api/crlf.c: Ditto.
* winsup.api/devzero.c: Ditto.
* winsup.api/iospeed.c: Ditto.
* winsup.api/mmaptest01.c: Ditto.
* winsup.api/mmaptest02.c: Ditto.
* winsup.api/mmaptest03.c: Ditto.
* winsup.api/mmaptest04.c: Ditto.
* winsup.api/nullgetcwd.c: Ditto.
* winsup.api/sigchld.c: Ditto.
* winsup.api/signal-into-win32-api.c: Ditto.
* winsup.api/systemcall.c: Ditto.
* winsup.api/waitpid.c: Ditto.
* winsup.api/pthread/mainthreadexits.c: Ditto.
* winsup.api/pthread/test.h: Ditto.
* winsup.api/pthread/threadidafterfork.c: Ditto.
* Makefile.in: Remove cygrun.exe from RUNTIME since it is built here now.
2003-01-23 21:21:28 +00:00
Christopher Faylor d8f0f146b8 * Makeifle.in: Use ALL_CFLAGS to build test programs so that correct libraries
and other options are used.
2003-01-23 21:14:56 +00:00
Danny Smith 2d771b3dd9 * lib/ws2_32.def (getaddrinfo, freeaddrinfo and getnameinfo):
Add stubs.
	* include/ws2tcpip.h (IPV6_*) Add IPPROTO_IPV6 level socket
	options.
2003-01-23 20:43:47 +00:00
Thomas Pfaff ea35a5e4ae * include/pthread.h (PTHREAD_MUTEX_RECURSIVE): Revert changes from 2003-01-09 mutex patch.
(PTHREAD_MUTEX_ERRORCHECK): Ditto.
2003-01-22 19:51:31 +00:00