1PKCHECK(1)                          pkcheck                         PKCHECK(1)
2
3
4

NAME

6       pkcheck - Check whether a process is authorized
7

SYNOPSIS

9       pkcheck [--version] [--help|-h]
10
11       pkcheck [--list-temp]
12
13       pkcheck [--revoke-temp]
14
15       pkcheck --action-id|-a action
16               {--process|-p { pid | pid,pid-start-time | pid,pid-start-time,uid }
17               | --system-bus-name|-s busname} [--allow-user-interaction|-u]
18               [--enable-internal-agent] [--detail|-d key value...]
19

DESCRIPTION

21       pkcheck is used to check whether a process, specified by either
22       --process (see below) or --system-bus-name, is authorized for action.
23       The --detail option can be used zero or more times to pass details
24       about action. If --allow-user-interaction is passed, pkcheck blocks
25       while waiting for authentication.
26
27       The invocation pkcheck --list-temp will list all temporary
28       authorizations for the current session and pkcheck --revoke-temp will
29       revoke all temporary authorizations for the current session.
30
31       This command is a simple wrapper around the polkit D-Bus interface; see
32       the D-Bus interface documentation for details.
33

RETURN VALUE

35       If the specified process is authorized, pkcheck exits with a return
36       value of 0. If the authorization result contains any details, these are
37       printed on standard output as key/value pairs using environment style
38       reporting, e.g. first the key followed by a an equal sign, then the
39       value followed by a newline.
40
41           KEY1=VALUE1
42           KEY2=VALUE2
43           KEY3=VALUE3
44           ...
45
46       Octets that are not in [a-zA-Z0-9_] are escaped using octal codes
47       prefixed with \. For example, the UTF-8 string føl,你好 will be printed
48       as f\303\270l\54\344\275\240\345\245\275.
49
50       If the specified process is not authorized, pkcheck exits with a return
51       value of 1 and a diagnostic message is printed on standard error.
52       Details are printed on standard output.
53
54       If the specified process is not authorized because no suitable
55       authentication agent is available or if the --allow-user-interaction
56       wasn't passed, pkcheck exits with a return value of 2 and a diagnostic
57       message is printed on standard error. Details are printed on standard
58       output.
59
60       If the specified process is not authorized because the authentication
61       dialog / request was dismissed by the user, pkcheck exits with a return
62       value of 3 and a diagnostic message is printed on standard error.
63       Details are printed on standard output.
64
65       If an error occurred while checking for authorization, pkcheck exits
66       with a return value of 127 with a diagnostic message printed on
67       standard error.
68
69       If one or more of the options passed are malformed, pkcheck exits with
70       a return value of 126. If stdin is a tty, then this manual page is also
71       shown.
72

NOTES

74       Do not use either the bare pid or pid,start-time syntax forms for
75       --process. There are race conditions in both. New code should always
76       use pid,pid-start-time,uid. The value of start-time can be determined
77       by consulting e.g. the proc(5) file system depending on the operating
78       system. If fewer than 3 arguments are passed, pkcheck will attempt to
79       look up them up internally, but note that this may be racy.
80
81       If your program is a daemon with e.g. a custom Unix domain socket, you
82       should determine the uid parameter via operating system mechanisms such
83       as PEERCRED.
84

AUTHENTICATION AGENT

86       pkcheck, like any other polkit application, will use the authentication
87       agent registered for the process in question. However, if no
88       authentication agent is available, then pkcheck can register its own
89       textual authentication agent if the option --enable-internal-agent is
90       passed.
91

AUTHOR

93       Written by David Zeuthen <davidz@redhat.com> with a lot of help from
94       many others.
95

BUGS

97       Please send bug reports to either the distribution or the polkit-devel
98       mailing list, see the link
99       https://gitlab.freedesktop.org/polkit/polkit/-/issues/ on how to
100       subscribe.
101

SEE ALSO

103       polkit(8), polkitd(8), pkaction(1), pkexec(1), pkttyagent(1)
104
105
106
107polkit                             May 2009                         PKCHECK(1)
Impressum