Small updates for NetBSD port

This commit is contained in:
Michiel Broek
2002-01-11 19:01:00 +00:00
parent da6dd3b898
commit 5e52163ff7
19 changed files with 60 additions and 47 deletions

View File

@@ -117,7 +117,7 @@ static int force; /* Force update of locked passwords */
#ifndef __FreeBSD__
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
static void fail_exit(int status)
{
// gr_unlock();
@@ -239,7 +239,7 @@ void pwd_init(void)
umask(077);
}
#endif /* not FreeBSD */
#endif /* not FreeBSD && NetBSD */
/*
@@ -531,7 +531,7 @@ static int new_password(const struct passwd *pw, char *newpasswd)
}
#ifndef __FreeBSD__
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
static void update_noshadow(int shadow_locked)
{
@@ -655,7 +655,7 @@ static void update_noshadow(int shadow_locked)
pw_unlock();
}
#endif /* Not __FreeBSD__ */
#endif /* Not __FreeBSD__ && __NetBSD__ */
#ifdef SHADOW_PASSWORD
@@ -719,7 +719,7 @@ static void update_shadow(void)
*/
int main(int argc, char *argv[])
{
#ifndef __FreeBSD__
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
const struct passwd *pw;
const struct group *gr;
#ifdef SHADOW_PASSWORD
@@ -858,7 +858,7 @@ int main(int argc, char *argv[])
* to root to protect against unexpected signals. Any
* keyboard signals are set to be ignored.
*/
#ifndef __FreeBSD__
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
pwd_init();
#else
pw_init();
@@ -871,7 +871,7 @@ int main(int argc, char *argv[])
exit(E_FAILURE);
}
#ifndef __FreeBSD__
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
#ifdef HAVE_USERSEC_H
update_userpw(pw->pw_passwd);
@@ -885,7 +885,7 @@ int main(int argc, char *argv[])
update_noshadow(0);
#endif /* !HAVE_USERSEC_H */
#else /* __FreeBSD__ */
#else /* __FreeBSD__ && __NetBSD__ */
/*
* FreeBSD password change, borrowed from the original FreeBSD sources
*/

View File

@@ -30,7 +30,7 @@ char *crypt_make_salt(void);
char *pw_encrypt(const char *, const char *);
int i64c(int);
char *l64a(long);
#ifndef __FreeBSD__
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
static void fail_exit(int);
static void oom(void);
static void update_noshadow(int);

View File

@@ -1,11 +1,10 @@
/*****************************************************************************
*
* File ..................: mbuseradd.c
* $Id$
* Purpose ...............: setuid root version of useradd
* Last modification date : 25-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2002
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -165,7 +164,7 @@ int main(int argc, char *argv[])
* Build command to add user entry to the /etc/passwd and /etc/shadow
* files. We use the systems own useradd program.
*/
#ifdef __linux__
#if defined(__linux__) || defined(__NetBSD__)
if ((access("/usr/bin/useradd", R_OK)) == 0)
strcpy(temp, "/usr/bin/useradd");
else if ((access("/bin/useradd", R_OK)) == 0)
@@ -194,7 +193,7 @@ int main(int argc, char *argv[])
sprintf(shell, "%s/bin/mbsebbs", getenv("MBSE_ROOT"));
#ifdef __linux__
#if defined(__linux__) || defined(__NetBSD__)
sprintf(PassEnt, "%s -c \"%s\" -d %s/%s -g %s -s %s %s",
temp, argv[3], argv[4], argv[2], argv[1], shell, argv[2]);
#endif

View File

@@ -1,11 +1,11 @@
/*****************************************************************************
*
* $Id$
* Purpose ...............: FreeBSD password utilities.
* Purpose ...............: FreeBSD/NetBSD password utilities.
* Remark ................: Taken from FreeBSD and modified for MBSE BBS.
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2002
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -62,7 +62,7 @@
* SUCH DAMAGE.
*/
#ifdef __FreeBSD__
#ifdef __FreeBSD__ || __NetBSD__
#include <sys/param.h>
#include <sys/errno.h>

View File

@@ -37,7 +37,7 @@
#ifndef _PW_UTIL_H
#define _PW_UTIL_H
#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__NetBSD__)
void pw_error __P((char *, int, int));
void pw_init __P((void));

View File

@@ -1,13 +1,12 @@
/*****************************************************************************
*
* File ..................: mbuseradd/pwio.c
* $Id$
* Purpose ...............: MBSE BBS Shadow Password Suite
* Last modification date : 09-Aug-2001
* 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
@@ -31,7 +30,7 @@
* Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*****************************************************************************/
#ifndef __FreeBSD__
#if !defined(__FreeBSD__) && !defined(__netBSD__)
#include "../config.h"
#include <stdio.h>
@@ -169,7 +168,7 @@ int pw_name(const char *filename)
#ifndef __FreeBSD__
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
int pw_lock(void)
{
return commonio_lock(&passwd_db);

View File

@@ -3,7 +3,7 @@
#ifndef _PWIO_H
#define _PWIO_H
#ifndef __FreeBSD__
#if !defined(__FreeBSD__) && !defined(__NetBSD__)
#ifndef PASSWD_FILE
#define PASSWD_FILE "/etc/passwd"

View File

@@ -38,7 +38,7 @@
#include <utmpx.h>
#endif
#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__NetBSD__)
#include <sys/types.h>
#include <libutil.h>
#endif
@@ -389,10 +389,10 @@ void setutmp(const char *name, const char *line, const char *host)
utent = utline;
}
#elif __FreeBSD__
#elif __FreeBSD__ || __NetBSD__
/*
* FreeBSD version, simple and mean.
* FreeBSD/NetBSD version, simple and mean.
*/
void setutmp(const char *name, const char *line, const char *host)
{

View File

@@ -20,7 +20,7 @@ static void updwtmpx(const char *, const struct utmpx *);
void setutmp(const char *, const char *, const char *);
#elif HAVE_UTMPX_H
void setutmp(const char *, const char *, const char *);
#elif __FreeBSD__
#elif __FreeBSD__ || __NetBSD__
void setutmp(const char *, const char *, const char *);
#else /* !SVR4 */
void setutmp(const char *, const char *);