zsh-workers
 help / color / mirror / code / Atom feed
* unknown user error
@ 2018-06-22 14:48 John, Michael
  2018-06-22 16:17 ` dana
  2018-06-22 16:20 ` Daniel Shahaf
  0 siblings, 2 replies; 5+ messages in thread
From: John, Michael @ 2018-06-22 14:48 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 470 bytes --]

Hello,

 

I'm trying to set my path but zsh gives be an unknown user error. I'm not
sure what's going on, never ran into this issue in the past.

 

$ export path=(/usr/local/bin /usr/local/sbin /usr/local/go/bin
/home/mjohn/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games
/usr/lib/jvm/java-8-oracle/bin/usr/lib/jvm/java-8-oracle/db/bin
/usr/lib/jvm/java-8-oracle/jre/bin)

zsh: unknown user

$ whoami

mjohn

 

Any ideas?

 

Thanks,

-Michael John

 


[-- Attachment #1.2: Type: text/html, Size: 3685 bytes --]

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5597 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: unknown user error
  2018-06-22 14:48 unknown user error John, Michael
@ 2018-06-22 16:17 ` dana
  2018-06-22 16:20 ` Daniel Shahaf
  1 sibling, 0 replies; 5+ messages in thread
From: dana @ 2018-06-22 16:17 UTC (permalink / raw)
  To: John, Michael; +Cc: zsh-workers

On 22 Jun 2018, at 09:48, John, Michael <Michael.John@Crown.com> wrote:
>I’m trying to set my path but zsh gives be an unknown user error. I’m not sure
>what’s going on, never ran into this issue in the past.
>
>$ export path=(/usr/local/bin ...)
>zsh: unknown user

Probably you're using an older version of zsh that doesn't have export as a
reserved word, and it's treating (/u...) as a glob qualifier. On those versions
of zsh, you need to do array declarations and assignments in two steps.

Also, i think Bart told me once that the result of exporting the array part of a
tied parameter is undefined (even though it does seem to work in this case), so
maybe it would be safer to use PATH for that:

  % path=(/usr/local/bin ...)
  % export PATH

dana


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: unknown user error
  2018-06-22 14:48 unknown user error John, Michael
  2018-06-22 16:17 ` dana
@ 2018-06-22 16:20 ` Daniel Shahaf
  2018-06-22 16:52   ` Bart Schaefer
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Shahaf @ 2018-06-22 16:20 UTC (permalink / raw)
  To: John, Michael, zsh-workers

[-- 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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: unknown user error
  2018-06-22 16:20 ` Daniel Shahaf
@ 2018-06-22 16:52   ` Bart Schaefer
  2018-06-22 19:46     ` Daniel Shahaf
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2018-06-22 16:52 UTC (permalink / raw)
  To: Daniel Shahaf; +Cc: zsh-workers

On Fri, Jun 22, 2018 at 9:20 AM, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>
> Let's expand that error message.  Patch attached.

Why make it "user: %s" in one ifdef-branch but "username '%s'" in the other?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: unknown user error
  2018-06-22 16:52   ` Bart Schaefer
@ 2018-06-22 19:46     ` Daniel Shahaf
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Shahaf @ 2018-06-22 19:46 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

Bart Schaefer wrote on Fri, 22 Jun 2018 09:52 -0700:
> On Fri, Jun 22, 2018 at 9:20 AM, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> >
> > Let's expand that error message.  Patch attached.
> 
> Why make it "user: %s" in one ifdef-branch but "username '%s'" in the other?

The #else branch says "username" because, in that preprocessor codepath,
the argument to the (u) globqual is resolvable if it's numeric (a uid)
but not if it's a username.

The #if branch says "user" because that's what it said before the patch.
I guess I'll change it unless someone sees a reason to preserve the
exact error message.

Cheers,

Daniel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-22 19:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-22 14:48 unknown user error John, Michael
2018-06-22 16:17 ` dana
2018-06-22 16:20 ` Daniel Shahaf
2018-06-22 16:52   ` Bart Schaefer
2018-06-22 19:46     ` Daniel Shahaf

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).