Updates for NetBSD port

This commit is contained in:
Michiel Broek 2002-01-11 21:47:22 +00:00
parent caf2629c8d
commit ae3df4d6dc
5 changed files with 4732 additions and 2297 deletions

View File

@ -68,6 +68,12 @@
/* Defined if you have libutil.h */
#undef HAVE_LIBUTIL_H
/* Defined if you have util.h */
#undef HAVE_UTIL_H
/* Defined if you have sys/types.h */
#undef HAVE_SYS_TYPES_H
/* Defined if it includes *Pw functions. */
#undef HAVE_LIBCRACK_PW

6959
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -117,7 +117,9 @@ fi
AC_CHECK_LIB(util,login,result=yes,result=no)
if test "$result" = "yes"; then
LIBS="$LIBS -lutil"
AC_CHECK_HEADERS(util.h)
AC_CHECK_HEADERS(libutil.h)
AC_CHECK_HEADERS(sys/types.h)
fi
dnl Checks for header files.

View File

@ -73,6 +73,7 @@
#include <syslog.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <paths.h>
#include <pwd.h>
@ -268,6 +269,7 @@ void pw_copy(int ffd, int tfd, struct passwd *pw)
goto err;
continue;
}
#ifdef __FreeBSD__
(void)fprintf(to, "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s\n",
pw->pw_name, pw->pw_passwd,
pw->pw_fields & _PWF_UID ? uidstr : "",
@ -276,6 +278,16 @@ void pw_copy(int ffd, int tfd, struct passwd *pw)
pw->pw_fields & _PWF_CHANGE ? chgstr : "",
pw->pw_fields & _PWF_EXPIRE ? expstr : "",
pw->pw_gecos, pw->pw_dir, pw->pw_shell);
#elif __NetBSD__
(void)fprintf(to, "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s\n",
pw->pw_name, pw->pw_passwd,
uidstr, gidstr,
pw->pw_class,
chgstr, expstr,
pw->pw_gecos, pw->pw_dir, pw->pw_shell);
#else
#error "Not FreeBSD or NetBSD - don't know what to do"
#endif
done = 1;
if (ferror(to))
goto err;
@ -289,6 +301,7 @@ void pw_copy(int ffd, int tfd, struct passwd *pw)
pw_error(NULL, 0, 1);
} else
#endif /* YP */
#ifdef __FreeBSD__
(void)fprintf(to, "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s\n",
pw->pw_name, pw->pw_passwd,
pw->pw_fields & _PWF_UID ? uidstr : "",
@ -297,6 +310,16 @@ void pw_copy(int ffd, int tfd, struct passwd *pw)
pw->pw_fields & _PWF_CHANGE ? chgstr : "",
pw->pw_fields & _PWF_EXPIRE ? expstr : "",
pw->pw_gecos, pw->pw_dir, pw->pw_shell);
#elif __NetBSD__
(void)fprintf(to, "%s:%s:%s:%s:%s:%s:%s:%s:%s:%s\n",
pw->pw_name, pw->pw_passwd,
uidstr, gidstr,
pw->pw_class,
chgstr, expstr,
pw->pw_gecos, pw->pw_dir, pw->pw_shell);
#else
#error "Not FreeBSD or NetBSD - don't know what to do"
#endif
}
if (ferror(to))

View File

@ -3,10 +3,10 @@
* $Id$
* Purpose ...............: MBSE BBS Shadow Password Suite
* Original Source .......: Shadow Password Suite
* Original Copyrioght ...: Julianne Frances Haugh and others.
* Original Copyright ....: Julianne Frances Haugh and others.
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2002
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -38,10 +38,15 @@
#include <utmpx.h>
#endif
#if defined(__FreeBSD__) || defined(__NetBSD__)
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_LIBUTIL_H
#include <libutil.h>
#endif
#if HAVE_UTIL_H
#include <util.h>
#endif
#include <fcntl.h>
#include <stdio.h>