]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
9 years agoBump minor DLL version to 1
Corinna Vinschen [Thu, 30 Apr 2015 15:53:15 +0000 (17:53 +0200)]
Bump minor DLL version to 1

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoUse all ACEs from original ACL on Samba share
Corinna Vinschen [Thu, 30 Apr 2015 10:08:20 +0000 (12:08 +0200)]
Use all ACEs from original ACL on Samba share

* security.cc (convert_samba_sd): Fix accidental dropping of all
non-Unix User, non-Unix Group accounts.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix more typos in ntsec.xml
Yaakov Selkowitz [Wed, 29 Apr 2015 16:20:21 +0000 (11:20 -0500)]
Fix more typos in ntsec.xml

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
9 years agoImprove check for int32_t being long or int
Corinna Vinschen [Wed, 29 Apr 2015 11:06:45 +0000 (13:06 +0200)]
Improve check for int32_t being long or int

        * libc/include/sys/config.h: Move evaluation of _UINTPTR_EQ_ULONG and
        _UINTPTR_EQ_ULONGLONG from here...
        * libc/include/sys/_intsup.h: ...to here.  Rename to _INTPTR_EQ_LONG
        and _INTPTR_EQ_LONGLONG to refer to signed base type.  Add test for
        base type of int32_t and set _INT32_EQ_LONG accordingly.
        * libc/include/stdint.h: Change checks for __have_long32 to checks
        for _INT32_EQ_LONG.
        * libc/include/inttypes.h: Ditto.  Accommodate aforementioned name
        change.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoDefine __s64 and __u64
Corinna Vinschen [Mon, 27 Apr 2015 12:39:57 +0000 (14:39 +0200)]
Define __s64 and __u64

        * include/asm/types.h: Add __s64 and __u64 types.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agocygserver.xml: Add new section. How to install Cygserver.
Mike DePaulo [Mon, 27 Apr 2015 08:46:18 +0000 (04:46 -0400)]
cygserver.xml: Add new section. How to install Cygserver.

* cygserver.xml (install-cygserver): Add new section. How to install
Cygserver.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoDocument previous unlink patch newlib-snapshot-20150423
Corinna Vinschen [Thu, 23 Apr 2015 13:22:37 +0000 (15:22 +0200)]
Document previous unlink patch

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoHandle unlinking in-use files on virtual drives
Corinna Vinschen [Thu, 23 Apr 2015 13:02:32 +0000 (15:02 +0200)]
Handle unlinking in-use files on virtual drives

        * path.cc (path_conv::set_nt_native_path): New function.
        * path.h (path_conv::set_nt_native_path): Add prototype.
        * syscall.cc (try_to_bin): Handle moving files to the recycler
        accessed via a local virtual drive (subst).  Fix a problem renaming
        the file to the unique replacement name on Samba.  Align comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix closing too many handles in pty fchown/fchmod
Corinna Vinschen [Wed, 22 Apr 2015 11:26:37 +0000 (13:26 +0200)]
Fix closing too many handles in pty fchown/fchmod

* fhandler_tty.cc (fhandler_pty_slave::fch_close_handles): Don't close
handles not opened via fhandler_pty_slave::fch_open_handles.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix OPOST for non-Cygwin pty slaves
Takashi Yano [Wed, 22 Apr 2015 11:22:59 +0000 (13:22 +0200)]
Fix OPOST for non-Cygwin pty slaves

* fhandler.h (class fhandler_base): Add virtual function
get_io_handle_cyg() to get handle from which OPOST-processed output is
read on PTY master.
(class fhandler_pty_slave): Add variable output_handle_cyg to store a
handle to which OPOST-processed output is written. Add two functions,
i.e., set_output_handle_cyg() and get_output_handle_cyg(), regarding
variable output_handle_cyg. Now, output_handle is used only by native
windows program. The data before OPOST-processing is written to
output_handle and OPOST-processing is applied in the master-side. For a
cygwin process, OPOST-processing is applied in the slave-side, and the
data after OPOST-processing is written to output_handle_cyg.
(class fhandler_pty_master): Add two variables, i.e., io_handle_cyg and
to_master_cyg, to store handles of a pipe through which OPOST-processed
output passes. Add pty_master_fwd_thread and function
pty_master_fwd_thread() for a thread which applies OPOST-processing
and forwards data from io_handle to to_master_cyg. Add function
get_io_handle_cyg() regarding variable io_handle_cyg. Now, the pipe
between io_handle and to_master are used only by native windows program
for applying OPOST-processing in the master-side. For a cygwin process,
the pipe between io_handle_cyg and to_master_cyg is used for passing
through the data which is applied OPOST-processing in the slave-side.
* fhandler_tty.cc (struct pipe_reply): Add member to_master_cyg.
(fhandler_pty_master::process_slave_output): Read slave output from
io_handle_cyg rather than io_handle.
(fhandler_pty_slave::fhandler_pty_salve): Initialize output_handle_cyg.
(fhandler_pty_slave::open): Set output_handle_cyg by duplicating handle
to_master_cyg on PTY master.
(fhandler_pty_slave::close): Close handle output_handle_cyg.
(fhandler_pty_slave::write): Write data to output_handle_cyg rather
than output_handle.
(fhandler_pty_slave::fch_close_handles): Close handle output_handle_cyg.
(fhandler_pty_master::fhandler_pty_master): Initialize io_handle_cyg,
to_master_cyg and master_fwd_thread.
(fhandler_pty_master::cleanup): Clean up to_master_cyg as well.
(fhandler_pty_master::close): Print to_master_cyg as well in debug
message. Terminate master forwarding thread. Close handles
to_master_cyg and io_handle_cyg.
(fhandler_pty_master::ioctl): Use io_handle_cyg rather than to_master.
(fhandler_pty_master::pty_master_thread): Add code for duplicating
handle to_master_cyg.
(fhandler_pty_master::pty_master_fwd_thread): New function for a thread
to forward OPOST-processed data from io_handle to to_master_cyg.  This
thread applies OPOST-processing to the output of native windows program.
(::pty_master_fwd_thread): Ditto.
(fhandler_pty_master::setup): Create a new pipe to pass thruegh OPOST-
processed output. Create new thread to forward data from io_handle to
to_master_cyg. Set handle to_master_cyg to tty. Print io_handle_cyg as
well in debug message. Close handles io_handle_cyg and to_master_cyg in
case of error.
(fhandler_pty_master::fixup_after_fork): Set handle to_master_cyg to
tty. Copy handle to_master_cyg from arch->to_master_cyg.
(fhandler_pty_master::fixup_after_exec): Clean up to_master_cyg.
* select.cc: Check handle returned by get_io_handle_cyg() rather than
get_handle().
* tty.h (class tty): Add variable _to_master_cyg to store a handle to
which OPOST-processed data is written. Add two functions,
to_master_cyg() and set_to_master_cyg(), regarding _to_master_cyg.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoUndef basename before defining function.
Corinna Vinschen [Wed, 22 Apr 2015 08:55:26 +0000 (10:55 +0200)]
Undef basename before defining function.

        * path.cc (basename): Undefine basename before defining function to
        avoid type collision with prototype in string.h.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix basename prototype collision string.h vs libgen.h
Corinna Vinschen [Wed, 22 Apr 2015 08:05:16 +0000 (10:05 +0200)]
Fix basename prototype collision string.h vs libgen.h

        * libc/include/libgen.h (basename): Drop defining _BASENAME_DEFINED.
        Always define macro basename.  Add comment to explain why.
        * libc/include/string.h (basename): Check for basename instead of
        _BASENAME_DEFINED.  Drop __GNUC__ branch, always use basename macro.
        Change comment to explain why.  Add nonnull function attribute.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agolibgloss: mcore: add custom syscall header
Mike Frysinger [Tue, 21 Apr 2015 05:36:00 +0000 (01:36 -0400)]
libgloss: mcore: add custom syscall header

The mcore simulator has a unique set of syscall numbers.  Add a header
that matches reality since the common one doesn't.

9 years agolibgloss: arm: fix copy & paste in syscall.h
Mike Frysinger [Tue, 21 Apr 2015 05:34:24 +0000 (01:34 -0400)]
libgloss: arm: fix copy & paste in syscall.h

This header was clearly copied from the common syscall.h and customized,
but the header comment is no longer accurate -- this isn't the general
file anymore.

9 years agoRemove Cygwin's libgen.h
Corinna Vinschen [Tue, 21 Apr 2015 12:51:30 +0000 (14:51 +0200)]
Remove Cygwin's libgen.h

* include/libgen.h: Remove in favor of newlib version.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAsia/Calcutta -> Asia/Kolkata (not on unicode.org)
Corinna Vinschen [Tue, 21 Apr 2015 12:29:01 +0000 (14:29 +0200)]
Asia/Calcutta -> Asia/Kolkata (not on unicode.org)

        * tzmap-from-unicode.org: Convert Calcutta to Kolkata.
        * tzmap.h: Regenerate.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoApply umask on "standard" Cygwin ACL
Corinna Vinschen [Tue, 21 Apr 2015 09:49:38 +0000 (11:49 +0200)]
Apply umask on "standard" Cygwin ACL

        * sec_acl.cc (get_posix_access): Check for Cygwin "standard" ACL.
        Apply umask, if so.  Align comments.
        * security.cc (set_created_file_access): Fix permission masking by
        incoming requested file mode.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoApply mask execute bit for SYSTEM and Admins group.
Corinna Vinschen [Mon, 20 Apr 2015 10:06:05 +0000 (12:06 +0200)]
Apply mask execute bit for SYSTEM and Admins group.

        * sec_acl.cc (set_posix_access): Apply mask only in terms of execute bit
        for SYSTEM and Admins group.

        * getfacl.c (main): Special-case SYSTEM and Admins group.  Add comments.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix inconsistencies in docs regarding fstab and executable file detection
David Macek [Sat, 18 Apr 2015 21:25:15 +0000 (23:25 +0200)]
Fix inconsistencies in docs regarding fstab and executable file detection

The inline list of mount options seemed redundant, so the paragraph now points
to the list below it.

List of executable extensions updated according to fhandler_disk_file.cc. List
of executable magic numbers updated according to path.h (has_exec_chars).

* pathnames.xml: Fix inconsistencies in docs regarding fstab and
executable file detection

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agosec_acl.cc (set_posix_access): Fix typo in comment
Corinna Vinschen [Mon, 20 Apr 2015 08:12:24 +0000 (10:12 +0200)]
sec_acl.cc (set_posix_access): Fix typo in comment

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoTry to avoid creating dangerous DENY ACEs
Corinna Vinschen [Sat, 18 Apr 2015 15:07:08 +0000 (17:07 +0200)]
Try to avoid creating dangerous DENY ACEs

        * sec_acl.cc (set_posix_access): Don't create DENY ACEs for USER and
        GROUP entries if they are the same as USER_OBJ or GROUP_OBJ.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoSupport acl(2) method for reading pty ACLs, fix pty chown
Corinna Vinschen [Fri, 17 Apr 2015 17:54:59 +0000 (19:54 +0200)]
Support acl(2) method for reading pty ACLs, fix pty chown

        * fhandler.h (fhandler_pty_slave::facl): Add prototype.
        * fhandler_tty.cc (fhandler_pty_slave::facl): New method.
        (fhandler_pty_slave::fchown): Fix uid/gid handling.
        * sec_acl.cc (set_posix_access): Drop superfluous class_idx variable.
        Simplify and move around code in a few places.  To improve ACL
        readability, add r/w permissions to Admins ACE appended to pty ACL.
        Add comment to explain Windows ACE Mask filtering being in the way of
        creating a real CLASS_OBJ.
        (get_posix_access): Fake CLASS_OBJ for ptys.  Explain why.
        * security.cc (get_object_attribute): Add S_IFCHR flag to attributes
        when calling get_posix_access.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix broken SID in passwd/group entry for unkown account
Corinna Vinschen [Fri, 17 Apr 2015 09:57:57 +0000 (11:57 +0200)]
Fix broken SID in passwd/group entry for unkown account

        * uinfo.cc (pwdgrp::fetch_account_from_windows): Always revert SID
        subauth count after checking for known domain.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix broken PSID problem on cygheap in account handling
Corinna Vinschen [Fri, 17 Apr 2015 09:56:15 +0000 (11:56 +0200)]
Fix broken PSID problem on cygheap in account handling

        * pwdgrp.h: Add comment to explain below change.
        (struct pg_pwd): Convert sid member to BYTE array.
        (struct pg_grp): Ditto.
        * grp.cc (pwdgrp::parse_group): Accommodate above change.
        * passwd.cc (pwdgrp::parse_passwd): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix merging group perms into owner perms in owner == group case
Corinna Vinschen [Thu, 16 Apr 2015 20:27:49 +0000 (22:27 +0200)]
Fix merging group perms into owner perms in owner == group case

        * sec_acl.cc (set_posix_access): Move merging group perms into owner
        perms in case of owner == group after mask has been computed.  Take
        mask into account when doing so to avoid unnecessary ACCESS_DENIED_ACE.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix setting saw_group_obj flag
Corinna Vinschen [Thu, 16 Apr 2015 20:25:23 +0000 (22:25 +0200)]
Fix setting saw_group_obj flag

        * sec_acl.cc (get_posix_access): Only set saw_group_obj flag if we saw
        the ACCESS_ALLOWED_ACE.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoSet GROUP_OBJ and CLASS_OBJ perms to new group perms
Corinna Vinschen [Thu, 16 Apr 2015 20:23:46 +0000 (22:23 +0200)]
Set GROUP_OBJ and CLASS_OBJ perms to new group perms

        * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Deliberatly
        set GROUP_OBJ and CLASS_OBJ perms to new group perms.  Add comment
        to explain why.
        * security.cc (set_created_file_access): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoBetter workaround owner/group SIDs being NULL
Corinna Vinschen [Thu, 16 Apr 2015 20:19:57 +0000 (22:19 +0200)]
Better workaround owner/group SIDs being NULL

        * sec_acl.cc (set_posix_access): Replace previous patch.  Return
        EINVAL if uid and/or guid is invalid and not backed by an actual
        Windows account.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoWorkaround owner/group SIDs being NULL
Corinna Vinschen [Thu, 16 Apr 2015 16:29:16 +0000 (18:29 +0200)]
Workaround owner/group SIDs being NULL

* sec_acl.cc (set_posix_access): Workaround owner/group SIDs being NULL.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAdd mask recomputation as on Linux
Corinna Vinschen [Thu, 16 Apr 2015 15:57:53 +0000 (17:57 +0200)]
Add mask recomputation as on Linux

        * setfacl.c: Align more to Linux tool.
        (delacl): New function to delete acl entries only.
        (modacl): Drop delete functionality.  Add handling of recomputing the
        mask and default mask values.
        (delallacl): Rename from delacl.
        (setfacl): Call delacl in Delete case.  Call delallacl in DeleteAll
        and DeleteDef case.
        (usage): Accommodate new options.  Rearrange and rephrase slightly.
        (longopts): Emit 'x' in --delete case.  Add --no-mask and --mask
        options.
        (opts): Add -x and -n options.
        (main): Handle -d and -x the same.  Handle -n and --mask options.
        Drop handling for -r option.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAdd output of effective rights to getfacl
Corinna Vinschen [Thu, 16 Apr 2015 11:31:16 +0000 (13:31 +0200)]
Add output of effective rights to getfacl

        * getfacl.c (usage): Align more closely to Linux version.  Add new
        options -c, -e, -E.  Change formatting to accommodate longer options.
        (longopts): Rename --noname to --numeric.  Keep --noname for backward
        compatibility.  Add --omit-header, --all-effective and --no-effective
        options.
        (opts): Add -c, -e and -E option.
        (main): Handle new -c, -e, and -E options.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoHandle files with owner == group.
Corinna Vinschen [Wed, 15 Apr 2015 15:20:14 +0000 (17:20 +0200)]
Handle files with owner == group.

* sec_acl.cc (set_posix_access): Handle files with owner == group.
Rephrase switch statement checking against unfiltered a_type value.
(get_posix_access): Handle files with owner == group.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix typo in comment
Corinna Vinschen [Tue, 14 Apr 2015 14:57:23 +0000 (16:57 +0200)]
Fix typo in comment

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix thinko in creating the {DEF_}CLASS_OBJ value on old-style ACLs
Corinna Vinschen [Tue, 14 Apr 2015 08:42:29 +0000 (10:42 +0200)]
Fix thinko in creating the {DEF_}CLASS_OBJ value on old-style ACLs

* sec_acl.cc (get_posix_access): Don't use GROUP_OBJ access to fix up
CLASS_OBJ mask on old-style ACLs.  Fix a comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix pty permssion handling in new permission handling code
Corinna Vinschen [Sun, 12 Apr 2015 18:26:27 +0000 (20:26 +0200)]
Fix pty permssion handling in new permission handling code

        * sec_acl.cc (set_posix_access): Always make sure Admins have
        WRITE_DAC and WRITE_OWNER permissions.
        * security.h (create_object_sd_from_attribute): Drop handle parameter
        from prototype.
        * security.cc (create_object_sd_from_attribute): Drop handle parameter.
        Just create the standard POSIXy security descriptor.
        (set_object_attribute): Accommodate dropped paramter in call to
        create_object_sd_from_attribute.
        * fhandler_tty.cc: Ditto, throughout.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoDon't rely on size argument in shmget call
Corinna Vinschen [Sun, 12 Apr 2015 12:05:12 +0000 (14:05 +0200)]
Don't rely on size argument in shmget call

* shm.cc (shmget): Fetch segment size from server rather than using
size argument to accommodate existing segments.  Add comment to explain
why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix typo in new fchmod implementation
Corinna Vinschen [Sat, 11 Apr 2015 14:03:18 +0000 (16:03 +0200)]
Fix typo in new fchmod implementation

* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix typo in
mask computation.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoBump Cygwin version to 2.0.0.
Corinna Vinschen [Fri, 10 Apr 2015 18:41:00 +0000 (20:41 +0200)]
Bump Cygwin version to 2.0.0.

* include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2000.
(CYGWIN_VERSION_DLL_MINOR): Set to 0.

* new-features.xml (ov-new2.0): Rename from ov-new1.7.36 and change
version number to 2.0.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoSet mcontext.cr2 to the faulting address
Jon TURNEY [Sat, 4 Apr 2015 15:12:27 +0000 (16:12 +0100)]
Set mcontext.cr2 to the faulting address

* exceptions.cc (call_signal_handler): Set mcontext.cr2 to the
faulting address.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoOnly construct ucontext for SA_SIGINFO signal handlers
Jon TURNEY [Thu, 2 Apr 2015 17:15:07 +0000 (18:15 +0100)]
Only construct ucontext for SA_SIGINFO signal handlers

* exceptions.cc (call_signal_handler): Only bother to construct
the ucontext for signal handlers with SA_SIGINFO set.  Set
mcontext.oldmask.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoInitialize context before RtlContextCapture
Jon TURNEY [Sat, 4 Apr 2015 15:19:31 +0000 (16:19 +0100)]
Initialize context before RtlContextCapture

* exceptions.cc (call_signal_handler): Zero initialize context and set
context flags, as RlCaptureContext doesn't.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoFirst cut of full implementation of new permission handling
Corinna Vinschen [Fri, 10 Apr 2015 09:25:40 +0000 (11:25 +0200)]
First cut of full implementation of new permission handling

        * fhandler.cc (fhandler_base::open_with_arch): Call open with mode
        not umasked.
        (fhandler_base::open): Explicitely umask mode on NFS here.  Call new
        set_created_file_access rather than set_file_attribute.
        * fhandler_disk_file.cc (fhandler_disk_file::fchmod): Reimplement
        setting permissions on filesystems supporting ACLs using the new
        set_posix_access call.
        (fhandler_disk_file::fchown): Ditto.
        (fhandler_disk_file::mkdir): Call new set_created_file_access rather
        than set_file_attribute.
        * fhandler_socket.cc (fhandler_socket::bind): Don't umask here.  Add
        WRITE_OWNER access to allow writing group in case of SGID bit set.
        Call new set_created_file_access rather than set_file_attribute.
        * path.cc (symlink_worker): Call new set_created_file_access rather
        than set_file_attribute.
        * sec_acl.cc (searchace): Un-staticize.
        (set_posix_access): New, complementary functionality to
        get_posix_access.
        (setacl): Implement in terms of get_posix_access/set_posix_access.
        (get_posix_access): Add handling for just created files requiring
        their first Cygwin ACL.  Fix new_style recognition.  Handle SGID
        bit.  For old-style ACLs, ignore SYSTEM and Administrators when
        computing the {DEF_}CLASS_OBJ perms.
        * security.cc (get_file_sd): Revamp comment.  Change and (hopefully)
        speed up inheritance processing for just created files.
        (alloc_sd): Remove.
        (set_security_attribute): Call set_posix_access instead of alloc_sd.
        (get_object_attribute): Fix return value.
        (create_object_sd_from_attribute): Call set_posix_access instead of
        alloc_sd.
        (set_file_attribute): Remove.
        (set_created_file_access): New function implemented in terms of
        get_posix_access/set_posix_access.
        * security.h (set_file_attribute): Remove prototype.
        (set_created_file_access): Add prototype.
        (searchace): Ditto.
        (set_posix_access): Ditto.
        * syscalls.cc (open): Call open_with_arch with mode not umasked.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoCall open_null to open fake handle
Corinna Vinschen [Thu, 9 Apr 2015 19:49:36 +0000 (21:49 +0200)]
Call open_null to open fake handle

* fhandler_dsp.cc (fhandler_dev_dsp::open): Call open_null.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFor the RX port, avoid using string instructions when __RX_DISALLOW_STRING_INSNS__...
Nick Clifton [Thu, 9 Apr 2015 08:20:00 +0000 (09:20 +0100)]
For the RX port, avoid using string instructions when __RX_DISALLOW_STRING_INSNS__ is defined.

* rx/crt0.S (_start): If string instructions are not allowed,
avoid using SMOVF.

* libc/machine/rx/memchr.S: Add non-string insn using version.
* libc/machine/rx/memcpy.S: Likewise.
* libc/machine/rx/memmove.S: Likewise.
* libc/machine/rx/mempcpy.S: Likewise.
* libc/machine/rx/strcat.S: Likewise.
* libc/machine/rx/strcmp.S: Likewise.
* libc/machine/rx/strcpy.S: Likewise.
* libc/machine/rx/strlen.S: Likewise.
* libc/machine/rx/strncat.S: Likewise.
* libc/machine/rx/strncmp.S: Likewise.
* libc/machine/rx/strncpy.S: Likewise.

9 years agoAdd .note and DWARF3 sections to RX linker scripts.
Nick Clifton [Wed, 8 Apr 2015 09:04:12 +0000 (10:04 +0100)]
Add .note and DWARF3 sections to RX linker scripts.

* rx/rx.ld: Add .note and DWARF3 sections.
* rx/rx-sim.ld: Likewise.

9 years agoIntroduce sidfromuid and sidfromgid
Corinna Vinschen [Wed, 8 Apr 2015 09:00:08 +0000 (11:00 +0200)]
Introduce sidfromuid and sidfromgid

* pwdgrp.h (sidfromuid): New inline function.
(sidfromgid): Ditto.
* fhandler_disk_file.cc (fhandler_disk_file::fchown): Use sidfromuid.
* quotactl.cc (quotactl): Use sidfromuid and sidfromgid.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoUse NULL dey ACE rather than special Cygwin ACE
Corinna Vinschen [Wed, 8 Apr 2015 08:12:27 +0000 (10:12 +0200)]
Use NULL dey ACE rather than special Cygwin ACE

* sec_acl.cc: Change preceeding comment explaining new-style ACLs.
Describe how to generate deny ACEs in more detail.  Accommodate the
fact that a NULL deny ACE is used for {DEF_}CLASS_OBJ, rather than
a special Cygwin ACE.  Improve further comments.
(CYG_ACE_NEW_STYLE): Define.
(get_posix_access): Change from Cygwin ACE to NULL deny ACE.  Fix
CLASS_OBJ handling to generate CLASS_OBJ and DEF_CLASS_OBJ from a single
NULL deny ACE if the inheritance flags say so.
* sec_helper.cc (well_known_cygwin_sid): Remove.
* security.h (well_known_cygwin_sid): Drop declaration.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoRemove __acl16 from official header
Corinna Vinschen [Wed, 8 Apr 2015 08:01:59 +0000 (10:01 +0200)]
Remove __acl16 from official header

* include/cyggwin/acl.h (struct __acl16): Move from here...
* sec_acl.cc: ...to here.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAlways include the .csstart section in RL78 executables.
Nick Clifton [Tue, 7 Apr 2015 13:51:44 +0000 (14:51 +0100)]
Always include the .csstart section in RL78 executables.

* rl78/rl78.ld (.csstart): Add a KEEP directive.
* rl78/rl78-sim.ld (.csstart): Add a KEEP directive.

9 years agoRemove unused 32/64 bit tty code
Corinna Vinschen [Tue, 7 Apr 2015 10:16:07 +0000 (12:16 +0200)]
Remove unused 32/64 bit tty code

* tty.h (class tty): Remove unused 32/64 bit interoperability
considerations.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoRaise # of ptys to 128.
Corinna Vinschen [Tue, 7 Apr 2015 10:11:52 +0000 (12:11 +0200)]
Raise # of ptys to 128.

* tty.h (NTTYS): Raise to 128.
* devices.in: Change pty, ptym, and cons expressions accordingly.
* devices.cc: Regenerate.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoCompile exceptions.cc with -fno-omit-frame-pointer on x86
Jon TURNEY [Sat, 4 Apr 2015 22:31:03 +0000 (23:31 +0100)]
Compile exceptions.cc with -fno-omit-frame-pointer on x86

Selectively using -fomit-frame-pointer when -O is used doesn't make sense
anymore, apparently since gcc 4.6, -O implies -fomit-frame-pointer.

exceptions.cc must be compiled with -fno-omit-frame-pointer on x86, as it uses
RtlCaptureContext, which requires a frame pointer.

* Makefile.in : Remove setting -fomit-frame-pointer for compiling
various files, it is already the default.  Set
-fno-omit-frame-pointer for exceptions.cc on x86.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoCygwin hangs up if several keys are typed during outputting a lot of texts.
Takashi Yano [Fri, 3 Apr 2015 04:07:35 +0000 (13:07 +0900)]
Cygwin hangs up if several keys are typed during outputting a lot of texts.

* fhandler_tty.cc (fhandler_pty_slave::read): Change calculation of
"readlen" not to use "bytes_in_pipe" value directly.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAdd FAQ entry on how Cygwin counters install and update MITM attacks
David A. Wheeler [Thu, 2 Apr 2015 18:04:55 +0000 (14:04 -0400)]
Add FAQ entry on how Cygwin counters install and update MITM attacks

* faq-setup.xml: Document how Cygwin secures installation and
update against man-in-the-middle (MITM) attacks.  Note that
setup embeds a public key to check the signature of setup.ini,
and that setup.ini includes SHA-512 cryptographic hashes.

Signed-off-by: David A. Wheeler <dwheeler@dwheeler.com>
9 years agoTry to make sure struct _mcontext is 16-byte aligned
Jon TURNEY [Thu, 2 Apr 2015 17:05:32 +0000 (18:05 +0100)]
Try to make sure struct _mcontext is 16-byte aligned

On x86_64, RtlCaptureContext() uses fxsave to save FPU/MMX/SSE state.

fxsave requires that the destination address is 16-byte aligned, or it will
fault.

CONTEXT is already annotated __attribute__ ((aligned (16))), do the same with
struct _mcontext.

Rearrange ucontext_t so that it's struct _mcontext element is also correctly
aligned.

* include/cygwin/signal.h (struct __mcontext): 16-byte align.
* include/sys/ucontext.h (ucontext_t): Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoRename index variable from i to idx.
Corinna Vinschen [Thu, 2 Apr 2015 11:48:55 +0000 (13:48 +0200)]
Rename index variable from i to idx.

* sec_acl.cc (CYG_ACE_ISBITS_TO_WIN): Fix typo.
(get_posix_access): Rename index variable from i to idx.  Define only
once at top level.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoDrop unused parameter from add_access_*_ace
Corinna Vinschen [Thu, 2 Apr 2015 11:46:04 +0000 (13:46 +0200)]
Drop unused parameter from add_access_*_ace

* security.cc (add_access_allowed_ace): Drop unused parameter "offset".
Accommodate throughout.
(add_access_denied_ace): Ditto.
* sec_acl.cc: Accommodate above change throughout.
* security.h (add_access_allowed_ace): Adjust prototype to above change.
(add_access_denied_ace): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAdd parens around MIN/MAX values in stdint.h.
Corinna Vinschen [Wed, 1 Apr 2015 18:40:43 +0000 (20:40 +0200)]
Add parens around MIN/MAX values in stdint.h.

* libc/include/stdint.h: Throughout add parens around MIN/MAX values.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoDrop local stdint.h and inttypes.h in favor of newlib files
Corinna Vinschen [Wed, 1 Apr 2015 18:37:58 +0000 (20:37 +0200)]
Drop local stdint.h and inttypes.h in favor of newlib files

* include/cygwin/types.h: Include sys/_stdint.h rather than stdint.h.
* include/stdint.h: Drop in favor of newlib version.
* include/inttypes.h: Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAdd <sys/_stdint.h> for FreeBSD compatibility
Sebastian Huber [Wed, 1 Apr 2015 18:34:08 +0000 (20:34 +0200)]
Add <sys/_stdint.h> for FreeBSD compatibility

        * libc/include/sys/_stdint.h: New file.
        * libc/include/stdint.h (int8_t): Move to <sys/_stdint.h>.
        (uint8_t): Likewise.
        (int16_t): Likewise.
        (uint16_t): Likewise.
        (int32_t): Likewise.
        (uint32_t): Likewise.
        (int64_t): Likewise.
        (uint64_t): Likewise.
        (intptr_t): Likewise.
        (uintptr_t): Likewise.
        * libc/include/sys/types.h: Include <sys/_stdint.h>.
        * libc/sys/rtems/machine/_types.h: Remove <stdint.h> include.
        * libc/sys/time.h>: Replace __uint32_t with uint32_t and
        __uint64_t with uint64_t.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoProvide ucontext to signal handlers
Jon TURNEY [Mon, 30 Mar 2015 19:31:13 +0000 (20:31 +0100)]
Provide ucontext to signal handlers

Add ucontext.h header, defining ucontext_t and mcontext_t types.

Provide sigaction sighandlers with a ucontext_t parameter, containing stack and
context information.

* include/sys/ucontext.h : New header.
* include/ucontext.h : Ditto.
* exceptions.cc (call_signal_handler): Provide ucontext_t
parameter to signal handler function.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoMake stack_t typedef generally available
Jon TURNEY [Tue, 31 Mar 2015 23:12:07 +0000 (00:12 +0100)]
Make stack_t typedef generally available

* libc/include/sys/signal.h (stack_t): Make typedef generally
available.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoAdd cygwin_internal() operation to retrieve the EXCEPTION_RECORD from a siginfo_t *
Jon TURNEY [Mon, 30 Mar 2015 19:56:03 +0000 (20:56 +0100)]
Add cygwin_internal() operation to retrieve the EXCEPTION_RECORD from a siginfo_t *

* external.cc (cygwin_internal): Add operation to retrieve a copy
of the EXCEPTION_RECORD from a siginfo_t *.
* include/sys/cygwin.h (cygwin_getinfo_types): Ditto.
* exception.h (cygwin_exception): Add exception_record accessor.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoRename struct ucontext to struct __mcontext
Jon TURNEY [Mon, 30 Mar 2015 17:05:51 +0000 (18:05 +0100)]
Rename struct ucontext to struct __mcontext

* include/cygwin/signal.h : Rename struct ucontext to struct
__mcontext.  Fix layout differences from the Win32 API CONTEXT
type.  Remove unused member _internal.  Rename member which
corresponds to ContextFlags.  Add cr2 member.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoFix UTF-16 surrogate handling in wctomb and friends.
Corinna Vinschen [Wed, 1 Apr 2015 13:31:18 +0000 (15:31 +0200)]
Fix UTF-16 surrogate handling in wctomb and friends.

* libc/stdlib/wctomb_r.c (__utf8_wctomb): Fix check for handling a
lone high surrogate.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAvoid potential crash at startup or in getgroups(2).
Corinna Vinschen [Wed, 1 Apr 2015 11:15:18 +0000 (13:15 +0200)]
Avoid potential crash at startup or in getgroups(2).

* grp.cc (internal_getgroups): Handle negative domain index to avoid
crashes.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix documentation of cygwin_internal()'s return type.
Jon TURNEY [Tue, 31 Mar 2015 17:32:41 +0000 (18:32 +0100)]
Fix documentation of cygwin_internal()'s return type.

* misc-funcs.xml (cygwin_internal): Correct return type.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoFix buffer size error handling in gethostname.
Renato Silva [Tue, 31 Mar 2015 19:18:46 +0000 (21:18 +0200)]
Fix buffer size error handling in gethostname.

* net.cc (cygwin_gethostname): Fix buffer size error handling.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAdd release msg
Corinna Vinschen [Tue, 31 Mar 2015 11:13:06 +0000 (13:13 +0200)]
Add release msg

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoDocument GNU basename.
Corinna Vinschen [Tue, 31 Mar 2015 11:12:24 +0000 (13:12 +0200)]
Document GNU basename.

* new-features.xml (ov-new1.7.36): Add new section.  Document GNU
basename.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoDon't allow fully qualified Windows account names.
Corinna Vinschen [Tue, 31 Mar 2015 09:54:34 +0000 (11:54 +0200)]
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>
9 years agoAvoid excessive locking and calling tzset in time functions.
Corinna Vinschen [Tue, 31 Mar 2015 09:22:50 +0000 (11:22 +0200)]
Avoid excessive locking and calling tzset in time functions.

* libc/time/lcltime_r.c (localtime_r): Call _tzset_unlocked inside
TZ lock.
* libc/time/mktime.c (mktime):  Ditto.
* libc/time/strftime.c (strftime, wcsftime): Ditto.  Guard against
calling _tzset_unlocked more than once (baring recursion).

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAdd _tzset_unlocked and _tzset_unlocked_r
Corinna Vinschen [Tue, 31 Mar 2015 09:14:22 +0000 (11:14 +0200)]
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>
9 years agoMove tzset calls to time functions.
Craig Howland [Tue, 31 Mar 2015 08:26:49 +0000 (10:26 +0200)]
Move tzset calls to time functions.

* libc/stdlib/setenv_r.c (_setenv_r): Remove tzset() call for TZ
definition.
* libc/time/lcltime_r.c (localtime_r): Add tzset() call
* libc/time/mktime.c (mktime):  Ditto.
* libc/time/strftime.c (strftime, wcsftime): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agostrftime: use tzname if TM_ZONE is NULL
Yaakov Selkowitz [Wed, 25 Mar 2015 21:26:07 +0000 (16:26 -0500)]
strftime: use tzname if TM_ZONE is NULL

This avoids a strlen(NULL) crash a few lines later.

* libc/time/strftime.c (strftime) <%Z>: Initialize tznam to NULL.
Use _tzname as fallback if TM_ZONE is NULL.

9 years agocygwin: add GNU basename(3)
Yaakov Selkowitz [Thu, 26 Mar 2015 05:20:15 +0000 (00:20 -0500)]
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.

9 years agostring: add GNU basename(3)
Yaakov Selkowitz [Wed, 25 Mar 2015 23:19:38 +0000 (18:19 -0500)]
string: add GNU basename(3)

* libc/include/libgen.h (_BASENAME_DEFINED): Define.
* libc/include/string.h (basename): Declare.
* libc/string/Makefile.am (ELIX_4_SOURCES): Add gnu_basename.c.
* libc/string/Makefile.in: Regenerate.
* libc/string/gnu_basename.c: New file.

9 years agoTry best to handle user from domain not in trusted domain list.
Corinna Vinschen [Mon, 30 Mar 2015 16:05:06 +0000 (18:05 +0200)]
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>
9 years agoPrepare to rename/reuse struct ucontext.
Corinna Vinschen [Mon, 30 Mar 2015 14:53:52 +0000 (16:53 +0200)]
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>
9 years agoAdd CMIN and CTIME definitions
Corinna Vinschen [Wed, 25 Mar 2015 16:21:38 +0000 (17:21 +0100)]
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>
9 years agoBump tty.cc copyright date
Corinna Vinschen [Wed, 25 Mar 2015 16:16:52 +0000 (17:16 +0100)]
Bump tty.cc copyright date

9 years agoTIOCPKT mode of PTY is broken if ONLCR bit is cleared.
Takashi Yano [Wed, 25 Mar 2015 11:42:38 +0000 (20:42 +0900)]
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>
9 years agoImport <sys/tree.h> from FreeBSD
Sebastian Huber [Mon, 23 Mar 2015 20:08:08 +0000 (21:08 +0100)]
Import <sys/tree.h> from FreeBSD

* libc/include/sys/tree.h: New file.

9 years agoIgnore __STDC_{FORMAT,LIMIT,CONSTANT}_MACROS
Corinna Vinschen [Tue, 24 Mar 2015 09:42:45 +0000 (10:42 +0100)]
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>
9 years ago* newlib.hin: Remove _UINTPTR_EQ_ULONG and _UINTPTR_EQ_ULONGLONG. newlib-snapshot-20150323
Joel Sherrill [Mon, 23 Mar 2015 14:41:22 +0000 (09:41 -0500)]
* newlib.hin: Remove _UINTPTR_EQ_ULONG and _UINTPTR_EQ_ULONGLONG.

2013-03-23  Joel Sherrill <joel.sherrill@oarcorp.com>

* newlib.hin: Remove _UINTPTR_EQ_ULONG and _UINTPTR_EQ_ULONGLONG.

9 years agoChange from configure time to compile time probe for intptr_t definition.
Joel Sherrill [Wed, 18 Mar 2015 20:44:41 +0000 (15:44 -0500)]
Change from configure time to compile time probe for intptr_t definition.

2015-03-23  Joel Sherrill <joel.sherrill@oarcorp.com

* configure.in: Delete logic to determine _UINTPTR_EQ_ULONGLONG
and _UINTPTR_EQ_ULONG at configuration time.
*libc/include/sys/config.h: Add logic to determine
_UINTPTR_EQ_ULONGLONG and _UINTPTR_EQ_ULONG at compilation time.
* libc/include/inttypes.h: Add include of <sys/config.h>.
* configure: Regenerated.

9 years agoDrop cygwin/_types.h.
Corinna Vinschen [Mon, 23 Mar 2015 10:52:05 +0000 (11:52 +0100)]
Drop cygwin/_types.h.

* include/cygwin/_types.h: Drop unused file.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoHandle S_ISGID bit and multiple ACEs for owner
Corinna Vinschen [Thu, 19 Mar 2015 17:27:03 +0000 (18:27 +0100)]
Handle S_ISGID bit and multiple ACEs for owner

* sec_acl.cc (get_posix_access): Handle multiple ACEs for the
owner and primary group of the file.  Handle the default primary
group ACE as DEF_GROUP_OBJ entry if the directory has the S_ISGID bit
set.  Add comments.  Minor code rearrangements.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years ago Add ChangeLog entry for last patch to libc/include/sys/time.h.
Steve Ellcey [Thu, 19 Mar 2015 17:19:35 +0000 (10:19 -0700)]
Add ChangeLog entry for last patch to libc/include/sys/time.h.

9 years ago Replace uint32_t/uint64_t type usage with __uint32_t/__uint64_t.
Steve Ellcey [Thu, 19 Mar 2015 17:05:07 +0000 (10:05 -0700)]
Replace uint32_t/uint64_t type usage with __uint32_t/__uint64_t.

* libc/include/sys/time.h: Replace uint32_t and uint64_t
with __uint32_t and __uint64_t.

9 years agoPreliminary read side implementation of new permission handling.
Corinna Vinschen [Wed, 18 Mar 2015 16:49:12 +0000 (17:49 +0100)]
Preliminary read side implementation of new permission handling.

* 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>
9 years agoImplmenet faster getfrompw/getfromgr
Corinna Vinschen [Wed, 18 Mar 2015 16:15:27 +0000 (17:15 +0100)]
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>
9 years agoDrop unneeded passwd argument from security functions
Corinna Vinschen [Wed, 18 Mar 2015 15:54:19 +0000 (16:54 +0100)]
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>
9 years agoDrop unused timeoput paramter to internal_getlogin
Corinna Vinschen [Tue, 17 Mar 2015 14:42:59 +0000 (15:42 +0100)]
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>
9 years agoAdd *.swp (Vim swap files) to .gitignore
Corinna Vinschen [Tue, 17 Mar 2015 11:03:30 +0000 (12:03 +0100)]
Add *.swp (Vim swap files) to .gitignore

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAvoid name change if script is called via symlink from execvp et al.
Corinna Vinschen [Tue, 17 Mar 2015 10:40:12 +0000 (11:40 +0100)]
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>
9 years agoFix newlib texinfo source so 'info libc' and 'info libm' work
Jon TURNEY [Thu, 12 Mar 2015 17:22:23 +0000 (17:22 +0000)]
Fix newlib texinfo source so 'info libc' and 'info libm' work

If the newlib .info files are installed using install-info, 'info libc' and
'info libm' don't work.

This seems to be due to the formatting of the directory entry line not being
quite right, so fix that.

Also use @direntry texinfo command, rather than writing .info directory entry
literally.

Also use @dircategory texinfo command to place into 'Newlib' category, rather
than ending up in 'Miscellaneous'

newlib/ChangeLog:

2015-03-13  Jon TURNEY  <jon.turney@dronecode.org.uk>

* libc/libc.texinfo: Fix directory entry.
* libm/libm.texinfo: Ditto.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoFix winsup/doc to install into prefix
Jon TURNEY [Wed, 11 Mar 2015 14:06:03 +0000 (14:06 +0000)]
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>
9 years agoTeach stackinfo::walk() how to virtually unwind the tls sigstack
Jon TURNEY [Mon, 9 Mar 2015 21:55:29 +0000 (21:55 +0000)]
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>
9 years agoRemove now useless include/cygwin/sys_time.h
Corinna Vinschen [Fri, 13 Mar 2015 12:22:19 +0000 (13:22 +0100)]
Remove now useless include/cygwin/sys_time.h

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This page took 0.082163 seconds and 5 git commands to generate.