Bug 29752

Summary: Qphotorec run as normal user shows warning, and is ineffective; this bug adds a root password dialogue which makes it work correctly.
Product: Mageia Reporter: Jose Manuel López <joselp>
Component: RPM PackagesAssignee: All Packagers <pkg-bugs>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Normal CC: fri, geiger.david68210
Version: 8   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: testdisk-7.1-2.mga8.src.rpm CVE:
Status comment:
Attachments: Qphotorec no-root
Qphotorec root

Description Jose Manuel López 2021-12-10 16:58:42 CET
Description of problem: Qphotorec is integrated with Photorec package in Mageia.

I have installed photorec and I can see Qphotorec in System tools menu section, but when I open it, appears a warning that say me "It can't found the hard disk because it is necesary be root user for use Photorec".

This doesn't make any sense if a normal user don't know how open it in terminal, and either know how modify this application from menu settings.

I have modified this application in applications settings, in menu settings, for open it as root, and when I open it, the application request me the root password. I think that this operation is more appropriate and the package install should configure the direct access with root execution.


Version-Release number of selected component (if applicable):Photorec and Mageia 8


How reproducible: Install Photorec and execute Qphotorec from menu applications


Steps to Reproduce:
1. Install Photorec
2. Execute Qphotorec from menu applications
3. The warning appears.
Comment 1 Jose Manuel López 2021-12-10 17:04:55 CET
Created attachment 13032 [details]
Qphotorec no-root

Here, Qphotored executed with normal user.
Comment 2 Jose Manuel López 2021-12-10 17:05:32 CET
Created attachment 13033 [details]
Qphotorec root

Here, Qphotorec executed whit root user.
Comment 3 Lewis Smith 2021-12-12 20:02:09 CET
Thank you for your report, and the work you have done.

This is delicate: you should certainly need to have root privileges to run this thing, but allowing this directly for any GUI program is verboten.
Your solution - dialogue for root password - is the standard one for GUI applications which need root privileges; well done for implementing it.

Just trying it. If you start Qphotorec from the menu, it does pop the dialogue
"No Disk!
No harddisk found.
You need to be root to use PhotoRec."

OK'ing this opens the application but with no discs listed.
The same thing happens from terminal:
 $ qphotorec
However, doing this as root:
 # qphotorec
does work, and the application lists partitions on the current disk.

Trying straight photorec from a terminal as normal user gives:
 $ photorec
PhotoRec 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
  PhotoRec is free software, and
comes with ABSOLUTELY NO WARRANTY.
No harddisk found
You need to be root to use PhotoRec.

Doing it as root presents a correct curses display.
---------------------------------------------------
This is part of the 'testdisk' SRPM, which has no particular maintainer; so assigning this bug globally. Please look at it: Jose's adaptation is very worthwhile.

Assignee: bugsquad => pkg-bugs
Summary: Qphotorec show warning because don't open with root user => Qphotorec run as normal user shows warning, and is ineffective; this bug adds a root password dialogue which makes it work correctly.
Source RPM: Photorec => testdisk-7.1-2.mga8.src.rpm

Comment 4 Jose Manuel López 2021-12-13 08:49:01 CET
Thanks for the comment!!, I simply configured in the applications menu, the Qphotorec shortcut to open with root user. 

I understand that the Mageia photorec rpm should be modified, so that when it is installed, it creates that shortcut with that configuration in the applications menu.

Greetings!!!
Comment 5 Jose Manuel López 2023-10-31 17:25:33 CET
This is still unresolved, I don't know if it is very difficult to modify the behavior so that it requests root permissions when running it.
Comment 6 Morgan Leijström 2023-10-31 19:37:48 CET
I think it is correct behaviour and is to be expected to need to run this as root.

CC: (none) => fri

Comment 7 David GEIGER 2023-11-01 07:06:30 CET
Could you report this issue upstream at https://github.com/cgsecurity/testdisk/issues , please?

To see what upstream says and think about root privileges.

CC: (none) => geiger.david68210