Bug Report - File uploads into wrong directory

From: "Beighley, Thomas" <tbeighley(at)usgs(dot)gov>
To: <pgadmin-hackers(at)postgresql(dot)org>
Subject: Bug Report - File uploads into wrong directory
Date: 2019-05-22 16:48:58
Message-ID: CAP_XXr4ux_LpBmCQX_f0MmOnPwL5BW7TSq=iZnJkK_ZM7Wc5ug@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

*Problem Description*
When trying to upload files for use in the restore dialog, the upload works
but the files end up in the wrong directory. See directory listing:

/var/lib/pgadmin4/storage# ls -l
total 8K
drwx--S---+ 2 www-data www-data 4.0K Nov 19 2018 tbeighley_usgs.gov
-rw-rw-r-- 1 www-data www-data 20 May 22 11:32 tbeighley_usgs.gov
\database.backup

It looks like the path isn't escaped properly and the files are uploaded
one directory up from where they should be, but with the correct folder as
part of the filename.

*Steps to reproduce*

1. Log in
2. Select Database
3. Right click, select restore
4. Click three dots button on filename field
5. Click upload file button
6. Drag file to the upload window to start upload
7. Upload bar completes - 100%
8. Cannot select file or click the "select button"

*Expected Behavior*
The files should end up in the users folder.

*OS*
Debian 8.11 Jessie
*PGAdmin Version*
Phython wheel 4.6 download
*Python Version*
2.7.9 (default, Sep 25 2018, 20:46:16) [GCC 4.9.2]
*Flask Version*
1.0.2
*Application Mode*
Server

Thank you! Having this feature is really useful if we can just fix this one
bug. I may dig into the code and see if I can find it but thought I'd ask
here first.

--
Tom Beighley

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2019-05-23 07:53:34 pgAdmin 4 commit: Fix handling of JSON in the Query Tool with NULL elem
Previous Message Aditya Toshniwal 2019-05-22 05:52:31 Re: [pgAdmin][RM4195] Tab navigation is broken in Query tool (Accessibility)