Operating System - HP-UX
1823063 Members
3197 Online
109645 Solutions
New Discussion юеВ

ftpaccess upload applies on files but not directories

 
Bard Selbekk
Occasional Advisor

ftpaccess upload applies on files but not directories

Hi, everyone!

I'm trying to configure restricted ftp on a HP-UX 11.0 server.

When I upload files, the permissions and ownerships works accordingly with the "upload" entry in my ftpaccess file. If i change the permissions in that file, the next ftp session picks up the changes. So, file-wise everything is ok.

But I'm not able to control the permissions or ownerships on creation of directories. Newly created directories are allways owned by user ext_usr and group ext_gr. And the permissions is allways drwxr-x---, no matter what i put in ftpaccess.

Some config info:

root@srv1:[~] grep ext_usr /etc/passwd
ext_usr:*:123:234::/home/ext_usr/./pub/:/usr/bin/false
root@srv1:[~] grep :234: /etc/group
ext_gr::234:LLadm
root@srv1:[~] grep ftponly /etc/group
ftponly::109:ext_usr
root@srv1:[~] grep '^ftp' /etc/inetd.conf
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -a /etc/ftpd/ftpaccess
root@srv1:[~] cat /etc/ftpd/ftpaccess
class local real,guest,anonymous *.domain 0.0.0.0
class remote real,guest,anonymous *
log transfers anonymous,real,guest
log commands real,guest
delete no anonymous,guest
overwrite no anonymous,guest
rename no anonymous,guest
chmod no anonymous,guest
umask no anonymous,guest
upload /home/ext_usr /pub yes ext_usr ext_gr 0660
upload /home/ext_usr /pub/* yes ext_usr ext_gr 0660
upload /home/ext_usr /pub/*/* yes ext_usr ext_gr 0660
path-filter guest /etc/pathmsg ^[-A-Za-z0-9_\.]*$ ^\. ^-
class gjester guest ftponly
guestgroup ftponly
root@srv1:[~]

Any help would be greatly appreciated.

-Bard
9 REPLIES 9
Jeff Schussele
Honored Contributor

Re: ftpaccess upload applies on files but not directories

Hi Bard,

Have you tried inserting the dirs argument at the end of the upload line? Example...

upload /home/ext_usr /pub yes ext_usr ext_gr 0660 dirs

Not sure if that will change the perms, but nodirs will disallow the mkdir command & I guess it's possible that explicitly stating the arg may change the default dir umask - but I've not tested this.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Christopher Caldwell
Honored Contributor

Re: ftpaccess upload applies on files but not directories

For mode, use the d_mode option which follows the dirs/nodirs clause.

See:
http://www.wuftpd.org/man/ftpaccess.html

For owner, use normal sticky bit settings on the directory.
Bard Selbekk
Occasional Advisor

Re: ftpaccess upload applies on files but not directories

Hi, Jeff.
Yes I tried that, but with no luck.

Chris, the d_mode you refer to is not in the manual on my server. There seem to be a difference in the versions of ftpaccess on HP-UX 11.0 and the one in http://www.wuftpd.org/man/ftpaccess.html.

-Bard
Christopher Caldwell
Honored Contributor

Re: ftpaccess upload applies on files but not directories

Post the results of
$what /usr/lbin/ftpd
Bard Selbekk
Occasional Advisor

Re: ftpaccess upload applies on files but not directories

root@dht-dwk:[/] what /usr/lbin/ftpd
/usr/lbin/ftpd:
$Id: ftpd.c,v 1.22 1996/04/15 05:51:04 sob Exp sob $ based on ftpd.c 5.40 (Berkeley) 7/2/91
Copyright (c) 1985, 1988, 1990 Regents of the University of California.
$Id: ftpcmd.y,v 1.8 1996/03/15 06:26:20 sob Exp $ based on ftpcmd.y 5.24 (Berkeley) 2/25/91
Revision 1.1.214.8 Fri Apr 20 07:27:42 GMT 2001
$Id: glob.c,v 1.6 1996/03/16 04:00:06 sob Exp $ from glob.c 5.9 (Berkeley) 2/25/91
popen.c 5.9 (Berkeley) 2/25/91
$Id: logwtmp.c,v 1.7 1995/10/15 06:35:17 sob Exp $
logwtmp.c 5.7 (Berkeley) 2/25/91
$Id: access.c,v 1.8 1996/03/15 07:29:08 sob Exp $
$Id: extensions.c,v 1.16 1996/03/15 06:26:20 sob Exp $
$Id: realpath.c,v 1.7 1996/03/15 08:15:56 sob Exp $
$Id: private.c,v 1.6 1995/12/11 09:20:19 sob Exp $
root@dht-dwk:[/]


-Bard
Bard Selbekk
Occasional Advisor

Re: ftpaccess upload applies on files but not directories

Never mind the changed servername. I'ts the same server... :-)

-Bard
Christopher Caldwell
Honored Contributor

Re: ftpaccess upload applies on files but not directories

You're running an old version.

Install this:
http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=WUFTPD26

You might need to follow with patches if security is a concern.

The aforementioned commands will work once you're done.
Bard Selbekk
Occasional Advisor

Re: ftpaccess upload applies on files but not directories

Thanks for the reply. Sadly, an "Failed to complete transaction. Internal Error" appears when I try to download the package... :-(

-Bard
Bard Selbekk
Occasional Advisor

Re: ftpaccess upload applies on files but not directories

Ok, after a while I was able to download & install the upgrade.

But the new version ignores my upload directives completely.

-Bard