]> sourceware.org Git - newlib-cygwin.git/log
newlib-cygwin.git
8 years agoflock: Fix hang in object collision case cygwin-acl github/cygwin-acl
Corinna Vinschen [Thu, 12 Nov 2015 12:14:08 +0000 (13:14 +0100)]
flock: Fix hang in object collision case

* flock.cc (lockf_t::create_lock_obj): Correctly recreate lock object
attributes anew in each loop.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd comment to explain previous patch
Corinna Vinschen [Thu, 12 Nov 2015 10:52:02 +0000 (11:52 +0100)]
Add comment to explain previous patch

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix crash at process init on 64 bit XP/2003 under WOW64
Corinna Vinschen [Thu, 12 Nov 2015 10:48:30 +0000 (11:48 +0100)]
Fix crash at process init on 64 bit XP/2003 under WOW64

* init.cc (munge_threadfunc): Don't call NtQueryInformationThread with
ThreadQuerySetWin32StartAddress info class on XP 64 and Server 2003 64.
It crashes.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoget_posix_access: Skip merging permissions if user can't get more permissions
Corinna Vinschen [Tue, 10 Nov 2015 09:00:33 +0000 (10:00 +0100)]
get_posix_access: Skip merging permissions if user can't get more permissions

        * sec_acl.cc (get_posix_access): Skip merging permissions if current
        user has rwx permissions anywa, or if the sum of all group and other
        permissions is less than or equal to the user's permissions.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoget_posix_access: Fix testing owner in every merge loop only
Corinna Vinschen [Tue, 10 Nov 2015 08:57:53 +0000 (09:57 +0100)]
get_posix_access: Fix testing owner in every merge loop only

        * sec_acl.cc (get_posix_access): Call authz_get_user_attribute on
        current users, not on owner.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoBump major version
Corinna Vinschen [Mon, 9 Nov 2015 09:17:02 +0000 (10:17 +0100)]
Bump major version

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFake volume serial number on filesystems not providing it
Corinna Vinschen [Thu, 5 Nov 2015 17:34:34 +0000 (18:34 +0100)]
Fake volume serial number on filesystems not providing it

* mount.cc (fs_info::update): Fake a serial number on filesystems not
providing one.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAvoid deadlock in flock(2)
Corinna Vinschen [Thu, 5 Nov 2015 17:31:36 +0000 (18:31 +0100)]
Avoid deadlock in flock(2)

* fcntl.cc (fcntl64): Don't lock fd table when performing locking.
* flock.cc (flock): Ditto.
(lockf): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix iterating over pending signals if a signal doesn't have to be cleared
Corinna Vinschen [Thu, 5 Nov 2015 09:09:08 +0000 (10:09 +0100)]
Fix iterating over pending signals if a signal doesn't have to be cleared

* sigproc.cc (pending_signals::clear): Yet another fix to fix the fix.
Actually iterate over the list of pending signals even if there's a
signal which doesn't have to be cleared.  Other than that, revert loop
to it's former self as a while loop.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAccommodate trailing NUL in PrlSF filesystem name.
Corinna Vinschen [Wed, 4 Nov 2015 13:47:25 +0000 (14:47 +0100)]
Accommodate trailing NUL in PrlSF filesystem name.

* globals.cc (ro_u_prlfs): Add trailing NUL.  Explain why.
* mount.cc (fs_info::update): Add a comment to explain PrlSF.
* path.h (path_conv::fs_is_prlfs): Add for symmetry.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd missing release message for 68b4238f4a1276a1f6f18430580b62dfa0420ffd
Corinna Vinschen [Wed, 4 Nov 2015 09:09:12 +0000 (10:09 +0100)]
Add missing release message for 68b4238f4a1276a1f6f18430580b62dfa0420ffd

8 years agoFix potential endless loop in pending_signals::clear
Corinna Vinschen [Tue, 3 Nov 2015 17:25:23 +0000 (18:25 +0100)]
Fix potential endless loop in pending_signals::clear

* sigproc.cc (pending_signals::clear): Fix previous fix resulting in
yet another endless loop.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoDefine MAX_IPOPTLEN
Corinna Vinschen [Mon, 2 Nov 2015 14:42:30 +0000 (15:42 +0100)]
Define MAX_IPOPTLEN

* include/netinet/ip.h (MAX_IPOPTLEN): Define.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix incorrect implementation to clear per-thread pending signals
Corinna Vinschen [Mon, 2 Nov 2015 12:53:25 +0000 (13:53 +0100)]
Fix incorrect implementation to clear per-thread pending signals

* sigproc.cc (class pending_signals): Drop sigproc_init friendship.
(pending_signals::clear): Fix implementation to avoid subsequent
endless loop in wait_sig.  Improve comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd support for Parallels Desktop FS (prlfs)
Corinna Vinschen [Mon, 2 Nov 2015 11:08:25 +0000 (12:08 +0100)]
Add support for Parallels Desktop FS (prlfs)

* mount.h (enum fs_info_type): Add prlfs (Parallels Desktop FS).
(class fs_info): Add has_broken_fnoi flag.  Implement prlfs FS flag.
* mount.cc (fs_info::update): Handle PrlFS.  Fill new has_broken_fnoi
flag with life.
(fs_names): Add prlfs.
* globals.cc (ro_u_prlfs): Define.
* path.h (path_conv::has_broken_fnoi): New method.
* path.cc (symlink_info::check): Call file_get_fnoi utilizing new
has_broken_fnoi filesystem flag.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Ditto.

* new-features.xml (ov-new2.3): Document Parallels Desktop FS support.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd missing ChangeLog entry for ce8159d5
Corinna Vinschen [Mon, 2 Nov 2015 09:24:14 +0000 (10:24 +0100)]
Add missing ChangeLog entry for ce8159d5

8 years agoInclude <sched.h> in <pthread.h>
Sebastian Huber [Fri, 30 Oct 2015 14:23:20 +0000 (15:23 +0100)]
Include <sched.h> in <pthread.h>

This is mandated by POSIX.

2015-10-30  Sebastian Huber  <sebastian.huber@embedded-brains.de>

libc/include/pthread.h: Include <sched.h> instead of
<sys/sched.h>.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoWorkaround bug in LocaleNameToLCID on Windows 10
Corinna Vinschen [Fri, 30 Oct 2015 19:13:26 +0000 (20:13 +0100)]
Workaround bug in LocaleNameToLCID on Windows 10

* nlsfuncs.cc (__get_lcid_from_locale): Handle LocaleNameToLCID
returning LOCALE_CUSTOM_UNSPECIFIED instead of failing in case of
an unsupported locale on Windows 10.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAvoid double unlock of TLS mutex
Corinna Vinschen [Fri, 30 Oct 2015 16:21:30 +0000 (17:21 +0100)]
Avoid double unlock of TLS mutex

* exceptions.cc (sigpacket::process): Avoid potentially double unlocking
the TLS mutex.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix sigwait and pthread_kill return values in case of error
Corinna Vinschen [Fri, 30 Oct 2015 15:05:43 +0000 (16:05 +0100)]
Fix sigwait and pthread_kill return values in case of error

* signal.cc (sigwait): Fix return value to reflect errno in case of
error according to POSIX.  Never return EINTR.
* thread.cc (pthread_kill): Return errno if sig_send failed.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoCheck for correct funtion entry address in munge_threadfunc
Qian Hong [Thu, 29 Oct 2015 08:17:46 +0000 (09:17 +0100)]
Check for correct funtion entry address in munge_threadfunc

* init.cc (munge_threadfunc): Check that we're actually replacing
the correct original function address on the stack.
* ntdll.h (enum _THREADINFOCLASS): Add ThreadQuerySetWin32StartAddress.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoRemove spurious execute permissions from some Cygwin source and text files
Jon Turney [Tue, 27 Oct 2015 13:45:08 +0000 (13:45 +0000)]
Remove spurious execute permissions from some Cygwin source and text files

2015-08-21  Jon Turney  <jon.turney@dronecode.org.uk>

* cygwin-cxx.h: Remove execute permissions.
* fenv.cc: Ditto.
* how-startup-shutdown-works.txt: Ditto.
* include/arpa/nameser.h: Ditto.
* include/arpa/nameser_compat.h: Ditto.
* include/fenv.h: Ditto.
* include/resolv.h: Ditto.
* libstdcxx_wrapper.cc: Ditto.

2015-10-27  Jon Turney  <jon.turney@dronecode.org.uk>

* winsup.api/signal-into-win32-api.c: Remove execute permissions.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
8 years agostrftime: Add support for %s (seconds since epoch)
Brian Inglis [Tue, 27 Oct 2015 08:41:22 +0000 (09:41 +0100)]
strftime: Add support for %s (seconds since epoch)

* libc/time/strftime.c (__strftime): add support for %s (seconds from
Unix epoch).  Fix whitespaces.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoClear pending signals targeting exiting thread
Corinna Vinschen [Fri, 23 Oct 2015 12:30:40 +0000 (14:30 +0200)]
Clear pending signals targeting exiting thread

* cygtls.cc (_cygtls::remove): Call remove_pending_sigs.
* cygtls.h (_cygtls::remove_pending_sigs): Declare.
* sigproc.cc (pending_signals::clear): Define new method taking a
_cygtls pointer argument.  Drop pending signals for that thread.
(_cygtls::remove_pending_sigs): Call pending_signals::clear for this
thread.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agowinsup/utils: add CPU cache variables to getconf(1)
Yaakov Selkowitz [Thu, 22 Oct 2015 17:33:37 +0000 (12:33 -0500)]
winsup/utils: add CPU cache variables to getconf(1)

* getconf.c (conf_table): Add LEVEL*_CACHE_* variables.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
8 years agoExport aligned_alloc, at_quick_exit, quick_exit.
Corinna Vinschen [Thu, 22 Oct 2015 14:21:17 +0000 (16:21 +0200)]
Export aligned_alloc, at_quick_exit, quick_exit.

* common.din (aligned_alloc): Export.
(at_quick_exit): Export.
(quick_exit): Export.

* posix.xml (std-iso): New section.
(std-deprec): Rearrange title text.
* new-features.xml (ov-new2.3): Document aligned_alloc, at_quick_exit,

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAvoid SEGV when handling SIDs with 0 subauthorities
Corinna Vinschen [Thu, 22 Oct 2015 13:38:42 +0000 (15:38 +0200)]
Avoid SEGV when handling SIDs with 0 subauthorities

* sec_helper.cc (cygsid::get_sid): Don't reject SIDs with missing
subauthorities.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoAdd release message for previous Cygwin patch
Corinna Vinschen [Thu, 22 Oct 2015 13:35:46 +0000 (15:35 +0200)]
Add release message for previous Cygwin patch

8 years agoFix length returned from sys_cp_wcstombs in case nwc > # of wchars
Corinna Vinschen [Thu, 22 Oct 2015 12:22:07 +0000 (14:22 +0200)]
Fix length returned from sys_cp_wcstombs in case nwc > # of wchars

* strfuncs.cc (sys_cp_wcstombs): Always return number of multibytes
without trailing NUL as the documentation implies.  Throughout Cygwin,
fix usage to align to this pattern.
* fhandler_process.cc (format_process_winexename): Drop trailing NUL
and LF from output.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix memory leak in pthread_getattr_np
Corinna Vinschen [Wed, 21 Oct 2015 10:46:32 +0000 (12:46 +0200)]
Fix memory leak in pthread_getattr_np

* thread.cc (pthread_getattr_np): Fix memory leak, remove usage of
malloc for small local buffer.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoFix EIO error accessing certain (OS X SMB?) drives
Corinna Vinschen [Wed, 21 Oct 2015 10:01:11 +0000 (12:01 +0200)]
Fix EIO error accessing certain (OS X SMB?) drives

* path.cc (symlink_info::check_reparse_point): Don't generate an EIO
error if NtFsControlFile returns STATUS_NOT_A_REPARSE_POINT.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years ago* winsup/doc/faq-using.xml (faq.using.same-with-permissions): New entry.
Ken Brown [Tue, 6 Oct 2015 20:31:05 +0000 (16:31 -0400)]
* winsup/doc/faq-using.xml (faq.using.same-with-permissions): New entry.

8 years agoFix compiler errors/warnings when compiling with -O3
Corinna Vinschen [Tue, 20 Oct 2015 10:33:13 +0000 (12:33 +0200)]
Fix compiler errors/warnings when compiling with -O3

* fhandler_socket.cc (fhandler_socket::wait_for_events): Fix compiler
warning in -O3 case.
(fhandler_socket::connect): Ditto.
* regex/regcomp.c (singleton): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
8 years agoC11 aligned_alloc() implementation
Sebastian Huber [Wed, 14 Oct 2015 05:39:37 +0000 (07:39 +0200)]
C11 aligned_alloc() implementation

aligned_alloc() is implemented in terms of posix_memalign() which is
only declared in <stdlib.h> but not defined in Newlib in general.  At
least Linux and RTEMS implement this function.

newlib/ChangeLog
2015-10-14  Sebastian Huber  <sebastian.huber@embedded-brains.de>

* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add
alloc_aligned.c.c.
* libc/stdlib/Makefile.in: Regenerate.
* libc/stdlib/aligned_alloc.c: New.

8 years agoC11 aligned_alloc() support for <stdlib.h>
Sebastian Huber [Wed, 14 Oct 2015 05:39:36 +0000 (07:39 +0200)]
C11 aligned_alloc() support for <stdlib.h>

newlib/ChangeLog
2015-10-14  Sebastian Huber  <sebastian.huber@embedded-brains.de>

* libc/include/stdlib.h (alloc_aligned): Declare.

8 years agoC11 quick_exit() support for <stdlib.h>
Sebastian Huber [Wed, 14 Oct 2015 05:39:35 +0000 (07:39 +0200)]
C11 quick_exit() support for <stdlib.h>

Import some <stdlib.h> function declarations from latest FreeBSD and
implement them.  I am not sure if we should call the global reent
cleanup in quick_exit() similar to exit().

newlib/ChangeLog
2015-10-14  Sebastian Huber  <sebastian.huber@embedded-brains.de>

* libc/include/stdlib.h (at_quick_exit): Declare.
(quick_exit): Likewise.
* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add
quick_exit.c.
* libc/stdlib/Makefile.in: Regenerate.
* libc/stdlib/quick_exit.c: New.

8 years agoSynchronize with FreeBSD.
Jeff Johnston [Tue, 13 Oct 2015 21:50:30 +0000 (17:50 -0400)]
Synchronize with FreeBSD.

        * libc/include/sys/cdefs.h: Synchronize with latest FreeBSD
        version.

8 years agoAdd FreeBSD style changes to sys/cdefs.h
Jeff Johnston [Tue, 13 Oct 2015 21:46:47 +0000 (17:46 -0400)]
Add FreeBSD style changes to sys/cdefs.h

* libc/include/sys/cdefs.h: Add style changes of latest FreeBSD
        version.

8 years agoCygwin 2.3.0: Add missing release message
Corinna Vinschen [Tue, 8 Sep 2015 20:53:54 +0000 (22:53 +0200)]
Cygwin 2.3.0: Add missing release message

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoflock.cc: Fix stack allocation from callee used in caller
Corinna Vinschen [Tue, 8 Sep 2015 08:57:54 +0000 (10:57 +0200)]
flock.cc: Fix stack allocation from callee used in caller

* flock.cc (lockf_t::create_lock_obj_attr): Add buffer parameter.
Call _everyone_sd with buffer argument from caller rather than
everyone_sd with locally allocated stack buffer.
(lockf_t::create_lock_obj): Call create_lock_obj_attr only once
outside the loop and with additional buffer argument.
(lockf_t::open_lock_obj): Call create_lock_obj_attr with additional
buffer argument.

9 years agofaq-using.xml: Replace makewhatis with mandb
Corinna Vinschen [Mon, 7 Sep 2015 11:55:21 +0000 (13:55 +0200)]
faq-using.xml: Replace makewhatis with mandb

* faq-using.xml (faq.using.man): Replace makewhatis with mandb.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix file type mode bit handling on object security.
Corinna Vinschen [Thu, 3 Sep 2015 17:29:55 +0000 (19:29 +0200)]
Fix file type mode bit handling on object security.

* fhandler_tty.cc (fhandler_pty_slave::open): Add S_IFCHR flag
in call to create_object_sd_from_attribute.
(fhandler_pty_slave::fstat): Ditto in call to get_object_attribute.
(fhandler_pty_slave::fchmod): Add an orig_mode flag and ditto for
both calls.
(fhandler_pty_master::setup): Ditto in call to
create_object_sd_from_attribute.
* security.cc (get_object_attribute): Never add S_IFCHR to mode
here.  Let the caller decide.
(create_object_sd_from_attribute): Ditto.

9 years agosetfacl: Allow to combine -b and -k options
Corinna Vinschen [Wed, 2 Sep 2015 10:23:09 +0000 (12:23 +0200)]
setfacl: Allow to combine -b and -k options

* setfacl.c (action_t): Rename DeleteAll to DeleteExt.  Add
DeleteAll.  Rearrange for bit-wise testing later in the code.
(delallacl): Handle -b -k combination.
(setfacl): Handle DeleteExt/DeleteAll.
(usage): Fix -b/-k output.  Rearrange output to better fill 80
columns.
(main): Allow to combine -b and -k.

* utils.xml (setfacl): Accommodate -b/-k change.
* new-features.xml (ov-new2.3): Add setfacl -b/-k change.

9 years agoFix permission evaluation for !new_style ACLs
Corinna Vinschen [Tue, 1 Sep 2015 22:05:46 +0000 (00:05 +0200)]
Fix permission evaluation for !new_style ACLs

* security.h (authz_get_user_attribute): Declare bool.
* sec_helper.cc (authz_ctx::get_user_attribute): Make bool method.
Set S_IxOTH bits in returned attributes rather than S_IxUSR bits.
(authz_get_user_attribute): Make bool function.
* sec_acl.cc (get_posix_access): Introduce cygsid array to keep
track of all SIDs in the ACL.  Move AuthZ calls into !new_style
permission post processing.  When not using AuthZ, use
CheckTokenMembership to collect group permissions.

9 years agoFix up POSIX permission handling
Corinna Vinschen [Tue, 1 Sep 2015 20:23:59 +0000 (22:23 +0200)]
Fix up POSIX permission handling

* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Disable
deviation from POSIX 1003.1e in terms of GROUP_OBJ/CLASS_OBJ
permissions.  Follow POSIX 1003.1e again.  Keep old code in
for future reference.
* sec_acl.cc: Accommodate changes in ACE creation in leading
comment.
(set_posix_access): Fix user deny ACE creation.  Split group
deny ACE creation into two steps, one to reflect CLASS_OBJ,
the other to reflect OTHER_OBJ.

9 years ago* sec_acl.cc (getacl): Use Authz to fetch correct user permissions.
Corinna Vinschen [Mon, 31 Aug 2015 09:34:38 +0000 (11:34 +0200)]
* sec_acl.cc (getacl): Use Authz to fetch correct user permissions.

9 years agoAdd Authz class to compute exact POSIX user perms in a security descriptor
Corinna Vinschen [Mon, 17 Aug 2015 16:29:24 +0000 (18:29 +0200)]
Add Authz class to compute exact POSIX user perms in a security descriptor

* autoload.cc (AuthzAccessCheck): Import.
(AuthzFreeContext): Import.
(AuthzInitializeContextFromSid): Import.
(AuthzInitializeContextFromToken): Import.
(AuthzInitializeResourceManager): Import.
* sec_helper.cc (get_sids_info): Remove.
(class authz_ctx_cache_entry): New class.
(class authz_ctx_cache): New class.
(class authz_ctx): New class.
(authz_get_user_attribute): New function.
* security.h (get_sids_info): Drop prototype.
(authz_get_user_attribute): Add prototype.
* winlean.h (_AUTHZ_): Define.

9 years ago* sec_acl.cc (get_posix_access): Fix class_perm in !new_style case.
Corinna Vinschen [Mon, 31 Aug 2015 14:56:14 +0000 (16:56 +0200)]
* sec_acl.cc (get_posix_access): Fix class_perm in !new_style case.

9 years agoReapply POSIX ACL changes.
Corinna Vinschen [Wed, 24 Jun 2015 09:52:29 +0000 (11:52 +0200)]
Reapply POSIX ACL changes.

  - New, unified implementation of POSIX permission and ACL handling.  The
    new ACLs now store the POSIX ACL MASK/CLASS_OBJ permission mask, and
    they allow to inherit the S_ISGID bit.  ACL inheritance now really
    works as desired, in a limited, but theoretically equivalent fashion
    even for non-Cygwin processes.

    To accommodate Windows default ACLs, the new code ignores SYSTEM and
    Administrators group permissions when computing the MASK/CLASS_OBJ
    permission mask on old ACLs, and it doesn't deny access to SYSTEM and
    Administrators group based on the value of MASK/CLASS_OBJ when
    creating the new ACLs.

    The new code now handles the S_ISGID bit on directories as on Linux:
    Setting S_ISGID on a directory causes new files and subdirs created
    within to inherit its group, rather than the primary group of the user
    who created the file.  This only works for files and directories
    created by Cygwin processes.

2015-05-29  Corinna Vinschen  <corinna@vinschen.de>

Reapply POSIX ACL changes.

* utils.xml (setfacl): Show new option output.
(getfacl): Show new option output.

* 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.

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

* 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.

* 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.

* 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.

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

* 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.

* 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.

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

* 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.

* 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.

* 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.

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

* 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.

* 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.

* 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.

* 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.

* 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.

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.

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

* 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.

* 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.

9 years agocygcheck.cc: Fix missing commas in products array
Corinna Vinschen [Sun, 30 Aug 2015 19:46:58 +0000 (21:46 +0200)]
cygcheck.cc: Fix missing commas in products array

* cygcheck.cc (dump_sysinfo): Fix missing commas in products array.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agocygcheck.cc: Fix debugger problem
Corinna Vinschen [Sun, 30 Aug 2015 19:35:23 +0000 (21:35 +0200)]
cygcheck.cc: Fix debugger problem

        * cygcheck.cc (load_cygwin): Only unload cygwin DLL if not running
        under a debugger.  Explain why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agocygcheck.cc: Handle W10/2016 sysinfo
Corinna Vinschen [Sun, 30 Aug 2015 19:34:24 +0000 (21:34 +0200)]
cygcheck.cc: Handle W10/2016 sysinfo

        * cygcheck.cc (dump_sysinfo): Correctly handle Windows 10/Server 2016.
        Add missing product types.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agocygcheck.cc: Fix downlevel DLL handling
Corinna Vinschen [Sun, 30 Aug 2015 19:32:56 +0000 (21:32 +0200)]
cygcheck.cc: Fix downlevel DLL handling

        * cygcheck.cc (track_down): Skip error output for "api-ms-win-"
        downlevel DLLs.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agosysconf.cc: Fix compiler warning.
Corinna Vinschen [Sat, 29 Aug 2015 07:32:00 +0000 (09:32 +0200)]
sysconf.cc: Fix compiler warning.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoAllow sysconf to return CPU cache information
Corinna Vinschen [Sat, 29 Aug 2015 07:16:47 +0000 (09:16 +0200)]
Allow sysconf to return CPU cache information

        * include/sys/unistd.h (_SC_LEVEL*): Add cache-related variables as
        on Linux.

        * fhandler_proc.cc (format_proc_cpuinfo): Fetch cache information
        from new cache functions in sysconf.cc, get_cpu_cache_intel and
        get_cpu_cache_amd.
        * sysconf.cc (__nt_query_system): New local helper.
        (get_nproc_values): Utilize __nt_query_system on pre-Windows 7 systems.
        Use GetLogicalProcessorInformationEx otherwise to handle more than
        64 CPUs.  Only handle _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN.
        (get_phys_pages): New helper to handle _SC_PHYS_PAGES.
        (cpuid2_cache_descriptor): New array to map Intel CPUID 2 descriptor
        values to cache type, cache size, associativity and linesize.
        (cpuid2_cache_desc_compar): Comparision function for bsearch over
        cpuid2_cache_descriptor.
        (get_cpu_cache_intel_cpuid2): New function to fetch cache info from
        Intel CPUID 2.
        (get_cpu_cache_intel_cpuid4): Ditto from Intel CPUID 4.
        (get_cpu_cache_intel): New function as CPU-specific entry point.
        (assoc): New array to map associativity values from AMD CPUID
        0x80000006.
        (get_cpu_cache_amd): New function to fetch cache info from AMD CPUIDs
        0x80000005 and 0x80000006.
        (get_cpu_cache): New function to fetch cache info.
        (sca): Call get_phys_pages if _SC_PHYS_PAGES is requested.  Call
        get_cpu_cache for new _SC_* cache requests.
        (SC_MAX): Set to _SC_LEVEL4_CACHE_LINESIZE.
        (get_phys_pages(void)): Call get_phys_pages(int).
        * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.

        * new-features.xml (ov-new2.3): Document sysconf cache addition.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoImplement POSIX_MADV_WILLNEED/POSIX_MADV_DONTNEED for newer OSes
Corinna Vinschen [Thu, 27 Aug 2015 11:34:10 +0000 (13:34 +0200)]
Implement POSIX_MADV_WILLNEED/POSIX_MADV_DONTNEED for newer OSes

        * autoload.cc (DiscardVirtualMemory): Import.
        (PrefetchVirtualMemory): Import.
        * mmap.cc (posix_madvise): Actually implement POSIX_MADV_WILLNEED
        utilizing PrefetchVirtualMemory and POSIX_MADV_DONTNEED utilizing
        DiscardVirtualMemory on systems supporting them.
        * wincap.h (wincaps::has_broken_prefetchvm): New element.
        * wincap.cc: Implement above element throughout.
        (wincapc::init): Make sure has_broken_prefetchvm is only true on
        W10 under WOW64.
        * include/cygwin/version.h (CYGWIN_VERSION_DLL_MAJOR): Bump to 2003.
        (CYGWIN_VERSION_API_MINOR): Reset to 0.

        * new-features.xml (ov-new2.3): New section, document posix_madvise
        POSIX_MADV_WILLNEED/POSIX_MADV_DONTNEED change.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agostrlen-armv7.S: Fix preprocessor check
Corinna Vinschen [Thu, 27 Aug 2015 10:55:22 +0000 (12:55 +0200)]
strlen-armv7.S: Fix preprocessor check

Hi!

I've got the situation, that the function strlen() occurs twice in libc.a
(building newlib for ARM-V7a and Size-Optimized).

In newlib/libc/machine/arm/strlen.c there are the pre-processor stetements ...
#if defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \
  (defined (__thumb__) && !defined (__thumb2__))
/*...*/
#else

#if !(defined(_ISA_ARM_7) || defined(__ARM_ARCH_6T2__))
/*...*/
#endif

and in newlib/libc/machine/arm/strlen-armv7.S the "exclude" begins with

/* NOTE: This ifdef MUST match the ones in arm/strlen.c
   We fallback to the one in arm/strlen.c for size optimised or
   for older architectures. */
#if defined(_ISA_ARM_7) || defined(__ARM_ARCH_6T2__) && \
    !(defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \
      (defined (__thumb__) && !defined (__thumb2__)))

But this is not completely contrary to arm/strlen.c (see above)!

To fix the logical statement in arm/strlen-armv7.S there are parentheses needed

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix for pri and scn formats
Andre Simoes Dias Vieira [Thu, 27 Aug 2015 10:50:25 +0000 (11:50 +0100)]
Fix for pri and scn formats

9 years agofhandler_proc.cc: Only request group relation information
Corinna Vinschen [Wed, 26 Aug 2015 16:39:53 +0000 (18:39 +0200)]
fhandler_proc.cc: Only request group relation information

        * fhandler_proc.cc (format_proc_cpuinfo): Only fetch group relations,
        we don't need anything else.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agowinsup.h: Claim Windows 10 support
Corinna Vinschen [Tue, 25 Aug 2015 20:23:01 +0000 (22:23 +0200)]
winsup.h: Claim Windows 10 support

        * winsup.h (_WIN32_WINNT): Set to 0x0a00 for Windows 10.
        (WINVER): Ditto.  Remove outdated comment.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoautoload.cc: Drop using full paths for system DLLs
Corinna Vinschen [Tue, 25 Aug 2015 20:17:03 +0000 (22:17 +0200)]
autoload.cc: Drop using full paths for system DLLs

System DLLs are always first in the DLL search order so
http://www.microsoft.com/technet/security/advisory/2269637.mspx
doesn't apply for them.

        * autoload.cc (std_dll_init): Revert using full paths to system DLLs.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoautload.cc: Avoid clobbering return address in noload on i686
Corinna Vinschen [Tue, 25 Aug 2015 20:15:22 +0000 (22:15 +0200)]
autload.cc: Avoid clobbering return address in noload on i686

This fixes a long-standing problem when GetProcAddress fails
to load a function.  The noload code calls SetLastError on
i686 without saving the edx register.  Starting with Windows 7,
SetLastError apparently uses $edx and the register is set to
0x00000000 on return.  So the subsequent `jmp *$edx' in noload
supposed to return to the caller, actually jumps to address NULL,
which results in a SEGV.

        * autoload.cc (noload): i686 only: Save and restore $edx when calling
        SetLastError to avoid clobbering return address stating with Windows 7.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agommap.cc: Fix some comments
Corinna Vinschen [Tue, 25 Aug 2015 20:02:35 +0000 (22:02 +0200)]
mmap.cc: Fix some comments

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoUpdated copyright notice
Andre Vieira [Fri, 21 Aug 2015 08:24:39 +0000 (09:24 +0100)]
Updated copyright notice

Update the ARM copyright notice to include 2015.

2015-08-20  Andre Vieira  <andre.simoesdiasvieira@arm.com>
         * COPYING.NEWLIB: Updated ARM's copyright notice.

From 913be92b12851bc6285b8ab77d6878fda613f77c Mon Sep 17 00:00:00 2001
From: Andre Simoes Dias Vieira <andsim01@arm.com>
Date: Thu, 20 Aug 2015 14:16:42 +0100
Subject: [PATCH] Updated general Copyright notice

9 years agoAlways declare "kill" in include/sys/signal.h
James Greenhalgh [Tue, 25 Aug 2015 13:31:11 +0000 (14:31 +0100)]
Always declare "kill" in include/sys/signal.h

Hi,

As I mentioned recently [1], newlib is providing a "kill" symbol to link
against, without declaring "kill" in signal.h. This is confusing for the
libgfortran build, which tries to link against kill (which succeeds), then
tries to use it (which triggers -Werror=implicit-function-declaration).

This patch implements my suggestion in that thread - making the declaration
of 'kill' in libc/include/sys/signal.h unconditional.

I've tested this by building a modified libgfortran on AArch64/ARM to see
that the Werror goes away, and the libgfortran build succeeds.

Is something like this OK for newlib? If so, can someone please commit
it on my behalf, as I have no commit access here.

Otherwise, what is your preferred direction for me to take this patch?

Thanks,
James

9 years agoSigproc.cc: Fix copyright. newlib-snapshot-20150824
Corinna Vinschen [Mon, 24 Aug 2015 17:09:16 +0000 (19:09 +0200)]
Sigproc.cc: Fix copyright.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix hang stracing forking processes but not following child
Corinna Vinschen [Mon, 24 Aug 2015 16:37:53 +0000 (18:37 +0200)]
Fix hang stracing forking processes but not following child

        * ntdll.h (PROCESSINFOCLASS): Define ProcessDebugFlags.
        * sigproc.cc (child_info::child_info): Only propagate _CI_STRACED to
        child if strace is actually tracing child processes.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoBump Cygwin DLL minor number.
Corinna Vinschen [Mon, 24 Aug 2015 16:35:49 +0000 (18:35 +0200)]
Bump Cygwin DLL minor number.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agooops - forgot to add PR number to ChangeLog entry.
Nick Clifton [Mon, 24 Aug 2015 09:05:19 +0000 (10:05 +0100)]
oops - forgot to add PR number to ChangeLog entry.

9 years agoAdd Lavasoft Web Companion to BLODA list.
Jon TURNEY [Tue, 18 Aug 2015 16:24:10 +0000 (17:24 +0100)]
Add Lavasoft Web Companion to BLODA list.

2015-08-18  Jon Turney  <jon.turney@dronecode.org.uk>

* faq-using.xml (faq.using.bloda): Add Lavasoft Web Companion to
BLODA list.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years ago * msp430/crt0.S: Remove watchdog disabling code.
Nick Clifton [Thu, 20 Aug 2015 16:19:49 +0000 (17:19 +0100)]
* msp430/crt0.S: Remove watchdog disabling code.

9 years agoManuals failing to build on Ubuntu LTS 14.04 cygwin-2_2_1-release
Jon TURNEY [Tue, 11 Aug 2015 13:55:23 +0000 (14:55 +0100)]
Manuals failing to build on Ubuntu LTS 14.04

On 11/08/2015 11:08, Andre Vieira wrote:
> On 10/08/15 14:38, Jon TURNEY wrote:
>> On 07/08/2015 11:13, Andre Vieira wrote:
>>> Building the manuals on Ubuntu LTS 14.04 (64-bit) using pdfTeX
>>> 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) is failing with the
>>> following error:
>>> "Transcript written on libc.log.
>>> /usr/bin/texi2dvi: pdfetex exited with bad status, quitting."
>>>
>>> libc.log complaints about the following:
>>>
>>> You can't use `@unskip' in vertical mode.
>>>
[...]
>>>
>>> This code has been around for a while, so it might have to do with a
>>> change in pdfTex?

So it seems this problem has been around for a while, and looks like it
is due to a change in texi2dvi in texinfo 5.0 or late 4.x, see [1].

I guess it's not very noticeable since it only occurs when doing 'make
dvi', which doesn't happen by default.

Attached is a different and perhaps cleaner workaround to the one in
that thread.

[1] https://sourceware.org/ml/newlib/2013/msg00057.html

From 4d386b5900b6c68e022004b447faa696be5ff8c7 Mon Sep 17 00:00:00 2001
From: Jon TURNEY <jon.turney@dronecode.org.uk>
Date: Tue, 11 Aug 2015 14:46:39 +0100
Subject: [PATCH] Use '@sp 1' rather than '@*' to workaround a change in
 texi2dvi.

Since about TexInfo 5.0, using '@*' immediately after a table causes a 'You
can't use `@unskip' in vertical mode' error.

See https://sourceware.org/ml/newlib/2013/msg00057.html

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoAdd MIN MAX macro to param header file.
Andre Vieira [Fri, 31 Jul 2015 09:29:08 +0000 (10:29 +0100)]
Add MIN MAX macro to param header file.

newlib/ChangeLog:
2015-07-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>

   * libc/sys/arm/sys/param.h (MIN,MAX): Define.

From 536ca7365d269f5e56679048e336d6969186d550 Mon Sep 17 00:00:00 2001
From: Andre Simoes Dias Vieira <andsim01@arm.com>
Date: Tue, 28 Jul 2015 14:19:08 +0100
Subject: [PATCH] Added min max macros

9 years agoUse machine header file for endianness configuration.
Andre Vieira [Fri, 31 Jul 2015 09:28:51 +0000 (10:28 +0100)]
Use machine header file for endianness configuration.

newlib/ChangeLog:
2015-07-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>

   * libc/sys/arm/sys/param.h (BIG_ENDIAN, LITTLE_ENDIAN): Moved
   to machine/endian.h.
   * libc/machine/arm/machine/param.h (BYTE_ORDER): Idem.
   * libc/machine/arm/machine/endian.h: New.

From ca6efccda91bc6b620b7d96a466b0f1e2f02cfeb Mon Sep 17 00:00:00 2001
From: Andre Simoes Dias Vieira <andsim01@arm.com>
Date: Tue, 28 Jul 2015 12:16:20 +0100
Subject: [PATCH 2/2] Move endianness configuration to machine/endian.h

9 years agoUse machine header file for param configuration.
Andre Vieira [Wed, 5 Aug 2015 12:22:43 +0000 (13:22 +0100)]
Use machine header file for param configuration.

On 31/07/15 10:34, Richard Earnshaw wrote:
> On 31/07/15 10:28, Andre Vieira wrote:
>> newlib/ChangeLog:
>> 2015-07-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>
>>
>>    * libc/sys/arm/sys/param.h: Include machine/param.h
>>    (HZ, NOFILE, PATHSIZE): Define.
>>
>> param_refactor_1.patch
>>
>>
>>  From abc2d5f3398721f6ca891b9581feaba58730b19c Mon Sep 17 00:00:00 2001
>> From: Andre Simoes Dias Vieira <andsim01@arm.com>
>> Date: Tue, 28 Jul 2015 12:10:59 +0100
>> Subject: [PATCH 1/2] Moved param configuration to machine/param.h
>>
>> ---
>>   newlib/libc/sys/arm/sys/param.h | 12 ++++++++++--
>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/newlib/libc/sys/arm/sys/param.h b/newlib/libc/sys/arm/sys/param.h
>> index adc066e9a8756e07edaaa8cadc79b5f05c996ac9..622c371972ab3c9dbb93ea5c51323a593e2a171a 100644
>> --- a/newlib/libc/sys/arm/sys/param.h
>> +++ b/newlib/libc/sys/arm/sys/param.h
>> @@ -3,9 +3,17 @@
>>   #ifndef _SYS_PARAM_H
>>   # define _SYS_PARAM_H
>>
>> -# define HZ (100)
>> -# define NOFILE (60)
>> +#include <machine/param.h>
>> +
>> +#ifndef HZ
>> +# define HZ (60)
>
> Why have you changed the value for HZ?  It seems that, by convention,
> ARM boards have always used 100.
>
> R.
>
>> +#endif
>> +#ifndef NOFILE
>> +# define NOFILE>(60)
>> +#endif
>> +#ifndef PATHSIZE
>>   # define PATHSIZE (1024)
>> +#endif
>>
>>   #define BIG_ENDIAN      4321
>>   #define LITTLE_ENDIAN   1234
>>
>
Hi Richard,

ARM's machine/param.h that is included in "#include <machine/param.h>",
before the 'ifndef' already defines HZ to be 100. This file was already
there, it was just not being used. I understand that this 'ifndef' might
be confusing, though I decided to add it to mimic the behavior of the
default sys/param.h.

There is however an unrelated issue with this patch, a typo in the
"#define NOFILE" that crept in there due to some copy pasting when
splitting the patch.

Here is a fixed version.

BR,
Andre

newlib/ChangeLog:
2015-07-28  Andre Vieira  <andre.simoesdiasvieira@arm.com>

   * libc/sys/arm/sys/param.h: Include machine/param.h
   (HZ, NOFILE, PATHSIZE): Define.

From abc2d5f3398721f6ca891b9581feaba58730b19c Mon Sep 17 00:00:00 2001
From: Andre Simoes Dias Vieira <andsim01@arm.com>
Date: Tue, 28 Jul 2015 12:10:59 +0100
Subject: [PATCH 1/2] Moved param configuration to machine/param.h

9 years agoCygwin: Return port number from getservent in network byte order
Corinna Vinschen [Tue, 18 Aug 2015 11:12:07 +0000 (13:12 +0200)]
Cygwin: Return port number from getservent in network byte order

        * netdb.cc (parse_services_line): Convert port number to network byte
        order.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoexceptions.cc: Drop including ucontext.h.
Corinna Vinschen [Tue, 18 Aug 2015 09:09:25 +0000 (11:09 +0200)]
exceptions.cc: Drop including ucontext.h.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agosys/signal.h: include sys/ucontext.h on Cygwin per POSIX.1-2008
Yaakov Selkowitz [Tue, 18 Aug 2015 02:46:19 +0000 (21:46 -0500)]
sys/signal.h: include sys/ucontext.h on Cygwin per POSIX.1-2008

* libc/include/sys/signal.h [__CYGWIN__]: include <sys/ucontext.h>
if compiling for POSIX.1-2008.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
9 years agoDon't call LsaLookupSids if we're not utilizing Windows account DBs
Corinna Vinschen [Mon, 17 Aug 2015 20:45:02 +0000 (22:45 +0200)]
Don't call LsaLookupSids if we're not utilizing Windows account DBs

        * grp.cc (internal_getgrfull): Drop asking caches.  Explain why.
        (internal_getgroups): In case we're not utilizing the Windows account
        DBs, don't call LsaLookupSids but iterate over the group SIDs in the
        token and call internal_getgrsid for each of them.  Explain why.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoTry harder to avoid LDAP access for RFC2307 mapping
Corinna Vinschen [Mon, 17 Aug 2015 18:24:49 +0000 (20:24 +0200)]
Try harder to avoid LDAP access for RFC2307 mapping

        * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Rearrange
        to fall back to myself uid/gid in case we don't utilize Windows
        account DBs, just as prior to 1.7.34.
        * sec_helper.cc (cygpsid::get_id): Disable Samba user/group mapping per
        RFC2307 if we're not utilizing Windows account DBs.
        * security.cc (convert_samba_sd): Revert previous patch.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix /proc/cpuinfo topology info on newer AMD CPUs
Corinna Vinschen [Mon, 17 Aug 2015 14:35:41 +0000 (16:35 +0200)]
Fix /proc/cpuinfo topology info on newer AMD CPUs

        * fhandler_proc.cc (format_proc_cpuinfo): Handle AMDs providing
        extended topology info in CPUID leaf 0x8000001e.  Fix handling of
        AMD CPUs providing extended legacy core info in CPUID leaf 0x80000008.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agomkglobals_h: Handle CRLF earlier.
Orgad Shaneh [Mon, 17 Aug 2015 09:05:20 +0000 (11:05 +0200)]
mkglobals_h: Handle CRLF earlier.

When globals.cc has CRLF line endings, winsup.h is not removed, and
compilation fails for duplicate definitions.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoSupport cpb and eff_freq_ro power mgmt flags in /proc/cpuinfo
Corinna Vinschen [Mon, 17 Aug 2015 08:04:33 +0000 (10:04 +0200)]
Support cpb and eff_freq_ro power mgmt flags in /proc/cpuinfo

        * fhandler_proc.cc (format_proc_cpuinfo): Print cpb and eff_freq_ro
        power management flags.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoCygwin: Improve 2.2.1 release notes
Corinna Vinschen [Sat, 15 Aug 2015 11:32:31 +0000 (13:32 +0200)]
Cygwin: Improve 2.2.1 release notes

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoCygwin: Try to fix potential data corruption in pipe write
Corinna Vinschen [Sat, 15 Aug 2015 10:30:09 +0000 (12:30 +0200)]
Cygwin: Try to fix potential data corruption in pipe write

        * fhandler.cc (fhandler_base_overlapped::raw_write): When performing
        nonblocking I/O, copy user space data into own buffer.  Add longish
        comment to explain why.
        * fhandler.h (fhandler_base_overlapped::atomic_write_buf): New member.
        (fhandler_base_overlapped::fhandler_base_overlapped): Initialize
        atomic_write_buf.
        (fhandler_base_overlapped::fhandler_base_overlapped): New destructor,
        free'ing atomic_write_buf.
        (fhandler_base_overlapped::copyto): Set atomic_write_buf to NULL in
        copied fhandler.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix copy/paste error in previous patch
Corinna Vinschen [Fri, 14 Aug 2015 19:55:42 +0000 (21:55 +0200)]
Fix copy/paste error in previous patch

        * security.cc (convert_samba_sd): Fix copy/paste error in previous
patch.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoDon't perform RFC2307 account mapping without account DB
Corinna Vinschen [Fri, 14 Aug 2015 19:41:37 +0000 (21:41 +0200)]
Don't perform RFC2307 account mapping without account DB

        * fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): Only try
        to map user and group info per RFC2307 if account info is fetched
        from Windows account DB.
        (convert_samba_sd): Ditto.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoEvaluate all group perms in ACL to emulate POSIX user perms
Corinna Vinschen [Fri, 14 Aug 2015 08:10:34 +0000 (10:10 +0200)]
Evaluate all group perms in ACL to emulate POSIX user perms

        * security,cc (get_attribute_from_acl): Merge all group perms into
        user perms if user is member of group.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoFix /proc/cpuinfo topology and cache size info
Corinna Vinschen [Thu, 13 Aug 2015 15:59:47 +0000 (17:59 +0200)]
Fix /proc/cpuinfo topology and cache size info

        * autoload.cc (GetLogicalProcessorInformationEx): Import.
        (SetThreadGroupAffinity): Import.
        * fhandler_proc.cc (add_size): New macro.
        (get_msb): New inline function.
        (mask_bits): Ditto.
        (format_proc_cpuinfo): Drop handling of old CPUs.  Check if we're
        running on a OS version supporting porcessor groups.  If so, use
        SetThreadGroupAffinity to set thread affinity.  Improve cache info
        to include 3rd level cache on Intel CPUs.  Improve multi core info.
        * wincap.h (wincaps::has_processor_groups): New element.
        * wincap.cc: Implement above element throughout.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agomiscfuncs.cc: Fix comment preceeding x86_64 memset and friends.
Corinna Vinschen [Mon, 10 Aug 2015 10:07:22 +0000 (12:07 +0200)]
miscfuncs.cc: Fix comment preceeding x86_64 memset and friends.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoRevert to leaving $HOME alone
Corinna Vinschen [Mon, 10 Aug 2015 10:00:12 +0000 (12:00 +0200)]
Revert to leaving $HOME alone

* uinfo.cc (cygheap_user::ontherange): Revert previous patch.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoor1k: Typo fixes
Jeff Johnston [Fri, 7 Aug 2015 18:55:49 +0000 (14:55 -0400)]
or1k: Typo fixes

  Wrong paranthesis and an incorrect symbol name are fixed.

          * or1k/boards/optimsoc.S: Fix symbol name
          * or1k/crt0.S: Remove paranthesis

9 years agoor1k: Allow exception nesting
Jeff Johnston [Fri, 7 Aug 2015 18:52:07 +0000 (14:52 -0400)]
or1k: Allow exception nesting

    Allow exceptions to be nested, which is especially useful with urgent
    interrupts while processing an exception.

    The implementation counts up the nesting level with each call to an
    exception. In the outer exception (level 1), the exception stack is
    started. All nested exceptions just reserve the redzone (scratch
    memory that may be used by compiler) and exception context on the
    stack, but then process on the same scratch.

    Restriction: Impure pointers are shared among all exceptions. This may
    be solved by creating an impure data structure in the stack frame with
    each nested exception.

       * or1k/crt0.S: Add exception nesting
       * or1k/exceptions-asm.S: ditto
       * or1k/util.c: ditto

9 years agoor1k: Fix critical handling in malloc locks
Jeff Johnston [Fri, 7 Aug 2015 18:49:16 +0000 (14:49 -0400)]
or1k: Fix critical handling in malloc locks

    Only on first call to the recursive malloc lock the restore value of
    exception enable fields is stored.

       * libc/sys/or1k/mlock.c: Fix exception enable saving

9 years agoor1k: Make heap end globally visible
Jeff Johnston [Fri, 7 Aug 2015 18:43:38 +0000 (14:43 -0400)]
or1k: Make heap end globally visible

    Boards may change the initial value from _end to another value.

           * or1k/sbrk.c: Make heap end globally visible

9 years agoImprove FAQ answer on debugging Cygwin
Jon TURNEY [Tue, 4 Aug 2015 12:34:10 +0000 (13:34 +0100)]
Improve FAQ answer on debugging Cygwin

Improve FAQ answer on debugging Cygwin to mention the cygwin-debuginfo package
and the gdb command 'set cygwin-exceptions on'.

2015-08-03  Jon Turney  <jon.turney@dronecode.org.uk>

* faq-programming.xml: Improve debugging-cygwin answer.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
9 years agoThis is part of a larger fix for RL78 complex relocs - they need an absolute symbol...
Nick Clifton [Tue, 4 Aug 2015 12:38:27 +0000 (13:38 +0100)]
This is part of a larger fix for RL78 complex relocs - they need an absolute symbol at address 0 that is not part of the *ABS* section.

* rl78/rl78-sim.ld: Provide a value for __rl78_abs__.
* rl78/rl78.ld: Likewise.

9 years agoFix wscanf family positional parameter handling in %lc, %ls, %l[]
Shoichi Sakon [Mon, 3 Aug 2015 19:51:16 +0000 (21:51 +0200)]
Fix wscanf family positional parameter handling in %lc, %ls, %l[]

        * libc/stdio/vfwscanf.c (__SVFWSCANF_R): Convert wrong usage of va_arg
        to GET_ARG in %lc, %ls nad %l[] cases.  Fix unterminated string in %l[]
        case.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agoBump Cygwin DLL minor number.
Corinna Vinschen [Mon, 3 Aug 2015 19:46:55 +0000 (21:46 +0200)]
Bump Cygwin DLL minor number.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
9 years agostrace: Handle ofile descriptor more carefully. cygwin-2_2_0-release
Corinna Vinschen [Mon, 3 Aug 2015 10:02:17 +0000 (12:02 +0200)]
strace: Handle ofile descriptor more carefully.

Fix coverity CIDs 128250 - 128252

        * strace.cc (main2): Don't call setvbuf on NULL descriptor.
        Explicitely fclose ofile.

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