Subject: [665] fchown does not work!

From: Sze-Yao Ni <[email-masked]>
Date: Thu, 10 Nov 1994 18:24:57 +0800

Hi:

I have installed wu-ftpd-2.4 in our DEC3000/400 running OSF1 V1.3.
The problem is that the command in ftpaccess:
'upload	/ftp/root	/pub/upload/* yes jlay users 0640 dirs'
will lead to error message 'fchown: Not owner' when someone tries to 
upload a file into that directory.

I traced the problem, I found the error message comes from src/ftpd.c:
        if ((fchown(fdout, uid, gid)) < 0) {
            (void) seteuid(oldid);
            perror_reply(550, "fchown");
            return;
        }
, then I try to use lchown:
        if ((lchown(name, uid, gid)) < 0) {
            (void) seteuid(oldid);
            perror_reply(550, "lchown");
            return;
        }
and it works!
I do'nt know why, is that a known bug? Is it safe to use lchown?

::  S.-Y. Ni  (Sze4-Yao2 Ni2)
::  Institute of CSIE, National Central University, Chungli, Taiwan, R.O.C
::  Internet: [email-masked],  [email-masked]
::  Internet BBS: Neesy at bbs.ee.ncu.edu.tw