xref: /OK3568_Linux_fs/buildroot/package/vsftpd/0001-utmpx-builddef.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1Add build option to disable utmpx update code
2
3On some embedded systems the libc may have utmpx support, but the
4feature would be redundant. So add a build switch to disable utmpx
5updating, similar to compiling on systems without utmpx support.
6
7Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
8
9diff -ru vsftpd-3.0.2.orig/builddefs.h vsftpd-3.0.2/builddefs.h
10--- vsftpd-3.0.2.orig/builddefs.h	2012-04-05 05:24:56.000000000 +0200
11+++ vsftpd-3.0.2/builddefs.h	2014-09-16 14:23:36.128003245 +0200
12@@ -4,6 +4,7 @@
13 #undef VSF_BUILD_TCPWRAPPERS
14 #define VSF_BUILD_PAM
15 #undef VSF_BUILD_SSL
16+#define VSF_BUILD_UTMPX
17
18 #endif /* VSF_BUILDDEFS_H */
19
20diff -ru vsftpd-3.0.2.orig/sysdeputil.c vsftpd-3.0.2/sysdeputil.c
21--- vsftpd-3.0.2.orig/sysdeputil.c	2012-09-16 06:18:04.000000000 +0200
22+++ vsftpd-3.0.2/sysdeputil.c	2014-09-16 14:26:42.686887724 +0200
23@@ -1158,7 +1158,7 @@
24
25 #endif /* !VSF_SYSDEP_NEED_OLD_FD_PASSING */
26
27-#ifndef VSF_SYSDEP_HAVE_UTMPX
28+#if !defined(VSF_BUILD_UTMPX) || !defined(VSF_SYSDEP_HAVE_UTMPX)
29
30 void
31 vsf_insert_uwtmp(const struct mystr* p_user_str,
32@@ -1173,7 +1173,7 @@
33 {
34 }
35
36-#else /* !VSF_SYSDEP_HAVE_UTMPX */
37+#else /* !VSF_BUILD_UTMPX || !VSF_SYSDEP_HAVE_UTMPX */
38
39 /* IMHO, the pam_unix module REALLY should be doing this in its SM component */
40 /* Statics */
41@@ -1238,7 +1238,7 @@
42   updwtmpx(WTMPX_FILE, &s_utent);
43 }
44
45-#endif /* !VSF_SYSDEP_HAVE_UTMPX */
46+#endif /* !VSF_BUILD_UTMPX || !VSF_SYSDEP_HAVE_UTMPX */
47
48 void
49 vsf_set_die_if_parent_dies()
50