Skip to content
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

Use symbolicmode.chmod to simplify chmod() code. #38

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ distro # apache2
linux-utils # mit
psutil>5.9.0 # bsd
shakenfist-utilities # apache2
symbolicmode>=1.0 # CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
symbolicmode>=2.0 # CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
8 changes: 1 addition & 7 deletions shakenfist_agent/commandline/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,7 @@ def put_file(self, packet):
self.incomplete_file_puts[path]['flo'].write(d)

def chmod(self, packet):
mode = packet['mode']
try:
int(mode)
except ValueError:
mode = symbolicmode.symbolic_to_numeric_permissions(mode)

os.chmod(packet['path'], mode)
symbolicmode.chmod(packet['path'], packet['mode'])
self.send_packet({
'command': 'chmod-response',
'path': packet['path'],
Expand Down
Loading