Subject: Re: 242b17 Sco3243 chown() problems

From: [email-masked]
Date: Mon, 29 Jun 1998 12:52:04 +0200

< still [email-masked] through foreign account >
< could be this will be sent as html or similar, I hope not. Sorry if this
is the case, I can't do anything about it, just hope it will be plain text
:-( >

> > - ftp (as any user) works, however any LIST command (dir, ls) will fail
> > on the server side
> The FAQ should shed some light on this.  Any messages in the system logs?

Where should I look in the Faq ? I found nothing relevant. Here is the
exact scenario:

The command

cat << EOF | ftp -dinvt
open 127.0.0.1
user root
<password>
dir
bye
EOF

gave me the output

Connected to 127.0.0.1.
220 scomx FTP server (Version wu-2.4.2-academ[BETA-17](5) Wed Jun 24
08:09:27 1998) ready.
---> SYST
215 UNIX Type: L8
Remote system type is UNIX.
---> TYPE I
200 Type set to I.
Using binary mode to transfer files.
---> USER root
331 Password required for root.
Password:
---> PASS <password>
230 User root logged in.
---> PORT 127,0,0,1,4,94
200 PORT command successful.
---> TYPE A
200 Type set to A.
---> LIST
150 Opening ASCII mode data connection for /bin/ls.
226 Transfer complete.
---> TYPE I
200 Type set to I.
---> QUIT
221 Goodbye.

while syslog gained these messages:

Jun 29 11:11:50 scomx ftpd[731]: ioctl SIOCSPGRP: Invalid argument
Jun 29 11:11:50 scomx ftpd[731]: <--- 220 scomx FTP server (Version
wu-2.4.2-academ[BETA-17](5) Wed Jun 24 08:09:27 1998) ready.
Jun 29 11:11:50 scomx ftpd[731]: command: SYST^M
Jun 29 11:11:50 scomx ftpd[731]: <--- 215 UNIX Type: L8
Jun 29 11:11:50 scomx ftpd[731]: command: TYPE I^M
Jun 29 11:11:50 scomx ftpd[731]: <--- 200 Type set to I.
Jun 29 11:11:50 scomx ftpd[731]: command: USER root^M
Jun 29 11:11:50 scomx ftpd[731]: <--- 331 Password required for root.
Jun 29 11:11:50 scomx ftpd[731]: USER root
Jun 29 11:11:52 scomx ftpd[731]: command: PASS password^M
Jun 29 11:11:52 scomx ftpd[731]: PASS password
Jun 29 11:11:52 scomx ftpd[731]: <--- 230 User root logged in.
Jun 29 11:11:52 scomx ftpd[731]: FTP LOGIN FROM localhost [127.0.0.1], root
Jun 29 11:11:52 scomx ftpd[731]: command: PORT 127,0,0,1,4,77^M
Jun 29 11:11:52 scomx ftpd[731]: PORT
Jun 29 11:11:52 scomx ftpd[731]: <--- 200 PORT command successful.
Jun 29 11:11:52 scomx ftpd[731]: command: TYPE A^M
Jun 29 11:11:52 scomx ftpd[731]: TYPE ASCII
Jun 29 11:11:52 scomx ftpd[731]: <--- 200 Type set to A.
Jun 29 11:11:52 scomx ftpd[731]: command: LIST^M
Jun 29 11:11:52 scomx ftpd[731]: LIST
Jun 29 11:11:52 scomx ftpd[731]: <--- 150 Opening ASCII mode data
connection for /bin/ls.
Jun 29 11:11:52 scomx ftpd[731]: <--- 226 Transfer complete.
Jun 29 11:11:52 scomx ftpd[731]: command: TYPE I^M
Jun 29 11:11:52 scomx ftpd[731]: TYPE Image
Jun 29 11:11:52 scomx ftpd[731]: <--- 200 Type set to I.
Jun 29 11:11:52 scomx ftpd[731]: command: QUIT^M
Jun 29 11:11:52 scomx ftpd[731]: QUIT
Jun 29 11:11:52 scomx ftpd[731]: <--- 221 Goodbye.
Jun 29 11:11:52 scomx ftpd[731]: FTP session closed

I have no way for debugging, trussing, *tracing here unfortunately, so I
don't know where exactly that ioctl error is occuring.

ls on this system is

-r-xr-xr-t   1 root     other      23674 Jun 25 14:30 /bin/ls

which seems pretty normal to me, note this was user root, no chrooted user.
Putting a small shell script in place of /bin/ls gave no results, as if
/bin/ls was not started.

[Just answering, newer info further on in this mail]

> > - Configured a user in a "guest" group. The manpages are pretty clear,
> > however I checked the Faq and the guest accounts how-to, too.
> > Connection is correct, che sessions seems to be chrooted to the anon
> > area, download works correctly, however upload gives "fchown: no such
> > file or directory", the file is created with 0 bytes but nothing more.
> Probably related to the same setup problem as the first issue.  Is the
> filesystem mounted via NFS or on a local drive?  This sounds like a
> possible NFS permissions problem.
Unfortunately, there is no nfs on that system.

> > #define fchown chown
> > there is no manpage for fchown on this box, only chown
> The #define says what the program calls fchown is chown on your system.
> Use the chown manpage.

In fact, this is what I supposed. However, I get

chown(S)              10 December 1991                  chown(S)

 Name

    chown - change owner and group of a  file

 Syntax

    cc ... -lc

    int   chown (path, owner, group)
    char*path;
    int   owner, group;

 Description

    path points     to a pathname naming a file.  The owner  ID and group
ID   of
    the   named file are set to the numeric values contained in owner and
group
    respectively.

while in ftpd.c, line 2102, fchown(fdout,... is called, which puzzled me.
In fact, a normal user has no problems, so I have no reason not to believe
you, just some reason to complain about that manpage :-(. But, /etc/passwd
mort:x:668:667:Test user for anon ftp:/u/ftp/./pub:/bin/true
/etc/group:
ftp:*:666:
ftponly:*:667:mort
ftpaccess contains:
class     anonimi anonymous        *
class   ospiti  guest              *
class   local   real,guest,anonymous     *

guestgroup ftponly
upload  /u/ftp  *             no
upload  /u/ftp  /pub          yes     root root 0600 nodirs
upload  /u/ftp  /bin          no
upload  /u/ftp  /dev          no
upload  /u/ftp  /etc          no
upload  /u/ftp  /shlib        no

In fact, while I wrote this, I noticed those upload settings again,
experimented a bit, and found that everything does work perfectly if I
remove the "root root 0600 nodirs" part, so after all it really is not a
library issue. Sorry for insisting, feel free to flame ;-) (at
[email-masked] please, not this account). Unfortunately I need that
feature.

NB ~ftp/etc/passwd:
root:x:0:1:Superuser::/bin/false
bin:x:2:2:Owner of system commands::/bin/false
ftp:x:666:666:Anonymous Ftp::/bin/false
anonymous:x:667:666:Anonymous Ftp::/bin/false
mort:x:668:667:Test user for anon ftp:/u/ftp/./pub:/bin/false

~ftp/etc/group:
root::0:
bin::2:bin,daemon
ftp:*:666:
ftponly:*:667:mort

I'm trying to build a system directly here where to compile and debug, any
idea what exactly I could look for ? What could cause that ioctl SIOCSPGRP:
Invalid argument, or for starting, where could it occur ?

Thanks

Heiko

---

From: Gregory A Lundberg <[email-masked]>
Date: Mon, 29 Jun 1998 08:07:34 -0400 (EDT)

On Mon, 29 Jun 1998 [email-masked] wrote:

> Where should I look in the Faq ?

Since this is _the_ most FAQ, your answer is there.  If you didn't see it,
you didn't RTFF.

You have not set up your ftp area correctly; either you're missing some
system files or your ~ftp/bin/ls command uses shared libraries and you'r
missing some of them. 

The location of the latest version of wu-ftpd can be found in the 
directory
 
      ftp://ftp.academ.com/pub/wu-ftpd/private/
 
You can't see the directory contents, so read the message informing you
of the actual filename to retrieve. It's there.
 
wu-ftpd Resource Center:  http://www.landfield.com/wu-ftpd/
wu-ftpd FAQ:              http://www.cetis.hvu.nl/~koos/wu-ftpd-faq.html
wu-ftpd list archive:     http://www.landfield.com/wu-ftpd/mail-archive/

----

Gregory A Lundberg		Senior Partner, VRnet Company
1441 Elmdale Drive              [email-masked]
Kettering, OH 45409-1615 USA    1-800-809-2195