Results 1 to 8 of 8

Thread: QDialog that asks user for root password

  1. #1
    Join Date
    Feb 2013
    Posts
    71
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QDialog that asks user for root password

    Just wanna know if I can ask users for root password/user password of the computer in a QDialog GUI?

    Thanks

    --

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QDialog that asks user for root password

    Yes, sure you can. You can ask the user for anything you like.

  3. #3
    Join Date
    Feb 2013
    Posts
    71
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QDialog that asks user for root password

    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?

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QDialog that asks user for root password

    facepalm.


    .............
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. The following user says thank you to amleto for this useful post:

    d_stranz (27th April 2013)

  6. #5
    Join Date
    Feb 2013
    Posts
    71
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QDialog that asks user for root password

    Quote Originally Posted by amleto View Post
    facepalm.


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

  7. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QDialog that asks user for root password

    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.

  8. #7
    Join Date
    Feb 2013
    Posts
    71
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QDialog that asks user for root password

    Quote Originally Posted by ChrisW67 View Post
    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.

  9. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDialog that asks user for root password

    No, you don't need superuser privileges to determine users' home paths.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Qt4.7 application dumps with Root user in Fedora 14
    By ankit17.ag in forum Qt Programming
    Replies: 2
    Last Post: 17th June 2011, 13:03
  2. Replies: 5
    Last Post: 7th December 2010, 22:02
  3. Replies: 3
    Last Post: 3rd November 2010, 18:30
  4. password for 'root' account in Greenphone
    By rishiraj in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 27th April 2009, 06:42
  5. Replies: 2
    Last Post: 27th November 2008, 11:16

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.