Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package bindfs for openSUSE:Factory checked in at 2022-12-09 13:16:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/bindfs (Old) and /work/SRC/openSUSE:Factory/.bindfs.new.1835 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "bindfs" Fri Dec 9 13:16:50 2022 rev:24 rq:1041651 version:1.17.1 Changes: -------- --- /work/SRC/openSUSE:Factory/bindfs/bindfs.changes 2022-07-31 23:01:08.235725438 +0200 +++ /work/SRC/openSUSE:Factory/.bindfs.new.1835/bindfs.changes 2022-12-09 13:16:58.534744971 +0100 @@ -1,0 +2,7 @@ +Mon Dec 5 10:42:06 UTC 2022 - Dirk Müller <dmuel...@suse.com> + +- update to 1.17.1: + * Fixed --resolve-symlinks when mountpoint name starts + with source dir name + +------------------------------------------------------------------- Old: ---- bindfs-1.17.0.tar.gz New: ---- bindfs-1.17.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ bindfs.spec ++++++ --- /var/tmp/diff_new_pack.fTzNvP/_old 2022-12-09 13:16:59.102747987 +0100 +++ /var/tmp/diff_new_pack.fTzNvP/_new 2022-12-09 13:16:59.106748009 +0100 @@ -17,7 +17,7 @@ Name: bindfs -Version: 1.17.0 +Version: 1.17.1 Release: 0 Summary: Filesystem for mapping directories with alternate permissions License: GPL-2.0-or-later ++++++ bindfs-1.17.0.tar.gz -> bindfs-1.17.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bindfs-1.17.0/ChangeLog new/bindfs-1.17.1/ChangeLog --- old/bindfs-1.17.0/ChangeLog 2022-07-12 20:31:10.000000000 +0200 +++ new/bindfs-1.17.1/ChangeLog 2022-10-17 07:52:52.000000000 +0200 @@ -1,3 +1,13 @@ +2022-10-17 Martin Pärtel <martin dot partel at gmail dot com> + + * Fixed --resolve-symlinks when mountpoint name starts + with source dir name (issue #122, thanks @1-eric) + * Released 1.17.1 + +2022-10-06 Martin Pärtel <martin dot partel at gmail dot com> + + * Basic OpenBSD support. The test suite does not pass yet. + 2022-07-12 Martin Pärtel <martin dot partel at gmail dot com> * Reverted change in 1.16.0 that made direct_io the default. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bindfs-1.17.0/configure new/bindfs-1.17.1/configure --- old/bindfs-1.17.0/configure 2022-07-12 20:31:12.000000000 +0200 +++ new/bindfs-1.17.1/configure 2022-10-17 07:52:54.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for bindfs 1.17.0. +# Generated by GNU Autoconf 2.71 for bindfs 1.17.1. # # Report bugs to <martin.par...@gmail.com>. # @@ -621,8 +621,8 @@ # Identity of this package. PACKAGE_NAME='bindfs' PACKAGE_TARNAME='bindfs' -PACKAGE_VERSION='1.17.0' -PACKAGE_STRING='bindfs 1.17.0' +PACKAGE_VERSION='1.17.1' +PACKAGE_STRING='bindfs 1.17.1' PACKAGE_BUGREPORT='martin.par...@gmail.com' PACKAGE_URL='' @@ -1372,7 +1372,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bindfs 1.17.0 to adapt to many kinds of systems. +\`configure' configures bindfs 1.17.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1443,7 +1443,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bindfs 1.17.0:";; + short | recursive ) echo "Configuration of bindfs 1.17.1:";; esac cat <<\_ACEOF @@ -1570,7 +1570,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bindfs configure 1.17.0 +bindfs configure 1.17.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1788,7 +1788,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bindfs $as_me 1.17.0, which was +It was created by bindfs $as_me 1.17.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -3058,7 +3058,7 @@ # Define the identity of the package. PACKAGE='bindfs' - VERSION='1.17.0' + VERSION='1.17.1' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h @@ -14163,7 +14163,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bindfs $as_me 1.17.0, which was +This file was extended by bindfs $as_me 1.17.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14231,7 +14231,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -bindfs config.status 1.17.0 +bindfs config.status 1.17.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bindfs-1.17.0/configure.ac new/bindfs-1.17.1/configure.ac --- old/bindfs-1.17.0/configure.ac 2022-07-12 20:31:10.000000000 +0200 +++ new/bindfs-1.17.1/configure.ac 2022-10-17 07:52:52.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT([bindfs],[1.17.0],[martin.par...@gmail.com]) +AC_INIT([bindfs],[1.17.1],[martin.par...@gmail.com]) AM_INIT_AUTOMAKE([foreign serial-tests]) AC_CONFIG_HEADERS([config.h]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bindfs-1.17.0/src/bindfs.c new/bindfs-1.17.1/src/bindfs.c --- old/bindfs-1.17.0/src/bindfs.c 2022-07-12 20:31:10.000000000 +0200 +++ new/bindfs-1.17.1/src/bindfs.c 2022-10-17 07:52:52.000000000 +0200 @@ -393,10 +393,10 @@ we want to be able to operate on broken symlinks. */ return strdup(path); } - } else if (strncmp(result, settings.mntdest, settings.mntdest_len) == 0) { + } else if (path_starts_with(result, settings.mntdest, settings.mntdest_len)) { /* Recursive call. We cannot handle this without deadlocking, especially in single-threaded mode. */ - DPRINTF("Denying recursive access to mountpoint `%s'", result); + DPRINTF("Denying recursive access to mountpoint \"%s\" at \"%s\"", settings.mntdest, result); free(result); errno = EPERM; return NULL; @@ -709,7 +709,11 @@ strerror(errno) ); bindfs_init_failed = true; +#ifdef __OpenBSD__ + exit(1); +#else fuse_exit(fuse_get_context()->fuse); +#endif } return NULL; @@ -1663,7 +1667,9 @@ .lock = bindfs_lock, .flock = bindfs_flock, #endif +#ifndef __OpenBSD__ .ioctl = bindfs_ioctl, +#endif .statfs = bindfs_statfs, .release = bindfs_release, .fsync = bindfs_fsync, @@ -2825,10 +2831,17 @@ } #endif +#ifdef __OpenBSD__ + if (settings.enable_ioctl) { + fprintf(stderr, "--enable-ioctl not supported on OpenBSD\n"); + return 1; + } +#else /* Remove the ioctl implementation unless the user has enabled it */ if (!settings.enable_ioctl) { bindfs_oper.ioctl = NULL; } +#endif /* Remove/Ignore some special -o options */ args = filter_special_opts(&args); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bindfs-1.17.0/src/misc.c new/bindfs-1.17.1/src/misc.c --- old/bindfs-1.17.0/src/misc.c 2022-07-12 20:31:10.000000000 +0200 +++ new/bindfs-1.17.1/src/misc.c 2022-10-17 07:52:52.000000000 +0200 @@ -135,6 +135,45 @@ } } +static const char* find_last_char_between(const char* start, const char* end, char ch) { + assert(start != NULL && end != NULL); + const char* p = end - 1; + while (p >= start) { + if (*p == ch) { + return p; + } + --p; + } + return NULL; +} + +bool path_starts_with(const char *path, const char* prefix, size_t prefix_len) +{ + size_t path_len = strlen(path); + while (prefix_len > 0 && prefix[prefix_len - 1] == '/') { + --prefix_len; + } + while (path_len > 0 && path[path_len - 1] == '/') { + --path_len; + } + + if (strncmp(path, prefix, prefix_len) == 0) { + // We still need to check that the last path component of + // 'path' does not simply start with the last path component of 'prefix'. + const char* prefix_slash = find_last_char_between(prefix, prefix + prefix_len, '/'); + const char* prefix_part = prefix_slash ? prefix_slash + 1 : prefix; + size_t prefix_part_len = (prefix + prefix_len - prefix_part); + + const char* path_part = path + (prefix_part - prefix); + const char* path_slash = strchr(path_part, '/'); + size_t path_part_len = path_slash ? path_slash - path_part : path_len - (path_part - path); + + return prefix_part_len == path_part_len; + } + + return false; +} + static char **dup_argv(int argc, const char * const *argv, struct arena *arena) { char **pointer_list = arena_malloc(arena, (argc + 1) * sizeof(char*)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bindfs-1.17.0/src/misc.h new/bindfs-1.17.1/src/misc.h --- old/bindfs-1.17.0/src/misc.h 2022-07-12 20:31:10.000000000 +0200 +++ new/bindfs-1.17.1/src/misc.h 2022-10-17 07:52:52.000000000 +0200 @@ -53,6 +53,10 @@ Otherwise, returns ".". */ const char *my_dirname(char *path); +/* Returns true if the initial path components of 'path' are the path components of 'prefix'. + Assumes 'strlen(prefix) == prefix_len'. */ +bool path_starts_with(const char *path, const char* prefix, size_t prefix_len); + /* Filters arguments in comma-separated lists prefixed by '-o'. * Allocates 'new_argv' and its strings, as well as some temporary data, into 'arena'. */ void filter_o_opts( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bindfs-1.17.0/tests/internals/test_common.h new/bindfs-1.17.1/tests/internals/test_common.h --- old/bindfs-1.17.0/tests/internals/test_common.h 2022-07-12 20:31:10.000000000 +0200 +++ new/bindfs-1.17.1/tests/internals/test_common.h 2022-10-17 07:52:52.000000000 +0200 @@ -7,7 +7,7 @@ extern int failures; -#define TEST_ASSERT(expr) do { if (!(expr)) { printf("Assertion failed: %s:%d: `%s'\n", __FILE__, __LINE__, #expr); failures++; } } while (0); +#define TEST_ASSERT(expr) do { if (!(expr)) { printf("Assertion failed: %s:%d: `%s'\n", __FILE__, __LINE__, #expr); ++failures; } } while (0); #define NEAR(a, b, eps) (fabs((a) - (b)) < (eps)) int run_suite(void (*suite)()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bindfs-1.17.0/tests/internals/test_internals.c new/bindfs-1.17.1/tests/internals/test_internals.c --- old/bindfs-1.17.0/tests/internals/test_internals.c 2022-07-12 20:31:10.000000000 +0200 +++ new/bindfs-1.17.1/tests/internals/test_internals.c 2022-10-17 07:52:52.000000000 +0200 @@ -40,13 +40,21 @@ const char *ret = my_dirname(arg); if (strcmp(ret, expected) != 0) { - printf("Expected my_dirname(`%s') to return `%s' but got `%s'\n", orig, expected, ret); - failures++; + printf("Expected my_dirname(\"%s\") to return \"%s\" but got \"%s\"\n", orig, expected, ret); + ++failures; } free(orig); } +static void test_path_starts_with(const char* path, const char* prefix, bool expected) +{ + if (path_starts_with(path, prefix, strlen(prefix)) != expected) { + printf("Expected path_starts_with(\"%s\", \"%s\") to return %d but got %d\n", path, prefix, (int)expected, (int)!expected); + ++failures; + } +} + static void my_dirname_suite() { char buf[256]; @@ -82,6 +90,60 @@ test_my_dirname(buf, ".."); } +static void path_starts_with_suite() +{ + test_path_starts_with("/a/b/c", "/a/b", true); + test_path_starts_with("/a/b/c", "/a/b/", true); + test_path_starts_with("/a/b/c/", "/a/b/c/", true); + test_path_starts_with("/a/b/c", "/a/b/c/", true); + test_path_starts_with("/a/b/c", "/a/b/c", true); + test_path_starts_with("/a/b/c", "/a/b/c/d", false); + test_path_starts_with("/a/b/c/d", "/a/b/c", true); + test_path_starts_with("/a/x/c", "/a/b", false); + test_path_starts_with("/x/b/c", "/a/b", false); + test_path_starts_with("/a", "/a/b", false); + test_path_starts_with("/a/b", "/a", true); + test_path_starts_with("a", "a/b", false); + test_path_starts_with("a/b", "a", true); + test_path_starts_with("a/b/c", "a/b", true); + test_path_starts_with("a/b/c", "a/b/c", true); + test_path_starts_with("/aaa/abc", "/aaa/abc", true); + test_path_starts_with("/aaa/abcd", "/aaa/abc", false); + test_path_starts_with("/aaa/abcdef", "/aaa/abc", false); + test_path_starts_with("/aaa/ab", "/aaa/abc", false); + test_path_starts_with("/aaa/abcdef/ccc", "/aaa/abc", false); + test_path_starts_with("/aaa/bbb/ccc", "/aaa/bbb/ccc", true); + test_path_starts_with("/aaa/bbb/ccc", "/aaa/bbb/cccc", false); + test_path_starts_with("/aaa/bbb/ccc", "/aaa/bbb/cc", false); + test_path_starts_with("/aaa/bbb/ccc/", "/aaa/bbb/ccc", true); + test_path_starts_with("/aaa/bbb/ccc/", "/aaa/bbb/cccc", false); + test_path_starts_with("/aaa/bbb/ccc/", "/aaa/bbb/cc", false); + test_path_starts_with("/aaa/bbb/ccc", "/aaa/bbb/ccc/", true); + test_path_starts_with("/aaa/bbb/ccc", "/aaa/bbb/cccc/", false); + test_path_starts_with("/aaa/bbb/ccc", "/aaa/bbb/cc/", false); + test_path_starts_with("/aaa/bbb/ccc/", "/aaa/bbb/ccc/", true); + test_path_starts_with("/aaa/bbb/ccc/", "/aaa/bbb/cccc/", false); + test_path_starts_with("/aaa/bbb/ccc/", "/aaa/bbb/cc/", false); + test_path_starts_with("abc", "abc", true); + test_path_starts_with("abc", "ab", false); + test_path_starts_with("abc", "abcd", false); + test_path_starts_with("abc/", "abc", true); + test_path_starts_with("abc/", "ab", false); + test_path_starts_with("abc/", "abcd", false); + test_path_starts_with("abc", "abc/", true); + test_path_starts_with("abc", "ab/", false); + test_path_starts_with("abc", "abcd/", false); + test_path_starts_with("abc/", "abc/", true); + test_path_starts_with("abc/", "ab/", false); + test_path_starts_with("abc/", "abcd/", false); + test_path_starts_with("abc//", "abc//", true); + test_path_starts_with("abc//", "ab//", false); + test_path_starts_with("abc//", "abcd//", false); + test_path_starts_with("/a/b/c", "", true); + test_path_starts_with("/a/b/c", "/", true); + test_path_starts_with("/a/b/c", "/", true); +} + static void sprintf_new_suite() { char *result; @@ -133,17 +195,17 @@ for (int i = 0; i < argc; ++i) { if (argv[i] == NULL) { printf("Expected %s but got end of argv at index %d with input %s\n", expected[i], i, joined_input); - failures++; + ++failures; break; } if (expected[i] == NULL) { printf("Expected end of args but got %s at index %d with input %s\n", argv[i], i, joined_input); - failures++; + ++failures; break; } if (strcmp(argv[i], expected[i]) != 0) { printf("Expected %s but got %s at index %d with input %s\n", expected[i], argv[i], i, joined_input); - failures++; + ++failures; break; } } @@ -240,6 +302,7 @@ static void test_internal_suite() { arena_suite(); my_dirname_suite(); + path_starts_with_suite(); sprintf_new_suite(); filter_o_opts_suite(); }