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

can't print system.posix_acl_access xattr after setfacl #4483

Closed
zhoucheng361 opened this issue Mar 11, 2024 · 1 comment
Closed

can't print system.posix_acl_access xattr after setfacl #4483

zhoucheng361 opened this issue Mar 11, 2024 · 1 comment
Labels
kind/bug Something isn't working

Comments

@zhoucheng361
Copy link
Contributor

zhoucheng361 commented Mar 11, 2024

What happened:
Reproduce script:

    def test_4483(self):
        state = JuicefsMachine()
        v1 = state.init_folders()
        state.set_acl(default=True, entry=v1, group='root', group_perm={'r'}, logical=True, mask={'r'}, not_recalc_mask=False, other_perm={'r', 'x'}, physical=False, recalc_mask=False, recursive=True, set_mask=True, sudo_user='user1', user='user2', user_perm={'r', 'w', 'x'})
        v4 = state.create_file(content=b'\xe65', file_name='abha', mode='a', parent=v1, umask=3, user='root')
        v5 = state.set_acl(default=False, entry=v4, group='user3', group_perm={'x'}, logical=False, mask={'x'}, not_recalc_mask=True, other_perm=set(), physical=True, recalc_mask=True, recursive=False, set_mask=False, sudo_user='root', user='user1', user_perm=set())
        state.list_xattr(file=v4, user='root')
        state.teardown()

Log:

root@bench-01:~/juicefs# python3 .github/scripts/hypo/fsrand2_test.py -k test_xxx
setup_logger ./log1
setup_logger ./log2
__init__
duration is 0.029425621032714844
2024-03-11 17:27:11,224 - INFO - run_cmd: sudo -u user1 setfacl -d -R   -L  -m u:user2:wxr,g:root:r,o::xr,m::r /tmp/fsrand/
2024-03-11 17:27:11,229 - INFO - do_set_acl /tmp/fsrand/ {'user_perm': 'wxr', 'group_perm': 'r', 'other_perm': 'xr'} failed:
setfacl: /tmp/fsrand/: Operation not permitted
2024-03-11 17:27:11,229 - INFO - run_cmd: sudo -u user1 setfacl -d -R   -L  -m u:user2:wxr,g:root:r,o::xr,m::r /tmp/jfs/fsrand/
2024-03-11 17:27:11,235 - INFO - do_set_acl /tmp/jfs/fsrand/ {'user_perm': 'wxr', 'group_perm': 'r', 'other_perm': 'xr'} failed:
setfacl: /tmp/jfs/fsrand/: Operation not permitted
2024-03-11 17:27:11,235 - INFO - do_create_file /tmp/fsrand/abha with mode a succeed
2024-03-11 17:27:11,242 - INFO - do_create_file /tmp/jfs/fsrand/abha with mode a succeed
2024-03-11 17:27:11,242 - INFO - run_cmd: sudo -u root setfacl   --mask --no-mask   -m u:user1:-,g:user3:x,o::- /tmp/fsrand/abha
run_cmd:getfacl /tmp/fsrand/abha
2024-03-11 17:27:11,248 - INFO - do_set_acl /tmp/fsrand/abha with u:user1:-,g:user3:x,o::- succeed
2024-03-11 17:27:11,248 - INFO - run_cmd: sudo -u root setfacl   --mask --no-mask   -m u:user1:-,g:user3:x,o::- /tmp/jfs/fsrand/abha
run_cmd:getfacl /tmp/jfs/fsrand/abha
2024-03-11 17:27:11,257 - INFO - do_set_acl /tmp/jfs/fsrand/abha with u:user1:-,g:user3:x,o::- succeed
2024-03-11 17:27:11,257 - INFO - do_list_xattr /tmp/fsrand/abha succeed
2024-03-11 17:27:11,257 - INFO - do_list_xattr /tmp/jfs/fsrand/abha succeed
F
======================================================================
FAIL: test_xxx (__main__.TestFsrand2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".github/scripts/hypo/fsrand2_test.py", line 145, in test_xxx
    state.list_xattr(file=v4, user='root')
  File "/root/juicefs/.github/scripts/hypo/fsrand2.py", line 366, in list_xattr
    user = st.sampled_from(SUDO_USERS))
  File "/root/hypothesis/hypothesis-python/src/hypothesis/stateful.py", line 681, in rule_wrapper
    return f(*args, **kwargs)
  File "/root/juicefs/.github/scripts/hypo/fsrand2.py", line 366, in list_xattr
    user = st.sampled_from(SUDO_USERS))
  File "/root/hypothesis/hypothesis-python/src/hypothesis/stateful.py", line 802, in precondition_wrapper
    return f(*args, **kwargs)
  File "/root/juicefs/.github/scripts/hypo/fsrand2.py", line 371, in list_xattr
    assert self.equal(result1, result2), f'\033[31mlist_xattr:\nresult1 is {result1}\nresult2 is {result2}\033[0m'
AssertionError: list_xattr:
result1 is [('system.posix_acl_access', b'\x02\x00\x00\x00\x01\x00\x06\x00\xff\xff\xff\xff\x02\x00\x00\x00\xc6\r\x00\x00\x04\x00\x06\x00\xff\xff\xff\xff\x08\x00\x01\x00\xc8\r\x00\x00\x10\x00\x06\x00\xff\xff\xff\xff \x00\x00\x00\xff\xff\xff\xff')]
result2 is []

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?

Environment:

  • JuiceFS version (use juicefs --version) or Hadoop Java SDK version:
  • Cloud provider or hardware configuration running JuiceFS:
  • OS (e.g cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Object storage (cloud provider and region, or self maintained):
  • Metadata engine info (version, cloud provider managed or self maintained):
  • Network connectivity (JuiceFS to metadata engine, JuiceFS to object storage):
  • Others:
@zhoucheng361 zhoucheng361 added the kind/bug Something isn't working label Mar 11, 2024
jiefenghuang added a commit to jiefenghuang/juicefs that referenced this issue Mar 11, 2024
@zhoucheng361
Copy link
Contributor Author

fixed by d188bda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant