~ubuntu-branches/debian/jessie/systemd/jessie

« back to all changes in this revision

Viewing changes to man/sd_uid_get_state.3

  • Committer: Package Import Robot
  • Author(s): Tollef Fog Heen, Tollef Fog Heen, Michael Biebl
  • Date: 2012-04-03 19:59:17 UTC
  • mfrom: (1.1.10) (6.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20120403195917-l532urrbg4pkreas
Tags: 44-1
[ Tollef Fog Heen ]
* New upstream version.
  - Backport 3492207: journal: PAGE_SIZE is not known on ppc and other
    archs
  - Backport 5a2a2a1: journal: react with immediate rotation to a couple
    of more errors
  - Backport 693ce21: util: never follow symlinks in rm_rf_children()
    Fixes CVE-2012-1174, closes: #664364
* Drop output message from init-functions hook, it's pointless.
* Only rmdir /lib/init/rw if it exists.
* Explicitly order debian-fixup before sysinit.target to prevent a
  possible race condition with the creation of sockets.  Thanks to
  Michael Biebl for debugging this.
* Always restart the initctl socket on upgrades, to mask sysvinit
  removing it.

[ Michael Biebl ]
* Remove workaround for non-interactive sessions from pam config again.
* Create compat /dev/initctl symlink in case we are upgrading from a system
  running a newer version of sysvinit (using /run/initctl) and sysvinit is
  replaced with systemd-sysv during the upgrade. Closes: #663219
* Install new man pages.
* Build-Depend on valac (>= 0.12) instead of valac-0.12. Closes: #663323

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
'\" t
 
2
.\"     Title: sd_uid_get_state
 
3
.\"    Author: Lennart Poettering <lennart@poettering.net>
 
4
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
 
5
.\"      Date: 03/16/2012
 
6
.\"    Manual: sd_uid_get_state
 
7
.\"    Source: systemd
 
8
.\"  Language: English
 
9
.\"
 
10
.TH "SD_UID_GET_STATE" "3" "03/16/2012" "systemd" "sd_uid_get_state"
 
11
.\" -----------------------------------------------------------------
 
12
.\" * Define some portability stuff
 
13
.\" -----------------------------------------------------------------
 
14
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
15
.\" http://bugs.debian.org/507673
 
16
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
 
17
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
18
.ie \n(.g .ds Aq \(aq
 
19
.el       .ds Aq '
 
20
.\" -----------------------------------------------------------------
 
21
.\" * set default formatting
 
22
.\" -----------------------------------------------------------------
 
23
.\" disable hyphenation
 
24
.nh
 
25
.\" disable justification (adjust text to left margin only)
 
26
.ad l
 
27
.\" -----------------------------------------------------------------
 
28
.\" * MAIN CONTENT STARTS HERE *
 
29
.\" -----------------------------------------------------------------
 
30
.SH "NAME"
 
31
sd_uid_get_state, sd_uid_is_on_seat, sd_uid_get_sessions, sd_uid_get_seats \- Determine login state of a specific Unix user ID
 
32
.SH "SYNOPSIS"
 
33
.sp
 
34
.ft B
 
35
.nf
 
36
#include <systemd/sd\-login\&.h>
 
37
.fi
 
38
.ft
 
39
.HP \w'int\ sd_uid_get_state('u
 
40
.BI "int sd_uid_get_state(uid_t\ " "pid" ", char**\ " "state" ");"
 
41
.HP \w'int\ sd_uid_is_on_seat('u
 
42
.BI "int sd_uid_is_on_seat(uid_t\ " "pid" ", int\ " "require_active" ", const\ char*\ " "seat" ");"
 
43
.HP \w'int\ sd_uid_get_sessions('u
 
44
.BI "int sd_uid_get_sessions(uid_t\ " "pid" ", int\ " "require_active" ", char***\ " "sessions" ");"
 
45
.HP \w'int\ sd_uid_get_seats('u
 
46
.BI "int sd_uid_get_seats(uid_t\ " "pid" ", int\ " "require_active" ", char***\ " "seats" ");"
 
47
.SH "DESCRIPTION"
 
48
.PP
 
49
\fBsd_uid_get_state()\fR
 
50
may be used to determine the login state of a specific Unix user identifier\&. The following states are currently known:
 
51
offline
 
52
(user not logged in at all),
 
53
lingering
 
54
(user not logged in, but some user services running),
 
55
online
 
56
(user logged in, but not active),
 
57
active
 
58
(user logged in on an active seat)\&. In the future additional states might be defined, client code should be written to be robust in regards to additional state strings being returned\&. The returned string needs to be freed with the libc
 
59
\fBfree\fR(3)
 
60
call after use\&.
 
61
.PP
 
62
\fBsd_uid_is_on_seat()\fR
 
63
may be used to determine whether a specific user is logged in or active on a specific seat\&. Accepts a Unix user identifier and a seat identifier string as parameters\&. The
 
64
\fIrequire_active\fR
 
65
parameter is a boolean\&. If non\-zero (true) this function will test if the user is active (i\&.e\&. has a session that is in the foreground and accepting user input) on the specified seat, otherwise (false) only if the user is logged in (and possibly inactive) on the specified seat\&.
 
66
.PP
 
67
\fBsd_uid_get_sessions()\fR
 
68
may be used to determine the current sessions of the specified user\&. Acceptes a Unix user identifier as parameter\&. The
 
69
\fIrequire_active\fR
 
70
boolean parameter controls whether the returned list shall consist of only those sessions where the user is currently active (true) or where the user is currently logged in at all, possibly inactive (false)\&. The call returns a NULL terminated string array of session identifiers in
 
71
\fIsessions\fR
 
72
which needs to be freed by the caller with the libc
 
73
\fBfree\fR(3)
 
74
call after use, including all the strings referenced\&. If the string array parameter is passed as NULL the array will not be filled in, but the return code still indicates the number of current sessions\&. Note that instead of an empty array NULL may be returned and should be considered equivalent to an empty array\&.
 
75
.PP
 
76
Similar,
 
77
\fBsd_uid_get_seats()\fR
 
78
may be used to determine the list of seats on which the user currently has sessions\&. Similar semantics apply, however note that the user may have multiple sessions on the same seat as well as sessions with no attached seat and hence the number of entries in the returned array may differ from the one returned by
 
79
\fBsd_uid_get_sessions()\fR\&.
 
80
.SH "RETURN VALUE"
 
81
.PP
 
82
On success
 
83
\fBsd_uid_get_state()\fR
 
84
returns 0 or a positive integer\&. If the test succeeds
 
85
\fBsd_uid_is_on_seat()\fR
 
86
returns a positive integer, if it fails 0\&.
 
87
\fBsd_uid_get_sessions()\fR
 
88
and
 
89
\fBsd_uid_get_seats()\fR
 
90
return the number of entries in the returned arrays\&. On failure, these calls return a negative errno\-style error code\&.
 
91
.SH "NOTES"
 
92
.PP
 
93
The
 
94
\fBsd_uid_get_state()\fR,
 
95
\fBsd_uid_is_on_seat()\fR,
 
96
\fBsd_uid_get_sessions()\fR, and
 
97
\fBsd_uid_get_seats()\fR
 
98
interfaces are available as shared library, which can be compiled and linked to with the
 
99
libsystemd\-login
 
100
\fBpkg-config\fR(1)
 
101
file\&.
 
102
.SH "SEE ALSO"
 
103
.PP
 
104
 
 
105
\fBsystemd\fR(1),
 
106
\fBsd-login\fR(7),
 
107
\fBsd_pid_get_owner_uid\fR(3)
 
108
.SH "AUTHOR"
 
109
.PP
 
110
\fBLennart Poettering\fR <\&lennart@poettering\&.net\&>
 
111
.RS 4
 
112
Developer
 
113
.RE