PKCHECK(1)
π PKCHECK(1) π
okay bestie, so this is the manual page for pkcheck, part of polkit. it's the little tool that asks the big question: is this process allowed to do this thing? let's get into it π«Ά
β¨ NAME β¨
pkcheck β check whether a process is authorized π
πΈ SYNOPSIS πΈ
pkcheck [--version] [--help|-h]
pkcheck [--list-temp]
pkcheck [--revoke-temp]
pkcheck --action-id|-a action
{--process|-p { pid | pid,pid-start-time | pid,pid-start-time,uid }
| --system-bus-name|-s busname} [--allow-user-interaction|-u]
[--enable-internal-agent] [--detail|-d key value...]
π¦ DESCRIPTION π¦
so pkcheck is the girl who checks whether a process is authorized for an action. and which process, you ask? you tell her, either with --process (details below, keep scrolling bestie) or with --system-bus-name.
you can pass --detail zero or more times to hand over extra details about the action. and if you pass --allow-user-interaction, pkcheck will literally just sit there and block while it waits for authentication. patience is a virtue β¨
now, the invocation pkcheck --list-temp will list all the temporary authorizations for the current session. and pkcheck --revoke-temp will revoke all the temporary authorizations for the current session. cleanup queen π
and lowkey, this command is just a simple wrapper around the polkit D-Bus interface β so if you want the real tea, go read the D-Bus interface documentation.
π RETURN VALUE π
okay this part matters so pay attention bestie, we're talking exit codes:
- if the specified process is authorized,
pkcheckexits with a return value of0. slay, we love a happy ending π - if the authorization result contains any details, those get printed on standard output as key/value pairs using environment style reporting. like, first the key, then an equal sign, then the value, then a newline. so:
KEY1=VALUE1
KEY2=VALUE2
KEY3=VALUE3
...
- any octets that are not in
[a-zA-Z0-9_]get escaped using octal codes prefixed with\. for example, the UTF-8 stringfΓΈl,δ½ ε₯½will be printed asf\303\270l\54\344\275\240\345\245\275. iconic escaping behaviour honestly π§ - if the specified process is not authorized,
pkcheckexits with a return value of1, and a diagnostic message is printed on standard error. details still go to standard output. - if the specified process is not authorized because no suitable authentication agent is available, or because the
--allow-user-interactionwasn't passed,pkcheckexits with a return value of2and a diagnostic message is printed on standard error. details β standard output. - if the specified process is not authorized because the authentication dialog / request was dismissed by the user,
pkcheckexits with a return value of3and a diagnostic message is printed on standard error. details β standard output. - if an error occurred while checking for authorization,
pkcheckexits with a return value of127with a diagnostic message printed on standard error. - and if one or more of the options you passed are malformed,
pkcheckexits with a return value of126. and ifstdinis a tty, this manual page also gets shown to you. it's giving "read the instructions, babe" π
π NOTES π
do NOT use either the barepidor thepid,start-timesyntax forms for--process. there are race conditions in both. that's not a vibe, that's a bug waiting to happen.
new code should always use pid,pid-start-time,uid. periodt.
the value of start-time can be determined by consulting e.g. the proc(5) file system, depending on the operating system. and heads up: if fewer than 3 arguments are passed, pkcheck will attempt to look them up internally β but ngl, that may be racy. π
if your program is a daemon with e.g. a custom Unix domain socket, you should determine the uid parameter via operating system mechanisms such as PEERCRED. iykyk.
π AUTHENTICATION AGENT π
pkcheck, like any other polkit application, will use the authentication agent registered for the process in question. so, the usual.
but β if no authentication agent is available, pkcheck can register its own textual authentication agent if you pass the --enable-internal-agent option. she's self-sufficient, she's her own main character π
β¨
π AUTHOR π
written by David Zeuthen <davidz@redhat.com> with a lot of help from many others. shoutout to the whole crew π«Ά
π BUGS π
please send bug reports to either the distribution or the polkit-devel mailing list, see https://github.com/polkit-org/polkit#bugs-and-development. don't be shy, they wanna hear from you π
β SEE ALSO β
polkit(8), polkitd(8), pkaction(1), pkexec(1), pkttyagent(1)
and that's the whole page bestie!! this came from polkit, dated May 2009 β yes it's older than some of us and it's still out here checking authorizations. respect the elders ππ go forth and check your processes, no cap π¦β¨
π¦ where this page comes from
- alpine 3.24: polkit-doc 127-r2 Β· GPL-2.0-or-later
- arch rolling: polkit 128-1 Β· LGPL-2.0-or-later
- fedora 44: polkit 127-2.fc44.2 Β· LGPL-2.0-or-later
- nixos 26.05: polkit 127
- nixpkgs unstable: polkit 127
- ubuntu resolute: polkitd 127-2ubuntu1
- ubuntu resolute: polkitd 127-2ubuntu1.1
- ubuntu stonking: polkitd 127-3ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms