bug#44770: chown: warn when encountering deprecated dot separator

2022-02-24 Thread Paul Eggert

Thanks for the suggestion. I installed the attached patches to do that.From 320b3f8c96fc69670475c7a39d5818c5b4755912 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Thu, 24 Feb 2022 18:05:03 -0800
Subject: [PATCH 1/2] build: update gnulib submodule to latest

---
 gnulib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnulib b/gnulib
index 06b2e943b..23cca8268 16
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 06b2e943be39284783ff81ac6c9503200f41dba3
+Subproject commit 23cca8268d21f5d58ed0209002d5673d0518c426
-- 
2.35.1

From aac2a3cff4f94df899483da7963f4fc983c7c6b0 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Thu, 24 Feb 2022 18:17:23 -0800
Subject: [PATCH 2/2] chown: warn about USER.GROUP

Suggested by Dan Jacobson (Bug#44770).
* src/chown.c, src/chroot.c (main):
Issue warnings if obsolete USER.GROUP notation is present.
---
 NEWS   |  5 +
 doc/coreutils.texi |  3 ++-
 src/chown.c| 17 ++---
 src/chroot.c   |  9 +
 4 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/NEWS b/NEWS
index eec705b2f..af6596b06 100644
--- a/NEWS
+++ b/NEWS
@@ -51,6 +51,11 @@ GNU coreutils NEWS-*- outline -*-
   simple copies between regular files.  This may be more efficient, by avoiding
   user space copies, and possibly employing copy offloading or reflinking.
 
+  chown and chroot now warn about usages like "chown root.root f",
+  which have the nonstandard and long-obsolete "." separator that
+  causes problems on platforms where user names contain ".".
+  Applications should use ":" instead of ".".
+
   cksum no longer allows abbreviated algorithm names,
   so that forward compatibility and robustness is improved.
 
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 641680e11..e9be0993a 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -11318,7 +11318,8 @@ or group ID, then you may specify it with a leading @samp{+}.
 Some older scripts may still use @samp{.} in place of the @samp{:} separator.
 POSIX 1003.1-2001 (@pxref{Standards conformance}) does not
 require support for that, but for backward compatibility GNU
-@command{chown} supports @samp{.} so long as no ambiguity results.
+@command{chown} supports @samp{.} so long as no ambiguity results,
+although it issues a warning and support may be removed in future versions.
 New scripts should avoid the use of @samp{.} because it is not
 portable, and because it has undesirable results if the entire
 @var{owner@samp{.}group} happens to identify a user whose name
diff --git a/src/chown.c b/src/chown.c
index 329b0f4dc..07cc907a4 100644
--- a/src/chown.c
+++ b/src/chown.c
@@ -227,11 +227,12 @@ main (int argc, char **argv)
 
 case FROM_OPTION:
   {
-char const *e = parse_user_spec (optarg,
- &required_uid, &required_gid,
- NULL, NULL);
+bool warn;
+char const *e = parse_user_spec_warn (optarg,
+  &required_uid, &required_gid,
+  NULL, NULL, &warn);
 if (e)
-  die (EXIT_FAILURE, 0, "%s: %s", e, quote (optarg));
+  error (warn ? 0 : EXIT_FAILURE, 0, "%s: %s", e, quote (optarg));
 break;
   }
 
@@ -297,10 +298,12 @@ main (int argc, char **argv)
 }
   else
 {
-  char const *e = parse_user_spec (argv[optind], &uid, &gid,
-   &chopt.user_name, &chopt.group_name);
+  bool warn;
+  char const *e = parse_user_spec_warn (argv[optind], &uid, &gid,
+&chopt.user_name,
+&chopt.group_name, &warn);
   if (e)
-die (EXIT_FAILURE, 0, "%s: %s", e, quote (argv[optind]));
+error (warn ? 0 : EXIT_FAILURE, 0, "%s: %s", e, quote (argv[optind]));
 
   /* If a group is specified but no user, set the user name to the
  empty string so that diagnostics say "ownership :GROUP"
diff --git a/src/chroot.c b/src/chroot.c
index 1cd04300c..be9601304 100644
--- a/src/chroot.c
+++ b/src/chroot.c
@@ -354,10 +354,11 @@ main (int argc, char **argv)
  Diagnose any failures.  If any have failed, exit before execvp.  */
   if (userspec)
 {
-  char const *err = parse_user_spec (userspec, &uid, &gid, NULL, NULL);
-
-  if (err && uid_unset (uid) && gid_unset (gid))
-die (EXIT_CANCELED, errno, "%s", (err));
+  bool warn;
+  char const *err = parse_user_spec_warn (userspec, &uid, &gid,
+  NULL, NULL, &warn);
+  if (err)
+error (warn ? 0 : EXIT_CANCELED, 0, "%s", err);
 }
 
   /* If no gid is supplied or looked up, do so now.
-- 
2.35.1



bug#45648: `dd` seek/skip which way is up?

2022-02-24 Thread Pádraig Brady

On 22/02/2022 17:12, Paul Eggert wrote:

On 1/4/21 20:08, Paul Eggert wrote:

On 1/4/21 7:44 PM, Bela Lubkin wrote:

TLDR: *huge* existing presence of 'iseek' and 'oseek'; most OSes document
them as pure synonyms for 'skip' and 'seek'.


Thanks for doing all that research. It's compelling, and I think your
patch (or something like it) should go in. I'll wait for a bit to hear
other opinions.


After thinking about the patch a bit more, let's omit the part about
adding new conversions iseek_bytes etc., as I think there's a better way
to address that issue. I proposed something in .

So instead of your patch, I installed the attached patches. The first
one adds the iseek and oseek operands that you suggested; the second one
clarifies dd documentation, as I found several things were confusing
when rereading it carefully. Something like these patches should appear
in the next coreutils release.


+1

The aliases are useful.
I always remembered it like skIp for Input,
but that is awkward.

As for the overlap in solaris with disabling reading,
I think that would be better as a flag, like "seek_only",
if deemed useful.

thanks,
Pádraig





bug#46808: Man page of "tail"

2022-02-24 Thread Brendan O'Dea
On Thu, Feb 24, 2022 at 12:02:55AM +0100, Andreas Schwab wrote:
>On Feb 27 2021, Reuti wrote:
>
>> I'm not a `groff` expert, but the sequence "\,some-text\/" appears a couple 
>> of times. What effect does it have for the formatting as the "," and "/" are 
>> not output?
>
>\, and \/ add some space as italic correction, see (groff) Ligatures and
>Kerning.

https://www.gnu.org/software/groff/manual/html_node/Ligatures-and-Kerning.html

Note that these escapes are a no-op when manual pages are formatted for
a terminal (e.g. running "man tail" and viewing the output in a pager).

They are added to improve output rendered for printing (ps, pdf, dvi,
etc):

  man -t tail | lpr -Pps
  man -Tpdf tail >tail.1.pdf

As Paul noted, those escapes and other formatting are added by help2man,
using a heuristic which mostly works, but seems a bit hit and miss with
some of the tail flags: "--bytes=[+]NUM" as you identified doesn't fare
well.  Compare to ls flags "--block-size=SIZE" and "--color[=WHEN]".

I'll take a look to see if I can do something to handle tail's output
better.

--bod