Operating System - HP-UX
1820592 Members
1882 Online
109626 Solutions
New Discussion юеВ

strange ftp list of files and directories

 
Xavier BLANC
Frequent Advisor

strange ftp list of files and directories

Hello
using ftp://user:pwd@myhpserver on the "window explorer" gives me a strange listing of files and directories. format is " date name" or "time name".
I'm HPUX B.11.23
no ftpaccess and so on configured. notice : LANG=fr_FR.iso88591
Regards
21 REPLIES 21
spex
Honored Contributor

Re: strange ftp list of files and directories

Hi,

To disable the FTP service, comment out the 'ftp' line in /etc/inetd.conf. Then restart inetd via '/usr/sbin/inetd -c'.

PCS
Peter Godron
Honored Contributor

Re: strange ftp list of files and directories

Hi,
if you use the right mouse button whilst hovering over the Name,Size toolbar you should be able to select the fields you want.
Xavier BLANC
Frequent Advisor

Re: strange ftp list of files and directories

Hello
Please note I need the ftp server.
I've already tried, to restart ftpd with inetd -c this doesn't change anything.
Please note that ftp work fine with command line and with client like "filezilla".

To clarify the situation here's an example of what I get under windows :
"!" to separate columns
name ! size !type ! Modified
09:36 test ! empty !dir ! 01/01/1980 - 12:00
2006 myfile! 2,88 Ko!file ! 01/01/1980 - 12:00

under unix :
test is : 14 sept 09:36
myfile is : 13 janv 2006

Hope this help you to help me ;-)
spex
Honored Contributor

Re: strange ftp list of files and directories

Hi Xavier,

What is your question exactly?

If you are wondering which file attributes are available to an FTP client, see the description of 'ls' from ftp(1):

ls [remote-directory] [local-file]
Write a listing of remote-directory to local-file. The listing includes any system-dependent information that the server chooses to include; for example, most UNIX systems produce output from the command ls -l (see also nlist). If neither remote-directory nor local-file is specified, list the remote working directory. If globbing is enabled, globbing metacharacters are expanded.

In other words, your client sees whichever attributes the FTP server allows it to see. However, this doesn't mean that your client reveals all those attributes to the end-user.

To get an idea of what different clients choose to display, open up a command line and manually 'ftp' to your server. Then issue 'ls'. Now FTP via Internet Explorer and compare results. Notice that, for instance, even though your server transmits each file's user and group, IE chooses not to display these data.

As a general rule, you are better off using a true FTP client (e.g. 'ftp', FileZilla, WS-FTP, CuteFTP, etc.) instead of a web browser.

Also notice that in IE, you can move attribute columns around by clicking on and dragging their headers.

PCS
Michal Toth
Regular Advisor

Re: strange ftp list of files and directories

hi Xavier,

do you get the same output from windows native ftp client.. try that one,.. run cmd.exe and then just ftp.. it behaves in the same way as standard cli ftp client.

Steven Schweda
Honored Contributor

Re: strange ftp list of files and directories

> LANG=fr_FR.iso88591

> test is : 14 sept 09:36
> myfile is : 13 janv 2006

The Windows FTP client is probably confused
by the four-character month names ("sept",
"janv"). Most FTP clients expect plain-old
English "ls -l" listings. Anything exotic
(like LANG=fr_FR.iso88591) will probably
defeat most of them.

I don't know how you could change the locale
for the FTP daemon, but I imagine that you
could write a short shell script which sets
LANG and then runs "ftpd", and then specify
the script in "/etc/inetd.conf" (or
wherever). Or, perhaps a more complex
command could be specified in
"/etc/inetd.conf" (like "LANG=xxx ftpd ...").
Or something like that.

Unless you really _wanted_ the FTP server
file listings to look French. In that case,
you may be doomed, but there could be some
smarter FTP client programs out there which
can handle a different date format.

Note that parsing the time-date information
in an "ls -l" file listing is complex enough
when the original "C" locale is used. I
don't know whether any FTP clients will
accept listings formatted for any other
locales.
Xavier BLANC
Frequent Advisor

Re: strange ftp list of files and directories

Thank you all for taking your time.
I'm sorry English language isn't my native language.
spex :
my question is around why "windows explorer" doesn't work well. It is not only a "display" problem. When you double-click on a directory the name is " date + name " instead of name so it "FAIL".


Some news
- running a script from inetd.conf doesn't seem to work , why ???? I don't know.
- if I do this
inetd -k
unset LANG
inetd -l
all come back ok

For those who don't understand the problem do this : inetd -k ; export LANG=fr_FR.iso88591; inetd -l
and ftp://yourlogin:password@yourserverIp from windows explorer adn you'll understand what I mean.

So now Here's few questions:
how can I unset LANG for ftpd ?
If I change /etc/rc.config.d/LANG that seems to be the default machine language what will it affect ?
Application used : xterm, telnet, sendmail, ftp(;), samba, cde, and other app with their own init var like databases

regards

Michal Toth
Regular Advisor

Re: strange ftp list of files and directories

inetd -k
export LANG=C
inetd -l

does this make any difference?
Xavier BLANC
Frequent Advisor

Re: strange ftp list of files and directories

Hello Michal
LANG=C and LANG=fr_FR.iso88591
have the same problem ... on my system.
Steven Schweda
Honored Contributor

Re: strange ftp list of files and directories

> - running a script from inetd.conf doesn't
> seem to work , why ???? I don't know.

What, exactly, did you do which didn't work?
Xavier BLANC
Frequent Advisor

Re: strange ftp list of files and directories

I try this :
create a script : /tmp/myftpd.sh
#myftpd.sh
unset LANG
/usr/lbin/ftpd -l
#end myftpd.sh

in inetd.conf I replace :
ftp stream tcp6 nowait root /usr/lbin/ftpd ftpd -l
with
ftp stream tcp6 nowait root /tmp/myftpd.sh ftpd -l

save and : inetd -c
from windows cmd, ftp myserverIp I get "server close connection".
If I add date > /tmp/mytrace in myftpd.sh, /tmp/mytrace is empty.
hum ... /tmp/myftpd.sh is 777 and root sys.



Steven Schweda
Honored Contributor

Re: strange ftp list of files and directories

I'd probably set the file ownership and
permissions on the script to equal the ones
on /usr/lbin/ftpd, but I don't know if that
would help.

I don't have an HP-UX system where I can
play with any of this stuff, so I probably
can't do much more for you. (I was just
exploring, trying to see if other forums were
working as badly as the Tru64 and VMS forums,
when your problem caught my eye.)
Michal Toth
Regular Advisor

Re: strange ftp list of files and directories

do I get it right that you are experiencing this issue only when using 'explorer.exe' as your ftp client and that other ftp clients work as expected on the same client machine?
Xavier BLANC
Frequent Advisor

Re: strange ftp list of files and directories

no problem steven.
you're right Michal. explorer and iexplore.
Michal Toth
Regular Advisor

Re: strange ftp list of files and directories

well that suggests that it's a client issue, not a server one

i'd consider posting this one to one of the microsoft forums (do they run any?) :-(
Steven Schweda
Honored Contributor

Re: strange ftp list of files and directories

> [...] it's a client issue [...]

Perhaps you can suggest an FTP client which
can parse the "LIST" output from this FTP
server when LANG is set this way.

I know of more than one client which can't do
it. If you don't know of one which can, then
it may make more sense to consider this
problem to be a problem with one server than
with every client.

(I run a VMS FTP server, and many FTP client
programs, especially ones from Microsoft,
can't deal with its "LIST" format, but some
can. I'd expect this to break down, however,
if I configured it to use a different
language.)
Michal Toth
Regular Advisor

Re: strange ftp list of files and directories

I know of more than one client which can't do
it. If you don't know of one which can, then
it may make more sense to consider this
problem to be a problem with one server than
with every client.


please read the thread carefully:

..Please note that ftp work fine with command line and with client like "filezilla". ..

Q: do I get it right that you are experiencing this issue only when using 'explorer.exe' as your ftp client and that other ftp clients work as expected on the same client machine?

A: you're right Michal. explorer and iexplore

so we definitely know which can. So you have a box, and three ftp clients from the same vendor and only one of those can properly understand ftp protocol. Furthermore you have other clients from other vendors that are confirmed to work. No, ftpd is really not the one to be blamed here.

Steven Schweda
Honored Contributor

Re: strange ftp list of files and directories

> ftp stream tcp6 nowait root /tmp/myftpd.sh ftpd -l

The comments in "/etc/inetd.conf" say:

[...]
# server program absolute pathname for the server inetd will
# execute
# server program args. arguments server program uses as they normally
# are starting with argv[0] which is the name of
# the server.
[...]

Thus there may be some confusion between
"myftpd.sh" and "ftpd". You might try
renaming the script to "/tmp/ftpd" (in real
life and in "/etc/inetd.conf").

Also, in the script, you could run the actual
ftpd using a line like:

/usr/lbin/ftpd "$@"

to pass the argument list ("-l") through to
the program instead of hard-coding the "-l"
in the script.
Xavier BLANC
Frequent Advisor

Re: strange ftp list of files and directories

Sorry I had problems accessing the itrc forum.

Ok It is solved.
Don't know if it's a clean solutions, but If it can help ...
create a script /tmp/ftpd.sh
#!/bin/sh
unset LANG
/usr/lbin/ftpd $*
# end script

chmod +x /tmp/ftpd.sh
chown bin:bin /tmp/ftpd.sh

edit inetd.conf
# inetd.conf : ftp stream tcp6 nowait root /tmp/ftpd.sh ftpd.sh
-l
then : inetd -c

best regards
Steven Schweda
Honored Contributor

Re: strange ftp list of files and directories

> Sorry I had problems accessing the itrc forum.

_Everyone_ has had problems accessing the
ITRC forums. For about a week, now. It's
not looking any better today, either.

> Ok It is solved. [...]

Clean or not, if it works, it works. And
it's easier than getting Microsoft to change
_their_ programs.

I would, however, get the script out of
"/tmp", where you're just begging someone to
delete the thing. I'd probably move it into
"/etc", but almost anywhere would be better
than "/tmp".
Xavier BLANC
Frequent Advisor

Re: strange ftp list of files and directories

Ok in reality, my script isn't in /tmp
;)
Thank you again
best regards