mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-27 07:44:29 +02:00
Made utmpx optional
This commit is contained in:
parent
fdb7caf293
commit
368cf64d5c
11
acconfig.h
11
acconfig.h
@ -27,6 +27,9 @@
|
|||||||
/* Define is utmpx.h has a ut_host field */
|
/* Define is utmpx.h has a ut_host field */
|
||||||
#undef HAVE_HOST_IN_UTMPX
|
#undef HAVE_HOST_IN_UTMPX
|
||||||
|
|
||||||
|
/* Define if you want to use utmpx */
|
||||||
|
#undef USE_UTMPX
|
||||||
|
|
||||||
/* Define is libutil has login() function */
|
/* Define is libutil has login() function */
|
||||||
#undef HAVE_LIBUTIL_LOGIN
|
#undef HAVE_LIBUTIL_LOGIN
|
||||||
|
|
||||||
@ -91,7 +94,7 @@
|
|||||||
# include <utmp.h> /* For _PATH_XXX */
|
# include <utmp.h> /* For _PATH_XXX */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_UTMPX_H
|
#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
|
||||||
# include <utmpx.h> /* For _PATH_XXX */
|
# include <utmpx.h> /* For _PATH_XXX */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -183,7 +186,7 @@ enum
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Use utmpx if supported */
|
/* Use utmpx if supported */
|
||||||
#ifdef HAVE_UTMPX_H
|
#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
|
||||||
# define UTMP_STR utmpx
|
# define UTMP_STR utmpx
|
||||||
#else
|
#else
|
||||||
# ifdef HAVE_UTMP_H
|
# ifdef HAVE_UTMP_H
|
||||||
@ -192,7 +195,7 @@ enum
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _PATH_UTMP
|
#ifndef _PATH_UTMP
|
||||||
# ifdef UTMPX_FILE
|
# if defined(UTMPX_FILE) && defined(USE_UTMPX)
|
||||||
# define _PATH_UTMP UTMPX_FILE
|
# define _PATH_UTMP UTMPX_FILE
|
||||||
# else
|
# else
|
||||||
# ifdef UTMP_FILE
|
# ifdef UTMP_FILE
|
||||||
@ -204,7 +207,7 @@ enum
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _PATH_WTMP
|
#ifndef _PATH_WTMP
|
||||||
# ifdef WTMPX_FILE
|
# if defined(WTMPX_FILE) && defined(USE_UTMPX)
|
||||||
# define _PATH_WTMP WTMPX_FILE
|
# define _PATH_WTMP WTMPX_FILE
|
||||||
# else
|
# else
|
||||||
# ifdef WTMP_FILE
|
# ifdef WTMP_FILE
|
||||||
|
@ -45,7 +45,7 @@ static char *rcsid = "$OpenBSD: login.c,v 1.5 1998/07/13 02:11:12 millert Exp $"
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef HAVE_UTMPX_H
|
#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
|
||||||
# include <utmpx.h>
|
# include <utmpx.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_UTMP_H
|
#ifdef HAVE_UTMP_H
|
||||||
@ -64,7 +64,7 @@ login(utp)
|
|||||||
|
|
||||||
#ifndef UT_LINESIZE
|
#ifndef UT_LINESIZE
|
||||||
# define UT_LINESIZE (sizeof(old_ut.ut_line))
|
# define UT_LINESIZE (sizeof(old_ut.ut_line))
|
||||||
# ifdef HAVE_UTMPX_H
|
# if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
|
||||||
# define UT_NAMESIZE (sizeof(old_ut.ut_user))
|
# define UT_NAMESIZE (sizeof(old_ut.ut_user))
|
||||||
# else
|
# else
|
||||||
# define UT_NAMESIZE (sizeof(old_ut.ut_name))
|
# define UT_NAMESIZE (sizeof(old_ut.ut_name))
|
||||||
@ -72,7 +72,7 @@ login(utp)
|
|||||||
# ifdef HAVE_HOST_IN_UTMP
|
# ifdef HAVE_HOST_IN_UTMP
|
||||||
# define UT_HOSTSIZE (sizeof(old_ut.ut_host))
|
# define UT_HOSTSIZE (sizeof(old_ut.ut_host))
|
||||||
# endif
|
# endif
|
||||||
# ifdef HAVE_HOST_IN_UTMPX
|
# if defined(HAVE_HOST_IN_UTMPX) && defined(USE_UTMPX)
|
||||||
# define UT_HOSTSIZE (sizeof(old_ut.ut_host))
|
# define UT_HOSTSIZE (sizeof(old_ut.ut_host))
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -290,6 +290,12 @@ AC_ARG_WITH(md5-passwords,
|
|||||||
[AC_DEFINE(HAVE_MD5_PASSWORDS)]
|
[AC_DEFINE(HAVE_MD5_PASSWORDS)]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
dnl Check whether to enable utmpx support
|
||||||
|
AC_ARG_WITH(utmpx,
|
||||||
|
[ --with-utmpx Enable utmpx support],
|
||||||
|
[AC_DEFINE(USE_UTMPX)]
|
||||||
|
)
|
||||||
|
|
||||||
dnl Check for the path to xauth
|
dnl Check for the path to xauth
|
||||||
AC_PATH_PROG(xauth_path, xauth)
|
AC_PATH_PROG(xauth_path, xauth)
|
||||||
AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
|
AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
|
||||||
|
6
login.c
6
login.c
@ -18,9 +18,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$Id: login.c,v 1.6 1999/12/08 23:16:55 damien Exp $");
|
RCSID("$Id: login.c,v 1.7 1999/12/20 22:51:36 damien Exp $");
|
||||||
|
|
||||||
#ifdef HAVE_UTMPX_H
|
#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
|
||||||
# include <utmpx.h>
|
# include <utmpx.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_UTMP_H
|
#ifdef HAVE_UTMP_H
|
||||||
@ -94,7 +94,7 @@ record_login(int pid, const char *ttyname, const char *user, uid_t uid,
|
|||||||
/* Construct an utmp/wtmp entry. */
|
/* Construct an utmp/wtmp entry. */
|
||||||
memset(&u, 0, sizeof(u));
|
memset(&u, 0, sizeof(u));
|
||||||
strncpy(u.ut_line, ttyname + 5, sizeof(u.ut_line));
|
strncpy(u.ut_line, ttyname + 5, sizeof(u.ut_line));
|
||||||
#ifdef HAVE_UTMPX_H
|
#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
|
||||||
u.ut_tv.tv_sec = time(NULL);
|
u.ut_tv.tv_sec = time(NULL);
|
||||||
strncpy(u.ut_user, user, sizeof(u.ut_name));
|
strncpy(u.ut_user, user, sizeof(u.ut_name));
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user