~ubuntu-branches/ubuntu/precise/xdm/precise

« back to all changes in this revision

Viewing changes to server.c

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2011-01-30 00:53:09 UTC
  • mfrom: (9.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110130005309-30mjjyk7div7d494
Tags: 1:1.1.10-3ubuntu1
* Merge from debian unstable.  Remaining changes: (LP: #682196)
  - debian/{rules, xdm.install, local/ubuntu*}:
    + Add Ubuntu graphics and configure xdm to use them by default.
  - debian/patches/ubuntu_no_whiteglass.diff: Don't hardcode
    the default Xcursor theme to whiteglass. Use the Ubuntu
    default x-cursor-theme instead.
* debian/patches/ftbfs_binutils-gold.diff: Fix FTBFS with binutils-gold
  and ld --as-needed. (Closes: #556694)
* Dropped changes, no longer applicable:
  - debian/{xdm.postinst.in, xdm.postrm.in, xdm.preinst.in}

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $XdotOrg: $ */
2
 
/* $Xorg: server.c,v 1.5 2001/02/09 02:05:40 xorgcvs Exp $ */
3
1
/*
4
2
 
5
3
Copyright 1988, 1998  The Open Group
27
25
from The Open Group.
28
26
 
29
27
*/
30
 
/* $XFree86: xc/programs/xdm/server.c,v 3.13 2001/12/14 20:01:23 dawes Exp $ */
31
28
 
32
29
/*
33
30
 * xdm - display manager daemon
36
33
 * server.c - manage the X server
37
34
 */
38
35
 
39
 
# include       "dm.h"
40
 
# include       "dm_error.h"
41
 
# include       "dm_socket.h"
 
36
#include        "dm.h"
 
37
#include        "dm_error.h"
 
38
#include        "dm_socket.h"
42
39
 
43
 
# include       <X11/Xlib.h>
44
 
# include       <X11/Xos.h>
45
 
# include       <stdio.h>
46
 
# include       <signal.h>
47
 
# include       <errno.h>
48
 
# include       <sys/socket.h>
 
40
#include        <X11/Xlib.h>
 
41
#include        <X11/Xos.h>
 
42
#include        <stdio.h>
 
43
#include        <signal.h>
 
44
#include        <errno.h>
 
45
#include        <sys/socket.h>
49
46
 
50
47
static int receivedUsr1;
51
48
 
91
88
        DestroyWellKnownSockets();
92
89
#endif
93
90
        if (d->authFile) {
94
 
            sprintf (arg, "-auth %s", d->authFile);
 
91
            snprintf (arg, sizeof(arg), "-auth %s", d->authFile);
95
92
            argv = parseArgs (argv, arg);
96
93
        }
97
94
        if (!argv) {
242
239
 
243
240
#ifdef XDMCP
244
241
 
245
 
#ifdef STREAMSCONN
246
 
#include <tiuser.h>
247
 
#endif
 
242
# ifdef STREAMSCONN
 
243
#  include <tiuser.h>
 
244
# endif
248
245
 
249
246
static void
250
247
GetRemoteAddress (struct display *d, int fd)
251
248
{
252
249
    char    buf[512];
253
250
    int     len = sizeof (buf);
254
 
#ifdef STREAMSCONN
 
251
# ifdef STREAMSCONN
255
252
    struct netbuf       netb;
256
 
#endif
 
253
# endif
257
254
 
258
255
    if (d->peer)
259
256
        free ((char *) d->peer);
260
 
#ifdef STREAMSCONN
 
257
# ifdef STREAMSCONN
261
258
    netb.maxlen = sizeof(buf);
262
259
    netb.buf = buf;
263
260
    t_getname(fd, &netb, REMOTENAME);
264
261
    len = 8;
265
262
    /* lucky for us, t_getname returns something that looks like a sockaddr */
266
 
#else
 
263
# else
267
264
    getpeername (fd, (struct sockaddr *) buf, (void *)&len);
268
 
#endif
 
265
# endif
269
266
    d->peerlen = 0;
270
267
    if (len)
271
268
    {
381
378
    SIGVAL  (*oldSig)(int);
382
379
    int     oldAlarm;
383
380
    static Display *aDpy;
384
 
    
 
381
 
385
382
    aDpy = (alternateDpy != NULL ? alternateDpy : d->dpy);
386
383
    oldError = XSetIOErrorHandler (PingLostIOErr);
387
384
    oldAlarm = alarm (0);