extrahd.cgi: Requires "auto" as hidden FS type to mount a new device

Message ID 20230626094059.2763-1-stefan.schantl@ipfire.org
State Accepted
Commit 65dc35dcf4108eca6f8ed296ad2edf5592fe7777
Headers
Series extrahd.cgi: Requires "auto" as hidden FS type to mount a new device |

Commit Message

Stefan Schantl June 26, 2023, 9:40 a.m. UTC
  Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
 html/cgi-bin/extrahd.cgi | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Michael Tremer June 27, 2023, 5:29 p.m. UTC | #1
Hello Stefan,

Thank you for the patch.

It kind of solves the problem, but allows a user to write arbitrary values into the configuration file which we don’t want. That value is not being read anywhere, but I still think we should be rather careful here and just fill the field with an empty string on the server side.

We can however let the client sent the “FS” parameter if that is at any other point convenient for you.

-Michael

> On 26 Jun 2023, at 10:40, Stefan Schantl <stefan.schantl@ipfire.org> wrote:
> 
> Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
> ---
> html/cgi-bin/extrahd.cgi | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi
> index bb67b792d..08d62172d 100644
> --- a/html/cgi-bin/extrahd.cgi
> +++ b/html/cgi-bin/extrahd.cgi
> @@ -305,6 +305,7 @@ END
> } else {
> unless($disabled) {
> print "<input type='hidden' name='ACTION' value='$Lang::tr{'add'}'>\n";
> + print "<input type='hidden' name='FS' value='auto'>\n";
> print "<img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'extrahd not configured'}' title='$Lang::tr{'extrahd not configured'}'>&nbsp;\n";
> print "<input type='image' alt='$Lang::tr{'add'}' title='$Lang::tr{'add'}' src='/images/add.gif'>\n";
> }
> -- 
> 2.39.2
>
  

Patch

diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi
index bb67b792d..08d62172d 100644
--- a/html/cgi-bin/extrahd.cgi
+++ b/html/cgi-bin/extrahd.cgi
@@ -305,6 +305,7 @@  END
 					} else {
 						unless($disabled) {
 							print "<input type='hidden' name='ACTION' value='$Lang::tr{'add'}'>\n";
+							print "<input type='hidden' name='FS' value='auto'>\n";
 							print "<img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'extrahd not configured'}' title='$Lang::tr{'extrahd not configured'}'>&nbsp;\n";
 							print "<input type='image' alt='$Lang::tr{'add'}' title='$Lang::tr{'add'}' src='/images/add.gif'>\n";
 						}