From abc87d0c357422181c7606b270d496816179270f Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 15 Oct 2015 14:55:14 +0000 Subject: Drop 8 support. With hat: portmgr Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D3694 --- .../msyslog/files/patch-src_modules_om__classic.c | 70 ++++++++++++++++++++++ .../msyslog/files/utmpx-src-modules-om_classic.c | 70 ---------------------- 2 files changed, 70 insertions(+), 70 deletions(-) create mode 100644 sysutils/msyslog/files/patch-src_modules_om__classic.c delete mode 100644 sysutils/msyslog/files/utmpx-src-modules-om_classic.c (limited to 'sysutils/msyslog/files') diff --git a/sysutils/msyslog/files/patch-src_modules_om__classic.c b/sysutils/msyslog/files/patch-src_modules_om__classic.c new file mode 100644 index 000000000000..36fedba7a2a9 --- /dev/null +++ b/sysutils/msyslog/files/patch-src_modules_om__classic.c @@ -0,0 +1,70 @@ +--- src/modules/om_classic.c.orig 2010-01-25 16:36:53.000000000 -0800 ++++ src/modules/om_classic.c +@@ -66,7 +66,7 @@ + #include + #include + #include +-#include ++#include + #include + /* if _PATH_UTMP isn't defined, define it here... */ + #ifndef _PATH_UTMP +@@ -100,7 +100,7 @@ + struct om_classic_ctx { + int fd; + union { +- char f_uname[MAXUNAMES][UT_NAMESIZE+1]; ++ char f_uname[MAXUNAMES][MAXLOGNAME+2]; + struct { + char f_hname[MAXHOSTNAMELEN]; + struct sockaddr f_addr; +@@ -396,9 +396,9 @@ + for (i = 0; i < MAXUNAMES && *p; i++) { + for (q = p; *q && *q != ','; ) + q++; +- (void)strncpy(c->f_un.f_uname[i], p, UT_NAMESIZE); +- if ((q - p) > UT_NAMESIZE) +- c->f_un.f_uname[i][UT_NAMESIZE] = '\0'; ++ (void)strncpy(c->f_un.f_uname[i], p, MAXLOGNAME+1); ++ if ((q - p) > MAXLOGNAME+1) ++ c->f_un.f_uname[i][MAXLOGNAME+1] = '\0'; + else + c->f_un.f_uname[i][q - p] = '\0'; + while (*q == ',' || *q == ' ') +@@ -456,24 +456,19 @@ + { + static int reenter; /* avoid calling ourselves */ + FILE *uf; +- struct utmp ut; ++ struct utmpx ut; + int i; + char *p; + char line[sizeof(ut.ut_line) + 1]; + + if (reenter++) + return; +- if ( (uf = fopen(_PATH_UTMP, "r")) == NULL) { +- dprintf(MSYSLOG_SERIOUS, "om_classic: error opening " +- "%s\n", _PATH_UTMP); +- reenter = 0; +- return; +- } ++ + /* NOSTRICT */ + while (fread(&ut, sizeof(ut), 1, uf) == 1) { + + #ifndef __linux__ +- if (ut.ut_name[0] == '\0') ++ if (ut.ut_user[0] == '\0') + #else + if ((ut.ut_type != USER_PROCESS && ut.ut_type != LOGIN_PROCESS) || + ut.ut_line[0] == ':' /* linux logs users that are not logged in (?!) */) +@@ -494,7 +489,7 @@ + for (i = 0; i < MAXUNAMES; i++) { + if (!c->f_un.f_uname[i][0]) + break; +- if (!strncmp(c->f_un.f_uname[i], ut.ut_name, ++ if (!strncmp(c->f_un.f_uname[i], ut.ut_user, + UT_NAMESIZE)) { + if ((p = ttymsg(iov, 6, line, TTYMSGTIME)) + != NULL) { diff --git a/sysutils/msyslog/files/utmpx-src-modules-om_classic.c b/sysutils/msyslog/files/utmpx-src-modules-om_classic.c deleted file mode 100644 index 36fedba7a2a9..000000000000 --- a/sysutils/msyslog/files/utmpx-src-modules-om_classic.c +++ /dev/null @@ -1,70 +0,0 @@ ---- src/modules/om_classic.c.orig 2010-01-25 16:36:53.000000000 -0800 -+++ src/modules/om_classic.c -@@ -66,7 +66,7 @@ - #include - #include - #include --#include -+#include - #include - /* if _PATH_UTMP isn't defined, define it here... */ - #ifndef _PATH_UTMP -@@ -100,7 +100,7 @@ - struct om_classic_ctx { - int fd; - union { -- char f_uname[MAXUNAMES][UT_NAMESIZE+1]; -+ char f_uname[MAXUNAMES][MAXLOGNAME+2]; - struct { - char f_hname[MAXHOSTNAMELEN]; - struct sockaddr f_addr; -@@ -396,9 +396,9 @@ - for (i = 0; i < MAXUNAMES && *p; i++) { - for (q = p; *q && *q != ','; ) - q++; -- (void)strncpy(c->f_un.f_uname[i], p, UT_NAMESIZE); -- if ((q - p) > UT_NAMESIZE) -- c->f_un.f_uname[i][UT_NAMESIZE] = '\0'; -+ (void)strncpy(c->f_un.f_uname[i], p, MAXLOGNAME+1); -+ if ((q - p) > MAXLOGNAME+1) -+ c->f_un.f_uname[i][MAXLOGNAME+1] = '\0'; - else - c->f_un.f_uname[i][q - p] = '\0'; - while (*q == ',' || *q == ' ') -@@ -456,24 +456,19 @@ - { - static int reenter; /* avoid calling ourselves */ - FILE *uf; -- struct utmp ut; -+ struct utmpx ut; - int i; - char *p; - char line[sizeof(ut.ut_line) + 1]; - - if (reenter++) - return; -- if ( (uf = fopen(_PATH_UTMP, "r")) == NULL) { -- dprintf(MSYSLOG_SERIOUS, "om_classic: error opening " -- "%s\n", _PATH_UTMP); -- reenter = 0; -- return; -- } -+ - /* NOSTRICT */ - while (fread(&ut, sizeof(ut), 1, uf) == 1) { - - #ifndef __linux__ -- if (ut.ut_name[0] == '\0') -+ if (ut.ut_user[0] == '\0') - #else - if ((ut.ut_type != USER_PROCESS && ut.ut_type != LOGIN_PROCESS) || - ut.ut_line[0] == ':' /* linux logs users that are not logged in (?!) */) -@@ -494,7 +489,7 @@ - for (i = 0; i < MAXUNAMES; i++) { - if (!c->f_un.f_uname[i][0]) - break; -- if (!strncmp(c->f_un.f_uname[i], ut.ut_name, -+ if (!strncmp(c->f_un.f_uname[i], ut.ut_user, - UT_NAMESIZE)) { - if ((p = ttymsg(iov, 6, line, TTYMSGTIME)) - != NULL) { -- cgit