aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-01-21Cygwin: Add fd validation where needed in mq_* functionsMark Geisert2-33/+51
Validate the fd returned by cygheap_getfd operating on given mqd. A release note is provided for 3.5.6. Reported-by: Christian Franke <Christian.Franke@t-online.de> Addresses: https://cygwin.com/pipermail/cygwin/2025-January/257090.html Signed-off-by: Mark Geisert <mark@maxrnd.com> Fixes: 46f3b0ce85a9 (Cygwin: POSIX msg queues: move all mq_* functionality into fhandler_mqueue)
2025-01-21Cygwin: signal: Do not handle signal when __SIGFLUSHFAST is sentTakashi Yano1-6/+5
The commit a22a0ad7c4f0 was not entirely correct. Even with the patch, some hangs still occur. This patch overrides the previous commit along with the patch that makes cygwait() reentrant, to fix these hangs. Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256954.html Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256987.html Fixes: d243e51ef1d3 ("Cygwin: signal: Fix deadlock between main thread and sig thread") Fixes: a22a0ad7c4f0 ("Cygwin: signal: Do not handle signal when __SIGFLUSHFAST is sent") Reported-by: Daisuke Fujimura <booleanlabel@gmail.com> Reported-by: Jeremy Drake <cygwin@jdrake.com> Reviewed-by: Corinna Vinschen <corinna@vinshcen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-01-21Cygwin: cygwait: Make cygwait() reentrantTakashi Yano4-9/+28
To allow cygwait() to be called in the signal handler, a locally created timer is used instead of _cygtls::locals.cw_timer if it is in use. Co-Authored-By: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-01-21Revert "Cygwin: signal: Do not handle signal when __SIGFLUSHFAST is sent"Takashi Yano2-18/+5
This reverts commit a22a0ad7c4f0 to apply a new patch for the same purpose. Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-01-20Cygwin: seteuid: set errno if TranslateNameW failsCorinna Vinschen1-0/+1
The call to TranslateNameW in s4uauth can fail and the code leaves the function indicating an error, if so. It just misses to set errno in this case, so add that. Fixes: 0fb497165f85 ("Cygwin: seteuid: use Kerberos/MsV1_0 S4U authentication by default") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-19Cygwin: CI: update deprecated artifacts actionJon Turney1-1/+1
2025-01-17Fixes compile failure if REENTRANT_SYSCALLS_PROVIDED and ↵Markus Eisenmann3-5/+2
MISSING_SYSCALL_NAMES defined If the macros REENTRANT_SYSCALLS_PROVIDED and MISSING_SYSCALL_NAMES are defined some _reent_*-functions are replaced by the system-call and this leads to compile-warning or a runtime-failure. * newlib/libc/stdio/fopen.c _open_r is replaces by open(), declared in <fcntl.h> * newlib/libc/stdio64/fopen64.c ditto * newlib/libc/stdio/rename.c _rename_r is rename() itself; i.e, fix recursion
2025-01-17Cygwin: doc: the library is called libcrypt, not cryptCorinna Vinschen1-4/+4
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-17Cygwin: doc: Remove executable name setup.exe from user guideCorinna Vinschen5-23/+22
Use "Cygwin Setup program" and add a link to the homepage in some cases. Reported-by: David Dyck <david.dyck@gmail.com> Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-17Cygwin: doc: clarify usage of sshd vs. cygsshdCorinna Vinschen4-10/+13
When Microsoft started to claim the "sshd" service name, we had to rename our service to "cygsshd" but we never updated the docs. Make sure the docs reflect the changed service name and fix a few bumpy expression. Reported-by: Mario Emmenlauer <mario@emmenlauer.de> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-17Cygwin: doc: remove "faq.using.sshd-in-domain"Corinna Vinschen1-69/+0
This FAQ entry has been commented out for quite some time. Drop it. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-16Add posix_spawn_file_actions_add{f}chdirCorinna Vinschen4-3/+17
POSIX®.1-2024 now defines posix_spawn_file_actions_addchdir and posix_spawn_file_actions_addfchdir. Add these interfaces to spawn.h, guarded as POSIX 202405 symbols. Cygwin-only: Export them as aliases of the *_np counterparts. Bump API minor. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-15Cygwin: cygwin/fs.h: rename FS_COMPRESSED_FL to FS_COMPR_FLCorinna Vinschen4-5/+9
FS_COMPR_FL is the Linux-compatible macro name. Redefine FS_COMPRESSED_FL as an alias of FS_COMPR_FL for backward compatibility. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-15Revert "Cygwin: mmap: use 64K pages for bookkeeping"Ken Brown1-16/+13
This reverts commit 74017d229d5e46867c8a3ec01bf653e4392bf14c. After this commit, gdb exits with a fatal error on startup. Addresses: https://cygwin.com/pipermail/cygwin-patches/2025q1/013240.html Fixes: 74017d229d5e ("Cygwin: mmap: use 64K pages for bookkeeping") Signed-off-by: Ken Brown <kbrown@cornell.edu>
2025-01-15Cygwin: get_posix_access: make sure pos is correctly set when usedCorinna Vinschen1-7/+10
The code merging permissions relies on `pos' being set to the number of current entries in the local aclent_t buffer. Commit 0e6d36766c83 ("Cygwin: get_posix_access: move umask masking to the end") moved that code to run earlier, but neglected to move setting `pos' correctly as well. Make sure to set `pos' inside the code block, as well as in the final array size check, so `pos' is set correctly where it belongs. Fixes: 0e6d36766c83 ("Cygwin: get_posix_access: move umask masking to the end") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-15Cygwin: get_posix_access: initalize obj_idxCorinna Vinschen1-1/+1
This fixes a false positive gcc warning. Fixes: 01c9386fd805 ("Cygwin: get_posix_access: improve merging permissions") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-15Cygwin: get_posix_access: move umask masking to the endCorinna Vinschen1-95/+95
umask handling for new file gets overriden by subsequent merging of permissions in Windows-generated ACLs. Fix this by performing umask masking after all other ACL manipulations. Fixes: a8716448cecc ("Simplify "Windows-standard-like" permissions") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-15Cygwin: get_posix_access: improve merging permissionsCorinna Vinschen1-49/+97
Add a second loop to the code snippet merging permissions in old-style or Windows-generated ACLs. This loop fixes up default ACL permissions created from ACEs which are valid for the directory itself, as well as getting inherited to child objects. The FULL_ACE bit utilized for this is removed from the ACE at the end of the function, together with the temporary DENY bits. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-15Revert "Cygwin: get_posix_access: do not merge permissions for just created ↵Corinna Vinschen1-1/+1
files" This reverts commit 971d2dffea7848270aa9dfb5c14dcd946c8971c0. This patch was supposed to fix lots of FAILs in our own testsuite/winsup.api/ltp/umask03.c test. The reason was that umask masking in get_posix_access when generating new files was overriden by later code in the same function, merging permissions in old-style or Windows generated ACLs. However, the solution to skip merging was not the right thing, because this breaks handling of Windows-generated ACLs. Rather, umask masking should be performed pretty late, certainly after merging permissions. This will be done by a followup patch. Fixes: 971d2dffea78 ("Cygwin: get_posix_access: do not merge permissions for just created files") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-15Cygwin: get_posix_access: fix id in default:user and default:group entryCorinna Vinschen1-2/+2
Setting the a_id in the default:user and default:group entries to the actual uid and gid of the current owner/group doesn't make sense. Change to ACL_UNDEFINED_ID. Fixes: bc444e5aa4ca ("Reapply POSIX ACL changes.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-15Cygwin: get_posix_access: don't drop admin and system perms in default ACLCorinna Vinschen1-5/+0
The permissions of entries for SYSTEM and the Administrators group are not added to the CLASS_OBJ entry, so they don't set the class perms to rwx all the time. This shouldn't be done for default perms, otherwise the resulting permissions when generating new files might be surprisingly restricted for Admins and SYSTEM. Fixes: bc444e5aa4ca ("Reapply POSIX ACL changes.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-15Cygwin: get_posix_access: accomodate owner==group in default:group permsCorinna Vinschen1-0/+3
When generating a default:group (Windows: CREATOR GROUP) ACL entry, make sure to copy over user perms to the new default group entry. Fixes: bc444e5aa4ca ("Reapply POSIX ACL changes.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-15Cygwin: get_posix_access: drop stray increment instructionCorinna Vinschen1-1/+0
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-15Cygwin: get_posix_access: Use correct type for local id variableCorinna Vinschen1-1/+2
it's an id_t, not an int. Fixes: bc444e5aa4ca ("Reapply POSIX ACL changes.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-15Cygwin: security.h: De-inline cygpsid::debug_printCorinna Vinschen2-5/+8
This allows to use the function from GDB during debugging. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-14Cygwin: signal: Do not handle signal when __SIGFLUSHFAST is sentTakashi Yano2-5/+18
After the commit d243e51ef1d3, zsh sometimes hangs at startup. This occurs because SIGCHLD, which should trigger sigsuspend(), is handled in cygwait() that is used to wait for a wakeup event in sig_send(), even when __SIGFLUSHFAST is sent. Despite __SIGFLUSHFAST being required to return before handling the signal, this does not happen. With this patch, if the signal currently being sent is __SIGFLUSHFAST, do not handle the received signal and keep it asserted after the cygwait() for the wakeup event. Apply the same logic to the cygwait() in the retrying loop for WriteFile() as well. Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256954.html Fixes: d243e51ef1d3 ("Cygwin: signal: Fix deadlock between main thread and sig thread") Reported-by: Daisuke Fujimura <booleanlabel@gmail.com> Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2025-01-13Cygwin: mmap: use 64K pages for bookkeepingKen Brown1-13/+16
It was convenient to use pages of size 4K (Windows page size) for bookkeeping when we were using filler pages. But all references to filler pages were removed in commit ceda26c9d35b ("Cygwin: mmap: remove __PROT_FILLER and the associated methods"), so this is no longer necessary. Switch to using pages of size 64K (Windows allocation granularity) for everything. Signed-off-by: Ken Brown <kbrown@cornell.edu>
2025-01-13Add missing getlocalename_l to LIBC_CHEWOUT_FILESCorinna Vinschen2-15/+16
Regenerate Makefile.in. Fixes: 71511d4ac8686 ("getlocalename_l: implement per SUS Base Specifications Issue 8 draft") Reported-by: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-12Cygwin: unlink/rename: fix skipping deletion with POSIX semanticsCorinna Vinschen2-4/+7
unlink_nt() and rename2 () both check for the FILE_SUPPORTS_OPEN_BY_FILE_ID flag to use POSIX delete/rename semantics. Both erroneously check the flag against the file attributes using has_attributes(). Given that this flag is a filesystem flag, check using fs_flags() instead. Fixes: fe2545e9faaf ("Cygwin: don't use unlink/rename POSIX semantics on certain NTFS") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-09Cygwin: remove winsup/cygwin/local_includes/mmap_helper.hKen Brown1-89/+0
None of its macros and functions are used anymore. Signed-off-by: Ken Brown <kbrown@cornell.edu>
2025-01-09Cygwin: mmap_list::try_map: simplifyKen Brown1-16/+14
Save the result of mmap_record::find_unused pages, and then pass that result to the appropriate version of mmap_record::map_pages. Add a new parameter of type off_t to the latter to make this possible, and change its return type from off_t to bool. This saves map_pages from having to call find_unused_pages again. Signed-off-by: Ken Brown <kbrown@cornell.edu>
2025-01-09Cygwin: mmap: remove __PROT_FILLER and the associated methodsKen Brown1-24/+7
This is left over from 32 bit Cygwin and is no longer used. Signed-off-by: Ken Brown <kbrown@cornell.edu>
2025-01-09Cygwin: mmap: remove is_mmapped_region()Ken Brown2-34/+0
The last use was removed in commit 29a126322783 ("Simplify stack allocation code in child after fork"). Signed-off-by: Ken Brown <kbrown@cornell.edu>
2025-01-09Cygwin: mmap: refactor mmap_record::matchKen Brown1-6/+25
Slightly simplify the code and add comments to explain what the function does. Add a version of this method with a new reference parameter "contains" that is set to true if the chunk of this mmap_record contains the given address range. Signed-off-by: Ken Brown <kbrown@cornell.edu>
2025-01-08Cygwin: access: Fix X_OK behaviour for backup operators and adminsCorinna Vinschen2-7/+26
After commit a0933cd17d19, access(_, X_OK) returns 0 if the user holds SE_BACKUP_PRIVILEGE, even if the file's ACL denies execution to the user. This is triggered by trying to open the file with FILE_OPEN_FOR_BACKUP_INTENT. Fix check_file_access() so it checks for X_OK without specifying the FILE_OPEN_FOR_BACKUP_INTENT flag if the file is not a directory. Rearrange function slightly and add comments for easier comprehension. Fixes: a0933cd17d19 ("Cygwin: access: Correction for samba/SMB share") Reported-by: Bruno Haible <bruno@clisp.org> Co-authored-by: Takashi Yano <takashi.yano@nifty.ne.jp> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2025-01-07Cygwin: mmap: allow remapping part of an existing anonymous mappingKen Brown2-18/+33
Previously mmap with MAP_FIXED would fail with EINVAL on an attempt to map an address range contained in the chunk of an existing mapping. With this commit, mmap will succeed, provided the mappings are anonymous, the MAP_SHARED/MAP_PRIVATE flags agree, and MAP_NORESERVE is not set for either mapping. Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256901.html Signed-off-by: Ken Brown <kbrown@cornell.edu>
2025-01-07Cygwin: mmap: fix mmap_is_attached_or_noreserveKen Brown1-23/+28
This commit fixes two problems. The first is that mmap_is_attached_or_noreserve would sometimes call VirtualAlloc with MEM_COMMIT on address ranges that were not known to have MEM_RESERVE status. These calls could fail, causing SIGBUS to be raised incorrectly. See https://cygwin.com/pipermail/cygwin-developers/2024-December/012725.html for details. Fix this by calling VirtualAlloc only on the part of the address range that's contained in the current mmap_record. The second problem is that the code would sometimes break out of the main loop without knowing whether attached mappings still occur later in the mmap_list. This could cause SIGBUS to not be raised when it should be. Fix this by using "continue" rather than "break". For efficiency, introduce a boolean variable "nocover" that's set to true if we discover that the address range cannot be covered by noreserve mmap regions. Addresses: https://cygwin.com/pipermail/cygwin-developers/2024-December/012725.html Fixes: 70e476d27be8 ("* include/cygwin/version.h: Bump DLL version to 1.7.0") Signed-off-by: Ken Brown <kbrown@cornell.edu>
2024-12-31Changes for 4.5.0 snapshotnewlib-4.5.0Jeff Johnston6-26/+42
- bump up release to 4.5.0
2024-12-19Cygwin: pinfo: raise MAX_PID to 4194304Corinna Vinschen3-2/+6
Reportedly, the maximum pid of 65536 is much too small in bigger environments. Raise the maximum PID to 4194304, whihc is the maximum pid on Linux (PID_MAX_LIMIT defined in include/linux/threads.h). Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-12-19Cygwin: mmap_list::try_map: fix a condition in a test of an mmap requestKen Brown1-1/+1
In testing whether the requested area is contained in an existing mapped region, an incorrect condition was used due to a misinterpretation of the u_addr and u_len variables. Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256913.html Fixes: c68de3a262fe5 ("* mmap.cc (class mmap_record): Declare new map_pages method with address parameter.") Signed-off-by: Ken Brown <kbrown@cornell.edu>
2024-12-19Cygwin: mmap: fix protection when unused pages are recycledKen Brown2-13/+21
Previously, when unused pages from an mmap_record were recycled, they were given the protection of the mmap_record rather than the protection requested in the mmap call. Fix this by adding a "new_prot" parameter to mmap_list::try_map() and mmap_record::map_pages() to keep track of the requested protection. Then use new_prot in the calls to VirtualProtect(). Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256911.html Fixes: f90e23f2714cb ("*autoload.cc (NtCreateSection): Define.") Signed-off-by: Ken Brown <kbrown@cornell.edu>
2024-12-17Cygwin: /proc/<PID>/stat: set field (18) according to scheduling policyChristian Franke5-41/+88
If a realtime policy is selected, set the '(18) priority' field to the negated sched_priority minus one. If SCHED_IDLE is selected, set it to the lowest priority 39. Also set '(19) nice' to the originally requested nice value. Ensure consistence with the current Windows priority in all cases. Move the sched_priority from/to Windows priority mapping from sched_get/setparam() to new functions in miscfuncs.cc. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-12-16Cygwin: doc: add SCHED_BATCH, SCHED_IDLE and SCHED_RESET_ON_FORKChristian Franke1-15/+22
Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-12-16or1k: Fix compiler warningsStafford Horne5-5/+8
In my build the below are treated as error now and causing failures. I have described the fixes of each warning below. In newlib/libc/sys/or1k/mlock.c: CC libc/sys/or1k/libc_a-mlock.o newlib/libc/sys/or1k/mlock.c: In function ‘__malloc_lock’: newlib/libc/sys/or1k/mlock.c:56:19: warning: implicit declaration of function ‘or1k_critical_begin’ [-Wimplicit-function-declaration] 56 | restore = or1k_critical_begin(); | ^~~~~~~~~~~~~~~~~~~ newlib/libc/sys/or1k/mlock.c: In function ‘__malloc_unlock’: newlib/libc/sys/or1k/mlock.c:93:17: warning: implicit declaration of function ‘or1k_critical_end’ [-Wimplicit-function-declaration] 93 | or1k_critical_end(restore); | ^~~~~~~~~~~~~~~~~ This patch adds prototypes for functions or1k_critical_begin and or1k_critical_end to suppress the warning, inline with what we do for or1k_sync_cas. In libgloss/or1k/or1k_uart.c: libgloss/or1k/or1k_uart.c: In function ‘or1k_uart_set_read_cb’: libgloss/or1k/or1k_uart.c:163:25: warning: passing argument 2 of ‘or1k_interrupt_handler_add’ from incompatible pointer type [-Wincompatible-pointer-types] 163 | _or1k_uart_interrupt_handler, 0); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | void (*)(uint32_t) {aka void (*)(long unsigned int)} In file included from libgloss/or1k/or1k_uart.c:19: libgloss/or1k/include/or1k-support.h:97:45: note: expected ‘or1k_interrupt_handler_fptr’ {aka ‘void (*)(void *)’} but argument is of type ‘void (*)(uint32_t)’ {aka ‘void (*)(long unsigned int)’} 97 | or1k_interrupt_handler_fptr handler, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ The public API is ‘void (*)(void *)' for our interrupt handlers. The function _or1k_uart_interrupt_hander is the internal default implementation of the uart IRQ handler and it doesn't use the data argument. This patch updates the _or1k_uart_interrupt_handler argument type from uint32_t to void* allowing the function prototype to match the required prototype. If we did have a 64-bit implementation it would be an ABI issue. But, there never has been one, or1k is only 32-bit. In libgloss/or1k/interrupts.c: libgloss/or1k/interrupts.c: In function ‘or1k_interrupt_handler_add’: libgloss/or1k/interrupts.c:41:52: warning: assignment to ‘void *’ from ‘long unsigned int’ makes pointer from integer without a cast [-Wint-conversion] 41 | _or1k_interrupt_handler_data_ptr_table[id] = (uint32_t) data_ptr; | ^ The table _or1k_interrupt_handler_data_ptr_table is an array of void* and data_ptr is void*. There is no need for the cast so remove it. In libgloss/or1k/sbrk.c: libgloss/or1k/sbrk.c:23:29: warning: initialization of ‘uint32_t’ {aka ‘long unsigned int’} from ‘uint32_t *’ {aka ‘long unsigned int *’} makes integer from pointer without a cast [-Wint-conversion] 23 | uint32_t _or1k_heap_start = &end; | This patch adds a cast, which is safe in or1k as the architecture in 32-bit only. But this code would not be 64-compatible. Signed-off-by: Stafford Horne <shorne@gmail.com>
2024-12-13Cygwin: signal: Fix typo in the comment added by previous commitTakashi Yano1-2/+2
Fixes: 1d1451ccd2a6 ("Cygwin: signal: Fix high load when retrying to process pending signal") Reported-by: Jon Turney <jon.turney@dronecode.org.uk> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-12-12Cygwin: signal: Fix high load when retrying to process pending signalTakashi Yano1-1/+9
The commit e10f822a2b39 has a problem that CPU load gets high if pending signal is not processed successfully for a long time. With this patch, wait_sig() calls Sleep(1), rather than yield(), if the pending signal has not been processed successfully for a predetermined time to prevent CPU from high load. Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256884.html Fixes: e10f822a2b39 ("Cygwin: signal: Handle queued signal without explicit __SIGFLUSH") Reported-by: 凯夏 <walkerxk@gmail.com> Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-12-12Cygwin: sched_setscheduler: accept SCHED_RESET_ON_FORK flagChristian Franke7-9/+52
Add SCHED_RESET_ON_FORK to <sys/sched.h>. If this flag is set, SCHED_FIFO and SCHED_RR are reset to SCHED_OTHER and negative nice values are reset to zero in each child process created with fork(2). Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-12-12Cygwin: sched_setscheduler: accept SCHED_BATCHChristian Franke6-84/+122
Add SCHED_BATCH to <sys/sched.h>. SCHED_BATCH is similar to SCHED_OTHER, except that the nice value is mapped to a one step lower Windows priority. Rework the mapping functions to ease the addition of this functionality. Signed-off-by: Christian Franke <christian.franke@t-online.de>
2024-12-11Cygwin: utils: cygpath: add -r option to emit paths with root-local prefixCorinna Vinschen3-16/+82
cygpath automatically adds the root-local prefix \\?\ automatically for paths exceeding 260 bytes. However, it does not add the root-local prefix if the path contains path components invalid in DOS paths, for instance path components with trailing dots or spaces. Add the -r option to always add the root-local prefix to the path. Add the option to the documentation and improve the help text. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2024-12-11Cygwin: access: Correction for samba/SMB shareTakashi Yano1-99/+20
Previously, access() and eaccess() does not determine the permissions for files on samba/SMB share correctly. Even if the user logs-in as the owner of the file, access() and eaccess() referes to others' permissions. With this patch, to determine the permissions correctly, NtOpenFile() with desired access mask is used. Fixes: cf762b08cfb0 ("* security.cc (check_file_access): Create.") Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>