zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: "John, Michael" <Michael.John@Crown.com>, zsh-workers@zsh.org
Subject: Re: unknown user error
Date: Fri, 22 Jun 2018 16:20:55 +0000	[thread overview]
Message-ID: <1529684455.1249728.1417132120.58CBE195@webmail.messagingengine.com> (raw)
In-Reply-To: <BYAPR07MB464776FCD03668F17DBBA59598750@BYAPR07MB4647.namprd07.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 232 bytes --]

John, Michael wrote on Fri, 22 Jun 2018 14:48 +0000:
> $ export path=(/usr/local/bin /usr/local/sbin /usr/local/go/bin [...] /usr/lib/jvm/java-8-oracle/jre/bin)
> zsh: unknown user

Let's expand that error message.  Patch attached.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-In-the-u-glob-qualifier-expand-and-correct-unknown-u.patch --]
[-- Type: text/x-patch; name="0001-In-the-u-glob-qualifier-expand-and-correct-unknown-u.patch", Size: 948 bytes --]

From 35d5c64dbff1954f80a9039f6075ace9cec9bb9e Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@daniel.shahaf.name>
Date: Fri, 22 Jun 2018 16:19:46 +0000
Subject: [PATCH] In the (u) glob qualifier, expand and correct "unknown user"
 error messages.

---
 Src/glob.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Src/glob.c b/Src/glob.c
index 66a95329f..eb4b1ea17 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -1455,13 +1455,15 @@ zglob(LinkList list, LinkNode np, int nountok)
 			    if ((pw = getpwnam(s + arglen)))
 				data = pw->pw_uid;
 			    else {
-				zerr("unknown user");
+				zerr("unknown user: %s", s + arglen);
 				data = 0;
 			    }
 			    *tt = sav;
 #else /* !USE_GETPWNAM */
 			    sav = *tt;
-			    zerr("unknown user");
+			    *tt = '\0';
+			    zerr("unable to resolve non-numeric username '%s'", s + arglen);
+			    *tt = sav;
 			    data = 0;
 #endif /* !USE_GETPWNAM */
 			    if (sav)

  parent reply	other threads:[~2018-06-22 16:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22 14:48 John, Michael
2018-06-22 16:17 ` dana
2018-06-22 16:20 ` Daniel Shahaf [this message]
2018-06-22 16:52   ` Bart Schaefer
2018-06-22 19:46     ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1529684455.1249728.1417132120.58CBE195@webmail.messagingengine.com \
    --to=d.s@daniel.shahaf.name \
    --cc=Michael.John@Crown.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).