Changeset 16505


Ignore:
Timestamp:
Aug 9, 2016, 10:11:04 AM (3 years ago)
Author:
dcorreia
Message:

Added check for root permissions in wizard main app.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • internals/2016/linuxloginsmartcardwizard/trunk/proto1/w4pages.py

    r16500 r16505  
    4949if __name__ == "__main__":
    5050    import sys
     51    import os
     52    if os.geteuid() != 0:
     53        print("Script not started as root. Running sudo...")
     54        args = ["sudo", sys.executable] + sys.argv + [os.environ]
     55        os.execlpe("gksudo", *args)
     56    print("Running with euid ", os.geteuid())
     57
    5158    app = QtWidgets.QApplication(sys.argv)
    5259    ui = MyWizard()
Note: See TracChangeset for help on using the changeset viewer.