This patch adds the long double functions missing in newlib to Cygwin.
Apart from some self-written additions (exp10l, finite{f,l}, isinf{f,l},
isnan{f,l}, pow10l) the files are taken from the Mingw-w64 math lib.
Minor changes were required, e.g. substitue _WIN64 with __x86_64__ and
fixing __FLT_RPT_DOMAIN/__FLT_RPT_ERANGE for Cygwin.
Cygwin:
* math: New subdir with math functions.
* Makefile.in (VPATH): Add math subdir.
(MATH_OFILES): List of object files collected from building files in
math subdir.
(DLL_OFILES): Add $(MATH_OFILES).
${CURDIR}/libm.a: Add $(MATH_OFILES) to build.
* common.din: Add new functions from math subdir.
* i686.din: Align to new math subdir. Remove functions now commonly
available.
* x86_64.din: Ditto.
* math.h: math.h wrapper to define mingw structs used in some files in
math subdir.
* include/cygwin/version.h: Bump API minor version.
newlib:
* libc/include/complex.h: Add prototypes for complex long double
functions. Only define for Cygwin.
* libc/include/math.h: Additionally enable prototypes of long double
functions for Cygwin. Add Cygwin-only prototypes for dreml, sincosl,
exp10l and pow10l. Explain why we don't add them to newlib.
* libc/include/tgmath.h: Enable long double handling on Cygwin.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
setstate is supposed to take a char *, not a const char *.
* random.cc (setstate): Unconstify parameter to align to stdlib.h.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
The inclusion of <sys/cygwin.h> by <sys/shm.h>, besides causing namespace
pollution, also makes it very difficult to get the WINVER-dependent parts
of the former. This affects code (such as x11vnc -unixpw_nis) which use
both SysV shared memory (e.g. the X11 MIT-SHM extension) and user password
authentication.
getpagesize is the simplest function to retreive this information, but it
is a legacy function and would also pollute the global namespace. The LSB
lists another form which is in the implementation-reserved namespace:
http://refspecs.linuxfoundation.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/baselib---getpagesize.html
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Prototypes also added for initstate() and setstate() but they
were not implemented in the shared newlib code.
* newlib/libc/include/cygwin/stdlib.h: Prototypes added.
* winsup/cygwin/include/cygwin/stdlib.h: Prototypes removed.
* newlib/libc/stdlib/random.c: New file.
* newlib/libc/machine/epiphany/machine/stdlib.h: Removed
* newlib/libc/stdlib/Makefile.am: Added random.c.
* newlib/libc/stdlib/stdlib.tex: Added random.def.
* newlib/libc/stdlib/Makefile.in: Regenerated.
Don't use u_char, u_short, u_int or u_long in Cygwin, unless it refers
to the Winsock types. Use u_intN_t in BSD-based sources, unsigned char
where strings are concerned, uintN_t otherwise. Also:
* net.cc: Fix comment, we're not using u_long anymore.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
FIONBIO is defined in sys/termios.h and asm/socket.h. Align the comments.
Remove unused REAL_FIONBIO.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
u_char, u_short, u_int, u_long are BSD-only types. Remove them from
Cygwin headers which are supposed to be used in a non-BSD scenario.
Drop special Cygwin handling of those types in sys/types.h.
newlib:
* libc/include/sys/types.h (u_char,u_short,u_int,u_long): Drop
Cygwin exception.
cygwin:
* fhandler_socket.cc (fhandler_socket::ioctl): Accommodate change
in include/asm/socket.h. Continue using u_long since that's the
MS type here.
* include/asm/socket.h: Since the type given in _IOR/_IOW macros
is only used for its sizeof, replace u_long with equivalent long.
* netdb.h (getnetbyaddr): Fix prototype.
* netinet/ip.h: Replace old BSD-only types with generically defined
old BSD types (u_char -> u_int8_t, etc).
* netinet/tcp.h: Ditto.
* netinet/udp.h: Ditto.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
The u_intN_t types are BSD types but sanctioned by POSIX. They are
always defined when using Glibc headers so we follow suit.
newlib:
* libc/include/sys/types.h: Drop outdated __INTTYPES_DEFINED__
macro. Always define u_intN_t types.
cygwin:
* include/cygwin/types.h: Remove definition of u_intN_t types.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
So far any group in the user's token could be used as primary group.
Windows doesn't check if the primary group is enabled or not, it just
has no meaning. From a POSIXy point of view it can lead to weird
results though.
* uinfo.cc (check_token_membership): New static function.
(internal_getlogin): Only allow enabled groups as primary group.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
A user token can be up to 64K in size. Using 32K buffers for TOKEN_GROUPS
may be insufficient.
* uinfo.cc (get_logon_sid): Use 64K buffers for the TOKEN_GROUPS
array.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
A user token can be up to 64K in size. The group list might take a lot
of that so use tmp_pathbuf allocated space rather than stack space
allocted via alloca. In create_token the TOKEN_GROUP was allocated via
malloc, but the code is needlessly complicated. Simplify by using
tmp_pathbuf as well.
* sec_auth.cc (verify_token): Allocate TOKEN_GROUP via tmp_pathbuf.
(create_token): Ditto.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
As long as we're not building in C++14 mode, the definition of the
sized delete operator results in a compatibility warning.
* cxx.cc (operator delete): Disable C++14 warning for sized variant.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
When compiling with -std=c++14 (the default for gcc 6.0+), the sized
deallocation operator must be defined to prevent undefined symbols when
linking.
winsup/cygwin/ChangeLog:
cxx.cc (operator delete(void *p, size_t)): Define.
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
The latest version of the mingw headers have been updated to make
DnsRecordListFree an alias of DnsFree when targeting Windows XP or later.
Use DnsFree directly, avoiding the wrapper function.
/home/peter/cross/src/cygwin/winsup/cygwin/libc/minires-os-if.c:289:
undefined reference to `DnsFree'
winsup/cygwin/ChangeLog
autoload.cc: Load DnsFree rather then DnsRecordListFree
libc/minires-os-if.cc (cygwin_query): Use DnsFree rather then DnsRecordListFree
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
GCC 6.0+ asserts that the memptr argument to the builtin function
posix_memalign is nonnull.
Add the necessary annotation to the prototype and
remove the now unnecessary check to fix a warning.
newlib/Changelog
newlib/libc/include/stdlib.h: Annotate arg to posix_memalign as
non-null.
winsup/cygwin/ChangeLog
malloc_wrapper.cc (posix_memalign): Remove always true nonnull check.
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
/dev/random calls getentropy. So there's no good reason to go out of
our way to open /dev/random just to call getentropy anyway.
* random.cc (srandomdev): Drop opening /dev/random in favor of
calling getentropy.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Newlib's default stdlib.h now defines these functions so we can
drop them from the Cygwin-specific header. Remove the arc4random_stir
and arc4random_uniform prototypes entirely. They shouldn't be used
by applications anymore.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
newlib:
* libc/stdlib/arc4random.h: Remove Cygwin-specific locking code.
Conditionalize arc4 locking. Check for _ARC4_LOCK_INIT being
undefined to fall back to default implementation.
cygwin:
* include/machine/_arc4random.h: New file.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cygwait.h (cygwait_us) Remove; this reverts previous changes.
* select.h: Eliminate redundant select_stuff::select_loop state.
* select.cc (select): Eliminate redundant
select_stuff::select_loop state. Eliminate redundant code for
zero timeout. Do not return early on early timer return.
(select_stuff::wait): Eliminate redundant
select_stuff::select_loop state.
* cygwait.h: Add cygwait_us() methods.
* select.h: Change prototype for select_stuff::wait() for larger
microsecond timeouts.
* select.cc (pselect): Convert from old cygwin_select().
Implement microsecond timeouts.
(cygwin_select): Rewrite as a wrapper on pselect().
(select): Implement microsecond timeouts.
(select_stuff::wait): Implement microsecond timeouts with a timer
object.
* fhandler.h (fhandler_console): Move get_nonascii_key() from
select.c into this class.
* select.cc (peek_console): Move get_nonascii_key() into
fhandler_console class.
Recent versions of autoconf define datadir/infodir in terms of
datarootdir. Add it.
winsup/ChangeLog
* Makefile.in: define datarootdir
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
winsup/cygwin/pinfo.cc:465:14: error: the compiler can assume that the
address of 'tc' will always evaluate to 'true' [-Werror=address]
winsup/cygwin/ChangeLog
* pinfo.cc (_pinfo::set_ctty): remove always true check.
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
The missing braces cause only the first expression to be guarded by the
else clause.
winsup/cygwin/ChangeLog
* fhandler_disk_file.cc (facl): Add missing braces to if statement.
* mount.cc (dos_drive_mappings): Add missing braces to if statement.
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
This if is unconditionally false, so remove it.
winsup/cygwin/fhandler_console.cc: In member function 'bool dev_console::fillin(HANDLE)':
winsup/cygwin/fhandler_console.cc:740:22: error: self-comparison always evaluates to false [-Werror=tautological-compare]
if (b.dwSize.Y != b.dwSize.Y || b.dwSize.X != b.dwSize.X)
~~~~~~~~~~~^~~~~~~~~~~~~
winsup/cygwin/fhandler_console.cc:740:50: error: self-comparison always evaluates to false [-Werror=tautological-compare]
if (b.dwSize.Y != b.dwSize.Y || b.dwSize.X != b.dwSize.X)
~~~~~~~~~~~^~~~~~~~~~~~~
winsup/cygwin/ChangeLog
* fhandle_console.cc (fillin): remove dead code
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
initial_sp has been unused since commit fbf23e3 back in 2000.
Keep the value, so as to avoid changing the offset of magic_biscuit.
winsup/cygwin/lib/_cygwin_crt0_common.cc:140:52:
error: calling 'void* __builtin_frame_address(unsigned int)' with a
nonzero argument is unsafe [-Werror=frame-address]
u->initial_sp = (char *) __builtin_frame_address (1);
winsup/cygwin/ChangeLog
lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Initialize initial_sp
with nullptr.
Signed-off-by: Peter Foley <pefoley2@pefoley.com>
Cygwin_props have been invented to allow switching off the unique
installation keys in the first place, supposedly for debugging.
This never really was a good idea, after all we *want* the installations
to be independent and there's no good reason to break that, not even
for debugging purposes.
Other than that, cygwin_props were meant to be used for some other global
settings which never took place. There's just no good reason to tweak
the DLL binary invisibly where a setting could be done in a file or the
environment.
This patch removes the cygwin_props entirely, including the related
settings in cygcheck.
cygwin:
* cygprops.h: Remove file.
* globals.cc (cygwin_props): Remove.
* cygheap.cc (init_cygheap::init_installation_root): Drop removing
installation key.
utils:
* cygcheck.cc: Drop including cygprops.h. Remove now unused option
values.
(unique_object_name_opt): Remove.
(handle_unique_object_name): Remove function.
(usage): Remove text for unique-object-names options.
(longopts): Remove unique-object-names options.
(main): Drop handling unique-object-names options.
doc:
* utils.xml (cygcheck): Remove text for unique-object-names options.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
The bswap_* "functions" are macros in glibc, so they may be tested for
by the preprocessor (e.g. #ifdef bswap_16).
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Throughout, simplify the C99/C11 conditionals, and replace
__STRICT_ANSI__ with the proper internal POSIX macros. The _*_r
reentrant functions need not be guarded (and most haven't been) because
such names in the global scope are reserved to the implementation.
atoff is unique to newlib.
dtoa is not actually exported (_dtoa_r is used internally), is
nonstandard, and the declaration conflicts with the code included in
MySQL, NSPR, and SpiderMonkey.
mktemp was removed in POSIX.1-2001.
The qsort_r declarations are reordered so that the GNU version retains
precedence.
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
MAXNAMLEN is a BSDism.
Use the proper internal macros instead of !_POSIX_SOURCE. telldir and
seekdir are XSI, scandir and alphasort are POSIX.1-2008, and scandirat
is GNU.
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
* ssp.c (lookup_thread_id): Consistently check if tix is a null
pointer.
(run_program): Annotate that STATUS_BREAKPOINT falls-through to
STATUS_SINGLE_STEP case.
(main): Guard against high_pc-low_pc overflow and malloc failure.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Add experimental code to workaround the issue described in the thread
starting at
https://cygwin.com/ml/cygwin/2015-07/msg00350.html
There's a hint in https://communities.vmware.com/message/2577858#2577858
that this problem is related to using the AI_ALL flag.
This patch checks if GetAddrInfoW returned with WSANO_RECOVERY and if
the AI_ALL flag was set, it retries GetAddrInfo without the AI_ALL flag.
* net.cc (cygwin_getaddrinfo): Add experimental code to retry
GetAddrInfoW without AI_ALL flag if it returned with WSANO_RECOVERY.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
If the ACL is supposed to reflect only standard POSIX permissions,
and if the permissions are so that user has more perms than group
and group has more perms than other, we don't really need the NULL
SID ACE. If the permissions are that simple, get_posix_access will
not call AuthZ.
* sec_acl.cc (set_posix_perms): Don't write NULL SID ACE if it's
not required. Explain why.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
When using RFC2307 uid/gid-mapping on Samba shares, the POSIX ACL contains
the Windows SIDs. When writing back such an ACL we have to map the
Windows SIDs back to the corresponding Samba SIDs representing the UNIX
uid/gid value. When reading Samba SIDs, make sure never to evaluate a
UNIX user account as group.
* sec_acl.cc (set_posix_access): Convert Windows SIDs to
RFC2307-mapped Sambe UNIX SIDs.
* sec_helper.cc (cygpsid::get_id): Skip UNIX user accounts when
trying to evaluate a SID as group. Skip UNIX group accounts when
trying to evaluate a SID as user.
* cygheap.h (cygheap_ugid_cache::reverse_get): New method to
get nfs id from cygwin id.
(cygheap_ugid_cache::reverse_get_uid): Wrapper for uids.
(cygheap_ugid_cache::reverse_get_gid): Wrapper for gids.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
So far creating cygsids requires to generate an "S-1-..." string
which is then converted to a SID by cygsid::getfromstr.
Add two new methods:
- cygsid::create (DWORD auth, DWORD subauth_count, ...)
... is a variable length list of subauth_count DWORD values being
the actual subauths.
- cygsid::append (DWORD rid)
allows to append a single RID to an alreaday constituted SID.
* security.h (cygsid::create): Declare public.
(cygsid::append): Ditto.
* sec_helper.cc (cygsid::create): Implement.
(cygsid::append): Implement.
* uinfo.cc (pwdgrp::fetch_account_from_windows): Use both new
methods as appropriate. Drop setting csid from string. Create
SID strings for printing SIDs only.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
gmonparam::state is used in calls to Win32 Interlocked functions.
Having this defined as int breaks the build on i686. Redefine as
LONG (same size and correct type on all platforms) to make gcc happy.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Hi.
I have noticed that Cygwin's spinlock goes into heavy sleeping code
for each spin. It seems it would be a good idea to actually try to
spin a bit first. There is this 'pause' instruction which let's the
CPU make such busy loops be less busy. Here is a patch to do this.
--
VH
This patch set modifies Cygwin's profiling support to sample PC values
of all an app's threads, not just the main thread. There is no change
to how profiling is requested: just compile and link the app with "-pg"
as usual. The profiling info is dumped into file gmon.out as always.
A new facility enabled via the environment variable GMON_OUT_PREFIX.
This facility is intended to match an undocumented Linux glibc feature.
Exporting the variable with a non-empty value such as "foo" causes the
profiling info to go to a file named foo.$pid instead of the default.
With that, both resulting processes of a fork() can have their profiling
data captured in separate files. gprof already knows how to accumulate
data from multiple files if they all pertain to the same app.
There is no change to the normal Cygwin execution paths if profiling is
not enabled. And when it is enabled, only the one profiling thread per
profiled app is doing more work than it used to.
* include/sys/cygwin.h: Add CW_CYGHEAP_PROFTHR_ALL.
* cygheap.cc (cygheap_profthr_all): New C-callable function that
runs cygheap's threadlist handing each pthread's thread handle in
turn to profthr_byhandle().
* external.cc (cygwin_internal): Add case CW_CYGHEAP_PROFTHR_ALL.
* gmon.c (_mcleanup): Add support for multiple simultaneous
gmon.out* files named via environment variable GMON_OUT_PREFIX.
* gmon.h (struct gmonparam): Make state decl volatile.
* mcount.c (_MCOUNT_DECL): Change stores into gmonparam.state to use
Interlocked operations. Add #include "winsup.h", update commentary.
* profil.c (profthr_byhandle): New function abstracting out the
updating of profile counters based on a thread handle.
(profthr_func): Update to call profthr_byhandle() to sample the main
thread then call cygheap_profthr_all() indirectly through
cygwin_internal(CW_CYGHEAP_PROFTHR_ALL) to sample all other threads.
(profile_off): Zero targthr to indicate profiling was turned off.
(profile_on): Fix handle leak on failure path.
(profile_child): New callback func to restart profiling in child
process after a fork if the parent was being profiled.
(profile_ctl): Call pthread_atfork() to set profile_child callback.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
According to https://cygwin.com/ml/cygwin/2016-03/msg00124.html it's a
problem to collect friendlyname info using AF_INET6 sockets. Fix problem
by exposing additional hardware info for all collected interfaces via the
pointer in the ifaddrs::ifa_data member.
* include/ifaddrs.h (struct ifaddrs_hwdata): Define as struct of
not yet exposed members of struct ifall, defined in net.cc.
* net.cc (struct ifall): Replace hardware dta members with struct
ifaddrs_hwdata. Accommodate throughout.
(get_ifs): Let ifaddrs ifa_data member point to ifall::ifa_hwdata
member.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Calling open from acl_extended_file{_nofollow} indiscriminately may hang
if the file is a FIFO. Ultimately the FIFO implementation needs a thorough
rewrite, but for the time being we better do what stat(2) and friends do:
Just create an fhandler directly.
* sec_posixacl.cc (__acl_extended_fh): New static function calling
fhandler::facl.
(acl_extended_fd): Just call __acl_extended_fh.
(__acl_extended_file): Take just a path_conv as parameter and
create temporary fhandler to call __acl_extended_fh.
(acl_extended_file): Create path_conv from incoming path and
call __acl_extended_file on it.
(acl_extended_file_nofollow): Ditto.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* ntdll.h (RtlGetNtVersionNumbers): Declare.
* wincap.cc (wincapc::init): Overwrite kernel version info
returned by RtlGetVersion with correct info returnd by
RtlGetNtVersionNumbers. Add comment.
Originally, using RtlGetVersion instead of GetVersionEx was supposed to
fix the fact that GetVersionInfo returns the wrong kernel version if the
executable has been built with an old manifest (or none at all), starting
with Windows 8.1. Either this never really worked as desired and our
testing was flawed, or this has been changed again with Windows 10, so
that RtlGetVersion does the kernel faking twist as well. Since we're
only reading the value in the first process in a process tree. the entire
process tree is running with a wrong OS version information in that case.
Fortunately, the (undocumented) RtlGetNtVersionNumbers function is not
affected by this nonsense, so we simply override the OS version info
fields with the correct values now.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
The problem this patch fixes showed up after updating to gcc-5.3.0. The
cuplrit is a change in gcc when emitting section attributes. It only
shows up when building without optimization. Effect in Cygwin: ws2_32
functions failed to load.
In the original code the definition of "NO_COPY wsadata" was preceeding
an __asm__ block (the definition of the _wsock_init wrapper), while the
definition of "NO_COPY here" immediately follows the same assembler
block. When gcc-5.3.0 emits assembler code for the wsadata definition,
it emits the .data_cygwin_nocopy section attribute.
Next it emits the assembler output for the __asm_ block, entirely ignoring
its content. The __asm__ block adds a .text section definition.
Eventually gcc emits assembler code for the here definition. However,
apparently gcc still "knows" that it just emitted the .data_cygwin_nocopy
section attribute and so doesn't redefine it. Remember the __asm__? It
changed the section to .text.
So with gcc-4.9.3 we got:
.section .data_cygwin_nocopy,"w"
wsadata:
__asm__ block:
.text
.section .data_cygwin_nocopy,"w"
here:
With gcc 5.3.0 we now get:
.section .data_cygwin_nocopy,"w"
wsadata:
__asm__ block:
.text
here:
So "here" is now in the .text segment which is read-only. Hilarity ensues.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* faq-using.xml (bloda): Alphabetically sort BLODA list for ease
of finding things in it.
(fixing-fork-failures): Update to suggest rebase-trigger rather
than running rebaseall via dash yourself. Mention detect_bloda
CYGWIN token.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
* sec_posixacl .cc (__acl_dup): Remove.
(acl_dup): Fold __acl_dup functionality into this function.
(acl_create_entry): Don't create new acl_t. Just realloc
acl->entry to make room for new aclent_t.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (DLL_OFILES): Add sec_posixacl.o.
(SUBLIBS): Add libacl.a
(libacl.a): New rule to create libacl.a.
* common.din: Export POSIX ACL functions as well as most libacl.a
extensions.
* fhandler.h (fhander_base::acl_get): New prototype.
(fhander_base::acl_set): Ditto.
(fhandler_disk_file::acl_get): Ditto.
(fhandler_disk_file::acl_set): Ditto.
* include/acl/libacl.h: New file.
* include/cygwin/version.h: Bump API minor version.
* include/sys/acl.h: Drop including cygwin/acl.h. Accommodate
throughout Cygwin. Add POSIX ACL definitions.
* sec_acl.cc: Include sec_posixacl.h. Replace ILLEGAL_UID and
ILLEGAL_GID with ACL_UNDEFINED_ID where sensible.
(__aclcheck): New internal acl check function to be used for
Solaris and POSIX ACLs.
(aclcheck32): Call __aclcheck.
(__aclcalcmask): New function to compute ACL_MASK value.
(__aclsort): New internal acl sort function to be used for Solaris
and POSIX ACLs.
(aclsort32): Call __aclsort.
(permtostr): Work directly on provided buffer.
(__acltotext): New internal acltotext function to be used for
Solaris and POSIX ACLs.
(acltotext32): Call __acltotext.
(__aclfromtext): New internal aclfromtext function to be used for
Solaris and POSIX ACLs.
(aclfromtext32): Call __aclfromtext.
* sec_posixacl.cc: New file implemeting POSIX ACL functions.
* sec_posixacl.h: New internal header.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
after some discussion on irc and the list i'm resubmitting a simpler
version of the patch.
setting the locale on cygwin to 'C.UTF-8' is not needed, so i'm always
setting it to 'C' which is sufficient for the build process and the
most simple fix.
short explanation: after setting up cygwin on my systems the default
locale is set to "de_DE.UTF-8". this leads to ccwrap not picking up
certain "-isystem" arguments, which in turn leads to "stddef.h: no such
file or directory". this breaks the build process for systems having non
english locale.
ccwrap scans the output of the first compiler invocation (line 21) for
some specific english output on and around line 43.
i changed the patch to check uname -o for cygwin string and set the
locale to either C or C.UTF-8
Fix various 32/64-bit portability issues in ssp, the single-step profiler, and
also build it for 64-bit.
This didn't turn out to actually be very useful for what I wanted to use it for,
so it's only been lightly tested.
It appears that on x86_64, single-step exceptions occur for much more of the
code in system DLLs, unlike x86, so ssp may take much, much longer to profile
some programs. There is existing code to use breakpoints to mitigate this, but
that is currently disabled.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
* sec_auth.cc (get_token_group_sidlist): Drop auth_luid and
auth_pos parameter. Remove code adding a logon SID.
(get_initgroups_sidlist): Drop auth_luid and auth_pos parameter.
Drop in call to get_token_group_sidlist. Accommodate in callers.
(get_setgroups_sidlist): Ditto.
(create_token): Explicitely set auth_luid to ANONYMOUS_LOGON_LUID
or LOCALSERVICE_LUID depending on OS. Explain why.
Remove handling of logon SID since we don't generate one anymore.
(lsaauth): Drop now unused local variable auth_luid and auth_pos.
* wincap.h (wincaps::has_broken_whoami): New element.
* wincap.cc: Implement above element throughout.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* cyglsa.c (must_create_logon_sid): Remove.
(LsaApInitializePackage): Drop checking version and setting
must_create_logon_sid accordingly.
(LsaApLogonUserEx): Drop code setting login SID only required on
Windows 2000 and earlier.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This follows up from my msg re GMP-ECM failing its 'make check' on the
main list https://cygwin.com/ml/cygwin/2016-02/msg00147.html .
There's an error that ought to be reported during dynamic linking if the
linked-to address is too far from the relocation site. However the error
is not reported if __OPTIMIZE__ was #defined when building the Cygwin DLL.
I can't see why optimization settings should affect this.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::conv_to_posix_path): Account for scenarios
where the path is identical to a mount point in terms of preserving
the trailing slash in the output.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>