set_appcontainer_acls.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env python3
  2. # Copyright 2021 The Chromium Authors. All rights reserved.
  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. import os
  7. import argparse
  8. import sys
  9. SRC_DIR = os.path.dirname(
  10. os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  11. sys.path.append(os.path.join(SRC_DIR, 'testing', 'scripts'))
  12. import common
  13. def main():
  14. parser = argparse.ArgumentParser(
  15. description='Sets App Container ACL on a directory.')
  16. parser.add_argument('--stamp',
  17. required=False,
  18. help='Touch this stamp file on success.')
  19. parser.add_argument('--dir', required=True, help='Set ACL on this directory.')
  20. # parser.add_argument('--fail', required=True, help='Argument to fail.')
  21. args = parser.parse_args()
  22. common.set_lpac_acls(os.path.abspath(args.dir))
  23. if args.stamp:
  24. open(args.stamp, 'w').close() # Update mtime on stamp file.
  25. if __name__ == '__main__':
  26. main()