加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

Windows用户可以覆盖CIFS / SMB共享上的文件的NFSv4 / Solaris A

发布时间:2020-12-13 23:02:33 所属栏目:Windows 来源:网络整理
导读:我在具有Solaris内核模块的OmniOS服务器上设置了SMB / CIFS文件共享,该模块使用可与 Windows客户端正常工作的NFSv4 ACL. 我想创建一个具有以下目标的共享目录:用户(比如alice)应该能够创建和修改文件,但不能删除它们.还应该防止创建子目录.应允许读访问权限
我在具有Solaris内核模块的OmniOS服务器上设置了SMB / CIFS文件共享,该模块使用可与 Windows客户端正常工作的NFSv4 ACL.

我想创建一个具有以下目标的共享目录:用户(比如alice)应该能够创建和修改文件,但不能删除它们.还应该防止创建子目录.应允许读访问权限.

我尝试过以下ACL,它基本上可以工作:

/usr/bin/chmod A=
user:root:rwxpdDaARWcCos:fd-----:allow,    # root has full access
user:alice:rwx---a-R-c--s:-------:allow,   # dir: create files,read everything
user:alice:rwxp--aARWc--s:f-i----:allow    # files: wpAW is needed for full file write access,everything is only inherited to files
/pool/share

但是,如果alice在Windows资源管理器中查看新添加文件的“安全”选项卡,则她可以授予自己完全访问权限并在之后删除该文件,即使她没有Co权限也是如此.

如何解释这种行为?我怎样才能更改它以便无法修改ACL?

编辑:ls的输出似乎正常:

# /usr/bin/ls -v
total 1
-rwx------+  1 alice staff          3 2016-03-21 test.txt
    0:user:root:read_data/write_data/append_data/read_xattr/write_xattr
        /execute/delete_child/read_attributes/write_attributes/delete
        /read_acl/write_acl/write_owner/synchronize:inherited:allow
    1:user:alice:read_data/write_data/append_data/read_xattr
        /write_xattr/execute/read_attributes/write_attributes/read_acl
        /synchronize:inherited:allow

# /usr/bin/ls -V
total 1
-rwx------+  1 alice staff          3 2016-03-21 test.txt
    user:root:rwxpdDaARWcCos:------I:allow
    user:alice:rwxp--aARWc--s:------I:allow

输出目录本身的ls:

# /usr/bin/ls -Vd
drwx------+  3 root     root           4 2016-03-21 .
 user:root:rwxpdDaARWcCos:fd-----:allow
user:alice:rwx---a-R-c--s:-------:allow
user:alice:rwxp--aARWc--s:f-i----:allow

# /usr/bin/ls -vd
drwx------+  3 root     root           4 2016-03-21 .
    0:user:root:list_directory/read_data/add_file/write_data
        /add_subdirectory/append_data/read_xattr/write_xattr/execute
        /delete_child/read_attributes/write_attributes/delete/read_acl
        /write_acl/write_owner/synchronize:file_inherit/dir_inherit:allow
    1:user:alice:list_directory/read_data/add_file/write_data
        /read_xattr/execute/read_attributes/read_acl/synchronize:allow
    2:user:alice:list_directory/read_data/add_file/write_data
        /add_subdirectory/append_data/read_xattr/write_xattr/execute
        /read_attributes/write_attributes/read_acl/synchronize
        :file_inherit/inherit_only:allow

共享的文件系统是ZFS.最有趣的非默认属性如下:

NAME        PROPERTY        VALUE          SOURCE
pool/share  type            filesystem     -
pool/share  compression     lz4            inherited from pool
pool/share  atime           off            local
pool/share  aclmode         restricted     local
pool/share  aclinherit      passthrough    local
pool/share  version         5              -
pool/share  utf8only        on             -
pool/share  normalization   formD          -
pool/share  casesensitivity insensitive    -
pool/share  nbmand          on             local
pool/share  sharesmb        name=testshare local

CIFS共享权限设置为允许每个人完全访问权限,因此只应应用文件权限.

更新:

This thread与我的问题非常相似,虽然将/pool/share/.zfs/shares/testshare中的ACL减少到每个人的modify_set(或拒绝用户特定的删除权限)的解决方案在我的情况下似乎不起作用我不喜欢不知道为什么.

恕我直言,如果你删除用户,组,每个人的琐碎acls,一切都会让人感到困惑.需要考虑的事项:

>如果拒绝权限或缺少文件的访问权限,则权限子系统将确定为文件所有者或超级用户授予的访问权限请求.此机制可防止文件所有者被锁定在其文件之外,并使超级用户能够修改文件以进行恢复.
>基于POSIX草案的ACL使用单个条目来定义允许哪些权限以及拒绝哪些权限.新的ACL模型有两种类型的ACE影响访问检查:ALLOW和DENY
>即使明确拒绝了权限,也会无条件地授予文件所有者write_acl权限.
>如果更改文件的权限,则会相应地更新文件的ACL.此外,如果删除授予用户访问文件或目录的非平凡ACL,则该用户仍可以访问该文件或目录,因为文件或目录的权限位可授予对组或每个人的访问权限

所以我的方法是根据需要修改普通的acls(使用deny模式),然后为所有特殊用例添加非平凡的acls.记住这一点:

>授予允许权限后,相同ACL权限集中的后续ACL拒绝条目不能拒绝该权限.

如果不知道OmniOS是什么,但这些文件帮助我理解了NFS ACL.我们将Solaris与ZFS一起使用
https://docs.oracle.com/cd/E53394_01/html/E54801/ftyxi.html#scrolltoc

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读