Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: unknown user error



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.
From 35d5c64dbff1954f80a9039f6075ace9cec9bb9e Mon Sep 17 00:00:00 2001
From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
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)


Messages sorted by: Reverse Date, Date, Thread, Author