-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: repair permission feature after indexing #25
Comments
To generate the text files with the appropriate file and folder lists we use duckdb against a pwalk csv file (or better against a parquet file that a csv file was converted to). In these examples we use
|
this issue is the lowest priority right now but there could be a simplified implementation for a tool share-repair that crawls the file system and implements this while logging all changes to STDOUT and errors to STDERR
|
As Froster is primarily an end user tool that does not run as root user, it will require at least read permissions for all file system indexing processes and read+write permissions to complete archiving processes. Posix file systems tend to experience permission drift over time. To ensure seamless collaboration among users, a systems administrator will have to repair permissions occasionally. As this process can be labor and time consuming, Froster can prepare the commands that a systems administrator will then review and execute as root. We need to address 3 use cases:
For all 3 problems there is a solution that can be executed as root, for example:
apples
tooranges
:find /my/dir -group apples -exec chgrp oranges {} +
find /my/dir -type d ! -perm -2000 -exec chmod g+s {} +
find /my/dir -group oranges ! -perm -g+r -exec chmod g+r {} + -o ! -perm -g+w -exec chmod g+w {} +
As crawling through the file system can take a very long time we can use pwalk and duckdb to generate text files containing file and folder lists for which permissions need to be adjusted. Permission changes can then be executed in parallel via xargs, for example here with 256 parallel processes triggered by xargs:
make sure to use the gid (e.g. 3901) and not the group name to avoid creating a fork bomb:
xargs -a repair-grp-hpcusers.txt -P 256 -d '\n' chgrp 3901
xargs -a repair-setgid.txt -P 256 -d '\n' chmod g+s
xargs -a repair-read-write-lab.txt -P 256 -d '\n' chmod g+rw
Froster could generate the text files required to repair permissions, or repair the permissions directly, for example:
froster index --repair-permissions --chgrp oldgroup:newgroup,oldgroup2:newgroup2
There are 3 different usage patterns:
froster index --repair-permissions
and hands over text files to system Administrator who will run the permission repair (this is the most inaccurate option as the end user may not have read access to a significant number of folders)froster index --repair-permissions
and will repair permissions directly.froster index --repair-permissions --pwalk-csv myfile.csv /my/folder
with a pwalk csv file previously run by a Systems administrator (this is an option if the Systems Administrator does not use Froster but prefers text files that contain files and folders that require certain actions)The text was updated successfully, but these errors were encountered: