This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ncftp - works, but doesn't display any prompts


Richard Stanton wrote:
> 
> Ahah! I'd never have thought of that. If that's the second to last entry, it
> says "/c". Thanks. That must be it (but bash still seems to behave
> differently from ncftp - it seems to use the environment variable in
> preference to this setting).

Well, after looking at your cygcheck output, it appears that you have
things set up...consistently.  (I can't say *I'd* do it that way, but
whatever.

Corinna's right: the behavior you are seeing is caused by the home dir
setting in /etc/passwd.  From util.c:

First, use getpwuid(geteuid()) to obtain a pointer to the user's entry
in the passwd file.
If pwptr is NULL, then use the $HOME variable.
   If no $HOME variable, then use '/' -- but there 
   is other logic that prevents saving state info
   in the root directory.

If pwptr not NULL, then use the value of the homedir field in the passwd
file
   Again, there is logic that prevents saving 
   info in the / directory.

Basically, it seems that ncftp uses $HOME only if there is no passwd
entry.  Based on your description (I've done no testing), Bash *appears*
to use $HOME in preference to the passwd entry.  If that is true, then
IMO bash is wrong.

It really doesn't make sense to use the homedir field in the passwd
directory for anything other than "This is my homedir".  If you want
bash to deposit you in some directory other than your homedir, then put
the appropriate 'cd /c' command in your .bashrc.

> 
> I have this set in /etc/passwd so that when I log in using, say, ssh, I am
> put into my root directory. However, I'd prefer configuration files to be
> stored in c:\home, to get them out of the way. Is there no way to have the
> HOME environment variable override the entry in /etc/passwd for local
> logins? I guess there must be, since bash does it.

Do it the other way.  let $HOME and passwd both specify "/home".  Then,
everything will get stored into /home.  in /home/.bashrc, specify 'cd
/'.  (You can even get tricky and detect whether the login is local or
remote, and only cd / for remote logins....)

I don't think *this* particular problem is a bug.  You have reported two
other difficulties:
  1) no prompt
     this is a bug, and I have a fix. 
  2) wierd formatting when running 'open' command in ncftp.  I can't
reproduce this.

--Chuck

--Chuck

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]