~robert-ancell/lightdm/xorg-displayfd

« back to all changes in this revision

Viewing changes to src/x-authority.c

  • Committer: Robert Ancell
  • Date: 2015-08-10 00:13:50 UTC
  • mfrom: (1947.2.216 trunk)
  • Revision ID: robert.ancell@canonical.com-20150810001350-mrigcdovq3xkw68u
Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Copyright (C) 2010-2011 Robert Ancell.
3
3
 * Author: Robert Ancell <robert.ancell@canonical.com>
4
 
 * 
 
4
 *
5
5
 * This program is free software: you can redistribute it and/or modify it under
6
6
 * the terms of the GNU General Public License as published by the Free Software
7
7
 * Foundation, either version 3 of the License, or (at your option) any later
27
27
    /* Address of the X server (format dependent on family) */
28
28
    guint8 *address;
29
29
    gsize address_length;
30
 
  
 
30
 
31
31
    /* Display number of X server */
32
32
    gchar *number;
33
33
 
46
46
{
47
47
    XAuthority *auth = g_object_new (X_AUTHORITY_TYPE, NULL);
48
48
 
49
 
    x_authority_set_family (auth, family);  
 
49
    x_authority_set_family (auth, family);
50
50
    x_authority_set_address (auth, address, address_length);
51
51
    x_authority_set_number (auth, number);
52
52
    x_authority_set_authorization_name (auth, name);
60
60
{
61
61
    guint8 cookie[16];
62
62
    gint i;
63
 
  
 
63
 
64
64
    for (i = 0; i < 16; i++)
65
65
        cookie[i] = g_random_int () & 0xFF;
66
66
 
193
193
 
194
194
    if (data_length - *offset < length)
195
195
        return FALSE;
196
 
  
 
196
 
197
197
    *value = g_malloc0 (length + 1);
198
198
    for (i = 0; i < length; i++)
199
199
        (*value)[i] = data[*offset + i];
360
360
    }
361
361
 
362
362
    return TRUE;
363
 
}    
 
363
}
364
364
 
365
365
static void
366
366
x_authority_init (XAuthority *auth)
381
381
    g_free (self->priv->authorization_name);
382
382
    g_free (self->priv->authorization_data);
383
383
 
384
 
    G_OBJECT_CLASS (x_authority_parent_class)->finalize (object);  
 
384
    G_OBJECT_CLASS (x_authority_parent_class)->finalize (object);
385
385
}
386
386
 
387
387
static void