Skip to content

Commit

Permalink
symlink protection
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Feb 6, 2020
1 parent 5436f9b commit 5dc9899
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion filemanager/filemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def writeFileContents(self):
command = 'ls -la %s' % (self.data['fileName'])
output = ProcessUtilities.outputExecutioner(command)

if output.find(website.externalApp) == -1 and output.find('No such file') == -1:
if output.find('lrwxrwxrwx') > -1 and output.find('->') > -1:
return self.ajaxPre(0, 'File exists and is symlink.')

if self.data['fileName'].find(self.data['home']) == -1 or self.data['fileName'].find('..') > -1:
Expand Down

0 comments on commit 5dc9899

Please sign in to comment.