PDA

View Full Version : QDialog that asks user for root password



Cyrebo
26th April 2013, 23:28
Just wanna know if I can ask users for root password/user password of the computer in a QDialog GUI?

Thanks

--

ChrisW67
26th April 2013, 23:30
Yes, sure you can. You can ask the user for anything you like.

Cyrebo
26th April 2013, 23:46
Wow I'm suprised, I didn't think you could. Is it an in-built function in QDialog or is there some path or something I have to specify?

amleto
26th April 2013, 23:54
facepalm.


.............

Cyrebo
26th April 2013, 23:59
facepalm.


.............

What? I don't get it...? Do i have to hardcode the password to be checked?

ChrisW67
27th April 2013, 00:47
Just wanna know if I can ask users for root password/user password of the computer in a QDialog GUI?
You can ask the user to provide anything you want. This has precisely nothing to do with what your code does with the provided information.

There is no auto-magic, obtain root login credentials, change the process effective uid to zero, and do stuff dialog. You have to code everything you want done with the user's input.

Cyrebo
27th April 2013, 01:17
You can ask the user to provide anything you want. This has precisely nothing to do with what your code does with the provided information.

There is no auto-magic, obtain root login credentials, change the process effective uid to zero, and do stuff dialog. You have to code everything you want done with the user's input.

That's what I thought but I enquired simply because QFileDialog is able to identify paths using users' default directory auto-magically. I understand to do something like this you would probably have to have root privileges set on the application anyway.

wysota
27th April 2013, 07:17
No, you don't need superuser privileges to determine users' home paths.