mirror of
https://github.com/neocities/neocities.git
synced 2025-07-04 01:53:22 +02:00
combine chmod to prevent permission denied issues when chmod does not run
This commit is contained in:
parent
e30e9eca7d
commit
343e85a3bc
2 changed files with 2 additions and 4 deletions
|
@ -58,8 +58,7 @@ post '/site_files/create' do
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
file_path = current_site.files_path(name)
|
file_path = current_site.files_path(name)
|
||||||
FileUtils.touch file_path
|
File.open(file_path, 'a', 0640) {}
|
||||||
File.chmod 0640, file_path
|
|
||||||
|
|
||||||
site_file ||= SiteFile.new site_id: current_site.id, path: name
|
site_file ||= SiteFile.new site_id: current_site.id, path: name
|
||||||
|
|
||||||
|
|
|
@ -1973,8 +1973,7 @@ class Site < Sequel::Model
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
FileUtils.cp uploaded.path, path
|
FileUtils.install uploaded.path, path, mode: 0640
|
||||||
File.chmod 0640, path
|
|
||||||
|
|
||||||
SiteChange.record self, relative_path if !opts[:new_install] && File.extname(relative_path).match(HTML_REGEX)
|
SiteChange.record self, relative_path if !opts[:new_install] && File.extname(relative_path).match(HTML_REGEX)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue