diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:23:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:23:00 +0000 |
commit | 803b3a091c225d48395508a8f9ffa6e08cbddc5b (patch) | |
tree | a3168c9e7da8991c423b5978aacf90c3c2b135c1 /term-utils | |
parent | Releasing progress-linux version 2.40-8~progress7.99u1. (diff) | |
download | util-linux-803b3a091c225d48395508a8f9ffa6e08cbddc5b.tar.xz util-linux-803b3a091c225d48395508a8f9ffa6e08cbddc5b.zip |
Merging upstream version 2.40.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'term-utils')
-rw-r--r-- | term-utils/agetty.8 | 6 | ||||
-rw-r--r-- | term-utils/agetty.c | 11 | ||||
-rw-r--r-- | term-utils/mesg.1 | 4 | ||||
-rw-r--r-- | term-utils/script.1 | 4 | ||||
-rw-r--r-- | term-utils/scriptlive.1 | 4 | ||||
-rw-r--r-- | term-utils/scriptreplay.1 | 4 | ||||
-rw-r--r-- | term-utils/setterm.1 | 6 | ||||
-rw-r--r-- | term-utils/ttymsg.c | 2 | ||||
-rw-r--r-- | term-utils/wall.1 | 4 | ||||
-rw-r--r-- | term-utils/wall.c | 16 | ||||
-rw-r--r-- | term-utils/write.1 | 6 |
11 files changed, 39 insertions, 28 deletions
diff --git a/term-utils/agetty.8 b/term-utils/agetty.8 index 5b855fe..2fec370 100644 --- a/term-utils/agetty.8 +++ b/term-utils/agetty.8 @@ -2,12 +2,12 @@ .\" Title: agetty .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-03-20 +.\" Date: 2024-05-01 .\" Manual: System Administration -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "AGETTY" "8" "2024-03-20" "util\-linux 2.40" "System Administration" +.TH "AGETTY" "8" "2024-05-01" "util\-linux 2.40.1" "System Administration" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 0fc6f15..55d9a61 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -1196,7 +1196,8 @@ static void open_tty(const char *tty, struct termios *tp, struct options *op) #endif } - op->term = get_terminal_default_type(op->tty, !(op->flags & F_VCONSOLE)); + if (!op->term) + op->term = get_terminal_default_type(op->tty, !(op->flags & F_VCONSOLE)); if (!op->term) log_err(_("failed to allocate memory: %m")); @@ -1876,6 +1877,7 @@ static int issue_is_changed(struct issue *ie) free(ie->mem_old); ie->mem_old = ie->mem; ie->mem = NULL; + ie->mem_sz = 0; return 0; } @@ -1902,7 +1904,7 @@ static void print_issue_file(struct issue *ie, } } - if (ie->mem_sz) + if (ie->mem_sz && ie->mem) write_all(STDOUT_FILENO, ie->mem, ie->mem_sz); if (ie->do_tcrestore) { @@ -2463,12 +2465,12 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -H, --host <hostname> specify login host\n"), out); fputs(_(" -i, --noissue do not display issue file\n"), out); fputs(_(" -I, --init-string <string> set init string\n"), out); - fputs(_(" -J --noclear do not clear the screen before prompt\n"), out); + fputs(_(" -J, --noclear do not clear the screen before prompt\n"), out); fputs(_(" -l, --login-program <file> specify login program\n"), out); fputs(_(" -L, --local-line[=<mode>] control the local line flag\n"), out); fputs(_(" -m, --extract-baud extract baud rate during connect\n"), out); fputs(_(" -n, --skip-login do not prompt for login\n"), out); - fputs(_(" -N --nonewline do not print a newline before issue\n"), out); + fputs(_(" -N, --nonewline do not print a newline before issue\n"), out); fputs(_(" -o, --login-options <opts> options that are passed to login\n"), out); fputs(_(" -p, --login-pause wait for any key before the login\n"), out); fputs(_(" -r, --chroot <dir> change root to the directory\n"), out); @@ -3026,4 +3028,5 @@ static void load_credentials(struct options *op) { op->autolog = str; } } + closedir(dir); } diff --git a/term-utils/mesg.1 b/term-utils/mesg.1 index 332bbba..64283a3 100644 --- a/term-utils/mesg.1 +++ b/term-utils/mesg.1 @@ -4,10 +4,10 @@ .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-01-31 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "MESG" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "MESG" "1" "2024-01-31" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/term-utils/script.1 b/term-utils/script.1 index 5e5c337..899d624 100644 --- a/term-utils/script.1 +++ b/term-utils/script.1 @@ -4,10 +4,10 @@ .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-01-31 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "SCRIPT" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "SCRIPT" "1" "2024-01-31" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/term-utils/scriptlive.1 b/term-utils/scriptlive.1 index ef3990c..a6193ba 100644 --- a/term-utils/scriptlive.1 +++ b/term-utils/scriptlive.1 @@ -4,10 +4,10 @@ .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-01-31 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "SCRIPTLIVE" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "SCRIPTLIVE" "1" "2024-01-31" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/term-utils/scriptreplay.1 b/term-utils/scriptreplay.1 index 0e538a1..d5e3f50 100644 --- a/term-utils/scriptreplay.1 +++ b/term-utils/scriptreplay.1 @@ -4,10 +4,10 @@ .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-01-31 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "SCRIPTREPLAY" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "SCRIPTREPLAY" "1" "2024-01-31" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/term-utils/setterm.1 b/term-utils/setterm.1 index 30d0cc7..1971698 100644 --- a/term-utils/setterm.1 +++ b/term-utils/setterm.1 @@ -2,12 +2,12 @@ .\" Title: setterm .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-03-20 +.\" Date: 2024-05-01 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "SETTERM" "1" "2024-03-20" "util\-linux 2.40" "User Commands" +.TH "SETTERM" "1" "2024-05-01" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/term-utils/ttymsg.c b/term-utils/ttymsg.c index faa0344..ef7e358 100644 --- a/term-utils/ttymsg.c +++ b/term-utils/ttymsg.c @@ -123,7 +123,7 @@ ttymsg(struct iovec *iov, size_t iovcnt, char *line, int tmout) { iovcnt * sizeof(struct iovec)); iov = localiov; } - for (cnt = 0; wret >= (ssize_t) iov->iov_len; ++cnt) { + for (cnt = 0; wret >= (ssize_t) iov->iov_len && iovcnt > 0; ++cnt) { wret -= iov->iov_len; ++iov; --iovcnt; diff --git a/term-utils/wall.1 b/term-utils/wall.1 index eee0c2b..d98aa8c 100644 --- a/term-utils/wall.1 +++ b/term-utils/wall.1 @@ -4,10 +4,10 @@ .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-01-31 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "WALL" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "WALL" "1" "2024-01-31" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/term-utils/wall.c b/term-utils/wall.c index 588d3a9..125fde4 100644 --- a/term-utils/wall.c +++ b/term-utils/wall.c @@ -136,10 +136,17 @@ static gid_t get_group_gid(const char *group) static struct group_workspace *init_group_workspace(const char *group) { - struct group_workspace *buf = xmalloc(sizeof(struct group_workspace)); + struct group_workspace *buf; + long n; + + n = sysconf(_SC_NGROUPS_MAX); + if (n < 0 || n > INT_MAX - 1) + return NULL; + + buf = xmalloc(sizeof(struct group_workspace)); + buf->ngroups = n + 1; /* room for the primary gid */ buf->requested_group = get_group_gid(group); - buf->ngroups = sysconf(_SC_NGROUPS_MAX) + 1; /* room for the primary gid */ buf->groups = xcalloc(buf->ngroups, sizeof(*buf->groups)); return buf; @@ -324,10 +331,10 @@ static char *makemsg(char *fname, char **mvec, int mvecsz, if (print_banner == TRUE) { char *hostname = xgethostname(); - char *whom, *where, date[CTIME_BUFSIZ]; + char *whombuf, *whom, *where, date[CTIME_BUFSIZ]; time_t now; - whom = xgetlogin(); + whombuf = whom = xgetlogin(); if (!whom) { whom = "<someone>"; warn(_("cannot get passwd uid")); @@ -358,6 +365,7 @@ static char *makemsg(char *fname, char **mvec, int mvecsz, whom, hostname, where, date); fprintf(fs, "%-*.*s\007\007\r\n", TERM_WIDTH, TERM_WIDTH, lbuf); free(hostname); + free(whombuf); } fprintf(fs, "%*s\r\n", TERM_WIDTH, " "); diff --git a/term-utils/write.1 b/term-utils/write.1 index 5e91495..90fcb53 100644 --- a/term-utils/write.1 +++ b/term-utils/write.1 @@ -2,12 +2,12 @@ .\" Title: write .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-03-20 +.\" Date: 2024-05-01 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "WRITE" "1" "2024-03-20" "util\-linux 2.40" "User Commands" +.TH "WRITE" "1" "2024-05-01" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 |