Skip to content

Commit

Permalink
Merge branch 'master' of git://anongit.freedesktop.org/git/xorg/app/xdm
Browse files Browse the repository at this point in the history
  • Loading branch information
bbidulock committed Jan 13, 2016
2 parents 95c0c29 + 994d32a commit 27616d0
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 353 deletions.
37 changes: 0 additions & 37 deletions chooser/chooser.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,28 +406,6 @@ DisposeHostname (HostName *host)
free (host);
}

#if 0
static void
RemoveHostname (HostName *host)
{
HostName **prev, *hosts;

prev = &hostNamedb;
for (hosts = hostNamedb; hosts; hosts = hosts->next)
{
if (hosts == host)
break;
prev = &hosts->next;
}
if (!hosts)
return;
*prev = host->next;
DisposeHostname (host);
NameTableSize--;
RebuildTable (NameTableSize);
}
#endif

static void
EmptyHostnames (void)
{
Expand Down Expand Up @@ -678,21 +656,6 @@ RegisterHostname (char *name)

static ARRAYofARRAY8 AuthenticationNames;

#if 0
static void
RegisterAuthenticationName (char *name, int namelen)
{
ARRAY8Ptr authName;
if (!XdmcpReallocARRAYofARRAY8 (&AuthenticationNames,
AuthenticationNames.length + 1))
return;
authName = &AuthenticationNames.data[AuthenticationNames.length-1];
if (!XdmcpAllocARRAY8 (authName, namelen))
return;
memmove( authName->data, name, namelen);
}
#endif

static int
InitXDMCP (char **argv)
{
Expand Down
97 changes: 1 addition & 96 deletions greeter/verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ from The Open Group.
# include <login_cap.h>
# include <stdarg.h>
# include <bsd_auth.h>
#elif defined(USESECUREWARE)
# include <sys/types.h>
# include <prot.h>
#endif

#include "greet.h"
Expand Down Expand Up @@ -226,99 +223,7 @@ Verify (struct display *d, struct greet_info *greet, struct verify_info *verify)
break;
}
}
#elif defined(USESECUREWARE) /* !USE_BSDAUTH */
/*
* This is a global variable and will be referenced in at least session.c
*/
struct smp_user_info *userp = 0;

_X_INTERNAL
int
Verify (struct display *d, struct greet_info *greet, struct verify_info *verify)
{
int ret, pwtries = 0, nis, delay;
char *reason = 0;
struct passwd *p;
char *shell, *home, **argv;

Debug ("Verify %s ...\n", greet->name);

p = getpwnam (greet->name);
endpwent();

if (!p || strlen (greet->name) == 0) {
LogError ("getpwnam() failed.\n");
bzero(greet->password, strlen(greet->password));
return 0;
}

ret = smp_check_user (SMP_LOGIN, greet->name, 0, 0, &userp, &pwtries,
&reason, &nis, &delay);
if (ret != SMP_RETIRED && userp->retired)
ret = userp->result = SMP_RETIRED;
Debug ("smp_check_user returns %d\n", ret);

switch (ret) {
case SMP_FAIL:
Debug ("Out of memory in smp_check_user\n");
goto smp_fail;
case SMP_EXTFAIL:
Debug ("SMP_EXTFAIL: %s", reason);
goto smp_fail;
case SMP_NOTAUTH:
Debug ("Not authorized\n");
goto smp_fail;
case SMP_TERMLOCK:
Debug ("Terminal is locked!\n");
goto smp_fail;
case SMP_ACCTLOCK:
Debug ("Account is locked\n");
goto smp_fail;
case SMP_RETIRED:
Debug ("Account is retired\n");
goto smp_fail;
case SMP_OVERRIDE:
Debug ("On override device ... proceeding\n");
break;
case SMP_NULLPW:
Debug ("NULL password entry\n");
if (!greet->allow_null_passwd) {
goto smp_fail;
}
break;
case SMP_BADUSER:
Debug ("User not found in protected password database\n");
goto smp_fail;
case SMP_PWREQ:
Debug ("Password change required\n");
goto smp_fail;
case SMP_HASPW:
break;
default:
Debug ("Unhandled smp_check_user return %d\n", ret);
smp_fail:
sleep(delay);
smp_audit_fail (userp, 0);
bzero(greet->password, strlen(greet->password));
return 0;
break;
}

if (ret != SMP_NULLPW) {
/*
* If we require a password, check it.
*/
ret = smp_check_pw (greet->password, userp, &reason);
switch (ret) {
case SMP_CANCHANGE:
case SMP_CANTCHANGE:
case SMP_OVERRIDE:
break;
default:
goto smp_fail;
}
}
#else /* !USE_BSDAUTH && !USESECUREWARE */
#else /* !USE_BSDAUTH */
_X_INTERNAL
int
Verify (struct display *d, struct greet_info *greet, struct verify_info *verify)
Expand Down
8 changes: 2 additions & 6 deletions include/dm.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ from The Open Group.
# include <sys/wait.h>
# else
# define _POSIX_SOURCE
# ifdef __SCO__
# include <sys/procset.h>
# include <sys/siginfo.h>
# endif
# include <sys/wait.h>
# undef _POSIX_SOURCE
# endif
Expand Down Expand Up @@ -508,8 +504,8 @@ extern void ProcessRequestSocket(int fd);

# include <stdlib.h>

# if defined(X_NOT_POSIX) || defined(__UNIXOS2__) || defined(__NetBSD__) && defined(__sparc__)
# if defined(SYSV) || defined(__UNIXOS2__)
# if defined(X_NOT_POSIX) || defined(__NetBSD__) && defined(__sparc__)
# if defined(SYSV)
# define SIGNALS_RESET_WHEN_CAUGHT
# define UNRELIABLE_SIGNALS
# endif
Expand Down
16 changes: 1 addition & 15 deletions xdm/choose.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ in this Software without prior written authorization from The Open Group.

# include "dm_socket.h"
# include <arpa/inet.h>

# ifndef X_NO_SYS_UN
# include <sys/un.h>
# endif
# include <sys/un.h>

# include <ctype.h>
# include <errno.h>
Expand Down Expand Up @@ -300,25 +297,14 @@ RegisterIndirectChoice (
{
ChoicePtr c;
int insert;
# if 0
int found = 0;
# endif

Debug ("Got indirect choice back\n");
for (c = choices; c; c = c->next) {
if (XdmcpARRAY8Equal (clientAddress, &c->client) &&
connectionType == c->connectionType) {
# if 0
found = 1;
# endif
break;
}
}
# if 0
if (!found)
return 0;
# endif

insert = 0;
if (!c)
{
Expand Down
32 changes: 0 additions & 32 deletions xdm/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ from The Open Group.
#ifdef __NetBSD__
# include <sys/param.h>
#endif
#ifdef USESECUREWARE
# include <prot.h>
#endif

#ifndef sigmask
# define sigmask(m) (1 << ((m - 1)))
Expand Down Expand Up @@ -151,10 +148,6 @@ main (int argc, char **argv)
}
#endif

#ifdef USESECUREWARE
set_auth_parameters (argc, argv);
#endif

/*
* Step 1 - load configuration parameters
*/
Expand Down Expand Up @@ -1093,31 +1086,6 @@ RemovePid (void)
_SysErrorMsg (errno));
}

#if 0
void
UnlockPidFile (void)
{
if (lockPidFile)
# ifdef F_SETLK
{
struct flock lock_data;
lock_data.l_type = F_UNLCK;
lock_data.l_whence = SEEK_SET;
lock_data.l_start = lock_data.l_len = 0;
(void) fcntl(pidFd, F_SETLK, &lock_data);
}
# else
# ifdef F_ULOCK
lockf (pidFd, F_ULOCK, 0);
# else
flock (pidFd, LOCK_UN);
# endif
# endif
close (pidFd);
fclose (pidFilePtr);
}
#endif

#ifndef HAVE_SETPROCTITLE
void SetTitle (char *name, ...)
{
Expand Down
9 changes: 7 additions & 2 deletions xdm/genauth.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,20 @@ GenerateAuthData (char *auth, int len)
static int xdmcpAuthInited;
long ldata[2];

# ifdef ITIMER_REAL
# ifndef HAVE_ARC4RANDOM
# ifdef ITIMER_REAL
struct timeval now;

X_GETTIMEOFDAY (&now);
ldata[0] = now.tv_usec;
ldata[1] = now.tv_sec;
# else
# else
ldata[0] = time ((long *) 0);
ldata[1] = getpid ();
# endif
# else
ldata[0] = arc4random();
ldata[1] = arc4random();
# endif

longtochars (ldata[0], data+0);
Expand Down
4 changes: 1 addition & 3 deletions xdm/netaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ from The Open Group.
# endif

# ifdef UNIXCONN
# ifndef X_NO_SYS_UN
# include <sys/un.h> /* struct sockaddr_un */
# endif
# include <sys/un.h> /* struct sockaddr_un */
# endif

/* given an XdmcpNetaddr, returns the socket protocol family used,
Expand Down
4 changes: 1 addition & 3 deletions xdm/prngc.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <X11/Xos.h>
#ifndef X_NO_SYS_UN
# include <sys/un.h>
#endif
#include <sys/un.h>
#include <netinet/in.h>
#include <errno.h>
#include <signal.h>
Expand Down
8 changes: 2 additions & 6 deletions xdm/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,8 @@ int choiceTimeout; /* chooser choice timeout */
#ifndef DEF_RANDOM_FILE
# define DEF_RANDOM_FILE "/dev/mem"
#endif
#ifdef __SCO__
# define DEF_PRNGD_SOCKET "/etc/egd-pool"
#else
# ifndef DEF_PRNGD_SOCKET
# define DEF_PRNGD_SOCKET "/tmp/entropy"
# endif
#ifndef DEF_PRNGD_SOCKET
# define DEF_PRNGD_SOCKET "/tmp/entropy"
#endif
#ifndef DEF_PRNGD_PORT
# define DEF_PRNGD_PORT "0"
Expand Down
Loading

0 comments on commit 27616d0

Please sign in to comment.