diff mbox

[5/5] vsftpd: Allow for setting FTP_HOME through USE flag

Message ID 0a1f9a456cea4834cb1c645732c46323012d62c6.1396522190.git.christian.braunersorensen@prevas.dk
State Accepted
Delegated to: Esben Haabendal
Headers show

Commit Message

christian.braunersorensen@prevas.dk April 3, 2014, 10:53 a.m. UTC
From: Christian Sørensen <christian.braunersorensen@prevas.dk>

USE_ftp_home: Set to a dirname, to where the ftp has to be.

Signed-off-by: Christian Sørensen <christian.braunersorensen@prevas.dk>
---
 recipes/vsftpd/files/passwd | 2 +-
 recipes/vsftpd/vsftpd.inc   | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Esben Haabendal April 14, 2014, 7:48 a.m. UTC | #1
Merged to master, thanks.

/Esben
diff mbox

Patch

diff --git a/recipes/vsftpd/files/passwd b/recipes/vsftpd/files/passwd
index 4ddc3c7..49aa493 100644
--- a/recipes/vsftpd/files/passwd
+++ b/recipes/vsftpd/files/passwd
@@ -1,2 +1,2 @@ 
-ftp:*:75:75::/home/ftp:/bin/false
+ftp:*:75:75::PLACEHOLDER_FTP_HOME:/bin/false
 nobody:x:65534:65534:nobody:/nonexisting:/bin/sh
diff --git a/recipes/vsftpd/vsftpd.inc b/recipes/vsftpd/vsftpd.inc
index 8179e2e..b312422 100644
--- a/recipes/vsftpd/vsftpd.inc
+++ b/recipes/vsftpd/vsftpd.inc
@@ -54,6 +54,12 @@  do_install() {
     install -d ${D}${sysconfdir}/init.d/
     install -m 755 ${SRCDIR}/init ${D}${sysconfdir}/init.d/vsftpd
 }
+RECIPE_FLAGS += "ftp_home"
+DEFAULT_USE_ftp_home = "/home/ftp"
+do_install[postfuncs] += "do_install_set_ftp_home"
+do_install_set_ftp_home() {
+	sed -i -e "s|PLACEHOLDER_FTP_HOME|${USE_ftp_home}|" ${D}${sysconfdir}/passwd.d/${PN}.1
+}
 
 RECIPE_FLAGS += "vsftpd_sysvinit_start vsftpd_sysvinit_stop"
 DEFAULT_USE_vsftpd_sysvinit_start	= "20"