Skip to content
  • David Zeuthen's avatar
    Add textual authentication agent and use it in pkexec(1) · 42177383
    David Zeuthen authored
    
    
    This makes pkexec(1) work when e.g. logging in via ssh(1) or the linux
    console but also when using `su -'. Example:
    
     [davidz@x61 ~]$ su - bateman
     Password:
     [bateman@x61 ~]$ pkexec bash
     ==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
     Authentication is needed to run `/bin/bash' as the super user
     Authenticating as: root
     Password:
     ==== AUTHENTICATION COMPLETE ===
     [root@x61 ~]#
    
    Summary of changes
    
     - Added a PolkitAgentTextListener class
    
     - Add new polkit_agent_listener_register() (and _unregister()) API
    
     - Deprecate polkit_agent_register_listener API
    
     - Allow registering authentication agents for PolkitUnixProcess subjects
       and prefer such agents to ones governing the session
    
     - Make PolkitAgentSession use the thread-default GMainContext - otherwise
       it won't work in spawned threads
    
     - (finally) use PolkitAgentTextListener in pkexec(1) if authorization
       via authentication is possible but no authentication agent was
       found
    
    Signed-off-by: default avatarDavid Zeuthen <davidz@redhat.com>
    42177383