default file/directory permission and owner

Please post here if you have problems in using Wing FTP Server.

default file/directory permission and owner

Postby chsfam » Thu Jan 28, 2010 1:47 pm

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.
chsfam
 
posts 1
 
joined Thu Jan 28, 2010 1:20 pm

Re: default file/directory permission and owner

Postby FTP » Thu Jan 28, 2010 5:47 pm

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.
FTP
Site Admin
 
posts 1212
 
joined Tue Sep 29, 2009 6:09 am

Re: default file/directory permission and owner

Postby mlesin » Mon Nov 07, 2011 5:04 pm

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.
mlesin
 
posts 3
 
joined Mon Nov 07, 2011 4:59 pm

Re: default file/directory permission and owner

Postby FTP » Mon Nov 07, 2011 5:12 pm

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

Code: Select all
os.execute("chmod 664 '%PathName' ")
FTP
Site Admin
 
posts 1212
 
joined Tue Sep 29, 2009 6:09 am

Re: default file/directory permission and owner

Postby mlesin » Tue Nov 08, 2011 11:01 am

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)
mlesin
 
posts 3
 
joined Mon Nov 07, 2011 4:59 pm

Re: default file/directory permission and owner

Postby FTP » Tue Nov 08, 2011 4:37 pm

OK, we will add a feature "Customized chmod permission" in the next release.
FTP
Site Admin
 
posts 1212
 
joined Tue Sep 29, 2009 6:09 am

Re: default file/directory permission and owner

Postby mlesin » Wed Apr 18, 2012 10:36 am

is there any progress on this?
mlesin
 
posts 3
 
joined Mon Nov 07, 2011 4:59 pm

Re: default file/directory permission and owner

Postby FTP » Fri Apr 20, 2012 10:15 am

Yes, we will add this feature in the version 4.0.6.
FTP
Site Admin
 
posts 1212
 
joined Tue Sep 29, 2009 6:09 am


Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron