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

file permission incorrect after set default acl. #4472

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

file permission incorrect after set default acl. #4472

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 code:

def test_acl_4472(self):
        state = JuicefsMachine()
        v1 = state.init_folders()
        v2 = state.create_file(content=b'', file_name='stsn', mode='x', parent=v1, umask=464, user='root')
        v3 = state.set_acl(default=True, entry=v1, group='group4', group_perm={'x'}, logical=False, mask={'w'}, not_recalc_mask=False, other_perm=set(), physical=False, recalc_mask=True, recursive=True, set_mask=True, sudo_user='root', user='root', user_perm={'r'})
        v8 = state.create_file(content=b'', file_name='qpyt', mode='w', parent=v1, umask=233, user='root')
        v9 = state.copy_file(entry=v2, follow_symlinks=False, new_entry_name='knmh', parent=v1, umask=23, user='root')
        state.open(file=v8, flags=[512], mode=2579, umask=34, user='root')
        state.teardown()

Log:


root@bench-01:~/juicefs# python3 .github/scripts/hypo/fsrand2_test.py -k test_acl_4472
setup_logger ./log1
setup_logger ./log2
__init__
duration is 0.029022932052612305
2024-03-11 12:53:05,681 - INFO - do_create_file /tmp/fsrand/stsn with mode x succeed
2024-03-11 12:53:05,688 - INFO - do_create_file /tmp/jfs/fsrand/stsn with mode x succeed
2024-03-11 12:53:05,688 - INFO - run_cmd: sudo -u root setfacl -d -R --mask    -m u:root:r,g:group4:x,o::-,m::w /tmp/fsrand/
run_cmd:getfacl /tmp/fsrand/
2024-03-11 12:53:05,694 - INFO - do_set_acl /tmp/fsrand/ with u:root:r,g:group4:x,o::-,m::w succeed
2024-03-11 12:53:05,694 - INFO - run_cmd: sudo -u root setfacl -d -R --mask    -m u:root:r,g:group4:x,o::-,m::w /tmp/jfs/fsrand/
run_cmd:getfacl /tmp/jfs/fsrand/
2024-03-11 12:53:05,703 - INFO - do_set_acl /tmp/jfs/fsrand/ with u:root:r,g:group4:x,o::-,m::w succeed
2024-03-11 12:53:05,704 - INFO - do_create_file /tmp/fsrand/qpyt with mode w succeed
2024-03-11 12:53:05,710 - INFO - do_create_file /tmp/jfs/fsrand/qpyt with mode w succeed
2024-03-11 12:53:05,711 - INFO - do_copy_file /tmp/fsrand/stsn /tmp/fsrand/knmh succeed
2024-03-11 12:53:05,721 - INFO - do_copy_file /tmp/jfs/fsrand/stsn /tmp/jfs/fsrand/knmh succeed
2024-03-11 12:53:05,721 - INFO - do_open /tmp/fsrand/qpyt [512] 2579 succeed
2024-03-11 12:53:05,724 - INFO - do_open /tmp/jfs/fsrand/qpyt [512] 2579 succeed
F
======================================================================
FAIL: test_acl_4465 (__main__.TestFsrand2)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".github/scripts/hypo/fsrand2_test.py", line 124, in test_acl_4465
    state.open(file=v8, flags=[512], mode=2579, umask=34, user='root')
  File "/root/juicefs/.github/scripts/hypo/fsrand2.py", line 102, in open
    flags = st_open_flags,
  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 102, in open
    flags = st_open_flags,
  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 110, in open
    assert self.equal(result1, result2), f'\033[31mopen:\nresult1 is {result1}\nresult2 is {result2}\033[0m'
AssertionError: open:
result1 is (0, 0, 0, '0o100640', 1)
result2 is (0, 0, 0, '0o100046', 1)

----------------------------------------------------------------------
Ran 1 test in 0.086s

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
Signed-off-by: jiefeng <jiefeng@juicedata.io>
@jiefenghuang
Copy link
Contributor

fix

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

2 participants