Batland



Home
GeneralNewsPerlProFTPd
Archives

Batland's Code
Batland's Photos

Login
May
30
Patch for proftpd: New Option for CreateHome to specify a UID

Hi,

I just added a patch for proftpd to extend the functionality of the CreateHome directive. My problem was that the home directory should not be created with the owner being the ftp user, because this can lead to several problems in some deployment scenarios. Basically it boils down to this: Several
users share the same home directory and they shall be able to read each
others files, but a user shall only be able able to delete it's own
files. Currently the owner of the directory can delete all files, even though the sticky bit is set, because the
user who first logs on will own the directory and, therefore, be able to
delete all files, regarding of the files' permissions.
Therefore, I needed a way to automatically create the home directory while being able to specify the owner.

So I added a new option to the CreateHome directive. The option is called homeuid and can be used as follows:

CreateHome on homeuid UID
So when the home directory is created the owner of the directory is set to UID. This option can be used with all the other officially supported options. For example,  assume the directory /ftp already exists and the home directory of the new user is set to /ftp/foobar/new, the following directive:
CreateHome on mode 755 uid 150 gid ~ homeuid 10000
will result in creating the following directories:
  • /ftp/foobar being owned by UID 150 and GID being the new user's group.
  • /ftp/foobar/new is owned by UID 10000 and GID of the new user's group.

The patch for mod_auth.c and mkhome.c can be found here. I'll submit this to the official proftpd project during the next couple of days. I'll inform you if the patch is accepted or not.

Bye,
Dennis

Posted by: DP

Comments Feb
28
christian louboutin wrote:

keep up your work.

Add Comment  


« Newer items | Older items »
Impressum | RSS | Powered by NucleusCMS | Ported by VinhBoy | Designed by DemusDesign