zsh-users
 help / color / mirror / code / Atom feed
* Named directory pointing to a symbolic link
@ 2005-10-24  4:04 Jean Chalard
  2005-10-24  8:21 ` DervishD
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jean Chalard @ 2005-10-24  4:04 UTC (permalink / raw)
  To: zsh-users

Hi zusers,

I've run into a behaviour I wasn't expecting with named directories on
FreeBSD. It's not like its a real inconvenience, but I thought I'd ask
anyway because I didn't find anything about this in the manual.

It seems to me like the 'www' variable (which ought to be unset when I
start the shell, it's not like it should be a special variable as far
as I understand) has a strange behaviour : it points on /nonexistent
when used as a named directory, and any attempt I do to have it point
elsewhere with the export builtin doesn't work when the variable is
used as a named directory, though it works when invoked as hash -d.
Other variable names don't seem to behave that way.

The script you see below is executed on a machine on which I installed
zsh in my user account, but I don't think it could be relevant because
I can reproduce it on another FreeBSD where zsh is installed the
vanilla way and where I don't have any configuration files. This
doesn't happen on the linux box I have my hands on at the moment,
where the www variable behaves exactly the same way as the foo
variable. It happens that I can't test on other systems I usually have
access to at the moment, sorry :/

To clarify what I mean :

> zsh/bin/zsh -f
mobdev% zsh/bin/zsh --version
zsh 4.2.5 (i386-unknown-freebsd4.11)
mobdev% uname -a
FreeBSD mobdev 4.11-STABLE FreeBSD 4.11-STABLE #1: Tue Feb 22 05:55:23 JST 2005
    root@:/usr/src/sys/compile/WDB  i386
mobdev% autoload -U parameters
mobdev% echo $nameddirs

mobdev% echo ~foo
zsh: no such user or named directory: foo
mobdev% echo $www

mobdev% echo ~www
/nonexistent
mobdev% export www=/usr
mobdev% echo $www
/usr
mobdev% echo ~www
/nonexistent
mobdev% hash -d www=/usr
mobdev% echo $www
/usr
mobdev% echo ~www
/usr
mobdev%

Does anyone have an idea of why this variable behaves that way ?

--
J
"Toi, je te trouve pas la même tête que sur la page précédente" -- Wakamiya

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

* Re: Named directory pointing to a symbolic link
  2005-10-24  4:04 Named directory pointing to a symbolic link Jean Chalard
@ 2005-10-24  8:21 ` DervishD
  2005-10-24  8:37   ` Jean Chalard
  2005-10-24  9:08 ` Peter Stephenson
  2005-10-24 14:48 ` Bart Schaefer
  2 siblings, 1 reply; 8+ messages in thread
From: DervishD @ 2005-10-24  8:21 UTC (permalink / raw)
  To: Jean Chalard; +Cc: zsh-users

    Hi Jean :)

 * Jean Chalard <jean.chalard@gmail.com> dixit:
> It seems to me like the 'www' variable (which ought to be unset
> when I start the shell, it's not like it should be a special
> variable as far as I understand) has a strange behaviour : it
> points on /nonexistent when used as a named directory, and any
> attempt I do to have it point elsewhere with the export builtin
> doesn't work when the variable is used as a named directory, though
> it works when invoked as hash -d. Other variable names don't seem
> to behave that way.

    I cannot reproduce under Linux, as you confirm in your next
paragraph. Have you took a look at any initial environment that
FreeBSD may be setting up, outside zsh RC's? I'm not familiar with
FreeBSD and I don't know how its "init" sets up initial environment,
that may be the problem. It is quite weird...

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...


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

* Re: Named directory pointing to a symbolic link
  2005-10-24  8:21 ` DervishD
@ 2005-10-24  8:37   ` Jean Chalard
  0 siblings, 0 replies; 8+ messages in thread
From: Jean Chalard @ 2005-10-24  8:37 UTC (permalink / raw)
  To: Jean Chalard, zsh-users

>  * Jean Chalard <jean.chalard@gmail.com> dixit:
> > It seems to me like the 'www' variable (which ought to be unset
> > when I start the shell, it's not like it should be a special
> > variable as far as I understand) has a strange behaviour : it
> > points on /nonexistent when used as a named directory, and any
> > attempt I do to have it point elsewhere with the export builtin
> > doesn't work when the variable is used as a named directory, though
> > it works when invoked as hash -d. Other variable names don't seem
> > to behave that way.
>
>     I cannot reproduce under Linux, as you confirm in your next
> paragraph. Have you took a look at any initial environment that
> FreeBSD may be setting up, outside zsh RC's? I'm not familiar with
> FreeBSD and I don't know how its "init" sets up initial environment,
> that may be the problem. It is quite weird...

I'm not that much familiar with it either ; all I can say for now is
that there doesn't seem to be any $www variable set at any moment (and
others shells agree with that), and I can see no reference to such a
variable in any of the startup scripts (the only occurence of the word
'www' being in the _webbrowser completer, in the command name : I
don't see why the shell would take that for a named directory).

--
J
"Toi, je te trouve pas la même tête que sur la page précédente" -- Wakamiya

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

* Re: Named directory pointing to a symbolic link
  2005-10-24  4:04 Named directory pointing to a symbolic link Jean Chalard
  2005-10-24  8:21 ` DervishD
@ 2005-10-24  9:08 ` Peter Stephenson
  2005-10-24  9:18   ` Jean Chalard
  2005-10-24 14:48 ` Bart Schaefer
  2 siblings, 1 reply; 8+ messages in thread
From: Peter Stephenson @ 2005-10-24  9:08 UTC (permalink / raw)
  To: zsh-users

Jean Chalard <jean.chalard@gmail.com> wrote:
> It seems to me like the 'www' variable (which ought to be unset when I
> start the shell, it's not like it should be a special variable as far
> as I understand) has a strange behaviour : it points on /nonexistent
> when used as a named directory, and any attempt I do to have it point
> elsewhere with the export builtin doesn't work when the variable is
> used as a named directory, though it works when invoked as hash -d.
> Other variable names don't seem to behave that way.

Do you have NIS (Yellow Pages) on your system?  I've seen some odd things
when trying to extract home directories from that which I've never tracked
down.


This message has been scanned for viruses by BlackSpider MailControl - www.blackspider.com


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

* Re: Named directory pointing to a symbolic link
  2005-10-24  9:08 ` Peter Stephenson
@ 2005-10-24  9:18   ` Jean Chalard
  0 siblings, 0 replies; 8+ messages in thread
From: Jean Chalard @ 2005-10-24  9:18 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: zsh-users

> > It seems to me like the 'www' variable (which ought to be unset when I
> > start the shell, it's not like it should be a special variable as far
> > as I understand) has a strange behaviour : it points on /nonexistent
> > when used as a named directory, and any attempt I do to have it point
> > elsewhere with the export builtin doesn't work when the variable is
> > used as a named directory, though it works when invoked as hash -d.
> > Other variable names don't seem to behave that way.
>
> Do you have NIS (Yellow Pages) on your system?  I've seen some odd things
> when trying to extract home directories from that which I've never tracked
> down.

I don't think so ; I'm not sure how to determine if it is in use or
not, but a quick glance at the man page makes me feel that if it was,
I should find a ypbind process on the machine, which I don't (or any
process that matches "| grep yp" for that matter), on any of the
machines I experience the problem with. So I guess the answer is 'no'.

--
J
"Toi, je te trouve pas la même tête que sur la page précédente" -- Wakamiya

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

* Re: Named directory pointing to a symbolic link
  2005-10-24  4:04 Named directory pointing to a symbolic link Jean Chalard
  2005-10-24  8:21 ` DervishD
  2005-10-24  9:08 ` Peter Stephenson
@ 2005-10-24 14:48 ` Bart Schaefer
  2005-10-24 22:36   ` Lloyd Zusman
  2005-10-25  2:51   ` Jean Chalard
  2 siblings, 2 replies; 8+ messages in thread
From: Bart Schaefer @ 2005-10-24 14:48 UTC (permalink / raw)
  To: Jean Chalard, zsh-users

On Oct 24,  1:04pm, Jean Chalard wrote:
}
} I've run into a behaviour I wasn't expecting with named directories on
} FreeBSD.  [...]
} 
} It seems to me like the 'www' variable (which ought to be unset when I
} start the shell, it's not like it should be a special variable [...]
} 
} I can reproduce it on another FreeBSD where zsh is installed the
} vanilla way and where I don't have any configuration files.

The most obvious answer is that there really is a user named "www";
perhaps the dummy user that runs the apache httpd or some such.  Have
you tried
	grep www /etc/passwd
??


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

* Re: Named directory pointing to a symbolic link
  2005-10-24 14:48 ` Bart Schaefer
@ 2005-10-24 22:36   ` Lloyd Zusman
  2005-10-25  2:51   ` Jean Chalard
  1 sibling, 0 replies; 8+ messages in thread
From: Lloyd Zusman @ 2005-10-24 22:36 UTC (permalink / raw)
  To: zsh-users

Bart Schaefer <schaefer@brasslantern.com> writes:

> On Oct 24,  1:04pm, Jean Chalard wrote:
> }
> } I've run into a behaviour I wasn't expecting with named directories on
> } FreeBSD.  [...]
> } 
> } It seems to me like the 'www' variable (which ought to be unset when I
> } start the shell, it's not like it should be a special variable [...]
> } 
> } I can reproduce it on another FreeBSD where zsh is installed the
> } vanilla way and where I don't have any configuration files.
>
> The most obvious answer is that there really is a user named "www";
> perhaps the dummy user that runs the apache httpd or some such.  Have
> you tried
> 	grep www /etc/passwd
> ??

This is almost certainly what's going on in your case, Jean.  On my
FreeBSD host, the default configuration for user ID's with no HOME
directory is to have the string "/nonexistent" in the "home_dir" field
of /etc/passwd.  For no login shell, the string "/nonexistent" goes into
the "shell" field.  To wit:

  % grep /nonexistent /etcpasswd
  ftp:*:14:5:Anonymous FTP Admin:/home/services/ftp:/nonexistent
  pop:*:68:6:Post Office Owner:/nonexistent:/sbin/nologin
  nobody:*:65534:65534:Unprivileged user:/nonexistent:/sbin/nologin

I wouldn't be surprised if the "www" user also has a "/nonexistent" HOME
in the default FreeBSD setup (I had manually changed my "www" user ages
ago).


-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.


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

* Re: Named directory pointing to a symbolic link
  2005-10-24 14:48 ` Bart Schaefer
  2005-10-24 22:36   ` Lloyd Zusman
@ 2005-10-25  2:51   ` Jean Chalard
  1 sibling, 0 replies; 8+ messages in thread
From: Jean Chalard @ 2005-10-25  2:51 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

> The most obvious answer is that there really is a user named "www";
> perhaps the dummy user that runs the apache httpd or some such.  Have
> you tried
> 	grep www /etc/passwd
> ??

Damn, it was so obvious. Yes, that's indeed the reason.

Thanks a lot. :)

--
J
"Toi, je te trouve pas la même tête que sur la page précédente" -- Wakamiya

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

end of thread, other threads:[~2005-10-25  2:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-24  4:04 Named directory pointing to a symbolic link Jean Chalard
2005-10-24  8:21 ` DervishD
2005-10-24  8:37   ` Jean Chalard
2005-10-24  9:08 ` Peter Stephenson
2005-10-24  9:18   ` Jean Chalard
2005-10-24 14:48 ` Bart Schaefer
2005-10-24 22:36   ` Lloyd Zusman
2005-10-25  2:51   ` Jean Chalard

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