Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to fix the bug that keeps asking for the password when adjusting the date and time #165

Open
louies0623 opened this issue Jun 21, 2023 · 12 comments

Comments

@louies0623
Copy link
Contributor

louies0623 commented Jun 21, 2023

PC-1-screen0.webm

Need to fix the bug that keeps asking for the password when adjusting the date and time

Originally posted by @louies0623 in #163 (comment)

@louies0623 louies0623 changed the title [PC-1-screen0.webm](https://github.com/helloSystem/Utilities/assets/44593430/842ecf81-1344-41e7-890f-6f45d0c15910) Need to fix the bug that keeps asking for the password when adjusting the date and time Jun 21, 2023
@probonopd
Copy link
Member

Can normal users adjust the machine-wide time without needing sudo on FreeBSD?

@Hierosme
Copy link

That is clearly un unexpected result, ask for Password yes but in loop no ....

I do not like that password ask, the window look worng and pop too mush, both trouble make a bad result ask you movie show.

In general that is it window it should pop:
image

Here how it should be done:
image

image

That is the small lock on the left bottom it make the job.

That tool in my scope i'll fork it under contruction and take a look ...
I can't confirm a 100% success. Password management require a memory an in general that memory is provide by a password manager .... I suppose by design it is where is the lake.

i post here news.
@probonopd i dont know if you have other priority (yet impossibel to me to work on Disk Utility), i'll focus to close issue.

Enjoy !!!

@louies0623
Copy link
Contributor Author

louies0623 commented Jun 22, 2023

I do not like that password ask, the window look worng and pop too mush, both trouble make a bad result ask you movie show.

@Hierosme Although this problem has been raised before, it just needs to be solved.

#422

@Hierosme
Copy link

Hierosme commented Jun 22, 2023

I just have create a draft pull request #170.
In few days you'll can test it on the Under Construction directory.

@Hierosme
Copy link

Hierosme commented Jun 22, 2023

I can confirm the trouble
Many function duplicate the call of system sudo command. that direct acces to sudo cause 2 troubles.

  • Error interception will be more complicated
  • sudo will do as it like, what it want in the Application.

My frist idea was to use a QProcess class for emit needed signals, then keep the control of what happen or not in the App.
Clearly it should have only one function it call Sudo, in front of a controller it know if the entire Model can be flush to the system....

Brieff i got the root cause, and a hammer for speack with ...

Frist step is to migrate to a True View system then separate the GUI to a .ui file.
Second Create a Model in charge to store the entire data of the application
only here the Hammer can split what is part of the Backend and part of a future Controller.

Just in case something still move, the backend will use a dedicated threads and the only one object it can speack with it will be the Controller.

About security. Basically i do my best to push the responssability of the askpass somewhere else of the application.

@Hierosme
Copy link

I Share to link here about how FreeDesktop want deal with App privilege.
In fact Polkit look to be the way.

https://www.freedesktop.org/software/polkit/docs/latest/

and

a Qt Binding (Not KAuth)

https://api.kde.org/polkit-qt-1/html/

The BSD Native pakage: https://freebsd.pkgs.org/13/freebsd-amd64/polkit-qt-1-0.114.0.pkg.html
We speack about 73K for the lib.

If remenber well Politkit was near a gas engine, and it do not exist a python binding....

Just to know. it have a raison about why sudo is use for permission ?

that is two different method. sudo change the user for execute a action (Then start in amount of the application)
Polkit asking for privilege Yes or No ....

In general the permission esclation is not under the app responssability.

@Hierosme
Copy link

Just for fun , here we are:

image

@Hierosme
Copy link

image

It have take me the day, but the clock is really near the OsX one ....

@probonopd
Copy link
Member

Please do not use PolKit in helloSystem.

https://github.com/helloSystem/hello/wiki/Welcome-and-unwelcome-technologies

@Hierosme
Copy link

Yes i got it.

I have read that page, The line about polkit look a bit worng to me ,
That is no similar to Sudo, That is the oposit of Sudo and a gas -engine...

Only pkexec is similar to sudo, THAT THE ONLY ONE SIMILARITY .... doas is similar to sudo where polkit is not...

I do my best to use Sudo, trust me i'll not doing dangerous thing for the system.

My reaction is about the confusion about Sudo / Polkit: everyone show screenshoot or execpt the result of the PolKit Auth Agent ....

Here will use Askpass the result will be totally different.

For me and unfortunally it do not exist alternative to Polkit .... And Sudo or Doas are NOT...
That is easy to say No polkit, but in general the reality is more complexe of that ....

Personally i simply hate lot polkit... i'm force to install it, but it have choise and no alternative .... KDE, XFCE, GNOME use it ....

My reaction will be all time that confusion will be done. The troouble is not relatif to GNU/Linux... Just install KDE/GNOME or XFCE on th BSD machine, it will work only because polkit is use ....

We are in front of a maturity touble.

Are we shure about a Desktop exist without polkit ? why that ?

All the trouble look to be confusion about Sudo is similar to Polkit....

@probonopd
Copy link
Member

Personally i simply hate lot polkit... i'm force to install it,

Life is much more pleasant once one stops using software that one thinks one is "forced" to. (This was a reason for me to start helloSystem - get rid of everything I don't like. ;-)

@Hierosme
Copy link

We'll found a way by the door or the window....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants