summaryrefslogtreecommitdiff
path: root/tests/src
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2013-06-26 14:36:43 +1200
committerRobert Ancell <robert.ancell@canonical.com>2013-06-26 14:36:43 +1200
commit1666050c96987b674a66a9ea4bdfc704532879c5 (patch)
tree3d91f90466bf4c3585fafadfd6ead18b069b60d0 /tests/src
parent66321294e7dfd5907b757dfdd41e9c91afa4f72c (diff)
parent24be578f0b29a85ec522511baf8829c8e741e7a7 (diff)
downloadlightdm-git-1666050c96987b674a66a9ea4bdfc704532879c5.tar.gz
Merge with trunk
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/X.c16
-rw-r--r--tests/src/libsystem.c14
2 files changed, 22 insertions, 8 deletions
diff --git a/tests/src/X.c b/tests/src/X.c
index 1240f7b0..66574238 100644
--- a/tests/src/X.c
+++ b/tests/src/X.c
@@ -27,6 +27,9 @@ static gchar *auth_path = NULL;
/* Display number being served */
static int display_number = 0;
+/* VT being run on */
+static int vt_number = -1;
+
/* X server */
static XServer *xserver = NULL;
@@ -198,6 +201,7 @@ main (int argc, char **argv)
gchar *mir_id = NULL;
gchar *lock_filename;
int lock_file;
+ GString *status_text;
signal (SIGINT, signal_cb);
signal (SIGTERM, signal_cb);
@@ -258,7 +262,7 @@ main (int argc, char **argv)
}
else if (g_str_has_prefix (arg, "vt"))
{
- /* Ignore VT args */
+ vt_number = atoi (arg + 2);
}
else if (strcmp (arg, "-novtswitch") == 0)
{
@@ -297,10 +301,14 @@ main (int argc, char **argv)
g_signal_connect (xserver, "client-connected", G_CALLBACK (client_connected_cb), NULL);
g_signal_connect (xserver, "client-disconnected", G_CALLBACK (client_disconnected_cb), NULL);
+ status_text = g_string_new ("");
+ g_string_printf (status_text, "XSERVER-%d START", display_number);
+ if (vt_number >= 0)
+ g_string_append_printf (status_text, " VT=%d", vt_number);
if (mir_id != NULL)
- status_notify ("XSERVER-%d START MIR-ID=%s", display_number, mir_id);
- else
- status_notify ("XSERVER-%d START", display_number);
+ g_string_append_printf (status_text, " MIR-ID=%s", mir_id);
+ status_notify (status_text->str);
+ g_string_free (status_text, TRUE);
config = g_key_file_new ();
g_key_file_load_from_file (config, g_build_filename (g_getenv ("LIGHTDM_TEST_ROOT"), "script", NULL), G_KEY_FILE_NONE, NULL);
diff --git a/tests/src/libsystem.c b/tests/src/libsystem.c
index ff90bac9..a30ff89f 100644
--- a/tests/src/libsystem.c
+++ b/tests/src/libsystem.c
@@ -957,9 +957,9 @@ static const char *
get_env_value (const char *name_value, const char *name)
{
int j;
-
- for (j = 0; name[j] && name[j] != '=' && name[j] == name_value[j]; j++);
- if (name_value[j] == '=')
+
+ for (j = 0; name[j] && name_value[j] && name[j] == name_value[j]; j++);
+ if (name[j] == '\0' && name_value[j] == '=')
return &name_value[j + 1];
return NULL;
@@ -969,15 +969,21 @@ int
pam_putenv (pam_handle_t *pamh, const char *name_value)
{
int i;
+ gchar *name;
if (pamh == NULL || name_value == NULL)
return PAM_SYSTEM_ERR;
+ name = strdup (name_value);
+ for (i = 0; name[i]; i++)
+ if (name[i] == '=')
+ name[i] = '\0';
for (i = 0; pamh->envlist[i]; i++)
{
- if (get_env_value (pamh->envlist[i], name_value))
+ if (get_env_value (pamh->envlist[i], name))
break;
}
+ free (name);
if (pamh->envlist[i])
{