Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve OpenBSD support #121

Open
vl-ms opened this issue Oct 6, 2022 · 6 comments
Open

Improve OpenBSD support #121

vl-ms opened this issue Oct 6, 2022 · 6 comments
Labels
feature New feature request/PR

Comments

@vl-ms
Copy link

vl-ms commented Oct 6, 2022

Gives me the following error:

$ make
make  all-recursive
Making all in src
cc -DHAVE_CONFIG_H -I. -I..  -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=700 -D__BSD_VISIBLE=1 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_DARWIN_BETTER_REALPATH     -std=c99 -Wall -Wpedantic -fno-common -g -O2 -MT bindfs.o -MD -MP -MF .deps/bindfs.Tpo -c -o bindfs.o bindfs.c
bindfs.c:712:9: warning: implicit declaration of function 'fuse_exit' is invalid in C99 [-Wimplicit-function-declaration]
        fuse_exit(fuse_get_context()->fuse);
        ^
bindfs.c:1666:6: error: field designator 'ioctl' does not refer to any field in type 'struct fuse_operations'
    .ioctl      = bindfs_ioctl,
     ^
bindfs.c:2830:21: error: no member named 'ioctl' in 'struct fuse_operations'
        bindfs_oper.ioctl = NULL;
        ~~~~~~~~~~~ ^
1 warning and 2 errors generated.
*** Error 1 in src (Makefile:455 'bindfs.o')
*** Error 1 in . (Makefile:427 'all-recursive': @fail=;  if (target_option=k; case ${target_option-} in  ?) ;;  *) echo "am__make_running_wi...)
*** Error 2 in /home/unix/soft/bindfs-1.17.0 (Makefile:334 'all')

Any advice on how to approach this? I'm not even close to being a C developer.

@mpartel mpartel added the feature New feature request/PR label Oct 6, 2022
@mpartel mpartel changed the title Attempting to build on OpenBSD OpenBSD support Oct 6, 2022
@mpartel
Copy link
Owner

mpartel commented Oct 6, 2022

It should now build with the latest git master, but I've not tested it properly yet.

@vl-ms
Copy link
Author

vl-ms commented Oct 8, 2022

Thank you for such a fast response! Now I cloned the repo, previously tried to compile from a tarball. Since OpenBSD doesn't have bash by default, the usual bash location is in /usr/local/bin/bash. So autogen.sh should use /usr/bin/env bash instead.
Anyway, compilation went fine, but after I tried to mount... Nothing happens. It doesn't exit with an error or anything, it silently returns me a shell and the files don't appear where they are supposed to be.
Maybe I misunderstood something, but the basic usage seems to be

bindfs directory-to-mount path-where-to-mount

At least that's what I did.

@mpartel
Copy link
Owner

mpartel commented Oct 8, 2022

That kind of basic usage works for me in an OpenBSD 7.1 VM.
You can try bindfs -d ... to have it stay in the foreground and print some debug info.

@vl-ms
Copy link
Author

vl-ms commented Oct 8, 2022

Thanks, the issue was that I expected fuse to work without root privileges by default (the error message from the -d flag pointed me to the solution). Running with doas works fine. Other issue I noticed: manpages are missing.

@mpartel
Copy link
Owner

mpartel commented Oct 8, 2022

OpenBSD removed support for running FUSE filesystems as non-root. This surprised me too. I guess bindfs on OpenBSD could check for this and print an error. I'm surprised their FUSE library doesn't already do this.

Good to hear that it seems to mostly work with such a small change. I'll leave this issue open since clearly there are more things to look into to properly support OpenBSD. Finding time for that is another matter :(

@mpartel mpartel changed the title OpenBSD support Improve OpenBSD support Oct 8, 2022
@vl-ms
Copy link
Author

vl-ms commented Oct 9, 2022

It's not that suprising considering that programs such as bindfs can trick other programs to read wrong config files, execute different scripts, etc. So I see how this can be dangerous and how a separate privilege level for using fuse programs should be added (a separate fuse group suffices, I think). Anyway, thanks for your hard work, once I figure out the man page issue bindfs can be packaged in OpenBSD ports!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request/PR
Projects
None yet
Development

No branches or pull requests

2 participants