Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pkcheck(1) [debian man page]

PKCHECK(1)							      pkcheck								PKCHECK(1)

NAME
pkcheck - Check whether a process is authorized SYNOPSIS
pkcheck [--version] [--help] pkcheck [--list-temp] pkcheck [--revoke-temp] pkcheck --action-id action {--process { pid | pid,pid-start-time } | --system-bus-name busname} [--allow-user-interaction] [--enable-internal-agent] [--detail key value...] DESCRIPTION
pkcheck is used to check whether a process, specified by either --process or --system-bus-name, is authorized for action. The --detail option can be used zero or more times to pass details about action. If --allow-user-interaction is passed, pkcheck blocks while waiting for authentication. The invocation pkcheck --list-temp will list all temporary authorizations for the current session and pkcheck --revoke-temp will revoke all temporary authorizations for the current session. This command is a simple wrapper around the PolicyKit D-Bus interface; see the D-Bus interface documentation for details. RETURN VALUE
If the specified process is authorized, pkcheck exits with a return value of 0. If the authorization result contains any details, these are printed on standard output as key/value pairs using environment style reporting, e.g. first the key followed by a an equal sign, then the value followed by a newline. KEY1=VALUE1 KEY2=VALUE2 KEY3=VALUE3 ... Octects that are not in [a-zA-Z0-9_] are escaped using octal codes prefixed with . For example, the UTF-8 string fol, will be printed as f303270l54344275240345245275. If the specificied process is not authorized, pkcheck exits with a return value of 1 and a diagnostic message is printed on standard error. Details are printed on standard output. If the specificied process is not authorized because no suitable authentication agent is available or if the --allow-user-interaction wasn't passed, pkcheck exits with a return value of 2 and a diagnostic message is printed on standard error. Details are printed on standard output. If the specificied process is not authorized because the authentication dialog / request was dismissed by the user, pkcheck exits with a return value of 3 and a diagnostic message is printed on standard error. Details are printed on standard output. If an error occured while checking for authorization, pkcheck exits with a return value of 127 with a diagnostic message printed on standard error. If one or more of the options passed are malformed, pkcheck exits with a return value of 126. If stdin is a tty, then this manual page is also shown. NOTES
Since process identifiers can be recycled, the caller should always use pid,pid-start-time to specify the process to check for authorization when using the --process option. The value of pid-start-time can be determined by consulting e.g. the proc(5) file system depending on the operating system. If only pid is passed to the --process option, then pkcheck will look up the start time itself but note that this may be racy. AUTHENTICATION AGENT
pkcheck, like any other PolicyKit application, will use the authentication agent registered for the process in question. However, if no authentication agent is available, then pkcheck can register its own textual authentication agent if the option --enable-internal-agent is passed. AUTHOR
Written by David Zeuthen davidz@redhat.com with a lot of help from many others. BUGS
Please send bug reports to either the distribution or the polkit-devel mailing list, see the link http://lists.freedesktop.org/mailman/listinfo/polkit-devel on how to subscribe. SEE ALSO
polkit(8), pkaction(1), pkexec(1), pkttyagent(1) polkit May 2009 PKCHECK(1)

Check Out this Related Man Page

POLKIT(8)							      polkit								 POLKIT(8)

NAME
polkit - Authorization Framework OVERVIEW
PolicyKit provides an authorization API intended to be used by privileged programs ("MECHANISMS") offering service to unprivileged programs ("CLIENTS") through some form of IPC mechanism such as D-Bus or Unix pipes. In this scenario, the mechanism typically treats the client as untrusted. For every request from a client, the mechanism needs to determine if the request is authorized or if it should refuse to service the client. Using the PolicyKit API, a mechanism can offload this decision to a trusted party: The PolicyKit Authority. In addition to acting as an authority, PolicyKit allows users to obtain temporary authorization through authenticating either an administrative user or the owner of the session the client belongs to. This is useful for scenarios where a mechanism needs to verify that the operator of the system really is the user or really is an administrative user. SYSTEM ARCHITECTURE
The system architecture of PolicyKit is comprised of the Authority (implemented as a service on the system message bus) and a Authentication Agent per user session (provided and started by the user session e.g. GNOME or KDE). Additionally, PolicyKit supports a number of extension points - specifically, vendors and/or sites can write extensions to completely control authorization policy. In a block diagram, the architecture looks like this: [IMAGE][1] +-------------------+ | Authentication | | Agent | +-------------------+ | libpolkit-agent-1 | +-------------------+ ^ +--------+ | | Client | +--------------+ +--------+ | ^ | | User Session | | =======================|========================|============= System Context | | | | | +---+ V | /------------ | | System Bus | | ------------/ | ^ ^ V | | +---------------------+ +--------------+ | | Mechanism | | | +---------------------+ V +----> | libpolkit-gobject-1 | +------------------+ +---------------------+ | org.freedesktop. | | PolicyKit1 | +------------------+ | Backends and | | Extensions | +------------------+ For convenience, the libpolkit-gobject-1 library wraps the PolicyKit D-Bus API using GObject. However, a mechanism can also use the D-Bus API or the pkcheck(1) command to check authorizations. The libpolkit-agent-1 library provides an abstraction of the native authentication system, e.g. pam(8) and also facilities registration and communication with the PolicyKit D-Bus service. PolicyKit extensions and authority backends are implemented using the libpolkit-backend-1 library. See the developer documentation[2] for more information about using and extending PolicyKit. See pklocalauthority(8) for information about the Local Authority - the default authority implementation shipped with PolicyKit. AUTHENTICATION AGENTS
An authentication agent is used to make the user of a session prove that the user of the session really is the user (by authenticating as the user) or an administrative user (by authenticating as a administrator). In order to integrate well with the rest of the user session (e.g. match the look and feel), authentication agents are meant to be provided by the user session that the user uses. For example, an authentication agent may look like this: [IMAGE][3] +----------------------------------------------------------+ | Authenticate [X] | +----------------------------------------------------------+ | | | [Icon] Authentication is required to run ATA SMART | | self tests | | | | An application is attempting to perform an | | action that requires privileges. Authentication | | as the super user is required to perform this | | action. | | | | Password for root: [_________________________] | | | | [V] Details: | | Drive: ATA INTEL SSDSA2MH08 (045C) | | Device: /dev/sda | | Action: org.fd.devicekit.disks.drive-ata-smart-selftest | | Vendor: The DeviceKit Project | | | | [Cancel] [Authenticate] | +----------------------------------------------------------+ If the system is configured without a root account it may allow you to select the administrative user who is authenticating: [IMAGE][4] +----------------------------------------------------------+ | Authenticate [X] | +----------------------------------------------------------+ | | | [Icon] Authentication is required to run ATA SMART | | self tests | | | | An application is attempting to perform an | | action that requires privileges. Authentication | | as one of the users below is required to | | perform this action. | | | | [[Face] Patrick Bateman (bateman) [V]] | | | | Password for bateman: [______________________] | | | | [V] Details: | | Drive: ATA INTEL SSDSA2MH08 (045C) | | Device: /dev/sda | | Action: org.fd.devicekit.disks.drive-ata-smart-selftest | | Vendor: The DeviceKit Project | | | | [Cancel] [Authenticate] | +----------------------------------------------------------+ See pklocalauthority(8) on how to set up the local authority implemention for systems without a root account. DECLARING ACTIONS
A mechanism need to declare a set of "ACTIONS" in order to use PolicyKit. Actions correspond to operations that clients can request the mechanism to carry out and are defined in XML files that the mechanism installs into the /usr/share/polkit-1/actions directory. PolicyKit actions are namespaced and can only contain the characters [a-z][0-9].- e.g. lower-case ASCII, digits, period and hyphen. Each XML file can contain more than one action but all actions need to be in the same namespace and the file needs to be named after the namespace and have the extension .policy. The XML file must have the following doctype declaration <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd"> The policyconfig element must be present exactly once. Elements that can be used inside policyconfig includes: vendor The name of the project or vendor that is supplying the actions in the XML document. Optional. vendor_url A URL to the project or vendor that is supplying the actions in the XML document. Optional. icon_name An icon representing the project or vendor that is supplying the actions in the XML document. The icon name must adhere to the Freedesktop.org Icon Naming Specification[5]. Optional. action Declares an action. The action name is specified using the id attribute and can only contain the characters [a-z][0-9].- e.g. lower-case ASCII, digits, period and hyphen. Elements that can be used inside action includes: description A human readable description of the action, e.g. "Install unsigned software". message A human readable message displayed to the user when asking for credentials when authentication is needed, e.g. "Installing unsigned software requires authentication". defaults This element is used to specify implicit authorizations for clients. Elements that can be used inside defaults includes: allow_any Implicit authorizations that apply to any client. Optional. allow_inactive Implicit authorizations that apply to clients in inactive sessions on local consoles. Optional. allow_active Implicit authorizations that apply to clients in active sessions on local consoles. Optional. Each of the allow_any, allow_inactive and allow_active elements can contain the following values: no Not authorized. yes Authorized. auth_self Authentication by the owner of the session that the client originates from is required. auth_admin Authentication by an administrative user is required. auth_self_keep Like auth_self but the authorization is kept for a brief period. auth_admin_keep Like auth_admin but the authorization is kept for a brief period. annotate Used for annotating an action with a key/value pair. The key is specified using the the key attribute and the value is specified using the value attribute. This element may appear zero or more times. See pkexec(1) for an example of how this can be used. vendor Used for overriding the vendor on a per-action basis. Optional. vendor_url Used for overriding the vendor URL on a per-action basis. Optional. icon_name Used for overriding the icon name on a per-action basis. Optional. For localization, description and message elements may occur multiple times with different xml:lang attributes. To list installed PolicyKit actions, use the pkaction(1) command. AUTHOR
Written by David Zeuthen davidz@redhat.com with a lot of help from many others. BUGS
Please send bug reports to either the distribution or the polkit-devel mailing list, see the link http://lists.freedesktop.org/mailman/listinfo/polkit-devel on how to subscribe. SEE ALSO
pklocalauthority(8) polkitd(8) pkaction(1), pkcheck(1), pkexec(1), NOTES
1. /usr/share/gtk-doc/html/polkit-1/polkit-architecture.png 2. developer documentation file:///usr/share/gtk-doc/html/polkit-1/index.html 3. /usr/share/gtk-doc/html/polkit-1/polkit-authentication-agent-example.png 4. /usr/share/gtk-doc/html/polkit-1/polkit-authentication-agent-example-wheel.png 5. Freedesktop.org Icon Naming Specification http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html polkit January 2009 POLKIT(8)
Man Page