~ubuntu-branches/ubuntu/trusty/xdm/trusty

« back to all changes in this revision

Viewing changes to rpcauth.c

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2011-12-09 03:00:26 UTC
  • mfrom: (9.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20111209030026-baa9vul2hhtujjxh
Tags: 1:1.1.11-1ubuntu1
* Merge from Debian testing.  Remaining changes:
  - 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.

* Drop debian/patches/ftbfs_binutils-gold.diff: Fixed upstream
* Change Vcs-* to XS-Debian-Vcs-*
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 
3
 
Copyright 1988, 1998  The Open Group
4
 
 
5
 
Permission to use, copy, modify, distribute, and sell this software and its
6
 
documentation for any purpose is hereby granted without fee, provided that
7
 
the above copyright notice appear in all copies and that both that
8
 
copyright notice and this permission notice appear in supporting
9
 
documentation.
10
 
 
11
 
The above copyright notice and this permission notice shall be included
12
 
in all copies or substantial portions of the Software.
13
 
 
14
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
 
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
 
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
 
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18
 
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19
 
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
 
OTHER DEALINGS IN THE SOFTWARE.
21
 
 
22
 
Except as contained in this notice, the name of The Open Group shall
23
 
not be used in advertising or otherwise to promote the sale, use or
24
 
other dealings in this Software without prior written authorization
25
 
from The Open Group.
26
 
 
27
 
*/
28
 
 
29
 
/*
30
 
 * xdm - display manager daemon
31
 
 * Author:  Keith Packard, MIT X Consortium
32
 
 *
33
 
 * rpcauth
34
 
 *
35
 
 * generate SecureRPC authorization records
36
 
 */
37
 
 
38
 
#include   <X11/Xos.h>
39
 
#include   <rpc/rpc.h>
40
 
#include   <rpc/key_prot.h>
41
 
 
42
 
#include   "dm.h"
43
 
#include   "dm_auth.h"
44
 
#include   "dm_error.h"
45
 
 
46
 
/*ARGSUSED*/
47
 
void
48
 
SecureRPCInitAuth (unsigned short name_len, char *name)
49
 
{
50
 
}
51
 
 
52
 
Xauth *
53
 
SecureRPCGetAuth (
54
 
    unsigned short  namelen,
55
 
    char            *name)
56
 
{
57
 
    char    key[MAXNETNAMELEN+1];
58
 
    Xauth   *new;
59
 
 
60
 
    new = (Xauth *) malloc (sizeof *new);
61
 
    if (!new)
62
 
        return (Xauth *) 0;
63
 
    new->family = FamilyWild;
64
 
    new->address_length = 0;
65
 
    new->address = 0;
66
 
    new->number_length = 0;
67
 
    new->number = 0;
68
 
 
69
 
    getnetname (key);
70
 
    Debug ("System netname %s\n", key);
71
 
    new->data_length = strlen(key);
72
 
    new->data = (char *) malloc (new->data_length);
73
 
    if (!new->data)
74
 
    {
75
 
        free ((char *) new);
76
 
        return (Xauth *) 0;
77
 
    }
78
 
    new->name = (char *) malloc (namelen);
79
 
    if (!new->name)
80
 
    {
81
 
        free ((char *) new->data);
82
 
        free ((char *) new);
83
 
        return (Xauth *) 0;
84
 
    }
85
 
    memmove( new->name, name, namelen);
86
 
    new->name_length = namelen;
87
 
    memmove( new->data, key, new->data_length);
88
 
    return new;
89
 
}