FLTK logo

[fltk/fltk] Preset filename is not shell quoted in kdialog file chooser implementation (Issue #1598)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Library      Forums      Links      Apps     Login 
[  All Forums  |  Back to fltk.issues  ]
 
[ Previous Message ] [ New Message | Reply ] [ Next Message ]

[fltk/fltk] Preset filename is not shell quoted in kdialog file chooser implementation (Issue #1598) Senko 23:41 Sep 02  
 
helpful-fox-senko-san created an issue (fltk/fltk#1598)

Description of the Bug Report
The preset filename is not shell quoted in the kdialog file chooser implementation, in contrast to the zenity implementation. This causes the file picker to break for characters with shell characters in the name when XDG_CURRENT_DESKTOP=KDE and is exploitable in some contexts.

To Reproduce
Steps to reproduce the behavior:
I don't have a good standalone reproduction but the issue is evident from the code difference between kdialog:

    if (_directory) strcpy(preset, _directory);
    else Fl::system_driver()->getcwd(preset, FL_PATH_MAX);
    strcat(preset, "/");
    strcat(preset, _preset_file);
// ...
  command += " ";
  command += option;
  command += " ";
  command += preset;

and zenity:

    std::string quoted_filename = _preset_file; shell_quote(quoted_filename);
    preset = "--filename=";
    preset += quoted_filename;

The calling application code is roughly:

    Fl_Native_File_Chooser flDlg;
    flDlg.title("Save COLLADA Models");
    flDlg.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE);
    flDlg.filter("*.dae");
    flDlg.preset_file(filename.c_str());
    int res = flDlg.show();

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Error seen in an actual program:

sh: -c: Zeile 1: Syntaxfehler beim unerwarteten Symbol »)«
sh: -c: Zeile 1: `kdialog --title 'Save COLLADA Models' --getsavefilename /xxx/(some very dumb name).dae 'COLLADA Models  (*.dae)'

FLTK Version

  • Version: 1.4.4

FLTK Configure / Build Options

		./configure --enable-localjpeg --enable-localzlib --enable-localpng \
				--enable-xdbe=no --enable-xcursor=no --enable-xfixes=no --enable-xrender=no --enable-xft=no

Operating System / Platform:

  • Linux, unknown, KDE

Linux/Unix Runtime, if applicable:

  • Unknown

Additional context
Issue was reported by user, did not reproduce locally

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/issues/1598@github.com>

[ Direct Link to Message ]
 
     
[ Previous Message ] [ New Message | Reply ] [ Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2026 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.