vsftpd: Add build option to disable utmpx update code
PATCH 1/1 vsftpd: Add build option to disable utmpx update code
This was modeled after a similar option for Dropbear.
The utmpx code is automatically disabled when compiling with musl, to avoid a build error due to WTMPX_FILE being undefined. Note that musl has an empty utmpx implementation, so no functionality is lost by not calling it.
---
Note that previously the utmpx code was being built, so this patch changes the default behavior. I think this is not a problem because most systems would not have a valid utmpx file, but it might be worth mentioning in the release notes.
package/vsftpd/Config.in | 12 ++++++ package/vsftpd/vsftpd-0001-utmpx-builddef.patch | 49 +++++++++++++++++++++++++ package/vsftpd/vsftpd.mk | 8 ++++ 3 files changed, 69 insertions(+) create mode 100644 package/vsftpd/vsftpd-0001-utmpx-builddef.patch
package/vsftpd/Config.in +12 -0
@@ -4,3 +4,15 @@ config BR2_PACKAGE_VSFTPD help vsftpd is an ftp daemon written with security in mind. http://vsftpd.beasts.org/ + +if BR2_PACKAGE_VSFTPD + +config BR2_PACKAGE_VSFTPD_UTMPX + bool "log vsftpd access to utmpx" + # musl 1.1.4 has an empty utmpx implementation and no WTMPX_FILE + depends on !BR2_TOOLCHAIN_USES_MUSL + help + Enable logging of vsftpd access to utmpx. + Note that Buildroot does not generate utmpx by default. + +endif
package/vsftpd/vsftpd-0001-utmpx-builddef.patch new file +49 -0
49 lines not on this page · raw message
package/vsftpd/vsftpd.mk +8 -0
@@ -10,10 +10,18 @@ VSFTPD_LIBS = -lcrypt VSFTPD_LICENSE = GPLv2 VSFTPD_LICENSE_FILES = COPYING +define VSFTPD_DISABLE_UTMPX + $(SED) 's/.*VSF_BUILD_UTMPX/#undef VSF_BUILD_UTMPX/' $(@D)/builddefs.h +endef + define VSFTPD_ENABLE_SSL $(SED) 's/.*VSF_BUILD_SSL/#define VSF_BUILD_SSL/' $(@D)/builddefs.h endef +ifneq ($(BR2_PACKAGE_VSFTPD_UTMPX),y) +VSFTPD_POST_CONFIGURE_HOOKS += VSFTPD_DISABLE_UTMPX +endif + ifeq ($(BR2_PACKAGE_OPENSSL),y) VSFTPD_DEPENDENCIES += openssl VSFTPD_LIBS += -lssl -lcrypto
Signature · 1 line
1.8.4.5
PATCH 1/1 vsftpd: Add build option to disable utmpx update code
Dear Maarten ter Huurne,
Quoted 4 lines · Maarten ter Huurne
This was modeled after a similar option for Dropbear.
The utmpx code is automatically disabled when compiling with musl, to avoid a build error due to
WTMPX_FILEbeing undefined.
I find this explanation unclear: when you say "is", I assume it's *before* this patch is applied, but my understanding is that you mean *once* the patch is applied, correct?
Quoted 10 lines
Note that
musl has an empty utmpx implementation, so no functionality is lost by not calling it.Signed-off-by Maarten ter Huurne <[email protected]>---
Note that previously the utmpx code was being built, so this patch changes the default behavior. I think this is not a problem because most systems would not have a valid utmpx file, but it might be worth mentioning in the release notes.
Then instead of adding yet another new option, what about simply disabling the utmpx support in vsftpd.mk when the C library is musl, and keep it enabled otherwise?
Quoted 6 lines
package/vsftpd/Config.in | 12 ++++++ package/vsftpd/vsftpd-0001-utmpx-builddef.patch | 49 +++++++++++++++++++++++++ package/vsftpd/vsftpd.mk | 8 ++++ 3 files changed, 69 insertions(+) create mode 100644 package/vsftpd/vsftpd-0001-utmpx-builddef.patch
Have you submitted vsftpd-0001-utmpx-builddef.patch upstream? It's kind of a feature patch, so something we _generally_ don't like to take in Buildroot.
Thanks,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 vsftpd: Add build option to disable utmpx update code
Quoted 11 lines · On Sunday 05 October 2014 23:46:37 Thomas Petazzoni wrote:
Dear Maarten ter Huurne,
Quoted 4 lines · Maarten ter Huurne
This was modeled after a similar option for Dropbear.
The utmpx code is automatically disabled when compiling with musl, to avoid a build error due to
WTMPX_FILEbeing undefined.I find this explanation unclear: when you say "is", I assume it's *before* this patch is applied, but my understanding is that you mean *once* the patch is applied, correct?
Correct. It describes the behavior that this patch introduces in package/vsftpd/Config.in, for which there is no "before". But it is not clear that it applies only to that part of the changes: if you look at the vsftpd package as a whole, then it could indeed be misinterpreted as describing the previous situation. I will rephrase it if the other parts of the patch are accepted.
Quoted 11 lines
Quoted 10 lines
Note that
musl has an empty utmpx implementation, so no functionality is lost by not calling it.Signed-off-by Maarten ter Huurne <[email protected]>---
Note that previously the utmpx code was being built, so this patch changes the default behavior. I think this is not a problem because most systems would not have a valid utmpx file, but it might be worth mentioning in the release notes.
Quoted 3 lines
Then instead of adding yet another new option, what about simply disabling the utmpx support in vsftpd.mk when the C library is musl, and keep it enabled otherwise?
That is possible, but systems running a libc with utmpx support might not actually be using it. This fragment exists in package/dropbear/Config.in:
config BR2_PACKAGE_DROPBEAR_WTMP
bool "log dropbear access to wtmp"
help
Enable logging of dropbear access to wtmp. Notice that Buildroot does not generate wtmp by default.
Therefore I thought that having an option to disable the feature would be useful even if building it is possible.
Quoted 10 lines
Quoted 6 lines
package/vsftpd/Config.in | 12 ++++++ package/vsftpd/vsftpd-0001-utmpx-builddef.patch | 49 +++++++++++++++++++++++++ package/vsftpd/vsftpd.mk | 8 ++++ 3 files changed, 69 insertions(+) create mode 100644 package/vsftpd/vsftpd-0001-utmpx-builddef.patchHave you submitted vsftpd-0001-utmpx-builddef.patch upstream? It's kind of a feature patch, so something we _generally_ don't like to take in Buildroot.
Yes, I mailed it to the maintainer on 2014-09-16. I haven't had a reply yet.
Bye,
Maarten
PATCH 1/1 vsftpd: Add build option to disable utmpx update code
In reply to Maarten ter HuurneDear Maarten ter Huurne,
Quoted 8 lines · Maarten ter Huurne
This was modeled after a similar option for Dropbear.
The utmpx code is automatically disabled when compiling with musl, to avoid a build error due to
WTMPX_FILEbeing undefined. Note that musl has an empty utmpx implementation, so no functionality is lost by not calling it.Signed-off-by Maarten ter Huurne <[email protected]>
Since the patch is not only a feature addition, but also fixing a build issue when using the musl C library:
One minor nit below, that can be fixed by Peter when applying:
Quoted 1 line
+ifneq ($(BR2_PACKAGE_VSFTPD_UTMPX),y)
Positive logic would be better here:
ifeq ($(BR2_PACKAGE_VSFTPD_UTMPX),)
package/vsftpd/vsftpd.mk VSFTPD_LIBS = -lcrypt · line 23
Quoted 2 lines
package/vsftpd/vsftpd.mk +2
-0+VSFTPD_POST_CONFIGURE_HOOKS += VSFTPD_DISABLE_UTMPX +endif
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 vsftpd: Add build option to disable utmpx update code
In reply to Maarten ter HuurneQuoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Maarten" == Maarten ter Huurne <[email protected]> writes:
This was modeled after a similar option for Dropbear. The utmpx code is automatically disabled when compiling with musl, to avoid a build error due to
WTMPX_FILEbeing undefined. Note that musl has an empty utmpx implementation, so no functionality is lost by not calling it.
Quoted 6 lines
Signed-off-by Maarten ter Huurne <[email protected]>---
Note that previously the utmpx code was being built, so this patch changes the default behavior. I think this is not a problem because most systems would not have a valid utmpx file, but it might be worth mentioning in the release notes.
Committed with the minor change suggested by Thomas, thanks.
Signature · 1 line
Bye, Peter Korsgaard