tparted icon indicating copy to clipboard operation
tparted copied to clipboard

Lack of compatibilitiy with doas / weird authority verification

Open Imeguras opened this issue 1 year ago • 6 comments

Apparently the program is using SUDO_UID to check if the user has superuser capabilities("This program requires admin rights to work properly."), I'm unsure how doas does it, but some behaviors differ from sudo.

Doing SUDO_UID=0 tparted bypasses the protections, later giving an exception to lack of permissions

Imeguras avatar Dec 26 '24 01:12 Imeguras

It's my first time seeing doas command. A quick test with PR https://github.com/Kagamma/tparted/pull/5 shows that it fixed the issue. I will make a new release soon.

Kagamma avatar Dec 30 '24 05:12 Kagamma

I am reopening this issue because at least on my system (Arch Linux), trying to run the app with doas on a virtual terminal without X session (Alt-Ctrl-F3, for example) results in Access Violation & error code 217. It runs fine on a terminal within X session. sudo is fine in both cases.

Edit: Further investigation shows that the exception occurs during the initialization of Free Vision framework, so this is beyond me at the moment. Maybe I should file a bug report to the Free Pascal team so they can take a look at it.

Kagamma avatar Dec 30 '24 05:12 Kagamma

New bug report to the FPC team: https://gitlab.com/freepascal.org/fpc/source/-/issues/41080

Kagamma avatar Dec 30 '24 06:12 Kagamma

Alright thank you! I also use arch, i've noticed other issues but since im not able to completely root out the cause and you seem to be developing the project alone i will atempt to investigate the code and post about the root cause of the issue

Imeguras avatar Dec 30 '24 15:12 Imeguras

Also i forgot to mention @Kagamma but i managed to make it work on my system in a weird contorted way Just for some context and documentation:

my machine is a IBM x3850 x6 running with two compute books removed, 128Gb DDR4 ECC, I believe the graphic IC is soldered directly on the standard io-book(which is kinda of an extension of the motherboard, again im unshure if its there or if its integrated or even hidden on the PCB of the "motherboard" if you can even call it that) a arch linux instance installed on bare metal, with 6.12.6-arch1-1 kernel. Im running extra/opendoas 6.8.2-3, the config is not exotic. I also have aur/doas-sudo-shim 0.1.1-3 as im mostly used to sudo, and running it all on zsh, with oh-my-zsh installed. im also using ssh to acess the machine even though its on a local network

The way i made it "work" was by doing doas su, (which results in me going to bash i believe?) as root and then i do SUDO_UID=0 tparted and it just werks

Imeguras avatar Dec 30 '24 15:12 Imeguras

Tested the last version, as stated on X works flawlessly

Imeguras avatar Jan 03 '25 00:01 Imeguras

Closed. See https://gitlab.com/freepascal.org/fpc/source/-/issues/41080#note_2823669920

Kagamma avatar Oct 15 '25 18:10 Kagamma