diff options
author | Dirk Meyer <dinoex@FreeBSD.org> | 2010-01-26 21:26:33 +0000 |
---|---|---|
committer | Dirk Meyer <dinoex@FreeBSD.org> | 2010-01-26 21:26:33 +0000 |
commit | f13f3765bcb59e689c3efd364ea3a3a23449d645 (patch) | |
tree | 1821a473aa34036fbb144494ec181926d5faa695 /net/freebsd-uucp | |
parent | c30300441bf3bd85391ebb960a9fdd049e7eea18 (diff) | |
download | ports-f13f3765bcb59e689c3efd364ea3a3a23449d645.tar.gz ports-f13f3765bcb59e689c3efd364ea3a3a23449d645.zip |
Notes
Diffstat (limited to 'net/freebsd-uucp')
-rw-r--r-- | net/freebsd-uucp/files/patch-uucpd.c | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/net/freebsd-uucp/files/patch-uucpd.c b/net/freebsd-uucp/files/patch-uucpd.c new file mode 100644 index 000000000000..0a0e2cc6baed --- /dev/null +++ b/net/freebsd-uucp/files/patch-uucpd.c @@ -0,0 +1,90 @@ +--- uucpd/uucpd.c.orig 2007-09-10 10:57:58.000000000 +0200 ++++ uucpd/uucpd.c 2010-01-26 22:03:02.000000000 +0100 +@@ -73,7 +73,11 @@ + #include <syslog.h> + #include <time.h> + #include <unistd.h> ++#if __FreeBSD_version >= 900007 ++#include <utmpx.h> ++#else + #include <utmp.h> ++#endif + #include <libutil.h> + + #include "pathnames.h" +@@ -110,11 +114,13 @@ + + #endif /* USE_PAM */ + ++#if __FreeBSD_version < 900007 + #if (MAXLOGNAME-1) > UT_NAMESIZE + #define LOGNAMESIZE UT_NAMESIZE + #else + #define LOGNAMESIZE (MAXLOGNAME-1) + #endif ++#endif + + #define SCPYN(a, b) strncpy(a, b, sizeof (a)) + +@@ -196,7 +202,11 @@ + } while (user[0] == '\0'); + + /* truncate username to LOGNAMESIZE characters */ ++#if __FreeBSD_version >= 900007 ++ user[sizeof user - 1] = '\0'; ++#else + user[LOGNAMESIZE] = '\0'; ++#endif + + /* always ask for passwords to deter account guessing */ + printf("Password: "); fflush(stdout); +@@ -468,11 +478,24 @@ + { + int status; + pid_t pid; ++#if __FreeBSD_version >= 900007 ++ struct utmpx ut; ++#else + char line[32]; ++#endif + + while ((pid=wait((int *)&status)) > 0) { ++#if __FreeBSD_version >= 900007 ++ memset(&ut, 0, sizeof ut); ++ ut.ut_type = DEAD_PROCESS; ++ gettimeofday(&ut.ut_tv, NULL); ++ ut.ut_pid = pid; ++ snprintf(ut.ut_id, sizeof ut.ut_id, "%xuucp", pid); ++ pututxline(&ut); ++#else + sprintf(line, "uucp%ld", (long)pid); + logwtmp(line, "", ""); ++#endif + } + } + +@@ -481,6 +504,18 @@ + */ + void dologin(struct passwd *pw, struct sockaddr *sin) + { ++#if __FreeBSD_version >= 900007 ++ struct utmpx ut; ++ ++ memset(&ut, 0, sizeof ut); ++ ut.ut_type = USER_PROCESS; ++ gettimeofday(&ut.ut_tv, NULL); ++ ut.ut_pid = getpid(); ++ snprintf(ut.ut_id, sizeof ut.ut_id, "%xuucp", ut.ut_pid); ++ SCPYN(ut.ut_user, pw->pw_name); ++ realhostname_sa(ut.ut_host, sizeof ut.ut_host, sin, sin->sa_len); ++ pututxline(&ut); ++#else + char line[32]; + char remotehost[UT_HOSTSIZE + 1]; + int f; +@@ -503,4 +539,5 @@ + (void) close(f); + } + logwtmp(line, pw->pw_name, remotehost); ++#endif + } |