proftpd: use /bin/false as the login shell and add home-dir
PATCH v2 1/1 proftpd: use /bin/false as the login shell and add home-dir
From: Roy Li <[email protected]>
Use /bin/false as the login shell, just like what Ubuntu does, otherwise there might be secure issue; add /var/lib/ftp as user ftp home-dir.
Signed-off-by Roy Li <[email protected]>
--- .../files/close-RequireValidShell-check.patch | 27 ++++++++++++++++++++ .../recipes-daemons/proftpd/proftpd_1.3.4b.bb | 4 ++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch
meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch new file +27 -0
@@ -0,0 +1,27 @@ +close RequireValidShell check + +Upstream-Status: Inappropriate [configuration] + +close RequireValidShell check since we like to make /bin/false as shell +for ftp user + +Signed-off-by: Roy Li <[email protected]> +--- + sample-configurations/basic.conf | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sample-configurations/basic.conf b/sample-configurations/basic.conf +index 314eb79..abcb284 100644 +--- a/sample-configurations/basic.conf ++++ b/sample-configurations/basic.conf +@@ -53,6 +53,7 @@ AllowOverwrite on + # We want clients to be able to login with "anonymous" as well as "ftp" + UserAlias anonymous ftp + ++ RequireValidShell off + # Limit the maximum number of anonymous logins + MaxClients 10 + +-- +1.7.10.4 +
meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb +3 -1
@@ -13,6 +13,7 @@ SRC_URI = "ftp://ftp.proftpd.org/distrib/source/${BPN}-${PV}.tar.gz \ file://proftpd-basic.init \ file://default \ file://move-pidfile-to-var-run.patch \ + file://close-RequireValidShell-check.patch \ " SRC_URI[md5sum] = "0871e0b93c9c3c88ca950b6d9a04aed2"
@@ -62,6 +63,7 @@ INITSCRIPT_PARAM = "defaults 85 15" USERADD_PACKAGES = "${PN}" GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}" -USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} ${FTPUSER}" +USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \ + --shell /bin/false ${FTPUSER}" FILES_${PN} += "/home/${FTPUSER}"
Signature · 1 line
1.7.10.4
Joe MacDonald
AppliedMerged, thanks.
-J.
Quoted 67 lines · [[oe] [PATCH meta-networking v2] proftpd: use /bin/false as the login shell…
From: Roy Li <[email protected]>
Use
/bin/falseas the login shell, just like what Ubuntu does, otherwise there might be secure issue; add/var/lib/ftpas user ftp home-dir.Signed-off-by Roy Li <[email protected]>--- .../files/close-RequireValidShell-check.patch | 27 ++++++++++++++++++++ .../recipes-daemons/proftpd/proftpd_1.3.4b.bb | 4 ++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patchmeta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch new file +27
-0@@ -0,0 +1,27 @@ +close RequireValidShell check + +Upstream-Status: Inappropriate [configuration] + +close RequireValidShell check since we like to make /bin/false as shell +for ftp user + +Signed-off-by: Roy Li <[email protected]> +--- + sample-configurations/basic.conf | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sample-configurations/basic.conf b/sample-configurations/basic.conf +index 314eb79..abcb284 100644 +--- a/sample-configurations/basic.conf ++++ b/sample-configurations/basic.conf +@@ -53,6 +53,7 @@ AllowOverwrite on + # We want clients to be able to login with "anonymous" as well as "ftp" + UserAlias anonymous ftp + ++ RequireValidShell off + # Limit the maximum number of anonymous logins + MaxClients 10 + +-- +1.7.10.4 +meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb +3
-1@@ -13,6 +13,7 @@ SRC_URI = "ftp://ftp.proftpd.org/distrib/source/${BPN}-${PV}.tar.gz \ file://proftpd-basic.init \ file://default \ file://move-pidfile-to-var-run.patch \ + file://close-RequireValidShell-check.patch \ " SRC_URI[md5sum] = "0871e0b93c9c3c88ca950b6d9a04aed2"@@ -62,6 +63,7 @@ INITSCRIPT_PARAM = "defaults 85 15" USERADD_PACKAGES = "${PN}" GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}" -USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} ${FTPUSER}" +USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \ + --shell /bin/false ${FTPUSER}" FILES_${PN} += "/home/${FTPUSER}"
Signature · 2 lines
-Joe MacDonald. :wq