Skip to content

Commit

Permalink
integrated fix in 0031-WebUI-Fix-FileUpload WebUI patch which fixes a
Browse files Browse the repository at this point in the history
broken HTTPS certificate file upload which was not storing the pem file
at the correct location. This fixes #2322.
  • Loading branch information
jens-maus committed Jul 11, 2023
1 parent 097368e commit 0b75a83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
set downloadOnly 0
--- occu/WebUI/www/config/cp_network.cgi.orig
+++ occu/WebUI/www/config/cp_network.cgi
@@ -148,36 +148,42 @@
@@ -148,36 +148,43 @@
}

proc action_cert_upload {} {
Expand All @@ -143,7 +143,8 @@
- file copy -force -- "/var/server.pem" "/etc/config/server.pem"
- file delete "/var/server.pem"
+ if { [string last " PRIVATE KEY-----" $line] != -1 } {
+ file rename -force -- $filename "/usr/local/tmp/server.pem"
+ catch { file copy -force -- "/etc/config/server.pem" "/etc/config/server.pem.bak" }
+ file rename -force -- $filename "/etc/config/server.pem"

cgi_javascript {
puts "var url = \"$env(SCRIPT_NAME)?sid=$sid\";"
Expand Down Expand Up @@ -179,7 +180,7 @@
}
}
}
@@ -343,8 +349,7 @@
@@ -343,8 +350,7 @@
table_row {
table_data {width="20"} {}
table_data {colspan="2"} {
Expand All @@ -189,7 +190,7 @@
file_button cert_file size=30 maxlength=1000000
}
puts {<iframe name="cert_upload_iframe" style="display: none;"></iframe>}
@@ -708,13 +713,15 @@
@@ -708,13 +714,15 @@
cgi_eval {
#cgi_debug -on
cgi_input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ proc action_cert_upload {} {
close $fp
#puts $line;
if { [string last " PRIVATE KEY-----" $line] != -1 } {
file rename -force -- $filename "/usr/local/tmp/server.pem"
catch { file copy -force -- "/etc/config/server.pem" "/etc/config/server.pem.bak" }
file rename -force -- $filename "/etc/config/server.pem"

cgi_javascript {
puts "var url = \"$env(SCRIPT_NAME)?sid=$sid\";"
Expand Down

0 comments on commit 0b75a83

Please sign in to comment.