set_appcontainer_acls.py (1021B)
1 #!/usr/bin/env python3 2 # Copyright 2021 The Chromium Authors 3 # Use of this source code is governed by a BSD-style license that can be 4 # found in the LICENSE file. 5 """Sets the app container ACLs on directory.""" 6 7 import os 8 import argparse 9 import sys 10 11 SRC_DIR = os.path.dirname( 12 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 13 14 sys.path.append(os.path.join(SRC_DIR, 'testing', 'scripts')) 15 16 import common 17 18 19 def main(): 20 parser = argparse.ArgumentParser( 21 description='Sets App Container ACL on a directory.') 22 parser.add_argument('--stamp', 23 required=False, 24 help='Touch this stamp file on success.') 25 parser.add_argument('--dir', required=True, help='Set ACL on this directory.') 26 # parser.add_argument('--fail', required=True, help='Argument to fail.') 27 args = parser.parse_args() 28 29 common.set_lpac_acls(os.path.abspath(args.dir)) 30 if args.stamp: 31 open(args.stamp, 'w').close() # Update mtime on stamp file. 32 33 34 if __name__ == '__main__': 35 main()