To build a working pure-ftpd on a system without shadow support
(preconfigured uClibc ...), I needed to disable shadow entries in
/etc/passwd. To make the system more consistent, I wanted to disable
shadow support in busybox, too. In ptxdist-1.99.9 this turned out to be
impossible when the "populate rootfs" option is selected.

In rules/rootfs.in, this is enforced by

config ROOTFS
        bool
        prompt "Create Directories in /"
        default y
        select BB_CONFIG_FEATURE_SHADOWPASSWDS if BUSYBOX

I think that this is a little too restrictive and suggest the following
patch to make ROOTFS_SHADOW select BB_CONFIG_FEATURE_SHADOWPASSWDS
instead. The patch also provides a non-shadow equivalent of the generic
/etc/passwd.

Signed-Off-By: Enrik Berkhan <[EMAIL PROTECTED]>

---
Index: rules/rootfs_configfiles.in
===================================================================
--- rules/rootfs_configfiles.in (revision 9181)
+++ rules/rootfs_configfiles.in (working copy)
@@ -44,6 +44,7 @@
        bool
        prompt "/etc/shadow, /etc/shadow-     "
        default y
+       select BB_CONFIG_FEATURE_SHADOWPASSWDS if BUSYBOX
        help
          Installs a /etc/shadow and /etc/shadow- file from a selectable source.
 
Index: rules/rootfs.in
===================================================================
--- rules/rootfs.in     (revision 9181)
+++ rules/rootfs.in     (working copy)
@@ -6,7 +6,6 @@
        bool
        prompt "Create Directories in /"
        default y
-       select BB_CONFIG_FEATURE_SHADOWPASSWDS if BUSYBOX
        help
          In order to support a standard root filesystem some subdirectories are
          mandatory. They will be created by ptxdist automatically. Some
Index: rules/rootfs.make
===================================================================
--- rules/rootfs.make   (revision 9181)
+++ rules/rootfs.make   (working copy)
@@ -408,10 +408,16 @@
 ifdef PTXCONF_ROOTFS_PASSWD
 # /etc/passwd
 ifdef PTXCONF_ROOTFS_GENERIC_PASSWD
+ifdef PTXCONF_ROOTFS_SHADOW
        @$(call install_copy, rootfs, 0, 0, 0644, \
                $(PTXDIST_TOPDIR)/generic/etc/passwd, \
                /etc/passwd, n)
+else
+       @$(call install_copy, rootfs, 0, 0, 0644, \
+               $(PTXDIST_TOPDIR)/generic/etc/passwd.noshadow, \
+               /etc/passwd, n)
 endif
+endif
 ifdef PTXCONF_ROOTFS_USER_PASSWD
        @$(call install_copy, rootfs, 0, 0, 0644, \
                $(PTXDIST_WORKSPACE)/projectroot/etc/passwd, \
Index: generic/etc/passwd.noshadow
===================================================================
--- generic/etc/passwd.noshadow (revision 0)
+++ generic/etc/passwd.noshadow (revision 0)
@@ -0,0 +1,7 @@
+root::0:0:root:/home:/bin/sh
+ftp::11:101:ftp user:/home:/bin/false
+www:*:12:102:www user:/home:/bin/false
+sshd:*:100:65534:SSH Server:/var/run/sshd:/bin/false
+messagebus:*:103:104:messagebus:/dev/null:/bin/false
+rpcuser:*:65533:65534:RPC user:/dev/null:/bin/false
+nobody:*:65534:65534:Unprivileged Nobody:/dev/null:/bin/false

--
ptxdist mailing list
[email protected]

Reply via email to