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

Don't fchdir at unmount when mounting read-only #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Aug 5, 2021

  1. Don't fchdir at unmount when mounting read-only

    Prior to this commit, after the fuse_loop function returns (e.g. as a
    result of "fusermount -u" or equivalent from a separate process), this
    main function would call fchdir(oldpwd) unconditionally and then, if the
    archive was modified (in memory), rewrite the archive on disk.
    
    This commit changes the "unconditionally" part so that fchdir is only
    called if we're about to rewrite the archive on disk. Walking backwards,
    the original working directory (the oldpwd variable) is no longer read
    if options.readonly is true, as it is not used anywhere else.
    
    For a read-only mount, the fchdir would just be unnecessary work. More
    importantly, when running archivemount (in read-only mode) in a
    syscall-based sandbox (e.g. minijail), removing the unconditionality of
    the fchdir call means fewer syscalls in our allow-list.
    nigeltao committed Aug 5, 2021
    Configuration menu
    Copy the full SHA
    cc8a5e7 View commit details
    Browse the repository at this point in the history