mkcookie.c revision 1233
* mkcookie.c 1.x
* $XConsortium: auth.c,v 1.17 89/12/14 09:42:18 rws Exp $
#include <stdio.h>
#ifdef SYSV
#ifndef bcopy
#ifndef bzero
#ifndef bcmp
#ifndef index
#ifndef rindex
#include <stdlib.h>
#define Foreign 0
typedef struct displayType {
} DisplayType;
struct display {
int peerlen;
struct verify_info {
struct AuthProtocol {
int name_length;
const char *name;
void (*InitAuth)(unsigned short, const char *);
int (*GetXdmcpAuth)();
int inited;
struct addrList {
unsigned short family;
unsigned short address_length;
char *address;
unsigned short number_length;
char *number;
static int auth_name_len;
char *result;
if (!result) {
return result;
setEnv (char **e,
const char *name,
const char *value)
char *newe;
int envsize;
if (!newe) {
if (*old) {
envsize = 0;
if (!new) {
return new;
while (len-- > 0)
#ifdef DEBUG
for (i = 0; i < len; i++)
struct addrList *a;
if (!new) {
char *name)
int fd;
#ifdef TCPCONN
#ifdef IPv6
int family,
int addr_length,
char *addr,
int cmd,
char *arg)
int ret;
return(ret);
int fd,
int len;
char *addr;
int family;
#ifdef SIOCGLIFCONF
#ifdef SIOCGLIFNUM
#ifdef SIOCGLIFCONF
--n >= 0; ifr++)
&addr);
ifr++)
if (family <= 0)
#ifdef IPv6
/* stolen from xinit.c */
#ifdef hpux
int *len,
char **addr)
if (len == 0)
case AF_UNSPEC:
#ifndef hpux
case AF_UNIX:
#ifdef TCPCONN
case AF_INET:
return (AF_INET);
#ifdef IPv6
case AF_INET6:
return (AF_INET6);
case AF_DECnet:
return (AF_DECnet);
char *name)
char *colon;
if (colon) {
++colon;
if (number) {
int mask;
if (!*newp) {
doneAddrs (void)
struct addrList *a, *n;
for (a = addrs; a; a = n) {
n = a->next;
if (a->address)
if (a->number)
free ((char *) a);
InitAuth (
unsigned short name_len,
const char *name)
static Xauth *
GetAuth (
int namelen,
const char *name)
if (!new)
return (Xauth *) 0;
return (Xauth *) 0;
return (Xauth *) 0;
return new;
char *auth,
int len)
int seed;
int value;
int fd;
auth[i] = (
char *authFile,
int mask;
int ret;
if (!auth_file) {
return ret;
static struct AuthProtocol *
int name_length,
const char *name)
for (i = 0; i < NUM_AUTHORIZATION; i++)
return &AuthProtocols[i];
return (struct AuthProtocol *) 0;
static Xauth *
const char *name,
int name_length)
struct AuthProtocol *a;
if (!a->inited)
return auth;
struct display *d)
if (d->authorization)
if (!auth)
struct display *d,
char *name;
char *home;
char *envname = 0;
int lockStatus;
int setenv;
if (home) {
setenv = 0;
addrs = 0;
if (old) {
doneAddrs ();
if (setenv) {
if (envname)
struct display d;
char *au_name;
d.authFile);
if (au_name) {
d.peer = 0;
d.peerlen = 0;
exit(0);