~lightdm-team/lightdm/1.2

« back to all changes in this revision

Viewing changes to tests/src/X.c

  • Committer: Robert Ancell
  • Date: 2012-03-20 05:11:28 UTC
  • Revision ID: robert.ancell@canonical.com-20120320051128-3pz5ies6mxx2pdik
Call initgroups before pam_setcred - this allows pam_setcred to change group membership correctly

Show diffs side-by-side

added added

removed removed

Lines of Context:
348
348
    if (g_getenv ("LIGHTDM_TEST_CONFIG"))
349
349
        g_key_file_load_from_file (config, g_getenv ("LIGHTDM_TEST_CONFIG"), G_KEY_FILE_NONE, NULL);
350
350
 
351
 
    return_lock = g_build_filename (g_getenv ("LIGHTDM_TEST_HOME_DIR"), ".xserver-returned", NULL);
352
 
    f = fopen (return_lock, "r");
353
 
    if (f == NULL && g_key_file_has_key (config, "test-xserver-config", "return-value", NULL))
 
351
    if (g_key_file_has_key (config, "test-xserver-config", "return-value", NULL))
354
352
    {
355
353
        int return_value = g_key_file_get_integer (config, "test-xserver-config", "return-value", NULL);
356
354
        status_notify ("XSERVER :%d EXIT CODE=%d", display_number, return_value);
357
 
 
358
 
        /* Write lock to stop repeatedly exiting */
359
 
        f = fopen (return_lock, "w");
360
 
        fclose (f);
361
 
 
362
355
        return return_value;
363
356
    }
364
 
    if (f != NULL)
365
 
        fclose (f);
366
357
 
367
358
    lock_path = g_strdup_printf ("/tmp/.X%d-lock", display_number);
368
359
    lock_file = open (lock_path, O_CREAT | O_EXCL | O_WRONLY, 0444);