Page 1 of 1

default file/directory permission and owner

Posted: Thu Jan 28, 2010 1:47 pm
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.

Re: default file/directory permission and owner

Posted: Thu Jan 28, 2010 5:47 pm
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.

Re: default file/directory permission and owner

Posted: Mon Nov 07, 2011 5:04 pm
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...

Re: default file/directory permission and owner

Posted: Mon Nov 07, 2011 5:12 pm
by FTP
You can use a simple lua script for the event OnFileUploaded:

Code: Select all

os.execute("chmod 664 '%PathName' ")

Re: default file/directory permission and owner

Posted: Tue Nov 08, 2011 11:01 am
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)

Re: default file/directory permission and owner

Posted: Tue Nov 08, 2011 4:37 pm
by FTP
OK, we will add a feature "Customized chmod permission" in the next release.

Re: default file/directory permission and owner

Posted: Wed Apr 18, 2012 10:36 am
by mlesin
is there any progress on this?

Re: default file/directory permission and owner

Posted: Fri Apr 20, 2012 10:15 am
by FTP
Yes, we will add this feature in the version 4.0.6.