From: Javi Barroso on 14 Jun 2010 07:22 On Jun 11, 2:00 am, Maxwell Lol <nos...(a)com.invalid> wrote: > > I know but I would like to know if that is a bash bug (so should I > > report it?) or not (because it is already known) > > If any process has a current directory that is deleted, then how can > it know where its current directory is? I don't known, but sure bash know, because if you do 'ls' files in that directory are showed. > > What do you expect it to answer? /root/to/parent # > > and if the current directory is unknown, what should ../ mean? Yes, but when you do cd .. and you are in '/' then bash should know about .. in '/' is '/' isn't it ? It is ugly have ../../../../../ # as current pwd, isn't it ? Regards,
From: Alan Curry on 14 Jun 2010 18:38 In article <feb294b1-fe93-42c8-92a2-89e84668614c(a)q12g2000yqj.googlegroups.com>, Javi Barroso <javibarroso(a)gmail.com> wrote: >On Jun 11, 2:00�am, Maxwell Lol <nos...(a)com.invalid> wrote: >> > I know but I would like to know if that is a bash bug (so should I >> > report it?) or not (because it is already known) >> >> If any process has a current directory that is deleted, then how can >> it know where its current directory is? >I don't known, but sure bash know, because if you do 'ls' files in >that directory are showed. If there are any files in a deleted directory, your filesystem is corrupted. unmount and fsck it as soon as possible. -- Alan Curry
From: Maxwell Lol on 14 Jun 2010 21:11 Javi Barroso <javibarroso(a)gmail.com> writes: > On Jun 11, 2:00 am, Maxwell Lol <nos...(a)com.invalid> wrote: >> > I know but I would like to know if that is a bash bug (so should I >> > report it?) or not (because it is already known) >> >> If any process has a current directory that is deleted, then how can >> it know where its current directory is? > I don't known, but sure bash know, because if you do 'ls' files in > that directory are showed. Then we are obviously not talking about the same thing. The only way to remove a directory is if the files in the directory are also removed. So I don't see how files can be listed when there aren't any. >> >> What do you expect it to answer? > /root/to/parent # First of all, if this is true, then the system has changed the current directory without you asking to change it. And when you type "touch filename" - what happens? Are you in the parent, or in the no-linger-existing directory? On my system, pwd does not change, and when I try to create a file, it says: touch: cannot touch `filename': No such file or directory This makes sense to me, as the directory does not exist. Having the system changing my currect directory does not. And since any process could remove a directory, this says that at any point in time, pwd will change without my knowledge or permission. I don;t believe computers should be non-deterministic. >> >> and if the current directory is unknown, what should ../ mean? > Yes, but when you do cd .. and you are in '/' then bash should know > about .. I don't understand your point. > in '/' is '/' isn't it ? It is ugly have ../../../../../ # > as current pwd, isn't it ? I don't understand. I've never seen this when I do a pwd.
From: Javi Barroso on 15 Jun 2010 02:30 On Jun 15, 12:38 am, pac...(a)kosh.dhis.org (Alan Curry) wrote: > In article <feb294b1-fe93-42c8-92a2-89e846686...(a)q12g2000yqj.googlegroups..com>, > Javi Barroso <javibarr...(a)gmail.com> wrote: > > >On Jun 11, 2:00 am, Maxwell Lol <nos...(a)com.invalid> wrote: > >> > I know but I would like to know if that is a bash bug (so should I > >> > report it?) or not (because it is already known) > > >> If any process has a current directory that is deleted, then how can > >> it know where its current directory is? > >I don't known, but sure bash know, because if you do 'ls' files in > >that directory are showed. > > If there are any files in a deleted directory, your filesystem is corrupted. > unmount and fsck it as soon as possible. Sorry, I wanted to say ls in parent directory, I'll reply last message with an example more
From: Javi Barroso on 15 Jun 2010 02:48 On Jun 15, 3:11 am, Maxwell Lol <nos...(a)com.invalid> wrote: > Javi Barroso <javibarr...(a)gmail.com> writes: > > On Jun 11, 2:00 am, Maxwell Lol <nos...(a)com.invalid> wrote: > >> > I know but I would like to know if that is a bash bug (so should I > >> > report it?) or not (because it is already known) > > >> If any process has a current directory that is deleted, then how can > >> it know where its current directory is? > > I don't known, but sure bash know, because if you do 'ls' files in > > that directory are showed. > > Then we are obviously not talking about the same thing. The only way > to remove a directory is if the files in the directory are also > removed. So I don't see how files can be listed when there aren't any. Sorry I wanted to say "in parent directory" > > >> What do you expect it to answer? > > /root/to/parent # > > First of all, if this is true, then the system has changed the > current directory without you asking to change it. I expect /root/to/parent # , after chdir .. command is executed > > And when you type "touch filename" - what happens? Are you in the > parent, or in the no-linger-existing directory? > > On my system, pwd does not change, and when I try to create a file, it > says: > > touch: cannot touch `filename': No such file or directory > > This makes sense to me, as the directory does not exist. Having the > system changing my currect directory does not. And since any process > could remove a directory, this says that at any point in time, pwd > will change without my knowledge or permission. Yes it make sense to me too > > I don;t believe computers should be non-deterministic. Of course > > > >> and if the current directory is unknown, what should ../ mean? > > Yes, but when you do cd .. and you are in '/' then bash should know > > about .. > > I don't understand your point. > > > in '/' is '/' isn't it ? It is ugly have ../../../../../ # > > as current pwd, isn't it ? > > I don't understand. I've never seen this when I do a pwd. You can see that in my example (in the first post) Please see this another example, where we can see bash knows about ../../x when current directory is deleted: $ mkdir test ; mkdir test/test2; cd test/test2/ ~/test/test2$ rmdir ../test2 ~/test/test2$ bash shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory ~/test/test2$ rmdir ../../test ~/test/test2$ ls ~/test* ls: cannot access /home/user/test*: No such file or directory So bash knows about parent directories But seems like something doesn't work like expected: ~/test/test2$ # continuing with the example ~/test/test2$ cd .. ...$ ls ...$ cd .. .../..$ ls # should I be here in ~ ? user1 user2 user3 ... userN Well, After all, Simply don't remove cwd, that is a stupid thing :-) Would this be more elegant if bash could change to a well known directory if cwd doesn't exist ? Regards,
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: setuid question - permission denied Next: Simple hack to get $500 to your home |