chiark / gitweb /
login: move seat udev rules to login subdir
[elogind.git] / src / login / logind-session.c
index 63ee75808b546f9ef668b380ebde57907c89d797..5ea7e260a7d3d0bf2fa4a8e3e45d136927d4c1b0 100644 (file)
@@ -185,7 +185,7 @@ int session_save(Session *s) {
                         "SERVICE=%s\n",
                         s->service);
 
-        if (s->seat && seat_is_vtconsole(s->seat))
+        if (s->seat && seat_can_multi_session(s->seat))
                 fprintf(f,
                         "VTNR=%i\n",
                         s->vtnr);
@@ -270,7 +270,7 @@ int session_load(Session *s) {
                         seat_attach_session(o, s);
         }
 
-        if (vtnr && s->seat && seat_is_vtconsole(s->seat)) {
+        if (vtnr && s->seat && seat_can_multi_session(s->seat)) {
                 int v;
 
                 k = safe_atoi(vtnr, &v);
@@ -324,7 +324,6 @@ finish:
 
 int session_activate(Session *s) {
         int r;
-        Session *old_active;
 
         assert(s);
 
@@ -343,10 +342,7 @@ int session_activate(Session *s) {
         if (r < 0)
                 return r;
 
-        old_active = s->seat->active;
-        s->seat->active = s;
-
-        return seat_apply_acls(s->seat, old_active);
+        return seat_set_active(s->seat, s);
 }
 
 static int session_link_x11_socket(Session *s) {
@@ -380,15 +376,13 @@ static int session_link_x11_socket(Session *s) {
                 return -ENOENT;
         }
 
-        t = strappend(s->user->runtime_path, "/X11/display");
+        t = strappend(s->user->runtime_path, "/X11-display");
         if (!t) {
                 log_error("Out of memory");
                 free(f);
                 return -ENOMEM;
         }
 
-        mkdir_parents(t, 0755);
-
         if (link(f, t) < 0) {
                 if (errno == EEXIST) {
                         unlink(t);
@@ -440,7 +434,7 @@ static int session_create_one_group(Session *s, const char *controller, const ch
         if (r < 0)
                 return r;
 
-        r = cg_set_task_access(controller, path, 0644, s->user->uid, s->user->gid);
+        r = cg_set_task_access(controller, path, 0644, s->user->uid, s->user->gid, -1);
         if (r >= 0)
                 r = cg_set_group_access(controller, path, 0755, s->user->uid, s->user->gid);
 
@@ -641,7 +635,7 @@ static int session_unlink_x11_socket(Session *s) {
 
         s->user->display = NULL;
 
-        t = strappend(s->user->runtime_path, "/X11/display");
+        t = strappend(s->user->runtime_path, "/X11-display");
         if (!t) {
                 log_error("Out of memory");
                 return -ENOMEM;