Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
NAME
rmtree - save and restore permissions of objects in a directory
SYNOPSIS
rmtree save [-C working_dir] [--files] [--dirs] rmtree apply [-C working_dir] [--files] [--dirs] [--dry-run] rmtree diff [-C working_dir] [--files] [--dirs] rmtree load rmtree help
DESCRIPTION
rmtree
is a simple version of known tool mtree
on *BSD system. The
primary purpose of the tool is to save some basic attributes of objects
in a directory to a text file and/or restore objects' properties from
a standard input of attributes.
The tool only works on file system that supports following attributes:
- File mode (like 0644 on Linux)
- File owner
- File group
When the action save
is used, the tool will scan the working directory
for all files and directories, and read their properties and print in
YAML format -- the readable format used by the action apply
(or load
.)
EXAMPLES
To back up objects' attributes to a file
rmtree save -C /path/to/working/dir | gzip -9c > backup.gz
To restore file permissions
zcat backup.gz | rmtree apply -C /path/to/working/dir
Save and load at the same time
rmtree save -C /this/dir/ | rmtree apply -C /that/dir/
To compare this directory with another one
rmtree save -C /this/dir | rmtree diff -C /that/dir
OPTIONS
Actions
help Print some help messages
save Scan for objects' attributes
apply Apply attributes to objects in working directory
load Load attribute data and print to STDOUT
diff Compare STDIN with the working directory
Options
-d --dry-run Execute `apply` in dry-run mode
-C --directory Set the working directory. The program will change
to this directory before scanning/applying attributes.
Default: current directory
-F --files Only work on files. When being used with 'diff',
all directories in working directory are ignored.
-D --dirs Only work on directories. When being used with 'diff',
all regular files in working directory are ignored.
--full-path Print absolute path when 'saving'. As the output has
the full paths, you may use the output for the action
'apply' without specifying the working directory.
(This also means that you can't apply the output to
another directory.) By default, the program prints
the relative paths.
-h --help Print help message
INSTALLATION
This ruby tool requires the rubygem 'slop' (for arguments parsing.)
To build a rubygem, try gem build rmtree.gemspec
.
To use this tool, simply make it executable (by chmod 755 rmtree.rb
.)
If the rubygem 'rmtree-x.y.z' was installed, the binary can be found
in the binary directory of your gem environment. (Please run the command
gem env | grep EXECUTABLE
for details.)
FAQs
Unknown package
We found that rmtree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.