Skip to content

Commit

Permalink
Remove potentially sensitive information
Browse files Browse the repository at this point in the history
  • Loading branch information
IreneLime committed Jan 7, 2025
1 parent ec6cf58 commit 8c1a1d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/features/SFTP.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def rename(self, cwd, old, new):
try:
self.sftp.chdir(cwd)
self.sftp.rename(old, new)
logger.debug("SFTP: Rename %s in directory %s to %s", old, cwd, new)
logger.debug("SFTP: File rename operation completed")
except Exception as e:
logger.exception("SFTP: Rename failed")
return False, repr(e)
Expand All @@ -150,10 +150,10 @@ def rename(self, cwd, old, new):
def chmod(self, path, mode, recursive):
_, _, _, stderr = self.exec_command_blocking(
f'chmod {"-R" if recursive else ""} {"{0:0{1}o}".format(mode, 3)} "{path}"')
logger.debug("SFTP: Change permission on %s to '%s'", path, "{0:0{1}o}".format(mode, 3))
logger.debug("SFTP: Change permission to '%s'", "{0:0{1}o}".format(mode, 3))
stderr_lines = stderr.readlines()
if len(stderr_lines) != 0:
logger.warning("SFTP: chmod failed due to %s", stderr_lines)
logger.warning(f"SFTP: chmod operation failed")
return False, 'Some files were not applied with the request mode due to permission issues.'

return True, ''
Expand Down Expand Up @@ -197,7 +197,7 @@ def rm(self, cwd, file_list):
return True, ''

def mkdir(self, cwd, name):
logger.debug("SFTP: Make directory %s at %s", name, cwd)
logger.debug("SFTP: Creating new directory")
_, _, _, stderr = self.exec_command_blocking(f'cd "{cwd}"&& mkdir "{name}"')
stderr_lines = stderr.readlines()
if len(stderr_lines) != 0:
Expand Down

0 comments on commit 8c1a1d8

Please sign in to comment.