Date: Thu, 05 Mar 2026 17:02:36 +0000 From: Rodrigo Osorio <rodrigo@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 8d60ebd11d8a - main - sysutils/whowatch: Revert port removal and mark it broken Message-ID: <69a9b72c.3c8e7.3d092bbb@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by rodrigo: URL: https://cgit.FreeBSD.org/ports/commit/?id=8d60ebd11d8a9fabc1e1d7cfd3bb8b3bbfa10aad commit 8d60ebd11d8a9fabc1e1d7cfd3bb8b3bbfa10aad Author: Rodrigo Osorio <rodrigo@FreeBSD.org> AuthorDate: 2026-03-05 15:38:55 +0000 Commit: Rodrigo Osorio <rodrigo@FreeBSD.org> CommitDate: 2026-03-05 17:02:04 +0000 sysutils/whowatch: Revert port removal and mark it broken This reverts commit 10c44e86de34692159e298a8d3542cecd596c5db. This reverts commit e49d8ae4238f7402cfc9d9cc61c033c85ceaa818. Mark sysutils/whowatch broken because current version is completly unusable in FreeBSD. PR 293113 tries to fix it. --- MOVED | 1 - sysutils/Makefile | 1 + sysutils/whowatch/Makefile | 27 ++++++++ sysutils/whowatch/distinfo | 3 + sysutils/whowatch/files/patch-Makefile.in | 13 ++++ sysutils/whowatch/files/patch-process.c | 11 ++++ sysutils/whowatch/files/patch-procinfo.c | 31 +++++++++ sysutils/whowatch/files/patch-whowatch.c | 105 ++++++++++++++++++++++++++++++ sysutils/whowatch/files/patch-whowatch.h | 27 ++++++++ sysutils/whowatch/pkg-descr | 5 ++ 10 files changed, 223 insertions(+), 1 deletion(-) diff --git a/MOVED b/MOVED index fdcf498588a2..447510fe07b3 100644 --- a/MOVED +++ b/MOVED @@ -5159,4 +5159,3 @@ net/unison240||2026-02-28|Has expired: Legacy release unsupported by upstream security/owasp-dependency-check||2026-02-28|Has expired: This port is 9 major versions and almost 8 years behind on upstream. No maintainer. No users in the ports tree. Does not compile with jdk11+ lang/go-devel|lang/go|2026-03-01|Has expired: Old version of Go. Use the go package (lang/go) instead devel/tbb|devel/onetbb|2026-03-01|Has expired: Project moved to devel/onetbb -sysutils/whowatch||2026-03-05| Relies on wtmp and utmp, which are deprecated since FreeBSD 9 diff --git a/sysutils/Makefile b/sysutils/Makefile index 89e1cad2f6eb..27e3cf6116b9 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -1597,6 +1597,7 @@ SUBDIR += weedit SUBDIR += wemux SUBDIR += whatpix + SUBDIR += whowatch SUBDIR += wiper SUBDIR += witr SUBDIR += wmapmload diff --git a/sysutils/whowatch/Makefile b/sysutils/whowatch/Makefile new file mode 100644 index 000000000000..5fd06eac62b2 --- /dev/null +++ b/sysutils/whowatch/Makefile @@ -0,0 +1,27 @@ +PORTNAME= whowatch +PORTVERSION= 1.4 +PORTREVISION= 2 +CATEGORIES= sysutils +MASTER_SITES= http://wizard.ae.krakow.pl/~mike/download/ \ + PACKETSTORM/UNIX/IDS + +MAINTAINER= ports@FreeBSD.org +COMMENT= Displays information in real time about users currently logged on +WWW= http://wizard.ae.krakow.pl/~mike/ + +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/COPYING + +BROKEN= Relies on wtmp and utmp, which are deprecated since FreeBSD 9 + +USES= ncurses +GNU_CONFIGURE= yes +GNU_CONFIGURE_MANPREFIX=${PREFIX}/share + +PLIST_FILES= bin/whowatch share/man/man1/${PORTNAME}.1.gz + +pre-patch: + @${FIND} ${WRKSRC} -name 'proc????.c' | ${XARGS} ${REINPLACE_CMD} -E \ + -e 's/kp_.?proc\.._/ki_/ ; s/pcred\.p_//' + +.include <bsd.port.mk> diff --git a/sysutils/whowatch/distinfo b/sysutils/whowatch/distinfo new file mode 100644 index 000000000000..fc1938b49783 --- /dev/null +++ b/sysutils/whowatch/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1772730100 +SHA256 (whowatch-1.4.tar.gz) = 221564dbdf503990e6e14803a1df0c735c61fa6069ebc56a57a8fba9ac22e4f4 +SIZE (whowatch-1.4.tar.gz) = 43084 diff --git a/sysutils/whowatch/files/patch-Makefile.in b/sysutils/whowatch/files/patch-Makefile.in new file mode 100644 index 000000000000..28e3c6ec6e86 --- /dev/null +++ b/sysutils/whowatch/files/patch-Makefile.in @@ -0,0 +1,13 @@ +--- Makefile.in.orig 2000-06-06 18:42:04.000000000 +0800 ++++ Makefile.in 2013-11-16 21:39:43.000000000 +0800 +@@ -70,8 +70,8 @@ clean: + rm -rf ./*.o + rm -f whowatch + install: whowatch +- $(INSTALL) -m 755 whowatch $(bindir)/whowatch +- $(INSTALL) -m 644 whowatch.1 $(mandir)/man1/whowatch.1 ++ $(BSD_INSTALL_PROGRAM) whowatch $(DESTDIR)$(bindir)/whowatch ++ $(BSD_INSTALL_MAN) whowatch.1 $(DESTDIR)$(mandir)/man1/whowatch.1 + + distclean: + make clean diff --git a/sysutils/whowatch/files/patch-process.c b/sysutils/whowatch/files/patch-process.c new file mode 100644 index 000000000000..8ab666024a78 --- /dev/null +++ b/sysutils/whowatch/files/patch-process.c @@ -0,0 +1,11 @@ +--- process.c.orig Wed Apr 4 16:25:29 2007 ++++ process.c Wed Apr 4 16:26:49 2007 +@@ -74,7 +74,7 @@ + memset(z, 0, sizeof *z); + check_line(l); + z->line = l++; +- (struct process *) p->priv = z; ++ p->priv = z; + z->proc = p; + if (*current){ + z->next = *current; diff --git a/sysutils/whowatch/files/patch-procinfo.c b/sysutils/whowatch/files/patch-procinfo.c new file mode 100644 index 000000000000..2f46a20b2fa5 --- /dev/null +++ b/sysutils/whowatch/files/patch-procinfo.c @@ -0,0 +1,31 @@ +--- procinfo.c.orig ++++ procinfo.c +@@ -65,7 +65,7 @@ + int fill_kinfo(struct kinfo_proc *info, int pid) + { + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid }; +- int len = sizeof *info; ++ size_t len = sizeof *info; + if(sysctl(mib, 4, info, &len, 0, 0) == -1) + return -1; + return len?0:-1; +@@ -124,7 +124,8 @@ + int get_login_pid(char *tty) + { + int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_TTY, 0}; +- int len, t, el, i, pid, cndt = -1, l; ++ int t, el, i, pid, cndt = -1, l; ++ size_t len; + struct kinfo_proc *info; + struct procinfo p; + +@@ -169,7 +170,8 @@ + int get_all_info(struct kinfo_proc **info) + { + int mib[3] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL }; +- int len, el; ++ int el; ++ size_t len; + + if(sysctl(mib, 3, 0, &len, 0, 0) == -1) + return 0; diff --git a/sysutils/whowatch/files/patch-whowatch.c b/sysutils/whowatch/files/patch-whowatch.c new file mode 100644 index 000000000000..9a0b00848f83 --- /dev/null +++ b/sysutils/whowatch/files/patch-whowatch.c @@ -0,0 +1,105 @@ +--- whowatch.c.orig 2000-06-06 03:21:44.000000000 -0700 ++++ whowatch.c 2010-02-02 19:56:37.081269004 -0800 +@@ -119,21 +119,17 @@ + /* + * Create new user structure and fill it + */ +-struct user_t *allocate_user(struct utmp *entry) ++struct user_t *allocate_user(struct utmpx *entry) + { + struct user_t *u; + int ppid; + u = calloc(1, sizeof *u); + if(!u) errx(1, "Cannot allocate memory."); +- strncpy(u->name, entry->ut_user, UT_NAMESIZE); +- strncpy(u->tty, entry->ut_line, UT_LINESIZE); +- strncpy(u->host, entry->ut_host, UT_HOSTSIZE); ++ strncpy(u->name, entry->ut_user, sizeof(entry->ut_user)); ++ strncpy(u->tty, entry->ut_line, sizeof(entry->ut_line)); ++ strncpy(u->host, entry->ut_host, sizeof(entry->ut_host)); + +-#ifdef HAVE_UTPID + u->pid = entry->ut_pid; +-#else +- u->pid = get_login_pid(u->tty); +-#endif + + if((ppid = get_ppid(u->pid)) == -1) + strncpy(u->parent, "can't access", sizeof u->parent); +@@ -192,34 +188,24 @@ + */ + void read_utmp() + { +- int fd, i; +- static struct utmp entry; ++ static struct utmpx *entry; + struct user_t *u; ++ ++ while ((entry = getutxent()) != NULL) { + +- if ((fd = open(UTMP_FILE ,O_RDONLY)) == -1){ +- curses_end(); +- errx(1, "Cannot open " UTMP_FILE); +- } +- while((i = read(fd, &entry,sizeof entry)) > 0) { +- if(i != sizeof entry) errx(1, "Error reading " UTMP_FILE ); +-#ifdef HAVE_USER_PROCESS +- if(entry.ut_type != USER_PROCESS) continue; +-#else +- if(!entry.ut_name[0]) continue; +-#endif +- u = allocate_user(&entry); ++ if(entry->ut_type != USER_PROCESS) continue; ++ u = allocate_user(entry); + print_user(u); + update_nr_users(u->parent, &u->prot, LOGIN); + how_many ++; + users_list.d_lines = how_many; + addto_list(u, users); + } +- close(fd); + wnoutrefresh(users_list.wd); + return; + } + +-struct user_t* new_user(struct utmp *newone) ++struct user_t* new_user(struct utmpx *newone) + { + struct user_t *u; + u = allocate_user(newone); +@@ -246,7 +232,7 @@ + void check_wtmp() + { + struct user_t *u; +- struct utmp entry; ++ struct utmpx entry; + int i; + + while((i = read(wtmp_fd, &entry, sizeof entry)) > 0){ +@@ -256,25 +242,17 @@ + errx(1, "Error reading " WTMP_FILE ); + } + /* user just logged in */ +-#ifdef HAVE_USER_PROCESS + if(entry.ut_type == USER_PROCESS) { +-#else +- if(entry.ut_user[0]) { +-#endif + u = new_user(&entry); + print_user(u); + wrefresh(users_list.wd); + print_info(); + continue; + } +-#ifdef HAVE_DEAD_PROCESS + if(entry.ut_type != DEAD_PROCESS) continue; +-#else +-// if(entry.ut_line[0]) continue; +-#endif + /* user just logged out */ + for_each(u, users) { +- if(strncmp(u->tty, entry.ut_line, UT_LINESIZE)) ++ if(strncmp(u->tty, entry.ut_line, sizeof(entry.ut_line))) + continue; + if (state == USERS_LIST) + delete_line(&users_list, u->line); diff --git a/sysutils/whowatch/files/patch-whowatch.h b/sysutils/whowatch/files/patch-whowatch.h new file mode 100644 index 000000000000..b0e051737708 --- /dev/null +++ b/sysutils/whowatch/files/patch-whowatch.h @@ -0,0 +1,27 @@ +--- whowatch.h.orig 2010-02-02 19:18:34.763514932 -0800 ++++ whowatch.h 2010-02-02 19:20:44.905393020 -0800 +@@ -2,7 +2,7 @@ + #include <stdlib.h> + #include <unistd.h> + #include <fcntl.h> +-#include <utmp.h> ++#include <utmpx.h> + #include <string.h> + #include <signal.h> + #include <sys/stat.h> +@@ -75,12 +75,12 @@ + { + struct user_t *next; + struct user_t *prev; +- char name[UT_NAMESIZE + 1]; /* login name */ +- char tty[UT_LINESIZE + 1]; /* tty */ ++ char name[sizeof(((struct utmpx *)0)->ut_user)]; /* login name */ ++ char tty[sizeof(((struct utmpx *)0)->ut_line)]; /* tty */ + int prot; + int pid; /* pid of login shell */ + char parent[16]; +- char host[UT_HOSTSIZE + 1]; ++ char host[sizeof(((struct utmpx *)0)->ut_host)]; + int line; + }; + diff --git a/sysutils/whowatch/pkg-descr b/sysutils/whowatch/pkg-descr new file mode 100644 index 000000000000..c7367b9a311b --- /dev/null +++ b/sysutils/whowatch/pkg-descr @@ -0,0 +1,5 @@ +Whowatch is an interactive who-like program that displays information about the +users currently logged on to the machine. In addition to standard information +(login name, tty, host, user's process), the type of the connection (telnet or +ssh) is shown. You can toggle display between the users' commands or idle times. +You can watch the process tree, navigate in it, and send INT and KILL signals.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69a9b72c.3c8e7.3d092bbb>
