HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/samba/tests/blackbox/__pycache__/smbcacls_basic.cpython-310.pyc
o

�/a�@s,ddlmZddlmZGdd�de�ZdS)�)�SmbCaclsBlockboxTestBase)�BlackboxProcessErrorcs<eZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Z�ZS)�BasicSmbCaclsTestscstt|���dS)N)�superr�setUp)�self��	__class__��E/usr/lib/python3/dist-packages/samba/tests/blackbox/smbcacls_basic.pyrszBasicSmbCaclsTests.setUpc
Cs�d}z|�|�}Wnty"}z
|�t|��WYd}~nd}~wwd|j}d|j|j||j|j|f}z|�|�}WntyV}z
|�t|��WYd}~nd}~ww|�	|�}|�
|�||��dS)z�test smbcacls '--set' attempts to overwrite the ACL for the file

        before:

        +-test_dir/
          +-file.1            (I)(F)

        after/expected:

        +-test_dir/
          +-file.1            (F)�file-1N�ACL:%s:ALLOWED/0x0/FULLz)bin/smbcacls -U%s%%%s --set %s //%s/%s %s)�create_remote_test_filer�fail�str�user�passwd�server�share�check_output�
ace_parse_str�
assertTrue�file_ace_check)r�file1�filepath�e�acl�command�result�acer
r
r�test_simple_single_sets"
��
��
z)BasicSmbCaclsTests.test_simple_single_setc
Cs�d|j}z9|�d�}|�d||g�|�|�}|�|�||��d|j}|�d||g�|�|�}|�|�||��WdStyX}z|�t|��WYd}~dSd}~ww)a)test smbcacls '--modify' attempts to modify the ACL for the file
        (note: first part of the test 'set' ACL to (F) then attempts to modify
        before:

        +-test_dir/
          +-file.1            (F)

        after/expected:

        +-test_dir/
          +-file.1            (READ)r
r�--setzACL:%s:ALLOWED/0x0/READz--modifyN�	rr�	smb_caclsrrrrrr�r�acl_str�
remotepathrrr
r
r�test_simple_single_mod8s




��z)BasicSmbCaclsTests.test_simple_single_modc
Cs�d|j}z'|�d�}|�|�}|�|�||��|�d||g�|�|�||��WdStyF}z|�t	|��WYd}~dSd}~ww)aTtest smbcacls '--delete' attempts to delete the ACL for the file
        (note: first part of the test 'set' ACL to (F) then attempts to delete
        before:

        +-tar_test_dir/
          +-file.1            (F)

        after/expected:

        +-tar_test_dir/
          +-file.1            (none) - meaning no (F) ACL for this userr
rz--deleteN)
rrrrrr#�assertFalserrrr$r
r
r�test_simple_single_delXs



��z)BasicSmbCaclsTests.test_simple_single_delc
Cs�d|j}d|j}z4|�d�}|�d||g�|�|�}|�|�||��|�d||g�|�|�}|�|�||��WdStyX}z|�t|��WYd}~dSd}~ww)Nr
zACL:%s:DENIED/0x0/READrr!r")rr%�dny_strr&rrr
r
r�test_simple_single_addts




��z)BasicSmbCaclsTests.test_simple_single_add)	�__name__�
__module__�__qualname__rr r'r)r+�
__classcell__r
r
rrrs rN)�samba.tests.blackbox.smbcaclsr�samba.testsrrr
r
r
r�<module>s