mirror of
https://github.com/neocities/neocities.git
synced 2025-07-03 17:43:21 +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
|
||||
else
|
||||
file_path = current_site.files_path(name)
|
||||
FileUtils.touch file_path
|
||||
File.chmod 0640, file_path
|
||||
File.open(file_path, 'a', 0640) {}
|
||||
|
||||
site_file ||= SiteFile.new site_id: current_site.id, path: name
|
||||
|
||||
|
|
|
@ -1973,8 +1973,7 @@ class Site < Sequel::Model
|
|||
end
|
||||
end
|
||||
|
||||
FileUtils.cp uploaded.path, path
|
||||
File.chmod 0640, path
|
||||
FileUtils.install uploaded.path, path, mode: 0640
|
||||
|
||||
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