Subject: Re: Can't create data socket?

From: [email-masked] (Terry Shannon)
Date: Thu, 4 May 95 12:20:11 BST

>I have installed wu-ftpd 2.4 on an Sun running Solaris 2.4.  I have built an
>"ls"
>binary without shared libraries (the GNU ls) and I get the following error
>when I
>do an "ls" command:
>
>425 Can't create data socket (0.0.0.0,20): Bad file number.
>
>What in the world is wrong and how can I fix it?
>
>ctp
>-----

I'm fairly new to this so I'm going to give you all the info I have.  I had
the same problem at one time and it had to do with either directory
permissions or missing files in the directories.  Below is the directory
tree for an ftp directory (and any other user you want to set up).  Below
that there is the text you should put in a script to create zero and tcp in
the ~ftp/dev directory.  (This can be found with 'man ftpd').  Also note
the permissions on the files -- I'm told nothing should be owned by ftp (or
any other user).  I'm taking it that you know how to create the link file
~ftp/usr/bin.  Some people put passwd etc. in ~ftp/etc but I don't need it.
I hope this isn't overkill and I hope I'm not insulting anyone's
intelligence but, as I say, I'm new to this and this is the kind of info I
could have done with.

total 14
-rw-r--r--   1 root     other        194 May  1 10:11 welcome.msg
dr-xr-xr-x   3 root     other        512 Jan 27 15:37 usr
drwxrwxr-x   2 root     staff        512 Apr 26 16:48 pub
drwx-wx-wx   2 root     other        512 May  1 10:12 incoming
d--x--x--x   2 root     other        512 Apr 27 09:43 etc
dr-xr-xr-x   2 root     other        512 Jan 30 12:03 dev
d--x--x--x   2 root     other        512 Jan 27 11:03 bin

./usr:
total 4
dr-xr-xr-x   2 root     other        512 Mar 30 12:00 lib
lrwxrwxrwx   1 root     other          3 Jan 27 15:37 bin -> bin

./usr/lib:
total 1386
-rwxr-xr-x   1 root     other      31248 Jan 27 14:57 libw.so.1
-rwxr-xr-x   1 root     other      14508 Jan 27 14:57 libintl.so.1
-rwxr-xr-x   1 root     other       4776 Mar 30 12:00 libdl.so.1
-rwxr-xr-x   1 root     other     546860 Mar 30 12:00 libc.so.1
-rwxr-xr-x   1 root     other      74476 Mar 30 11:59 ld.so.1
-rwxr-xr-x   1 root     other      24576 Mar 30 12:00 ld.so
-rw-r--r--   1 root     other         62 Jan 30 12:01 README

./pub:

./incoming:

./etc:

./dev:
total 4
crw-rw-rw-   1 root     other     13, 12 Jan 27 14:15 zero
crw-rw-rw-   1 root     other     11, 42 Jan 27 14:15 tcp
-rw-r--r--   1 root     other        464 Jan 27 14:15 devscript
-rw-r--r--   1 root     other         45 Jan 30 12:03 README

./bin:
total 40
---x--x--x   1 root     other      19896 Jan 27 11:03 ls

The script for creating zero and tcp in ~ftp/dev.  Note that you should
change <user name> to the name of the user (e.g. ftp or guest or whatever)
because the script looks up the directory in the passwd file.

                 FTP="`grep <user name>: /etc/passwd | cut -d: -f6`"
                 MAJORMINOR="`ls -lL /dev/tcp | nawk '{ gsub(/,/,
                 ""); print $5, $6}'`"
                 mknod $FTP/dev/tcp c $MAJORMINOR
                 chmod 666 $FTP/dev/tcp

               MAJORMINOR="`ls  -lL   /dev/zero   |   nawk   '{
                 gsub(/,/, ""); print $5, $6}'`"
                 mknod $FTP/dev/zero c $MAJORMINOR
                 chmod 666 $FTP/dev/zero

---

From: [email-masked] (J.J.Bailey)
Date: Thu, 4 May 1995 08:05:49 -0700 (PDT)

>                  mknod $FTP/dev/zero c $MAJORMINOR

Hmm...  Try this instead:

# cd /
# ls dev/tcp dev/zero | cpio -pdvm ~ftp

-- 
J.J.Bailey
Consultant
[email-masked]