Commit Graph

10681 Commits

Author SHA1 Message Date
Renato Silva f7ddc49f40 Fix buffer size error handling in gethostname.
* net.cc (cygwin_gethostname): Fix buffer size error handling.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:09 +02:00
Corinna Vinschen 7b90cc4b9c Add release msg
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:09 +02:00
Corinna Vinschen 2e3968cefa Document GNU basename.
* new-features.xml (ov-new1.7.36): Add new section.  Document GNU
	basename.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:09 +02:00
Corinna Vinschen f0b38a8af6 Don't allow fully qualified Windows account names.
* uinfo.cc (pwdgrp::fetch_account_from_windows): Don't allow fully
	qualified Windows account names (domain\user or user@domain).

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:09 +02:00
Corinna Vinschen c117793326 Add _tzset_unlocked and _tzset_unlocked_r
newlib:

	* libc/time/local.h (_tzset_unlocked_r): Add prototype.
	(_tzset_unlocked): Ditto.
	* libc/time/tzset.c (_tzset_unlocked): New function, call
	_tzset_unlocked_r.
	(tzset): Lock and call _tzset_unlocked_r.
	* libc/time/tzset_r (_tzset_unlocked_r): Remove locking and rename
	from _tzset_r.
	(_tzset_r): Lock and call _tzset_unlocked_r.

cygwin:

	* localtime.cc (tzset_unlocked): Export as _tzset_unlocked.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:08 +02:00
Yaakov Selkowitz 75d5f68aab cygwin: add GNU basename(3)
winsup/cygwin/
* common.din (__gnu_basename): Export.
* path.cc (__gnu_basename): New function.

winsup/doc/
* posix.xml (std-gnu): Add basename.
(std-notes): Add note about two forms of basename.
2015-04-23 21:57:08 +02:00
Corinna Vinschen d4f8c94a9b Try best to handle user from domain not in trusted domain list.
* cygheap.h (cygheap_domain_info::add_domain): Add prototype.
	* uinfo.cc (cygheap_domain_info::add_domain): New method.
	(pwdgrp::fetch_account_from_windows): Try to add domain explicitely
	if it was not in the original list of trusted domains and go ahead
	rather than bailing out.  Add comment to explain why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:07 +02:00
Corinna Vinschen 3fb21f9143 Prepare to rename/reuse struct ucontext.
* cygtls.h (struct _cygtls): Convert thread_context to type CONTEXT.
	* exceptions.cc (_cygtls::signal_debugger): Use sizeof (CONTEXT) for
	size of CONTEXT copied for GDB's digestion.
	* include/cygwin/signal.h: Add a preliminary comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:07 +02:00
Corinna Vinschen 03d5584c4b Add CMIN and CTIME definitions
* include/sys/termios.h: Add CMIN and CTIME.
	* fhandler_termios.cc (fhandler_termios::tcinit): Use CMIN and CTIME.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:07 +02:00
Corinna Vinschen e6c735f685 Bump tty.cc copyright date 2015-04-23 21:57:07 +02:00
Takashi Yano 8c1a778e7d TIOCPKT mode of PTY is broken if ONLCR bit is cleared.
* tty.h (class tty_min): Remove variable "write_error" to which any
	errors are not currently set at anywhere.
	(class tty): Add variable "column" for handling ONOCR.
	* tty.cc (tty::init): Add initialization code for variable "column".
	* fhandler.h (class fhandler_pty_master): Remove variable "need_nl"
	which is not necessary any more. "need_nl" was needed by OPOST process
	in fhandler_pty_master::process_slave_output().
	(class fhandler_pty_common): Add function process_opost_output() for
	handling post processing for OPOST in write process.
	* fhandler_tty.cc (fhandler_pty_master::process_slave_output): Count
	TIOCPKT control byte into length to be read in TIOCPKT mode. Move
	post processing for OPOST to write process. Remove code related to
	variable "write_error". Return with EIO error if slave is already
	closed.
	(fhandler_pty_master::fhandler_pty_master): Remove initialization
	code for variable "need_nl".
	(fhandler_pty_common::process_opost_output): Add this function for
	handling of OPOST in write process. Add code to avoid blocking in
	non-blocking mode when output is suspended by ^S.
	(fhandler_pty_slave::write): Call fhandler_pty_common::
	process_opost_output() instead of WriteFile(). Remove code related to
	variable "write_error".
	(fhandler_pty_master::doecho): Call fhandler_pty_common::
	 process_opost_output() instead of WriteFile().
	* select.cc (peek_pipe): Remove code related to variable "need_nl".

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:07 +02:00
Corinna Vinschen 7befea740d Ignore __STDC_{FORMAT,LIMIT,CONSTANT}_MACROS
Per glibc BZ #15366:
	* inttypes.h: Drop __STDC_FORMAT_MACROS consideration.
	* stdint.h: Drop __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS
	consideration.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:06 +02:00
Corinna Vinschen dd3d3b10e2 Drop cygwin/_types.h.
* include/cygwin/_types.h: Drop unused file.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-04-23 21:57:06 +02:00
Corinna Vinschen 4a9636b1d6
Implmenet faster getfrompw/getfromgr
* grp.cc (pwdgrp::parse_group): Call cygsid::getfromgr_passwd.
	* passwd.cc (pwdgrp::parse_passwd): Call cygsid::getfrompw_gecos.
	* pwdgrp.h (cygsid::getfrompw): Implement as inline method here,
	accessing pg_pwd's sid member directly.
	(cygsid::getfromgr): Implement as inline method here, accessing
	pg_grp's sid member directly.
	* sec_auth.cc (extract_nt_dom_user): Call cygsid::getfrompw_gecos.
	Explain why.
	* sec_helper.cc (cygsid::getfrompw): Drop implementation.
	(cygsid::getfromgr): Ditto.
	* security.h (cygsid::getfrompw_gecos): Implement former getfrompw
	inline here.
	(cygsid::getfromgr_passwd): Implement former getfromgr inline here.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-18 17:15:27 +01:00
Corinna Vinschen 1d91d469ee
Drop unneeded passwd argument from security functions
* sec_auth.cc (get_server_groups): Drop unused passwd argument.  Adjust
	calls throughout.
	(get_initgroups_sidlist): Ditto.
	(get_setgroups_sidlist): Ditto.
	(create_token): Ditto.
	(lsaauth): Ditto.
	* security.h (create_token): Adjust prototype to above change.
	(lsaauth): Ditto.
	(get_server_groups): Ditto.
	* grp.cc (get_groups): Adjust call to get_server_groups.
	* syscalls.cc (seteuid32): Adjust calls to lsaauth and create_token.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-18 16:54:19 +01:00
Corinna Vinschen 6f93f1d6a5
Drop unused timeoput paramter to internal_getlogin
* grp.cc (internal_getgroups): Drop unused timeout parameter.
	* pwdgrp.h (internal_getgroups): Ditto in prototype.
	* uinfo.cc (internal_getlogin): Ditto in usage.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-17 15:42:59 +01:00
Corinna Vinschen 8f00fa7f36
Avoid name change if script is called via symlink from execvp et al.
* spawn.cc (find_exec): Fix a name change in case of a symlink which
	can be opened as is.

Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
2015-03-17 11:40:12 +01:00
Jon TURNEY b7f2a6c0a7 Fix winsup/doc to install into prefix
By default, docdir and htmldir are defined in terms of prefix, so make sure to
define it, so their values are prefix-relative.

Without this, 'make install' installs the documentation into /share/doc/ unless
configured otherwise.

	* Makefile.in (prefix): Define.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-03-16 14:53:05 +00:00
Jon TURNEY e9e47b8ce6 Teach stackinfo::walk() how to virtually unwind the tls sigstack
This improves how stackinfo::dumpstack() dumps _sigbe and sigdelayed frames

	* exceptions.cc (stack_info): Add sigstackptr member.
	(walk): Unwind sigstackptr inside _sigbe and sigdelayed.
	* gendef (_sigdelayed_end): Add symbol to mark end of sigdelayed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-03-13 13:05:52 +00:00
Corinna Vinschen 63c9ffeed8
Remove now useless include/cygwin/sys_time.h
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-13 13:22:19 +01:00
Alexey Pavlov aaa7d1f14a
net.cc: Remove extra braces.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-13 10:38:49 +01:00
Alexey Pavlov 63b41daeb6
Fix typo in include/cygwin/version.h
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-12 18:48:59 +01:00
Corinna Vinschen f9d35f473b
Drop defining _BSDTYPES_DEFINED before including winsup.h.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-12 17:11:19 +01:00
Takashi Yano 32fd5b0fe1
Let pty slave detect closure of last master handle
* fhandler_tty.cc (fhandler_pty_master::close): Add code to make slave
	detect closure of master. Fix typo in error message.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-12 15:48:10 +01:00
Corinna Vinschen a34ebbad28
Fix more typos in ntsec.xml
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-12 11:14:57 +01:00
Corinna Vinschen 1aa532fec2
Fix typos in ntsec.xml
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-12 10:53:33 +01:00
Corinna Vinschen 6e90585ad8
Include sys/_timespec.h in cygwin/types.h to adjust to newlib
* include/cygwin/types.h: Include <sys/_timespec.h>

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-11 15:47:19 +01:00
Corinna Vinschen 6bd719beeb
* autoload.cc (CreateEnvironmentBlock): Make loading non-fatal.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-11 12:56:53 +01:00
Corinna Vinschen f085e9d321 Fix condition in DLL loading loop 2015-03-11 12:22:45 +01:00
Yaakov Selkowitz 2a6db5083c cygwin: fix __x86_64__ conditional in stdint.h
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2015-03-10 16:32:52 -05:00
Corinna Vinschen 84195ba6c5 whitespace fix 2015-03-10 16:07:07 +01:00
Corinna Vinschen 9272d8f942 Change CVS->GIT in docs
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2015-03-10 14:19:42 +01:00
Corinna Vinschen e479f4ffb7 mv .cvsignore to .gitignore
Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
2015-03-09 21:40:26 +01:00
Corinna Vinschen 5e99eb1104 * tty.h (tty::set_master_ctl_closed): Rename from set_master_closed.
(tty::is_master_closed): Drop method.
	* fhandler_tty.cc (fhandler_pty_slave::open): Remove code prematurely
	bailing out if master control thread is not running.
	(fhandler_pty_slave::read): Don't generate SIGHUP if master control
	thread is not running.
	(fhandler_pty_master::close): Rearrange code to avoid stopping master
	control thread twice in multi-threaded scenarios.
2015-03-05 13:58:03 +00:00
Corinna Vinschen 3bf693dde1 * fhandler.h (fhandler_base::get_echo_handle): New virtual method.
(class fhandler_pty_master): Add echo_r and echo_w handles constituting
	read and write side of new echo pipe.
	* select.cc (peek_pipe): On pty masters, check additionally if input
	from the echo pipe is available.
	* fhandler_tty.cc (fhandler_pty_master::doecho): Drop output_mutex
	locking.  Write output to echo pipe.
	(fhandler_pty_master::process_slave_output): Check if input is available
	in echo pipe and prefer to read from it, if so.
	(fhandler_pty_slave::write): Drop output_mutex locking.
	(fhandler_pty_master::fhandler_pty_master): Initialize echo pipe
	handles to NULL.
	(fhandler_pty_master::close): Close and NULL echo pipe handles.
	(fhandler_pty_master::setup): Create echo pipe, close in case of error.
2015-03-05 12:57:34 +00:00
Corinna Vinschen e8ef9994cf * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 36. 2015-03-04 11:46:02 +00:00
Corinna Vinschen 1d7a60f56c * posix.xml (std-bsd): Add issetugid. 2015-03-04 11:44:07 +00:00
Corinna Vinschen 694626a5f5 * new-features.xml (ov-new1.7.35): Add SIGSYS change. 2015-03-03 17:10:54 +00:00
Corinna Vinschen 8ac0306085 * msg.cc: Throughout, drop raising SIGSYS if cygserver is not running.
* sem.cc: Ditto.
	* shm.cc: Ditto.
2015-03-03 17:09:30 +00:00
Corinna Vinschen 73c0c53cf4 * new-features.xml (ov-new1.7.35): Add new section. 2015-03-03 13:02:21 +00:00
Corinna Vinschen 37e87b843f * common.din (issetugid): Export.
* glob.cc (issetugid): Drop macro.
	* sec_auth.cc (issetugid): New exported function.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2015-03-03 12:58:34 +00:00
Corinna Vinschen f9f1fbe47e * security.cc (get_attribute_from_acl): Don't spill Everyone permissions
into group permissions if owner SID == group SID.
	(alloc_sd): Add parenthesis for clarity.
2015-03-02 10:52:07 +00:00
Corinna Vinschen 583d56ee20 * utils.xml (getfacl): Adjust options to option nmame change. 2015-02-28 13:15:53 +00:00
Corinna Vinschen f33558a084 *** empty log message *** 2015-02-28 13:14:30 +00:00
Corinna Vinschen 3da543e5bd * getfacl.c (usage): Change --all to --access, --dir to --default.
Align text to output of Linux tool.
	(longopts): Add --access and --default options.
2015-02-28 13:13:19 +00:00
Corinna Vinschen 146200310f * uinfo.cc (pwdgrp::add_line): Return NULL if parsing a line failed.
(pwdgrp::add_account_post_fetch): Check return value from add_line and
	return NULL if add_line returns NULL.
2015-02-28 12:12:34 +00:00
Corinna Vinschen fab17cf934 *** empty log message *** 2015-02-27 16:08:26 +00:00
Corinna Vinschen 9f6688dfc5 * security.cc (alloc_sd): For directories, mark inherited ACEs
inheritable to better follow POSIX 1003.1e rules.
2015-02-27 15:54:15 +00:00
Corinna Vinschen 83b0e8cffe * sec_acl.cc (getacl): Add mask even if all group and secondary account
permissions are 0.
2015-02-27 14:51:00 +00:00
Corinna Vinschen 211cb4df18 * uinfo.cc (pwdgrp::fetch_account_from_windows): Drop redundant test
for SidTypeUser.
2015-02-27 14:03:29 +00:00