~noskcaj/ubuntu/vivid/gdm/3.14.1

« back to all changes in this revision

Viewing changes to daemon/gdm-display-access-file.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha, Tim Lunn, Jeremy Bicha, Robert Ancell
  • Date: 2013-05-31 22:36:08 UTC
  • mfrom: (1.4.55)
  • Revision ID: package-import@ubuntu.com-20130531223608-33uo85niksee5460
Tags: 3.8.1.1-0ubuntu1
[ Tim Lunn ]
* New upstream release
* debian/patches/ubuntu_dont_catch_sigsegv.patch:
  - Dropped, obsolete
* debian/rules:
  - Don't rename gdm binary since that's already been
    done in the new version

[ Jeremy Bicha ]
* debian/control.in: Bump minimum glib
* debian/watch: Watch for unstable releases
* debian/patches/00git_logind_check.patch:
  - Dropped, applied in new release
* debian/patches/08_frequent-users_greeter.patch: Refreshed

[ Robert Ancell ]
* New upstream release
* debian/patches/ubuntu_daemon_autologin_tracking.patch:
* debian/patches/ubuntu_ensure_dirs.patch:
* debian/patches/ubuntu_slave-only-set-up-autologin.patch:
  - Applied upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
438
438
        gdm_display_is_local (display, &is_local, NULL);
439
439
 
440
440
        if (is_local) {
 
441
                /* We could just use FamilyWild here except xauth
 
442
                 * (and by extension su and ssh) doesn't support it yet
 
443
                 *
 
444
                 * https://bugs.freedesktop.org/show_bug.cgi?id=43425
 
445
                 */
441
446
                char localhost[HOST_NAME_MAX + 1] = "";
442
447
                *family = FamilyLocal;
443
448
                if (gethostname (localhost, HOST_NAME_MAX) == 0) {
538
543
                display_added = TRUE;
539
544
        }
540
545
 
 
546
        /* If we wrote a FamilyLocal entry, we still want a FamilyWild
 
547
         * entry, because it's more resiliant against hostname changes
 
548
         *
 
549
         */
 
550
        if (auth_entry.family == FamilyLocal) {
 
551
                auth_entry.family = FamilyWild;
 
552
 
 
553
                if (XauWriteAuth (file->priv->fp, &auth_entry)
 
554
                    && fflush (file->priv->fp) != EOF) {
 
555
                        display_added = TRUE;
 
556
                }
 
557
        }
541
558
 
542
559
        g_free (auth_entry.address);
543
560
        g_free (auth_entry.number);
560
577
        unsigned short  name_length;
561
578
        char           *name;
562
579
 
 
580
        gboolean        result = FALSE;
563
581
 
564
582
        g_return_val_if_fail (file != NULL, FALSE);
565
583
        g_return_val_if_fail (file->priv->path != NULL, FALSE);
584
602
        g_free (number);
585
603
        g_free (name);
586
604
 
587
 
        if (auth_entry == NULL) {
 
605
        if (auth_entry != NULL) {
 
606
                XauDisposeAuth (auth_entry);
 
607
                result = TRUE;
 
608
        }
 
609
 
 
610
        /* If FamilyLocal, we also added a FamilyWild entry,
 
611
         * so we need to clean that up too
 
612
         */
 
613
        if (family == FamilyLocal) {
 
614
                auth_entry = XauGetAuthByAddr (FamilyWild,
 
615
                                               address_length,
 
616
                                               address,
 
617
                                               number_length,
 
618
                                               number,
 
619
                                               name_length,
 
620
                                               name);
 
621
 
 
622
                if (auth_entry != NULL) {
 
623
                        XauDisposeAuth (auth_entry);
 
624
                        result = TRUE;
 
625
                }
 
626
        }
 
627
 
 
628
 
 
629
        if (result == FALSE) {
588
630
                g_set_error (error,
589
631
                             GDM_DISPLAY_ACCESS_FILE_ERROR,
590
632
                             GDM_DISPLAY_ACCESS_FILE_ERROR_FINDING_AUTH_ENTRY,
591
633
                             "could not find authorization entry");
592
 
                return FALSE;
593
 
        }
594
 
 
595
 
        XauDisposeAuth (auth_entry);
596
 
 
597
 
        if (fflush (file->priv->fp) == EOF) {
 
634
        } else if (fflush (file->priv->fp) == EOF) {
598
635
                g_set_error (error,
599
636
                             G_FILE_ERROR,
600
637
                             g_file_error_from_errno (errno),
601
638
                             "%s", g_strerror (errno));
602
 
                return FALSE;
 
639
                result = FALSE;
603
640
        }
604
641
 
605
 
        return TRUE;
 
642
        return result;
606
643
}
607
644
 
608
645
void