summaryrefslogtreecommitdiffstats
path: root/winsup
Commit message (Collapse)AuthorAgeFilesLines
* Preliminary read side implementation of new permission handling.Corinna Vinschen2015-03-186-355/+394
| | | | | | | | | | | | | | | | | | | | | | | | * acl.h (MAX_ACL_ENTRIES): Raise to 2730. Add comment to explain. * sec_acl.cc: Add leading comment to explain new ACL style. Add definitions and macros to use for bits in new Cygwin ACL. (DENY_RWX): New mask value for all temporary deny bits. (getace): Add bool parameter to decide when leaving all bits intact, rather than filtering them per the already set bits. (get_posix_access): New function, taking over functionality to read POSIX ACL from SECURITY_DESCRIPTOR. (getacl): Just call get_posix_access. * sec_helper.cc (well_known_cygwin_sid): Define. * security.cc (get_attribute_from_acl): Remove. (get_info_from_sd): Remove. (get_reg_sd): Call get_posix_access instead of get_info_from_sd. (get_file_attribute): Ditto. (get_object_attribute): Ditto. * security.h (well_known_cygwin_sid): Declare. (get_posix_access): Add prototype. * Throughout, use simpler ACE macros from Windows' accctrl.h. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Implmenet faster getfrompw/getfromgrCorinna Vinschen2015-03-187-18/+43
| | | | | | | | | | | | | | | | | | * 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>
* Drop unneeded passwd argument from security functionsCorinna Vinschen2015-03-185-18/+31
| | | | | | | | | | | | | | | | * 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>
* Drop unused timeoput paramter to internal_getloginCorinna Vinschen2015-03-174-7/+9
| | | | | | | | * 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>
* Avoid name change if script is called via symlink from execvp et al.Corinna Vinschen2015-03-173-6/+14
| | | | | | | * 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>
* Fix winsup/doc to install into prefixJon TURNEY2015-03-162-0/+5
| | | | | | | | | | | | 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>
* Teach stackinfo::walk() how to virtually unwind the tls sigstackJon TURNEY2015-03-133-0/+21
| | | | | | | | | | 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>
* Remove now useless include/cygwin/sys_time.hCorinna Vinschen2015-03-132-27/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* net.cc: Remove extra braces.Alexey Pavlov2015-03-132-2/+7
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix typo in include/cygwin/version.hAlexey Pavlov2015-03-122-1/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Drop defining _BSDTYPES_DEFINED before including winsup.h.Corinna Vinschen2015-03-122-2/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Let pty slave detect closure of last master handleTakashi Yano2015-03-122-3/+14
| | | | | | | * 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>
* Fix more typos in ntsec.xmlCorinna Vinschen2015-03-122-2/+7
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix typos in ntsec.xmlCorinna Vinschen2015-03-122-4/+10
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Include sys/_timespec.h in cygwin/types.h to adjust to newlibCorinna Vinschen2015-03-112-1/+6
| | | | | | * include/cygwin/types.h: Include <sys/_timespec.h> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* * autoload.cc (CreateEnvironmentBlock): Make loading non-fatal.Corinna Vinschen2015-03-112-1/+5
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Fix condition in DLL loading loopCorinna Vinschen2015-03-112-2/+7
|
* cygwin: fix __x86_64__ conditional in stdint.hYaakov Selkowitz2015-03-102-1/+5
| | | | Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* whitespace fixCorinna Vinschen2015-03-101-1/+0
|
* Change CVS->GIT in docsCorinna Vinschen2015-03-103-8/+14
| | | | Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* mv .cvsignore to .gitignoreCorinna Vinschen2015-03-091-0/+0
| | | | Signed-off-by: Corinna Vinschen <vinschen@redhat.com>
* * tty.h (tty::set_master_ctl_closed): Rename from set_master_closed.Corinna Vinschen2015-03-054-24/+28
| | | | | | | | | | (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.
* * fhandler.h (fhandler_base::get_echo_handle): New virtual method.Corinna Vinschen2015-03-055-11/+71
| | | | | | | | | | | | | | | | (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.
* * include/cygwin/version.h (CYGWIN_VERSION_DLL_MINOR): Bump to 36.Corinna Vinschen2015-03-042-1/+5
|
* * posix.xml (std-bsd): Add issetugid.Corinna Vinschen2015-03-042-0/+5
|
* * new-features.xml (ov-new1.7.35): Add SIGSYS change.Corinna Vinschen2015-03-032-0/+9
|
* * msg.cc: Throughout, drop raising SIGSYS if cygserver is not running.Corinna Vinschen2015-03-035-26/+13
| | | | | * sem.cc: Ditto. * shm.cc: Ditto.
* * new-features.xml (ov-new1.7.35): Add new section.Corinna Vinschen2015-03-032-0/+54
|
* * common.din (issetugid): Export.Corinna Vinschen2015-03-036-2/+20
| | | | | | * glob.cc (issetugid): Drop macro. * sec_auth.cc (issetugid): New exported function. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
* * security.cc (get_attribute_from_acl): Don't spill Everyone permissionsCorinna Vinschen2015-03-022-5/+12
| | | | | into group permissions if owner SID == group SID. (alloc_sd): Add parenthesis for clarity.
* * utils.xml (getfacl): Adjust options to option nmame change.Corinna Vinschen2015-02-282-6/+8
|
* *** empty log message ***Corinna Vinschen2015-02-281-0/+3
|
* * getfacl.c (usage): Change --all to --access, --dir to --default.Corinna Vinschen2015-02-282-6/+12
| | | | | Align text to output of Linux tool. (longopts): Add --access and --default options.
* * uinfo.cc (pwdgrp::add_line): Return NULL if parsing a line failed.Corinna Vinschen2015-02-282-7/+14
| | | | | (pwdgrp::add_account_post_fetch): Check return value from add_line and return NULL if add_line returns NULL.
* *** empty log message ***Corinna Vinschen2015-02-271-0/+18
|
* * security.cc (alloc_sd): For directories, mark inherited ACEsCorinna Vinschen2015-02-272-0/+11
| | | | inheritable to better follow POSIX 1003.1e rules.
* * sec_acl.cc (getacl): Add mask even if all group and secondary accountCorinna Vinschen2015-02-272-4/+17
| | | | permissions are 0.
* * uinfo.cc (pwdgrp::fetch_account_from_windows): Drop redundant testCorinna Vinschen2015-02-272-1/+6
| | | | for SidTypeUser.
* * sec_acl.cc (setacl): Fix bug which leads to ACE duplication inCorinna Vinschen2015-02-274-52/+93
| | | | | | | | | | | | | | | | case owner SID == group SID. (getacl): Reverse order of SID test against group or owner sid to prefer owner attributes over group attributes. Disable setting group permissions equivalent to owner permissions if owner == group. Add comment to explain why. Fix indentation. * security.cc (get_attribute_from_acl): Change type of local variables containing permission to mode_t. Apply deny mask to group if group SID == owner SID to avoid Everyone permissions to spill over into group permissions. Disable setting group permissions equivalent to owner permissions if owner == group. Add comment to explain why. * uinfo.cc (pwdgrp::fetch_account_from_windows): Allow user SID as group account if user is a "Microsoft Account". Explain why. Drop workaround enforcing primary group "Users" for "Microsoft Accounts".
* * ldap.cc (cyg_ldap::wait): Call cygwait with cw_infinite timeout valueCorinna Vinschen2015-02-262-3/+8
| | | | | and with cw_sig_restart instead of cw_sig_eintr. Drop useless _my_tls.call_signal_handler call. Return EIO if cygwait failed.
* * posix_ipc.cc (ipc_mutex_lock): Revert unneeded call to signal handler.Corinna Vinschen2015-02-262-1/+4
|
* * posix_ipc.cc (ipc_mutex_lock): Add bool parameter to influence ifCorinna Vinschen2015-02-262-8/+21
| | | | | | | | | | cygwait should be in EINTR or in restart mode. Call signal handler if in EINTR mode. (mq_getattr): Call ipc_mutex_lock in restart mode. (mq_setattr): Ditto. (mq_notify): Ditto. (_mq_send): Call ipc_mutex_lock in EINTR mode. (_mq_receive): Ditto.
* * fhandler_termios.cc (fhandler_termios::line_edit): Fix conditionCorinna Vinschen2015-02-263-7/+20
| | | | for writing remaining bytes in readahead buffer in non-canonical mode.
* * sec_acl.cc (setacl): Always grant default owner entryCorinna Vinschen2015-02-252-0/+7
| | | | STANDARD_RIGHTS_ALL and FILE_WRITE_ATTRIBUTES access, too.
* *** empty log message ***Corinna Vinschen2015-02-251-0/+3
|
* * mkgroup.c (MAX_SID_LEN): Remove. Instead, use SECURITY_MAX_SID_SIZECorinna Vinschen2015-02-253-49/+61
| | | | | | | throughout. (enum_unix_groups): Introduce numeric_psid and rearrange code to avoid potential heap corruption. * mkpasswd.c: Ditto.
* * fhandler_tape.cc (fhandler_dev_tape::_lock): Add cw_sig_restart toCorinna Vinschen2015-02-254-15/+19
| | | | | | | | | | cygwait call. * thread.cc (pthread_mutex::lock): Ditto. (semaphore::_timedwait): Fix formatting. (semaphore::_wait): Ditto. * thread.h (fast_mutex::lock): Ditto. ...and fix ChangeLog accordingly.
* Applied the "chgrp `id -g`" improvements suggested by Corinna for the FAQWarren Young2015-02-252-0/+21
| | | | item about SSH keys not working in 1.7.34+.
* * security.cc (alloc_sd): Don't apply temporary workaround for chmodCorinna Vinschen2015-02-252-8/+18
| | | | to DEF_USER_OBJ, DEF_GROUP_OBJ, and DEF_OTHER_OBJ ACEs.
* * fhandler_tty.cc (fhandler_pty_slave::read): Having no input is not anCorinna Vinschen2015-02-252-2/+15
| | | | error condition for tcflush.