mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-25 01:16:31 -05:00
Add new build option to allow symlinks
This commit is contained in:
parent
dccba9fd8c
commit
2f5ffc3e90
3 changed files with 15 additions and 1 deletions
2
HISTORY
2
HISTORY
|
|
@ -34,6 +34,8 @@ SnapRAID HISTORY
|
||||||
build time. When not specified, the existing runtime discovery
|
build time. When not specified, the existing runtime discovery
|
||||||
behaviour is preserved. Primarily intended for NixOS and other
|
behaviour is preserved. Primarily intended for NixOS and other
|
||||||
non-FHS systems.
|
non-FHS systems.
|
||||||
|
* Added --enable-symlink-tools configure option to allow the validation
|
||||||
|
logic to accept symbolic links for the specified --with-* paths.
|
||||||
|
|
||||||
14.7 2026/06
|
14.7 2026/06
|
||||||
============
|
============
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,10 @@ static int verify_executable(const char* exec_path, char* resolved_path)
|
||||||
* Open the executable
|
* Open the executable
|
||||||
* O_NOFOLLOW prevents following symlinks to mitigate redirection attacks
|
* O_NOFOLLOW prevents following symlinks to mitigate redirection attacks
|
||||||
*/
|
*/
|
||||||
int fd = openat(dir_fd, exec_name, O_RDONLY | O_NOFOLLOW
|
int fd = openat(dir_fd, exec_name, O_RDONLY
|
||||||
|
#if !HAVE_SYMLINK_TOOLS
|
||||||
|
| O_NOFOLLOW
|
||||||
|
#endif
|
||||||
#if !HAVE_FEXECVE
|
#if !HAVE_FEXECVE
|
||||||
| O_CLOEXEC /* with fexecve cannot use O_CLOEXEC (Close on Exec) */
|
| O_CLOEXEC /* with fexecve cannot use O_CLOEXEC (Close on Exec) */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -498,6 +498,15 @@ WITH_TOOL([zfs], [zfs], [ZFS pool management])
|
||||||
WITH_TOOL([zpool], [zpool], [ZFS pool status])
|
WITH_TOOL([zpool], [zpool], [ZFS pool status])
|
||||||
WITH_TOOL([bcachefs], [bcachefs], [Bcachefs management])
|
WITH_TOOL([bcachefs], [bcachefs], [Bcachefs management])
|
||||||
|
|
||||||
|
# Enable support for symlinked tool paths
|
||||||
|
AC_ARG_ENABLE([symlink-tools],
|
||||||
|
[AS_HELP_STRING([--enable-symlink-tools], [allow paths specified with --with-* options to be symbolic links])],
|
||||||
|
[
|
||||||
|
AS_IF([test "x$enableval" = "xyes"], [
|
||||||
|
AC_DEFINE([HAVE_SYMLINK_TOOLS], [1], [Define to 1 if paths specified with --with-* options are allowed to be symlinks.])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
AC_ARG_VAR([TESTENV], [Test environment])
|
AC_ARG_VAR([TESTENV], [Test environment])
|
||||||
AC_ARG_VAR([FAILENV], [Test environment for failing tests])
|
AC_ARG_VAR([FAILENV], [Test environment for failing tests])
|
||||||
AC_ARG_VAR([TESTENV_SSE2], [Test environment for SSE2])
|
AC_ARG_VAR([TESTENV_SSE2], [Test environment for SSE2])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue