Code Monkey home page Code Monkey logo

Comments (10)

SerCeMan avatar SerCeMan commented on May 28, 2024

Hi, @philrykoff!

I believe it is better to ask that question on the winfsp repo. As far as I understand, it is all about mapping unix-style fuse permission to windows permissions through winfsp. If it is possible on the fuse layer of winfsp then there should be no problem to do the same via jnr-fuse.

from jnr-fuse.

PhilLehmann avatar PhilLehmann commented on May 28, 2024

I was unsure whom to ask myself πŸ˜„

The creator of WinFSP commented on my request here winfsp/winfsp#114 (comment)

Basically, he is saying that osxfuse has extensions called chflags for similar requirements. Do you know about this feature of might it already be implemented in jnr-fuse? Please feel free to comment over there 😁

from jnr-fuse.

PhilLehmann avatar PhilLehmann commented on May 28, 2024

Here is some info I found about chflags:

This indeed looks like it could be helpful. If we would have a somewhat similar API for OSX and Win, would that be something you would consider as an addition?

from jnr-fuse.

PhilLehmann avatar PhilLehmann commented on May 28, 2024

@SerCeMan: billziss-gh implemented the changes needed in WinFSP (winfsp/winfsp#114).

It seems osxfuse has a similar implementation already done using chflags:
Usage in osxfuse: https://github.com/osxfuse/fuse/blob/master/example/fusexmp_fh.c#L299-L426
Apple man file: https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/chflags.1.html

For Linux, my only find was chattr, but that only works for ext2/3/4 file systems.

A proper solution would probably implement Windows and MacOS, optionally Linux. Based on the jnr-fuse code I already saw, I feel comfortable to implement the Windows part. I would have time in about two weeks to pick this up, if no one feels eager to do so beforehand. πŸ˜‰

from jnr-fuse.

billziss-gh avatar billziss-gh commented on May 28, 2024

@philrykoff ping me when you have such a PR ready. I may have suggestions on how to ensure that jnr-fuse remains backwards/forwards compatible with different versions of WinFsp. [Caveat: I am very rusty on Java.]

BTW, I am implementing these changes in cgofuse. Related issue is winfsp/cgofuse#20. You may want to keep an eye as I have to face similar compatibility issues. [E.g. what happens when the latest cgofuse is used with a version of WinFsp that does not have the FSP_FUSE_CAP_STAT_EX capability.]

from jnr-fuse.

SerCeMan avatar SerCeMan commented on May 28, 2024

Based on the jnr-fuse code I already saw, I feel comfortable to implement the Windows part. I would have time in about two weeks to pick this up, if no one feels eager to do so beforehand.

That sounds great to me πŸ‘ . Feel free to reach out if you need any help!

from jnr-fuse.

billziss-gh avatar billziss-gh commented on May 28, 2024

The winfsp/cgofuse#20 issue is now closed. Most of it is not relevant to this discussion, except that it solves the problem of using a version of cgofuse with flags capability with a version of WinFsp that does not have this capability (e.g. latest cgofuse with WinFsp v1.1 which does not have BSD flags support).

Here is the relevant code from cgofuse:

    // during FUSE init
    conn->want |= conn->capable & FSP_FUSE_CAP_STAT_EX;
    cgofuse_stat_ex = 0 != (conn->want & FSP_FUSE_CAP_STAT_EX);

And:

    // during copy of Go struct stat to C struct stat
    if (cgofuse_stat_ex)
        ((struct fuse_stat_ex *)stbuf)->st_flags = flags;

Here is how this works. A newer version of WinFsp will pass FSP_FUSE_CAP_STAT_EX during init signifying that it supports BSD flags. So we respond that we want this capability. We also remember that the capability is supported so that we can copy the flags whenever we need to pass a struct stat from Go to C.

An older version of WinFsp will not pass FSP_FUSE_CAP_STAT_EX and no flags copying will happen.

Apologies if all this is too obvious.

from jnr-fuse.

PhilLehmann avatar PhilLehmann commented on May 28, 2024

Documentation is never bad. Thanks for the helpful insights πŸ‘

from jnr-fuse.

billziss-gh avatar billziss-gh commented on May 28, 2024

Please note that WinFsp v1.2B3 has been released. It has support for BSD flags, chflags, setcrtime and setchgtime.

from jnr-fuse.

fredolier avatar fredolier commented on May 28, 2024

Was this eventually implemented in jnr-fuse ?
I do not see whether it is actually done.

Edited: Would be appreciated if someone could show me how to get round this issue to be able to set the Windows extra-attibutes 'SYSTEM'/'READONLY'.

from jnr-fuse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.