summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Koegel <eric.koegel@gmail.com>2016-02-29 19:54:54 +0300
committerEric Koegel <eric.koegel@gmail.com>2016-03-19 18:15:31 +0300
commitc067d48fbb3394507d3b0629a8f348986aabba03 (patch)
tree3d6f2c734d2d0d58ecc7fd87f18cf6832e04fac5
parent416aa734c28555da90109ada78e11f24d8da599b (diff)
downloadConsoleKit2-c067d48fbb3394507d3b0629a8f348986aabba03.tar.gz
Handle the legacy 'user' property as an override setting
A DM can set the 'user' property rather than the 'unix-user' as an override to force a specific uid during session startup. We just need to convert that back to a 'unix-user' in the session leader before handing that data back to the manager.
-rw-r--r--src/ck-session-leader.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ck-session-leader.c b/src/ck-session-leader.c
index 2b392b6..b3c0f4e 100644
--- a/src/ck-session-leader.c
+++ b/src/ck-session-leader.c
@@ -52,6 +52,7 @@ static struct {
{ "session-type", "s", G_TYPE_STRING },
{ "is-local", "b", G_TYPE_BOOLEAN },
{ "unix-user", "i", G_TYPE_INT },
+ { "user", "i", G_TYPE_INT },
};
struct CkSessionLeaderPrivate
@@ -295,6 +296,12 @@ save_parameters (CkSessionLeader *leader,
continue;
}
+ /* Convert legacy user property to unix-user */
+ if (g_strcmp0 (prop_name, "user") == 0) {
+ g_free (prop_name);
+ prop_name = g_strdup ("unix-user");
+ }
+
g_debug ("Setting override parameters for: %s", prop_name);
/* takes ownership */