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 7import os 8import argparse 9import sys 10 11SRC_DIR = os.path.dirname( 12 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 13 14sys.path.append(os.path.join(SRC_DIR, 'testing', 'scripts')) 15 16import common 17 18 19def 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 34if __name__ == '__main__': 35 main() 36