Originacl / Copy Security Descriptor Between Files
Copy Security Descriptor Between Files
Originacl command syntax to copy security descriptor between files. Copyable examples, output expectations, and common mistakes.
$
Terminal $OriginAcl = Get-Acl -Path <path\to\file>; Set-Acl -Path <path\to\file> -AclObject $OriginAcl $env:OriginAcl = Get-Acl -Path <path/to/file>; Set-Acl -Path <path/to/file> -AclObject $env:OriginAcl #!/bin/bash
# Copy Security Descriptor Between Files
$OriginAcl = Get-Acl -Path {{path\to\file}}; Set-Acl -Path {{path\to\file}} -AclObject $OriginAcl import subprocess
# Copy Security Descriptor Between Files
# Make sure to replace <placeholders> with actual values
def run_command():
cmd = [
"originacl",
"=",
"Get-Acl",
"-Path",
"<path\\to\\file>;",
"Set-Acl",
"-Path",
"<path\\to\\file>",
"-AclObject",
"$OriginAcl"
]
try:
print(f"Executing: {' '.join(cmd)}")
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e}")
except FileNotFoundError:
print("Error: originacl not found. Please install it first.")
if __name__ == "__main__":
run_command() Command Breakdown
What each part is doing
-
$OriginAcl - Base Command
- The executable that performs this operation. Here it runs Originacl before the shell applies any redirect operators.
-
<path\to\file> - Input Files
- The file path or paths supplied to this command.
-
-Path - Command Option
- Tool-specific option used by this command invocation.
-
-AclObject - Command Option
- Tool-specific option used by this command invocation.
Alternative Approaches
Comparable commands in other tools
Alternative filesystem tools for the same job.
Rdiff Backup / Restore Most Recent Backup
rdiff-backup restore <path/to/backup> <path/to/destination> Rdiff Backup / Backup Source To rdiff-backup backup <path/to/source> <path/to/backup> Mysqldump / Backup All Databases Prompts Password mysqldump --user <user> --password --all-databases > <path/to/file.sql> Sfdisk / Backup Partition Layout To File sudo sfdisk -d </dev/sdX> > <path/to/file.dump> Copy / Copy File Dos COPY <path/to/source_file> <path/to/destination_file>