chiark / gitweb /
unit: introduce ConditionFileIsExecutable= and use it where we check for a binary...
[elogind.git] / src / logind-seat.c
index 11b3a65b64354700746515bb653d146834d3df9e..3cf3958c8d47330d13cac925573238713a54ef55 100644 (file)
@@ -117,27 +117,20 @@ int seat_save(Seat *s) {
         if (s->sessions) {
                 Session *i;
 
-                fputs("OTHER=", f);
+                fputs("SESSIONS=", f);
                 LIST_FOREACH(sessions_by_seat, i, s->sessions) {
-                        if (i == s->active)
-                                continue;
-
                         fprintf(f,
                                 "%s%c",
                                 i->id,
                                 i->sessions_by_seat_next ? ' ' : '\n');
                 }
 
-                fputs("OTHER_UIDS=", f);
-                LIST_FOREACH(sessions_by_seat, i, s->sessions) {
-                        if (i == s->active)
-                                continue;
-
+                fputs("UIDS=", f);
+                LIST_FOREACH(sessions_by_seat, i, s->sessions)
                         fprintf(f,
                                 "%lu%c",
                                 (unsigned long) i->user->uid,
                                 i->sessions_by_seat_next ? ' ' : '\n');
-                }
         }
 
         fflush(f);
@@ -453,9 +446,12 @@ int seat_get_idle_hint(Seat *s, dual_timestamp *t) {
         return idle_hint;
 }
 
-int seat_check_gc(Seat *s) {
+int seat_check_gc(Seat *s, bool drop_not_started) {
         assert(s);
 
+        if (drop_not_started && !s->started)
+                return 0;
+
         if (seat_is_vtconsole(s))
                 return 1;
 
@@ -496,5 +492,8 @@ bool seat_name_is_valid(const char *name) {
                 if (!seat_name_valid_char(*p))
                         return false;
 
+        if (strlen(name) > 255)
+                return false;
+
         return true;
 }