default file/directory permission and owner

Please post here if you have problems in using Wing FTP Server.
Post Reply
chsfam
Posts: 1
Joined: Thu Jan 28, 2010 1:20 pm

default file/directory permission and owner

Post by chsfam »

I am trying to setup a wingftp server on Linux Redhat 5.4.

How can you change the permission and ownership when uploading files/creating directories?

The out-of-the box settings of wingftp is to create files with 666 and directories with 777 permission
and the owner of the files is root. With the owner "root" of the files I could somehow live, but the
world-writable part is pretty scary on a unix system.

As a workaround I have tried to use "Execute Program" with OnFileUploaded and OnDirCreated
to fix the permission/ownership. This works for OnFileUploaded but with OnDirCreated I don't
know how to pass the directory name to the external program.

Maybe there is a nice way to fix this problem.
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: default file/directory permission and owner

Post by FTP »

I think its our fault, we have not executed "chmod" after creating file/dir.
Next version will correct this bug, for creating files with 644 and directories with 755 permission.
mlesin
Posts: 3
Joined: Mon Nov 07, 2011 4:59 pm

Re: default file/directory permission and owner

Post by mlesin »

Is there any possibility to set default chmod?
I'd like to use 664 and 775 instead of default's 644 and 755 but can't find any way to do this...
I need it to be able for users of some group to be able to read/write files to ftp's subfolders using nfs mount
For a default group I have found a solution to set a sticky bit on root folder, and later all files and subfolders are created with the same group, but for permissions it doesn't work...
Last edited by mlesin on Tue Nov 08, 2011 11:03 am, edited 1 time in total.
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: default file/directory permission and owner

Post by FTP »

You can use a simple lua script for the event OnFileUploaded:

Code: Select all

os.execute("chmod 664 '%PathName' ")
mlesin
Posts: 3
Joined: Mon Nov 07, 2011 4:59 pm

Re: default file/directory permission and owner

Post by mlesin »

it says events are not available in secure edition.
I think it's not that task when events are really needed, and purchasing a corporate edition just for that is like using a microscope as a hammer =)
I think it would be great to have some variable in preferences about default file rights (and possibly file owner/group)
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: default file/directory permission and owner

Post by FTP »

OK, we will add a feature "Customized chmod permission" in the next release.
mlesin
Posts: 3
Joined: Mon Nov 07, 2011 4:59 pm

Re: default file/directory permission and owner

Post by mlesin »

is there any progress on this?
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: default file/directory permission and owner

Post by FTP »

Yes, we will add this feature in the version 4.0.6.
Post Reply