diff options
Diffstat (limited to 'misc-utils')
49 files changed, 199 insertions, 145 deletions
diff --git a/misc-utils/Makemodule.am b/misc-utils/Makemodule.am index 0720dda..6104c64 100644 --- a/misc-utils/Makemodule.am +++ b/misc-utils/Makemodule.am @@ -326,7 +326,7 @@ misc-utils/enosys.c: syscalls.h syscalls.h: $(top_srcdir)/tools/all_syscalls @echo ' GEN $@' - @$(top_srcdir)/tools/all_syscalls $(CC) $(CFLAGS) + @$(top_srcdir)/tools/all_syscalls "$(SED)" $(CC) $(CFLAGS) -include syscalls.h.deps CLEANFILES += syscalls.h syscalls.h.deps diff --git a/misc-utils/blkid.8 b/misc-utils/blkid.8 index f6d67b3..97aa9f1 100644 --- a/misc-utils/blkid.8 +++ b/misc-utils/blkid.8 @@ -2,12 +2,12 @@ .\" Title: blkid .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-03-27 +.\" Date: 2024-05-06 .\" Manual: System Administration -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "BLKID" "8" "2024-03-27" "util\-linux 2.40" "System Administration" +.TH "BLKID" "8" "2024-05-06" "util\-linux 2.40.1" "System Administration" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/blkid.8.adoc b/misc-utils/blkid.8.adoc index 5e8002d..3b02c75 100644 --- a/misc-utils/blkid.8.adoc +++ b/misc-utils/blkid.8.adoc @@ -1,6 +1,6 @@ //po4a: entry man manual // Copyright 2000 Andreas Dilger (adilger@turbolinux.com) -// This file may be copied under the terms of the GNU Public License. +// This file may be copied under the terms of the GNU General Public License. = blkid(8) :doctype: manpage :man manual: System Administration diff --git a/misc-utils/cal.1 b/misc-utils/cal.1 index ccc137f..1ee62cd 100644 --- a/misc-utils/cal.1 +++ b/misc-utils/cal.1 @@ -2,12 +2,12 @@ .\" Title: cal .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-01-31 +.\" Date: 2024-04-24 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "CAL" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "CAL" "1" "2024-04-24" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/cal.c b/misc-utils/cal.c index e6f4a6e..900f727 100644 --- a/misc-utils/cal.c +++ b/misc-utils/cal.c @@ -360,7 +360,7 @@ int main(int argc, char **argv) * POSIX: 19971201 + 7 -1 = 0 */ { - int wfd; + unsigned int wfd; union { unsigned int word; char *string; } val; val.string = nl_langinfo(_NL_TIME_WEEK_1STDAY); diff --git a/misc-utils/enosys.1 b/misc-utils/enosys.1 index 28bb049..b29fe1f 100644 --- a/misc-utils/enosys.1 +++ b/misc-utils/enosys.1 @@ -2,12 +2,12 @@ .\" Title: enosys .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-03-27 +.\" Date: 2024-05-06 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "ENOSYS" "1" "2024-03-27" "util\-linux 2.40" "User Commands" +.TH "ENOSYS" "1" "2024-05-06" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/exch.1 b/misc-utils/exch.1 index 72b1009..4fbfcee 100644 --- a/misc-utils/exch.1 +++ b/misc-utils/exch.1 @@ -2,12 +2,12 @@ .\" Title: exch .\" 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 "EXCH" "1" "2024-03-20" "util\-linux 2.40" "User Commands" +.TH "EXCH" "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/misc-utils/fadvise.1 b/misc-utils/fadvise.1 index 1778da2..0bf2cc2 100644 --- a/misc-utils/fadvise.1 +++ b/misc-utils/fadvise.1 @@ -2,12 +2,12 @@ .\" Title: fadvise .\" 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 "FADVISE" "1" "2024-03-20" "util\-linux 2.40" "User Commands" +.TH "FADVISE" "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/misc-utils/fincore.1 b/misc-utils/fincore.1 index 2fd1e2b..903e017 100644 --- a/misc-utils/fincore.1 +++ b/misc-utils/fincore.1 @@ -2,12 +2,12 @@ .\" Title: fincore .\" 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 "FINCORE" "1" "2024-03-20" "util\-linux 2.40" "User Commands" +.TH "FINCORE" "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/misc-utils/fincore.1.adoc b/misc-utils/fincore.1.adoc index 73f90c3..2ee4343 100644 --- a/misc-utils/fincore.1.adoc +++ b/misc-utils/fincore.1.adoc @@ -2,7 +2,7 @@ //// Copyright 2017 Red Hat, Inc. -This file may be copied under the terms of the GNU Public License. +This file may be copied under the terms of the GNU General Public License. //// = fincore(1) :doctype: manpage diff --git a/misc-utils/findfs.8 b/misc-utils/findfs.8 index a1c9661..1a511c7 100644 --- a/misc-utils/findfs.8 +++ b/misc-utils/findfs.8 @@ -2,12 +2,12 @@ .\" Title: findfs .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-01-31 +.\" Date: 2024-05-06 .\" Manual: System Administration -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "FINDFS" "8" "2024-01-31" "util\-linux 2.40" "System Administration" +.TH "FINDFS" "8" "2024-05-06" "util\-linux 2.40.1" "System Administration" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/findfs.8.adoc b/misc-utils/findfs.8.adoc index 560a5ba..4e033b7 100644 --- a/misc-utils/findfs.8.adoc +++ b/misc-utils/findfs.8.adoc @@ -1,6 +1,6 @@ //po4a: entry man manual // Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved. -// This file may be copied under the terms of the GNU Public License. +// This file may be copied under the terms of the GNU General Public License. = findfs(8) :doctype: manpage :man manual: System Administration diff --git a/misc-utils/findmnt.8 b/misc-utils/findmnt.8 index 56fe1f1..1838732 100644 --- a/misc-utils/findmnt.8 +++ b/misc-utils/findmnt.8 @@ -2,12 +2,12 @@ .\" Title: findmnt .\" 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 "FINDMNT" "8" "2024-03-20" "util\-linux 2.40" "System Administration" +.TH "FINDMNT" "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/misc-utils/findmnt.c b/misc-utils/findmnt.c index cc397da..f40b137 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -552,7 +552,6 @@ static char *get_vfs_attr(struct libmnt_fs *fs, int sizetype) static char *get_data_col_sources(struct libmnt_fs *fs, int evaluate, size_t *datasiz) { const char *tag = NULL, *p = NULL; - int i = 0; const char *device = NULL; char *val = NULL; blkid_dev_iterate iter; @@ -602,10 +601,8 @@ static char *get_data_col_sources(struct libmnt_fs *fs, int evaluate, size_t *da dev = blkid_verify(blk_cache, dev); if (!dev) continue; - if (i != 0) - ul_buffer_append_data(&buf, "\0", 1); ul_buffer_append_string(&buf, blkid_dev_devname(dev)); - i++; + ul_buffer_append_data(&buf, "\0", 1); } blkid_dev_iterate_end(iter); free(val); @@ -1636,7 +1633,7 @@ int main(int argc, char *argv[]) break; case 'I': flags &= ~FL_TREE; - flags |= FL_DF_INODES; + flags |= (FL_DF_INODES | FL_DF); break; case 'i': flags |= FL_INVERT; @@ -1775,22 +1772,20 @@ int main(int argc, char *argv[]) if (collist) list_colunms(); /* print end exit */ - if (!ncolumns && (flags & FL_DF_INODES)) { + if (!ncolumns && (flags & FL_DF)) { add_column(columns, ncolumns++, COL_SOURCE); add_column(columns, ncolumns++, COL_FSTYPE); - add_column(columns, ncolumns++, COL_INO_TOTAL); - add_column(columns, ncolumns++, COL_INO_USED); - add_column(columns, ncolumns++, COL_INO_AVAIL); - add_column(columns, ncolumns++, COL_INO_USEPERC); - add_column(columns, ncolumns++, COL_TARGET); - } - else if (!ncolumns && (flags & FL_DF)) { - add_column(columns, ncolumns++, COL_SOURCE); - add_column(columns, ncolumns++, COL_FSTYPE); - add_column(columns, ncolumns++, COL_SIZE); - add_column(columns, ncolumns++, COL_USED); - add_column(columns, ncolumns++, COL_AVAIL); - add_column(columns, ncolumns++, COL_USEPERC); + if (flags & FL_DF_INODES) { + add_column(columns, ncolumns++, COL_INO_TOTAL); + add_column(columns, ncolumns++, COL_INO_USED); + add_column(columns, ncolumns++, COL_INO_AVAIL); + add_column(columns, ncolumns++, COL_INO_USEPERC); + } else { + add_column(columns, ncolumns++, COL_SIZE); + add_column(columns, ncolumns++, COL_USED); + add_column(columns, ncolumns++, COL_AVAIL); + add_column(columns, ncolumns++, COL_USEPERC); + } add_column(columns, ncolumns++, COL_TARGET); } diff --git a/misc-utils/findmnt.h b/misc-utils/findmnt.h index 5c69450..85ab68d 100644 --- a/misc-utils/findmnt.h +++ b/misc-utils/findmnt.h @@ -24,7 +24,7 @@ enum { FL_SHADOWED = (1 << 20), FL_DELETED = (1 << 21), FL_SHELLVAR = (1 << 22), - FL_DF_INODES = (1 << 23) | FL_DF, + FL_DF_INODES = (1 << 23), /* basic table settings */ FL_ASCII = (1 << 25), diff --git a/misc-utils/getopt.1 b/misc-utils/getopt.1 index fe9003e..a9fc54c 100644 --- a/misc-utils/getopt.1 +++ b/misc-utils/getopt.1 @@ -2,12 +2,12 @@ .\" Title: getopt .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-01-31 +.\" Date: 2024-04-24 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "GETOPT" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "GETOPT" "1" "2024-04-24" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/getopt.c b/misc-utils/getopt.c index f989461..c57dd87 100644 --- a/misc-utils/getopt.c +++ b/misc-utils/getopt.c @@ -446,7 +446,6 @@ int main(int argc, char *argv[]) ctl.shell = shell_type(optarg); break; case 'T': - free(ctl.long_options); return TEST_EXIT_CODE; case 'u': ctl.quote = 0; diff --git a/misc-utils/hardlink.1 b/misc-utils/hardlink.1 index 175cbc8..5784fcf 100644 --- a/misc-utils/hardlink.1 +++ b/misc-utils/hardlink.1 @@ -2,12 +2,12 @@ .\" Title: hardlink .\" 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 "HARDLINK" "1" "2024-03-20" "util\-linux 2.40" "User Commands" +.TH "HARDLINK" "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/misc-utils/kill.1 b/misc-utils/kill.1 index 12c3252..9bc625f 100644 --- a/misc-utils/kill.1 +++ b/misc-utils/kill.1 @@ -2,12 +2,12 @@ .\" Title: kill .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-01-31 +.\" Date: 2024-04-24 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "KILL" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "KILL" "1" "2024-04-24" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/lastlog2.8 b/misc-utils/lastlog2.8 index 62eb1e2..538ede6 100644 --- a/misc-utils/lastlog2.8 +++ b/misc-utils/lastlog2.8 @@ -2,12 +2,12 @@ .\" Title: lastlog2 .\" 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 "LASTLOG2" "8" "2024-03-20" "util\-linux 2.40" "User Commands" +.TH "LASTLOG2" "8" "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/misc-utils/lastlog2.8.adoc b/misc-utils/lastlog2.8.adoc index b6be372..c0d3ecf 100644 --- a/misc-utils/lastlog2.8.adoc +++ b/misc-utils/lastlog2.8.adoc @@ -1,7 +1,7 @@ //po4a: entry man manual //// Copyright 2023 Thorsten Kukuk (kukuk@suse.de) -This file may be copied under the terms of the GNU Public License. +This file may be copied under the terms of the GNU General Public License. //// = lastlog2(8) :doctype: manpage diff --git a/misc-utils/lastlog2.c b/misc-utils/lastlog2.c index 4029f5e..7e511b0 100644 --- a/misc-utils/lastlog2.c +++ b/misc-utils/lastlog2.c @@ -108,15 +108,15 @@ static void __attribute__((__noreturn__)) usage(void) fprintf(output, _(" %s [options]\n"), program_invocation_short_name); fputs(USAGE_OPTIONS, output); - fputs(_(" -b, --before DAYS Print only records older than DAYS\n"), output); - fputs(_(" -C, --clear Clear record of a user (requires -u)\n"), output); - fputs(_(" -d, --database FILE Use FILE as lastlog2 database\n"), output); - fputs(_(" -i, --import FILE Import data from old lastlog file\n"), output); - fputs(_(" -r, --rename NEWNAME Rename existing user to NEWNAME (requires -u)\n"), output); - fputs(_(" -s, --service Display PAM service\n"), output); - fputs(_(" -S, --set ySet lastlog record to current time (requires -u)\n"), output); - fputs(_(" -t, --time DAYS Print only lastlog records more recent than DAYS\n"), output); - fputs(_(" -u, --user LOGIN Print lastlog record of the specified LOGIN\n"), output); + fputs(_(" -b, --before DAYS print only records older than DAYS\n"), output); + fputs(_(" -C, --clear clear record of a user (requires -u)\n"), output); + fputs(_(" -d, --database FILE use FILE as lastlog2 database\n"), output); + fputs(_(" -i, --import FILE import data from old lastlog file\n"), output); + fputs(_(" -r, --rename NEWNAME rename existing user to NEWNAME (requires -u)\n"), output); + fputs(_(" -s, --service display PAM service\n"), output); + fputs(_(" -S, --set set lastlog record to current time (requires -u)\n"), output); + fputs(_(" -t, --time DAYS print only lastlog records more recent than DAYS\n"), output); + fputs(_(" -u, --user LOGIN print lastlog record of the specified LOGIN\n"), output); fputs(USAGE_SEPARATOR, output); fprintf(output, USAGE_HELP_OPTIONS(25)); diff --git a/misc-utils/logger.1 b/misc-utils/logger.1 index d6165ad..d7df605 100644 --- a/misc-utils/logger.1 +++ b/misc-utils/logger.1 @@ -2,12 +2,12 @@ .\" Title: logger .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-01-31 +.\" Date: 2024-04-24 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "LOGGER" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "LOGGER" "1" "2024-04-24" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/look.1 b/misc-utils/look.1 index 93fb78d..1d5d3aa 100644 --- a/misc-utils/look.1 +++ b/misc-utils/look.1 @@ -2,12 +2,12 @@ .\" Title: look .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-01-31 +.\" Date: 2024-04-24 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "LOOK" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "LOOK" "1" "2024-04-24" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/lsblk.8 b/misc-utils/lsblk.8 index 235f88b..bc65b78 100644 --- a/misc-utils/lsblk.8 +++ b/misc-utils/lsblk.8 @@ -2,12 +2,12 @@ .\" Title: lsblk .\" 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 "LSBLK" "8" "2024-03-20" "util\-linux 2.40" "System Administration" +.TH "LSBLK" "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/misc-utils/lsblk.c b/misc-utils/lsblk.c index 30bd2ed..15d9b19 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -935,8 +935,7 @@ static char *device_get_data( ul_buffer_append_string(&buf, "[SWAP]"); else ul_buffer_append_string(&buf, mnt_fs_get_target(fs)); - if (i + 1 < n) - ul_buffer_append_data(&buf, "\0", 1); + ul_buffer_append_data(&buf, "\0", 1); } str = ul_buffer_get_data(&buf, datasiz, NULL); break; @@ -953,8 +952,7 @@ static char *device_get_data( if (mnt_fs_is_swaparea(fs)) continue; ul_buffer_append_string(&buf, root ? root : "/"); - if (i + 1 < n) - ul_buffer_append_data(&buf, "\0", 1); + ul_buffer_append_data(&buf, "\0", 1); } str = ul_buffer_get_data(&buf, datasiz, NULL); break; @@ -1276,7 +1274,7 @@ static void device_fill_scols_cell(struct lsblk_device *dev, ce = scols_line_get_cell(ln, colnum); if (!ce) return; - rc = datasiz ? scols_cell_refer_memory(ce, data, datasiz + 1) + rc = datasiz ? scols_cell_refer_memory(ce, data, datasiz) : scols_cell_refer_data(ce, data); if (rc) err(EXIT_FAILURE, _("failed to add output data")); diff --git a/misc-utils/lsclocks.1 b/misc-utils/lsclocks.1 index b38138f..612a187 100644 --- a/misc-utils/lsclocks.1 +++ b/misc-utils/lsclocks.1 @@ -2,12 +2,12 @@ .\" Title: lsclocks .\" 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 "LSCLOCKS" "1" "2024-03-20" "util\-linux 2.40" "User Commands" +.TH "LSCLOCKS" "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/misc-utils/lsclocks.c b/misc-utils/lsclocks.c index 867f860..0799f65 100644 --- a/misc-utils/lsclocks.c +++ b/misc-utils/lsclocks.c @@ -277,6 +277,7 @@ static int64_t get_namespace_offset(const char *name) } free(buf); + close(fd); return ret; } diff --git a/misc-utils/lsfd-sock-xinfo.c b/misc-utils/lsfd-sock-xinfo.c index a293806..71be41a 100644 --- a/misc-utils/lsfd-sock-xinfo.c +++ b/misc-utils/lsfd-sock-xinfo.c @@ -179,9 +179,12 @@ static void load_sock_xinfo_no_nsswitch(struct netns *nsobj) load_xinfo_from_proc_packet(netns); diagsd = socket(AF_NETLINK, SOCK_DGRAM, NETLINK_SOCK_DIAG); + DBG(ENDPOINTS, ul_debug("made a diagnose socket [fd=%d; %s]", diagsd, + (diagsd >= 0)? "successful": strerror(errno))); if (diagsd >= 0) { load_xinfo_from_diag_unix(diagsd, netns); close(diagsd); + DBG(ENDPOINTS, ul_debug("close the diagnose socket")); } if (nsobj) @@ -337,6 +340,7 @@ static void send_diag_request(int diagsd, void *req, size_t req_size, bool (*cb)(ino_t, size_t, void *), ino_t netns) { + int r; struct sockaddr_nl nladdr = { .nl_family = AF_NETLINK, }; @@ -361,30 +365,45 @@ static void send_diag_request(int diagsd, void *req, size_t req_size, __attribute__((aligned(sizeof(void *)))) uint8_t buf[8192]; - if (sendmsg(diagsd, &mhd, 0) < 0) + r = sendmsg(diagsd, &mhd, 0); + DBG(ENDPOINTS, ul_debug("sendmsg [rc=%d; %s]", + r, (r >= 0)? "successful": strerror(errno))); + if (r < 0) return; for (;;) { const struct nlmsghdr *h; - int r = recvfrom(diagsd, buf, sizeof(buf), 0, NULL, NULL); + r = recvfrom(diagsd, buf, sizeof(buf), 0, NULL, NULL); + DBG(ENDPOINTS, ul_debug("recvfrom [rc=%d; %s]", + r, (r >= 0)? "successful": strerror(errno))); if (r < 0) return; h = (void *) buf; + DBG(ENDPOINTS, ul_debug(" OK: %d", NLMSG_OK(h, (size_t)r))); if (!NLMSG_OK(h, (size_t)r)) return; for (; NLMSG_OK(h, (size_t)r); h = NLMSG_NEXT(h, r)) { - if (h->nlmsg_type == NLMSG_DONE) + if (h->nlmsg_type == NLMSG_DONE) { + DBG(ENDPOINTS, ul_debug(" DONE")); return; - if (h->nlmsg_type == NLMSG_ERROR) + } + if (h->nlmsg_type == NLMSG_ERROR) { + struct nlmsgerr *e = (struct nlmsgerr *)NLMSG_DATA(h); + DBG(ENDPOINTS, ul_debug(" ERROR: %s", + strerror(- e->error))); return; + } if (h->nlmsg_type == SOCK_DIAG_BY_FAMILY) { + DBG(ENDPOINTS, ul_debug(" FAMILY")); if (!cb(netns, h->nlmsg_len, NLMSG_DATA(h))) return; } + DBG(ENDPOINTS, ul_debug(" NEXT")); } + DBG(ENDPOINTS, ul_debug(" OK: 0")); } } @@ -639,6 +658,8 @@ static void load_xinfo_from_proc_unix(ino_t netns_inode) FILE *unix_fp; unix_fp = fopen("/proc/net/unix", "r"); + DBG(ENDPOINTS, ul_debug("open /proc/net/unix [fp=%p; %s]", unix_fp, + unix_fp? "successful": strerror(errno))); if (!unix_fp) return; @@ -655,13 +676,18 @@ static void load_xinfo_from_proc_unix(ino_t netns_inode) unsigned long inode; struct unix_xinfo *ux; char path[UNIX_LINE_LEN + 1] = { 0 }; + int r; + DBG(ENDPOINTS, ul_debug(" line: %s", line)); - if (sscanf(line, "%*x: %*x %*x %" SCNx64 " %x %x %lu %" + r = sscanf(line, "%*x: %*x %*x %" SCNx64 " %x %x %lu %" stringify_value(UNIX_LINE_LEN) "[^\n]", - &flags, &type, &st, &inode, path) < 4) + &flags, &type, &st, &inode, path); + DBG(ENDPOINTS, ul_debug(" scanf: %d", r)); + if (r < 4) continue; + DBG(ENDPOINTS, ul_debug(" inode: %lu", inode)); if (inode == 0) continue; @@ -675,10 +701,12 @@ static void load_xinfo_from_proc_unix(ino_t netns_inode) ux->st = st; xstrncpy(ux->path, path, sizeof(ux->path)); + DBG(ENDPOINTS, ul_debug(" path: %s", ux->path)); add_sock_info(&ux->sock); } out: + DBG(ENDPOINTS, ul_debug("close /proc/net/unix")); fclose(unix_fp); } @@ -712,6 +740,9 @@ static bool handle_diag_unix(ino_t netns __attribute__((__unused__)), if (diag->udiag_family != AF_UNIX) return false; + DBG(ENDPOINTS, ul_debug(" UNIX")); + DBG(ENDPOINTS, ul_debug(" LEN: %zu (>= %zu)", nlmsg_len, + (size_t)(NLMSG_LENGTH(sizeof(*diag))))); if (nlmsg_len < NLMSG_LENGTH(sizeof(*diag))) return false; @@ -719,21 +750,29 @@ static bool handle_diag_unix(ino_t netns __attribute__((__unused__)), inode = (ino_t)diag->udiag_ino; xinfo = get_sock_xinfo(inode); + DBG(ENDPOINTS, ul_debug(" inode: %llu", (unsigned long long)inode)); + DBG(ENDPOINTS, ul_debug(" xinfo: %p", xinfo)); + if (xinfo == NULL) /* The socket is found in the diag response but not in the proc fs. */ return true; + DBG(ENDPOINTS, ul_debug(" xinfo->class == &unix_xinfo_class: %d", + xinfo->class == &unix_xinfo_class)); if (xinfo->class != &unix_xinfo_class) return true; unix_xinfo = (struct unix_xinfo *)xinfo; rta_len = nlmsg_len - NLMSG_LENGTH(sizeof(*diag)); + DBG(ENDPOINTS, ul_debug(" rta_len: %zu", rta_len)); for (struct rtattr *attr = (struct rtattr *)(diag + 1); RTA_OK(attr, rta_len); attr = RTA_NEXT(attr, rta_len)) { size_t len = RTA_PAYLOAD(attr); + DBG(ENDPOINTS, ul_debug(" len = %2zu, type: %d", + rta_len, attr->rta_type)); switch (attr->rta_type) { case UNIX_DIAG_NAME: unix_refill_name(xinfo, RTA_DATA(attr), len); diff --git a/misc-utils/lsfd.1 b/misc-utils/lsfd.1 index efc229c..ccffa65 100644 --- a/misc-utils/lsfd.1 +++ b/misc-utils/lsfd.1 @@ -2,12 +2,12 @@ .\" Title: lsfd .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-03-27 +.\" Date: 2024-05-06 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "LSFD" "1" "2024-03-27" "util\-linux 2.40" "User Commands" +.TH "LSFD" "1" "2024-05-06" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/lsfd.1.adoc b/misc-utils/lsfd.1.adoc index 512fb23..69b9f42 100644 --- a/misc-utils/lsfd.1.adoc +++ b/misc-utils/lsfd.1.adoc @@ -2,7 +2,7 @@ //// Copyright 2021 Red Hat, Inc. -This file may be copied under the terms of the GNU Public License. +This file may be copied under the terms of the GNU General Public License. //// = lsfd(1) :doctype: manpage diff --git a/misc-utils/lsfd.c b/misc-utils/lsfd.c index 771daef..98820ee 100644 --- a/misc-utils/lsfd.c +++ b/misc-utils/lsfd.c @@ -84,6 +84,14 @@ static int kcmp(pid_t pid1 __attribute__((__unused__)), #include "lsfd.h" +UL_DEBUG_DEFINE_MASK(lsfd); +UL_DEBUG_DEFINE_MASKNAMES(lsfd) = UL_DEBUG_EMPTY_MASKNAMES; + +static void lsfd_init_debug(void) +{ + __UL_INIT_DEBUG_FROM_ENV(lsfd, LSFD_DEBUG_, 0, LSFD_DEBUG); +} + /* * /proc/$pid/mountinfo entries */ @@ -402,7 +410,7 @@ static const struct colinfo infos[] = { N_("user of the process") }, [COL_XMODE] = { "XMODE", 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, - N_("extended version of MDOE (rwxD[Ll]m)") }, + N_("extended version of MODE (rwxD[Ll]m)") }, }; static const int default_columns[] = { @@ -2271,6 +2279,8 @@ int main(int argc, char *argv[]) { NULL, 0, NULL, 0 }, }; + lsfd_init_debug(); + setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); diff --git a/misc-utils/lsfd.h b/misc-utils/lsfd.h index 1859dc7..e646758 100644 --- a/misc-utils/lsfd.h +++ b/misc-utils/lsfd.h @@ -28,7 +28,11 @@ #include <sys/stat.h> #include <dirent.h> #include <inttypes.h> +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include "debug.h" #include "libsmartcols.h" #include "list.h" #include "nls.h" @@ -37,6 +41,17 @@ #include "xalloc.h" /* + * debug + */ +UL_DEBUG_DECLARE_MASK(lsfd); + +#define LSFD_DEBUG_INIT (1 << 1) +#define LSFD_DEBUG_ENDPOINTS (1 << 2) +#define LSFD_DEBUG_ALL 0xFFFF + +#define DBG(m, x) __UL_DBG(lsfd, LSFD_DEBUG_, m, x) + +/* * column IDs */ enum { diff --git a/misc-utils/lslocks.8 b/misc-utils/lslocks.8 index 3f593a2..1cc9f7a 100644 --- a/misc-utils/lslocks.8 +++ b/misc-utils/lslocks.8 @@ -2,12 +2,12 @@ .\" Title: lslocks .\" 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 "LSLOCKS" "8" "2024-03-20" "util\-linux 2.40" "System Administration" +.TH "LSLOCKS" "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/misc-utils/lslocks.c b/misc-utils/lslocks.c index 3d70b04..a630c3d 100644 --- a/misc-utils/lslocks.c +++ b/misc-utils/lslocks.c @@ -89,7 +89,7 @@ static struct colinfo infos[] = { [COL_END] = { "END", 10, SCOLS_FL_RIGHT, N_("ending offset of the lock")}, [COL_PATH] = { "PATH", 0, SCOLS_FL_TRUNC, N_("path of the locked file")}, [COL_BLOCKER] = { "BLOCKER", 0, SCOLS_FL_RIGHT, N_("PID of the process blocking the lock") }, - [COL_HOLDERS] = { "HOLDERS", 0, SCOLS_FL_WRAP, N_("HOLDERS of the lock") }, + [COL_HOLDERS] = { "HOLDERS", 0, SCOLS_FL_WRAP, N_("holders of the lock") }, }; static int columns[ARRAY_SIZE(infos) * 2]; @@ -490,12 +490,11 @@ static int get_pid_locks(void *locks, void (*add_lock)(void *, struct lock *), s return rc; } -static int get_pids_locks(void *locks, void (*add_lock)(void *, struct lock *)) +static void get_pids_locks(void *locks, void (*add_lock)(void *, struct lock *)) { DIR *dir; struct dirent *d; struct path_cxt *pc = NULL; - int rc = 0; pc = ul_new_path(NULL); if (!pc) @@ -513,10 +512,8 @@ static int get_pids_locks(void *locks, void (*add_lock)(void *, struct lock *)) if (procfs_dirent_get_pid(d, &pid) != 0) continue; - if (procfs_process_init_path(pc, pid) != 0) { - rc = -1; - break; - } + if (procfs_process_init_path(pc, pid) != 0) + continue; if (procfs_process_get_cmdname(pc, buf, sizeof(buf)) <= 0) continue; @@ -528,7 +525,7 @@ static int get_pids_locks(void *locks, void (*add_lock)(void *, struct lock *)) closedir(dir); ul_unref_path(pc); - return rc; + return; } static int get_proc_locks(void *locks, void (*add_lock)(void *, struct lock *), void *fallback) diff --git a/misc-utils/mcookie.1 b/misc-utils/mcookie.1 index b2e8284..ba2b560 100644 --- a/misc-utils/mcookie.1 +++ b/misc-utils/mcookie.1 @@ -2,12 +2,12 @@ .\" Title: mcookie .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-01-31 +.\" Date: 2024-04-24 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "MCOOKIE" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "MCOOKIE" "1" "2024-04-24" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/namei.1 b/misc-utils/namei.1 index 6eb1766..9d1ccd6 100644 --- a/misc-utils/namei.1 +++ b/misc-utils/namei.1 @@ -2,12 +2,12 @@ .\" Title: namei .\" 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 "NAMEI" "1" "2024-03-20" "util\-linux 2.40" "User Commands" +.TH "NAMEI" "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/misc-utils/pipesz.1 b/misc-utils/pipesz.1 index b6ebcf5..987c67d 100644 --- a/misc-utils/pipesz.1 +++ b/misc-utils/pipesz.1 @@ -2,12 +2,12 @@ .\" Title: pipesz .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-01-31 +.\" Date: 2024-04-24 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "PIPESZ" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "PIPESZ" "1" "2024-04-24" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/rename.1 b/misc-utils/rename.1 index 63ca2ea..a62d13a 100644 --- a/misc-utils/rename.1 +++ b/misc-utils/rename.1 @@ -2,12 +2,12 @@ .\" Title: rename .\" 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 "RENAME" "1" "2024-03-20" "util\-linux 2.40" "User Commands" +.TH "RENAME" "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/misc-utils/uuidd.8 b/misc-utils/uuidd.8 index 082ffee..8d98a2b 100644 --- a/misc-utils/uuidd.8 +++ b/misc-utils/uuidd.8 @@ -2,12 +2,12 @@ .\" Title: uuidd .\" 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 "UUIDD" "8" "2024-03-20" "util\-linux 2.40" "System Administration" +.TH "UUIDD" "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/misc-utils/uuidd.8.adoc b/misc-utils/uuidd.8.adoc index c1c6625..16b4e90 100644 --- a/misc-utils/uuidd.8.adoc +++ b/misc-utils/uuidd.8.adoc @@ -1,7 +1,7 @@ //po4a: entry man manual //// Copyright 2007 by Theodore Ts'o. All Rights Reserved. -This file may be copied under the terms of the GNU Public License. +This file may be copied under the terms of the GNU General Public License. //// = uuidd(8) :doctype: manpage diff --git a/misc-utils/uuidgen.1 b/misc-utils/uuidgen.1 index 4987f6d..4af29e7 100644 --- a/misc-utils/uuidgen.1 +++ b/misc-utils/uuidgen.1 @@ -2,12 +2,12 @@ .\" Title: uuidgen .\" 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 "UUIDGEN" "1" "2024-03-20" "util\-linux 2.40" "User Commands" +.TH "UUIDGEN" "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/misc-utils/uuidgen.1.adoc b/misc-utils/uuidgen.1.adoc index e1d2cae..659a780 100644 --- a/misc-utils/uuidgen.1.adoc +++ b/misc-utils/uuidgen.1.adoc @@ -1,7 +1,7 @@ //po4a: entry man manual //// Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca) -This file may be copied under the terms of the GNU Public License. +This file may be copied under the terms of the GNU General Public License. //// = uuidgen(1) :doctype: manpage diff --git a/misc-utils/uuidparse.1 b/misc-utils/uuidparse.1 index 25e93d5..e73c32f 100644 --- a/misc-utils/uuidparse.1 +++ b/misc-utils/uuidparse.1 @@ -2,12 +2,12 @@ .\" Title: uuidparse .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-01-31 +.\" Date: 2024-04-24 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "UUIDPARSE" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "UUIDPARSE" "1" "2024-04-24" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/waitpid.1 b/misc-utils/waitpid.1 index 8dca30d..6c18aea 100644 --- a/misc-utils/waitpid.1 +++ b/misc-utils/waitpid.1 @@ -2,12 +2,12 @@ .\" Title: waitpid .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-01-31 +.\" Date: 2024-04-24 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "WAITPID" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "WAITPID" "1" "2024-04-24" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/waitpid.c b/misc-utils/waitpid.c index 0a4e03d..4d77e1d 100644 --- a/misc-utils/waitpid.c +++ b/misc-utils/waitpid.c @@ -236,7 +236,7 @@ int main(int argc, char **argv) if (count && count > n_pids) errx(EXIT_FAILURE, - _("can't want for %zu of %zu PIDs"), count, n_pids); + _("can't wait for %zu of %zu PIDs"), count, n_pids); pid_t *pids = parse_pids(argc - pid_idx, argv + pid_idx); diff --git a/misc-utils/whereis.1 b/misc-utils/whereis.1 index 005f40b..d64e621 100644 --- a/misc-utils/whereis.1 +++ b/misc-utils/whereis.1 @@ -2,12 +2,12 @@ .\" Title: whereis .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2024-01-31 +.\" Date: 2024-04-24 .\" Manual: User Commands -.\" Source: util-linux 2.40 +.\" Source: util-linux 2.40.1 .\" Language: English .\" -.TH "WHEREIS" "1" "2024-01-31" "util\-linux 2.40" "User Commands" +.TH "WHEREIS" "1" "2024-04-24" "util\-linux 2.40.1" "User Commands" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 diff --git a/misc-utils/wipefs.8 b/misc-utils/wipefs.8 index 50ff2ad..4f967c2 100644 --- a/misc-utils/wipefs.8 +++ b/misc-utils/wipefs.8 @@ -2,12 +2,12 @@ .\" Title: wipefs .\" 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 "WIPEFS" "8" "2024-03-20" "util\-linux 2.40" "System Administration" +.TH "WIPEFS" "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/misc-utils/wipefs.8.adoc b/misc-utils/wipefs.8.adoc index 184c723..886ddb6 100644 --- a/misc-utils/wipefs.8.adoc +++ b/misc-utils/wipefs.8.adoc @@ -1,6 +1,6 @@ //po4a: entry man manual // Copyright 2009 by Karel Zak. All Rights Reserved. -// This file may be copied under the terms of the GNU Public License. +// This file may be copied under the terms of the GNU General Public License. = wipefs(8) :doctype: manpage :man manual: System Administration |