ptxdist allows to compile pure-ftpd in inetd mode but does not add the
relevant entries to /etc/services and /etc/inetd.conf, yet.

This patch adds a FTPD symbol and its substitution. Other ftp servers
than pure-ftpd are not supported.

Signed-off-by: Enrik Berkhan <[EMAIL PROTECTED]>
---
 generic/etc/inetd.conf |    1 +
 generic/etc/services   |    1 +
 rules/pureftpd.in      |    2 +-
 rules/rootfs.make      |   26 ++++++++++++++++++++++++++
 4 files changed, 29 insertions(+), 1 deletion(-)

Index: generic/etc/inetd.conf
===================================================================
--- generic/etc/inetd.conf.orig 2008-12-05 08:23:37.000000000 +0100
+++ generic/etc/inetd.conf      2008-12-05 08:24:12.000000000 +0100
@@ -10,3 +10,4 @@
 @PORTMAPD@
 @DNSD@
 @TFTPD@
[EMAIL PROTECTED]@
Index: generic/etc/services
===================================================================
--- generic/etc/services.orig   2008-12-05 08:29:58.000000000 +0100
+++ generic/etc/services        2008-12-05 08:34:40.000000000 +0100
@@ -9,3 +9,4 @@
 @PORTMAPD@
 @DNSD@
 @TFTPD@
[EMAIL PROTECTED]@
Index: rules/rootfs.make
===================================================================
--- rules/rootfs.make.orig      2008-12-05 08:25:24.000000000 +0100
+++ rules/rootfs.make   2008-12-05 08:40:06.000000000 +0100
@@ -910,6 +910,32 @@ else
 endif
 endif
 # -----------------------------------------------------------------------------
+# add ftpd if enabled
+#
+# TODO: do this for other inetd-enabled ftp server variants, too
+#
+ifdef PTXCONF_PUREFTPD_INETD_SERVER
+ifneq ($(PTXCONF_PUREFTPD_INETD_STRING),"")
+       @$(call install_replace, rootfs, /etc/inetd.conf, \
+               @FTPD@, \
+               $(PTXCONF_PUREFTPD_INETD_STRING) )
+else
+# add default string to start the ftpd into inetd.conf
+       @$(call install_replace, rootfs, /etc/inetd.conf, \
+               @FTPD@, \
+               "ftp stream tcp nowait root /usr/sbin/pure-ftp ftpd" )
+endif
+# add ftp service
+       @$(call install_replace, rootfs, \
+               /etc/services, \
+               @FTPD@, \
+               "ftp 21/tcp" )
+else
+# remove all tftp entries if this service is not enabled
+       @$(call install_replace, rootfs, /etc/inetd.conf, @FTPD@, )
+       @$(call install_replace, rootfs, /etc/services, @FTPD@, )
+endif
+# -----------------------------------------------------------------------------
        @$(call install_finish, rootfs)
 
        @$(call touch, $@)
Index: rules/pureftpd.in
===================================================================
--- rules/pureftpd.in.orig      2008-12-05 08:39:32.000000000 +0100
+++ rules/pureftpd.in   2008-12-05 08:39:46.000000000 +0100
@@ -102,7 +102,7 @@ config PUREFTPD_INETD_STRING
        string
        depends on PUREFTPD_INETD_SERVER
        prompt "inetd service entry"
-       default "ftp stream tcp nowait root /usr/bin/pure-ftp ftpd"
+       default "ftp stream tcp nowait root /usr/sbin/pure-ftp ftpd"
        help
          This string is added to inetd's configuration /etc/inetd.conf.
 

--
ptxdist mailing list
[email protected]

Reply via email to