Subject: SunOS and VR13

From: Homer Wilson Smith <[email-masked]>
Date: Fri, 12 Feb 1999 22:12:28 -0500 (EST)

Running SunOS 4.1.4 ftp beta 18 VR 13.

    Can someone tell me why I am getting the following can't
find cwdir?

    Works like a champ in linux.

    Thanks  Homer

Script started on Fri Feb 12 22:09:34 1999
superoot majesty/root/bat: ftp majesty
Connected to majesty.lightlink.com.
220 majesty.lightlink.com FTP server (Version wu-2.4.2-academ[BETA-18-VR13](1) Wed Feb 10 17:29:35 EST 1999) ready.
Name (majesty:root): homer
331 Password required for homer.
Password:
230 User homer logged in.
ftp> ls
200 PORT command successful.
553 Could not determine cwdir: Invalid argument.
ftp> quit
150 Opening ASCII mode data connection for file list.
superoot majesty/root/bat: ^Dexit

script done on Fri Feb 12 22:09:51 1999

------------------------------------------------------------------------
Homer Wilson Smith     The paths of lovers    Art Matrix - Lightlink
(607) 277-0959               cross in         Internet Access, Ithaca NY
[email-masked]     the line of duty.     http://www.lightlink.com

---

From: Gregory A Lundberg <[email-masked]>
Date: Fri, 12 Feb 1999 23:28:09 -0500 (EST)

> 150 Opening ASCII mode data connection for file list.

I see two things going on here.

The first is serious if for no other reason than it caused the second. The
553/cwdir occurs only in upl_check() when, for some reason, the real
pathname of the current working directory could not be determined.  Start
by checking the consistency of the server when the user logs in; do a pwd
command immedeately: is it what you expected?  If not, correct the
_global_ (system)  /etc/passwd entry for the user and retest.  Do a cwd to
move to the user's home and another pwd: still correct?  No, correct the
_local_ (chroot'd) etc/passwd and retest.  If you still have a problem,
look for reasons why the root-user would not be able to determine the real
pathname of the current working directory.  This could be an NFS problem
(which I thought was fixed), or a symlink used in /etc/passwd which isn't
valid once we've chroot'd.  If you're still stumped, follow up to me and
we'll work through it off the list.

The second just shows what happens when a Turing Machine breaks down.  
The 150 appearing after the quit is because you're running a state-driven
client and it was confused by the 553 appearing where it did and the
daemon continuing on its way.  It occurs because somewhere in the
spaghetti code we call 'wu-ftpd' something didn't check a return status,
or did but didn't handle it properly.  I chase these down as they are
found.  I believe I already have a fix for this one, but I'll check to be
sure.

-- 

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

---

From: [email-masked] (KOJIMA Hajime)
Date: Mon, 15 Feb 1999 15:36:19 +0900

In <[email-masked]>,
Homer Wilson Smith wrote:
| 
|     Running SunOS 4.1.4 ftp beta 18 VR 13.
| 
|     Can someone tell me why I am getting the following can't
| find cwdir?
....
| ftp> ls
| 200 PORT command successful.
| 553 Could not determine cwdir: Invalid argument.

  This is a patch that I am using our SunOS 4.1.3_U1:

--- ./src/realpath.c.dist	Wed Feb 10 17:26:26 1999
+++ ./src/realpath.c	Wed Feb 10 17:26:51 1999
@@ -118,7 +118,11 @@
 	/* Save the starting point. */
 	errno = 0;
 #ifdef HAS_NO_FCHDIR
+#ifdef HAS_GETCWD
 	pcwd = getcwd(cwd, sizeof (cwd));
+#else
+	pcwd = getwd(cwd);
+#endif
 #else
 	fd = open(".", O_RDONLY);
 #endif

   And, if you execute C2conv, you must #define HAS_NO_FCHDIR in
   config.h.  

----
KOJIMA Hajime - Ryukoku University, Seta, Ootsu, Shiga, 520-2194 Japan
[Office] [email-masked], http://www.st.ryukoku.ac.jp/~kjm/