CI: test mounting.

This commit is contained in:
relan
2021-07-03 11:46:18 +03:00
parent c1132b5e2a
commit 433a2c2622
3 changed files with 19 additions and 7 deletions
+5 -1
View File
@@ -29,6 +29,7 @@ task:
install_script: |
apt-get update
apt-get install -y libfuse-dev
modprobe fuse
- name: macos
macos_instance:
@@ -45,7 +46,7 @@ task:
compile_script: |
autoreconf --install
./configure CFLAGS='-Wall -Wextra'
./configure --enable-user-mounts CFLAGS='-Wall -Wextra'
make -k
test_script: |
@@ -53,3 +54,6 @@ task:
mkfs/mkexfatfs -i 12345678 foo.img
fsck/exfatfsck foo.img
echo 'f1b3a11f781533f5b69086596be38367d0ebfb77 foo.img' | shasum -c
mkdir /tmp/foo
fuse/mount.exfat-fuse foo.img /tmp/foo
umount /tmp/foo
+5
View File
@@ -54,4 +54,9 @@ AC_CONFIG_FILES([
label/Makefile
mkfs/Makefile
Makefile])
AC_ARG_ENABLE([user-mounts],
AS_HELP_STRING([--enable-user-mounts],
[Allow non-privileged users to mount.]))
AS_IF([test "x$enable_user_mounts" = "xyes"],
[AC_DEFINE([USER_MOUNTS], [], [Allow non-privileged users to mount.])])
AC_OUTPUT
+9 -6
View File
@@ -458,7 +458,7 @@ static char* add_ro_option(char* options, bool ro)
return ro ? add_option(options, "ro", NULL) : options;
}
#if defined(__linux__) || defined(__FreeBSD__)
#if !defined(USER_MOUNTS) && (defined(__linux__) || defined(__FreeBSD__))
static char* add_user_option(char* options)
{
struct passwd* pw;
@@ -477,7 +477,7 @@ static char* add_user_option(char* options)
}
#endif
#if defined(__linux__)
#if !defined(USER_MOUNTS) && defined(__linux__)
static char* add_blksize_option(char* options, long cluster_size)
{
long page_size = sysconf(_SC_PAGESIZE);
@@ -499,12 +499,12 @@ static char* add_fuse_options(char* options, const char* spec, bool ro)
options = add_ro_option(options, ro);
if (options == NULL)
return NULL;
#if defined(__linux__) || defined(__FreeBSD__)
#if !defined(USER_MOUNTS) && (defined(__linux__) || defined(__FreeBSD__))
options = add_user_option(options);
if (options == NULL)
return NULL;
#endif
#if defined(__linux__)
#if !defined(USER_MOUNTS) && defined(__linux__)
options = add_blksize_option(options, CLUSTER_SIZE(*ef.sb));
if (options == NULL)
return NULL;
@@ -554,11 +554,14 @@ int main(int argc, char* argv[])
printf("FUSE exfat %s\n", VERSION);
fuse_options = strdup("allow_other,"
fuse_options = strdup(
#ifndef USER_MOUNTS
"allow_other,"
#endif
#if defined(__linux__) || defined(__FreeBSD__)
"big_writes,"
#endif
#if defined(__linux__)
#if !defined(USER_MOUNTS) && defined(__linux__)
"blkdev,"
#endif
"default_permissions");