summaryrefslogtreecommitdiffstats
path: root/src/os_unix.c
AgeCommit message (Collapse)Author
2024-03-10patch 9.1.0162: problem with writing extended attributes on failurev9.1.0162Paul R. Tagliamonte
Problem: problem with writing extended attributes on failure Solution: Change return type to ssize_t and check listxattr's return value correctly on failure (Paul Tagliamonte) The existing logic will return when the listxattr call returns with the errno set to ENOTSUP (or a size of 0 bytes), without checking to see if listxattr actually failed. listxattr can fail with at least E2BIG, ENOTSUP, ERANGE, or anything that `stat(2)` can fail with (in my case; ENOENT from stat). The returned size is stored to a size_t, but the return type is a ssize_t. On failure, listxattr returns -1, which will get translated to size_t's MAX. If the listxattr call failed with anything other than ENOTSUP, this triggers a request for size_t MAX bytes. This means that, if the listxattr call fails with anything other than ENOTSUP on save, vim will error with `E342: Out of memory! (allocating 18446744073709551615 bytes)` (keen observers will note 18446744073709551615 is 0xffffffffffffffff) In reality, this is likely masking a different (usually filesystem?) error -- but at least it's an error being pushed to the user now, and we don't try to allocate size_t MAX bytes. I've opted to change the type that we store listxattr to from size_t to ssize_t, to match listxattr(2)'s signature, and to check for the -1 return value. Additionally, I've removed the errno check -- if we get a listxattr failure for any reason, we may as well bail without trying; it's not like we can even recover. closes: #14169 Signed-off-by: Paul Tagliamonte <paultag@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-29patch 9.1.0064: No Wayland supportv9.1.0064lilydjwg
Problem: No Wayland support Solution: Add Wayland UI support (lilydjwg) closes: #9639 Signed-off-by: lilydjwg <lilydjwg@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-04patch 9.1.0006: is*() and to*() function may be unsafev9.1.0006Keith Thompson
Problem: is*() and to*() function may be unsafe Solution: Add SAFE_* macros and start using those instead (Keith Thompson) Use SAFE_() macros for is*() and to*() functions The standard is*() and to*() functions declared in <ctype.h> have undefined behavior for negative arguments other than EOF. If plain char is signed, passing an unchecked value from argv for from user input to one of these functions has undefined behavior. Solution: Add SAFE_*() macros that cast the argument to unsigned char. Most implementations behave sanely for negative arguments, and most character values in practice are non-negative, but it's still best to avoid undefined behavior. The change from #13347 has been omitted, as this has already been separately fixed in commit ac709e2fc0db6d31abb7da96f743c40956b60c3a (v9.0.2054) fixes: #13332 closes: #13347 Signed-off-by: Keith Thompson <Keith.S.Thompson@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-16patch 9.0.2034: don't try to copy SMACK attribute, when none existv9.0.2034Christian Brabandt
Problem: don't try to copy SMACK attribute, when none exist Solution: return early if SMACK extended attributes do not exist or if they are not supported closes: #1711 closes: #13348 Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-02patch 9.0.1975: xattr: permission-denied errors on writev9.0.1975Gene C
Problem: xattr: permission-denied errors on write Solution: ignore those errors closes: #13246 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Gene C <arch@sapience.com>
2023-10-01patch 9.0.1967: xattr errors not translatedv9.0.1967zeertzjq
Problem: xattr errors not translated Solution: mark for translation, consistently capitalize first letter. closes: #13236 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-30patch 9.0.1964: xattr support fails to build on MacOS Xv9.0.1964Christian Brabandt
Problem: xattr support fails to build on MacOS X Solution: Disable xattr support for MacOS X MacOS X uses the same headers and functions sys/xattr.h but the function signatures for xattr support are much different, so building fails. So let's for now disable xattr support there. closes: #13230 closes: #13232 Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-30patch 9.0.1963: Configure script may not detect xattrv9.0.1963zeertzjq
Problem: Configure script may not detect xattr correctly Solution: include sys/xattr instead of attr/xattr, make Test_write_with_xattr_support() test xattr feature correctly This also applies to the Smack security feature, so change the include and configure script for it as well. closes: #13229 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-30patch 9.0.1962: No support for writing extended attributesv9.0.1962Christian Brabandt
Problem: No support for writing extended attributes Solution: Add extended attribute support for linux It's been a long standing issue, that if you write a file with extended attributes and backupcopy is set to no, the file will loose the extended attributes. So this patch adds support for retrieving the extended attributes and copying it to the new file. It currently only works on linux, mainly because I don't know the different APIs for other systems (BSD, MacOSX and Solaris). On linux, this should be supported since Kernel 2.4 or something, so this should be pretty safe to use now. Enable the extended attribute support with normal builds. I also added it explicitly to the :version output as well as make it able to check using `:echo has("xattr")`, to have users easily check that this is available. In contrast to the similar support for SELINUX and SMACK support (which also internally uses extended attributes), I have made this a FEAT_XATTR define, instead of the similar HAVE_XATTR. Add a test and change CI to include relevant packages so that CI can test that extended attributes are correctly written. closes: #306 closes: #13203 Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27patch 9.0.1946: filename expansion using ** in bash may failv9.0.1946Christian Brabandt
Problem: filename expansion using ** in bash may fail Solution: Try to enable the globstar setting Starting with bash 4.0 it supports extended globbing using the globstar shell option. This makes matching recursively below a certain directory using the ** pattern work as expected nowadays. However, we need to explicitly enable this using the 'shopt -s globstar' bash command. So let's check the bash environment variable $BASH_VERSINFO (which is supported since bash 3.0 and conditionally enable the globstar option, if the major version is at least 4. For older bashs, this at least shouldn't cause errors (unless one is using really ancient bash 2.X or something). closes: #13002 closes: #13144 Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24patch 9.0.1930: compiler warnings with clang-17v9.0.1930Dominique Pellé
Problem: compiler warnings with clang-17 Solution: Fix function prototypes and function pointer fix: clang compilation warnings with -Wstrict-prototypes Change fixes this kind of compilation warnings with clang: ``` proto/if_python3.pro:13:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] 13 | int python3_version(); | ^ | void ``` closes: #13166 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
2023-06-21patch 9.0.1642: build failure with tiny featuresv9.0.1642Bram Moolenaar
Problem: Build failure with tiny features. Solution: Add #ifdef's.
2023-06-21patch 9.0.1641: the log file does not give information about window sizesv9.0.1641Bram Moolenaar
Problem: The log file does not give information about window sizes. Solution: Add a few log messages about obtaining the window size.
2023-05-20patch 9.0.1572: error messages are not translatedv9.0.1572Bram Moolenaar
Problem: Error messages are not translated. Solution: Add _().
2023-05-20patch 9.0.1571: RedrawingDisabled not used consistentlyv9.0.1571Bram Moolenaar
Problem: RedrawingDisabled not used consistently. Solution: Avoid RedrawingDisabled going negative. Set RedrawingDisabled in win_split_ins(). (closes #11961)
2023-05-11patch 9.0.1544: recent glibc marks sigset() as a deprecatedv9.0.1544ichizok
Problem: Recent glibc marks sigset() as a deprecated. Solution: Use sigaction() in mch_signal() if possible. (Ozaki Kiichi, closes #12373)
2023-04-19patch 9.0.1471: warnings for function declarationsv9.0.1471Michael Jarvis
Problem: Warnings for function declarations. Solution: Add argument types. (Michael Jarvis, closes #12277)
2023-04-13patch 9.0.1450: MacOS: building fails if clock_gettime() is not availablev9.0.1450Bram Moolenaar
Problem: MacOS: building fails if clock_gettime() is not available. Solution: Add a configure check for clock_gettime(). (closes #12242)
2023-03-12patch 9.0.1403: unused variables and functionsv9.0.1403Dominique Pelle
Problem: Unused variables and functions. Solution: Delete items and adjust #ifdefs. (Dominique Pellé, closes #12145)
2023-03-07patch 9.0.1390: FOR_ALL_ macros are defined in an unexpected filev9.0.1390Yegappan Lakshmanan
Problem: FOR_ALL_ macros are defined in an unexpected file. Solution: Move FOR_ALL_ macros to macros.h. Add FOR_ALL_HASHTAB_ITEMS. (Yegappan Lakshmanan, closes #12109)
2023-03-04patch 9.0.1377: job_status() may return "dead" if the process parent changedv9.0.1377Bram Moolenaar
Problem: job_status() may return "dead" if the process parent changed. Solution: Call mch_process_running() to check if the job is still alive.
2023-01-16patch 9.0.1208: code is indented more than necessaryv9.0.1208Yegappan Lakshmanan
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11819)
2023-01-10patch 9.0.1168: code to enable/disable mouse is not from terminfo/termcapv9.0.1168Bram Moolenaar
Problem: Code to enable/disable mouse is not from terminfo/termcap. Solution: Request the "XM" entry and use it to set 'ttymouse' if possible.
2022-12-19patch 9.0.1080: the "kitty" terminfo entry is not widespreadv9.0.1080Bram Moolenaar
Problem: The "kitty" terminfo entry is not widespread, resulting in the kitty terminal not working properly. Solution: Go back to using "xterm-kitty" and avoid the problems it causes in another way.
2022-12-01patch 9.0.0980: the keyboard state response may end up in a shell commandv9.0.0980Bram Moolenaar
Problem: The keyboard state response may end up in a shell command. Solution: Only request the keyboard protocol state when the typeahead is empty, no more commands are following and not exiting. Add the t_RK termcap entry for this.
2022-11-30patch 9.0.0977: it is not easy to see what client-server commands are doingv9.0.0977Bram Moolenaar
Problem: It is not easy to see what client-server commands are doing. Solution: Add channel log messages if ch_log() is available. Move the channel logging and make it available with the +eval feature.
2022-11-28patch 9.0.0965: using one window for executing autocommands is insufficientv9.0.0965Bram Moolenaar
Problem: Using one window for executing autocommands is insufficient. Solution: Use up to five windows for executing autocommands.
2022-11-25patch 9.0.0948: 'ttyfast' is set for arbitrary terminalsv9.0.0948Bram Moolenaar
Problem: 'ttyfast' is set for arbitrary terminals. Solution: Always set 'ttyfast'. (closes #11549)
2022-11-23patch 9.0.0930: cannot debug the Kitty keyboard protocol with TermDebugv9.0.0930Bram Moolenaar
Problem: Cannot debug the Kitty keyboard protocol with TermDebug. Solution: Add Kitty keyboard protocol support to the libvterm fork. Recognize the escape sequences that the protocol generates. Add the 'keyprotocol' option to allow the user to specify for which terminal what protocol is to be used, instead of hard-coding this. Add recognizing the kitty keyboard protocol status.
2022-11-18patch 9.0.0904: various comment and indent flawsv9.0.0904Bram Moolenaar
Problem: Various comment and indent flaws. Solution: Improve comments and indenting.
2022-10-08patch 9.0.0694: no native sound support on Mac OSv9.0.0694Yee Cheng Chin
Problem: No native sound support on Mac OS. Solution: Add sound support for Mac OS. (Yee Cheng Chin, closes #11274)
2022-10-04patch 9.0.0655: passing modifier codes to a shell running in the GUIv9.0.0655Bram Moolenaar
Problem: passing modifier codes to a shell running in the GUI. (Gary Johnson) Solution: Include modifier codes into the key and drop the modifiers.
2022-10-03patch 9.0.0653: BS and DEL do not work properly in an interacive shellv9.0.0653Bram Moolenaar
Problem: BS and DEL do not work properly in an interacive shell. (Gary Johnson) Solution: Adjust the length for replaced codes.
2022-09-27patch 9.0.0606: system() opens a terminal window when "!" is in 'guioptions'v9.0.0606Bram Moolenaar
Problem: system() opens a terminal window when using the GUI and "!" is in 'guioptions'. Solution: Do not use a terminal window when the SHELL_SILENT flag is used. (closes #11202)
2022-09-04patch 9.0.0376: clang warns for dead assignmentsv9.0.0376Yegappan Lakshmanan
Problem: Clang warns for dead assignments. Solution: Adjust the code. (Yegappan Lakshmanan, closes #11048)
2022-08-27patch 9.0.0287: Irix systems no longer existv9.0.0287Yegappan Lakshmanan
Problem: Irix systems no longer exist. Solution: Remove references to Irix. (Yegappan Lakshmanan, closes #10994)
2022-08-26patch 9.0.0271: using INIT() in non-header filesv9.0.0271zeertzjq
Problem: Using INIT() in non-header files. Solution: Remove INIT(). (closes #10981)
2022-08-14patch 9.0.0206: redraw flags are not named specificallyv9.0.0206Bram Moolenaar
Problem: Redraw flags are not named specifically. Solution: Prefix "UPD_" to the flags, for UPDate_screen().
2022-07-28patch 9.0.0100: get hit-enter prompt for system() when '!' is in 'guioptions'v9.0.0100Bram Moolenaar
Problem: Get hit-enter prompt for system() when '!' is in 'guioptions'. Solution: Do not call wait_return() when not redrawing. (closes #3327)
2022-06-23patch 8.2.5154: still mentioning version8, some cosmetic issuesv8.2.5154Bram Moolenaar
Problem: Still mentioning version8, some cosmetic issues. Solution: Prefer mentioning version9, cosmetic improvements.
2022-06-20patch 8.2.5141: using "volatile int" in a signal handler might be wrongv8.2.5141Bram Moolenaar
Problem: Using "volatile int" in a signal handler might be wrong. Solution: Use "volatile sig_atomic_t".
2022-06-20patch 8.2.5137: cannot build without the +channel featurev8.2.5137Bram Moolenaar
Problem: Cannot build without the +channel feature. (Dominique Pellé) Solution: Add #ifdef around ch_log() calls. (closes #10598)
2022-06-19patch 8.2.5129: timeout handling is not optimalv8.2.5129Bram Moolenaar
Problem: Timeout handling is not optimal. Solution: Avoid setting timeout_flag twice. Adjust the pointer when stopping the regexp timeout. Adjust variable name.
2022-06-17patch 8.2.5115: search timeout is overrun with some patternsv8.2.5115Bram Moolenaar
Problem: Search timeout is overrun with some patterns. Solution: Check for timeout in more places. Make the flag volatile and atomic. Use assert_inrange() to see what happened.
2022-06-16patch 8.2.5113: timer becomes invalid after fork/exec, :gui gives errorsv8.2.5113Bram Moolenaar
Problem: Timer becomes invalid after fork/exec, :gui gives errors. (Gabriel Dupras) Solution: Delete the timer befor forking. (closes #10584)
2022-06-08patch 8.2.5067: timer_create is not available on every Mac systemv8.2.5067Bram Moolenaar
Problem: Timer_create is not available on every Mac system. (Hisashi T Fujinaka) Solution: Adjust #ifdef.
2022-06-06patch 8.2.5062: Coverity warns for dead codev8.2.5062Bram Moolenaar
Problem: Coverity warns for dead code. Solution: Remove the dead code.
2022-06-05patch 8.2.5061: C89 requires signal handlers to return voidv8.2.5061Bram Moolenaar
Problem: C89 requires signal handlers to return void. Solution: Drop RETSIGTYPE and hard-code a void return value.
2022-06-05patch 8.2.5057: using gettimeofday() for timeout is very inefficientv8.2.5057Paul Ollis
Problem: Using gettimeofday() for timeout is very inefficient. Solution: Set a platform dependent timer. (Paul Ollis, closes #10505)
2022-05-09patch 8.2.4928: various white space and cosmetic mistakesv8.2.4928Bram Moolenaar
Problem: Various white space and cosmetic mistakes. Solution: Change spaces to tabs, improve comments.