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

« back to all changes in this revision

Viewing changes to src/login/logind.h

  • 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
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 
2
 
 
3
#ifndef foologindhfoo
 
4
#define foologindhfoo
 
5
 
 
6
/***
 
7
  This file is part of systemd.
 
8
 
 
9
  Copyright 2011 Lennart Poettering
 
10
 
 
11
  systemd is free software; you can redistribute it and/or modify it
 
12
  under the terms of the GNU General Public License as published by
 
13
  the Free Software Foundation; either version 2 of the License, or
 
14
  (at your option) any later version.
 
15
 
 
16
  systemd is distributed in the hope that it will be useful, but
 
17
  WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
19
  General Public License for more details.
 
20
 
 
21
  You should have received a copy of the GNU General Public License
 
22
  along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
23
***/
 
24
 
 
25
#include <stdbool.h>
 
26
#include <inttypes.h>
 
27
#include <dbus/dbus.h>
 
28
#include <libudev.h>
 
29
 
 
30
#include "util.h"
 
31
#include "list.h"
 
32
#include "hashmap.h"
 
33
#include "cgroup-util.h"
 
34
 
 
35
typedef struct Manager Manager;
 
36
 
 
37
#include "logind-device.h"
 
38
#include "logind-seat.h"
 
39
#include "logind-session.h"
 
40
#include "logind-user.h"
 
41
 
 
42
struct Manager {
 
43
        DBusConnection *bus;
 
44
 
 
45
        Hashmap *devices;
 
46
        Hashmap *seats;
 
47
        Hashmap *sessions;
 
48
        Hashmap *users;
 
49
 
 
50
        LIST_HEAD(Seat, seat_gc_queue);
 
51
        LIST_HEAD(Session, session_gc_queue);
 
52
        LIST_HEAD(User, user_gc_queue);
 
53
 
 
54
        struct udev *udev;
 
55
        struct udev_monitor *udev_seat_monitor, *udev_vcsa_monitor;
 
56
 
 
57
        int udev_seat_fd;
 
58
        int udev_vcsa_fd;
 
59
 
 
60
        int console_active_fd;
 
61
        int bus_fd;
 
62
        int epoll_fd;
 
63
 
 
64
        unsigned n_autovts;
 
65
 
 
66
        Seat *vtconsole;
 
67
 
 
68
        char *cgroup_path;
 
69
        char **controllers, **reset_controllers;
 
70
 
 
71
        char **kill_only_users, **kill_exclude_users;
 
72
 
 
73
        bool kill_user_processes;
 
74
 
 
75
        unsigned long session_counter;
 
76
 
 
77
        Hashmap *cgroups;
 
78
        Hashmap *fifo_fds;
 
79
};
 
80
 
 
81
enum {
 
82
        FD_SEAT_UDEV,
 
83
        FD_VCSA_UDEV,
 
84
        FD_CONSOLE,
 
85
        FD_BUS,
 
86
        FD_FIFO_BASE
 
87
};
 
88
 
 
89
Manager *manager_new(void);
 
90
void manager_free(Manager *m);
 
91
 
 
92
int manager_add_device(Manager *m, const char *sysfs, Device **_device);
 
93
int manager_add_seat(Manager *m, const char *id, Seat **_seat);
 
94
int manager_add_session(Manager *m, User *u, const char *id, Session **_session);
 
95
int manager_add_user(Manager *m, uid_t uid, gid_t gid, const char *name, User **_user);
 
96
int manager_add_user_by_name(Manager *m, const char *name, User **_user);
 
97
int manager_add_user_by_uid(Manager *m, uid_t uid, User **_user);
 
98
 
 
99
int manager_process_seat_device(Manager *m, struct udev_device *d);
 
100
int manager_dispatch_seat_udev(Manager *m);
 
101
int manager_dispatch_vcsa_udev(Manager *m);
 
102
int manager_dispatch_console(Manager *m);
 
103
 
 
104
int manager_enumerate_devices(Manager *m);
 
105
int manager_enumerate_seats(Manager *m);
 
106
int manager_enumerate_sessions(Manager *m);
 
107
int manager_enumerate_users(Manager *m);
 
108
 
 
109
int manager_startup(Manager *m);
 
110
int manager_run(Manager *m);
 
111
int manager_spawn_autovt(Manager *m, int vtnr);
 
112
 
 
113
void manager_cgroup_notify_empty(Manager *m, const char *cgroup);
 
114
 
 
115
void manager_gc(Manager *m, bool drop_not_started);
 
116
 
 
117
int manager_get_idle_hint(Manager *m, dual_timestamp *t);
 
118
 
 
119
int manager_get_session_by_cgroup(Manager *m, const char *cgroup, Session **session);
 
120
int manager_get_session_by_pid(Manager *m, pid_t pid, Session **session);
 
121
 
 
122
extern const DBusObjectPathVTable bus_manager_vtable;
 
123
 
 
124
DBusHandlerResult bus_message_filter(DBusConnection *c, DBusMessage *message, void *userdata);
 
125
 
 
126
int manager_send_changed(Manager *manager, const char *properties);
 
127
 
 
128
/* gperf lookup function */
 
129
const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned length);
 
130
 
 
131
#endif