From 3628b9971fe25390c843f8c8f97e132578f755f5 Mon Sep 17 00:00:00 2001 From: Jay Larson Date: Wed, 2 Nov 2016 23:34:05 -0500 Subject: [PATCH] Fixed patches, cleaned up Makefile, added dependencies --- Makefile | 18 +++++++----------- SNAP/usher | 4 ++++ SRC/patches/03_use-sha512.patch | 19 +++++-------------- SRC/patches/03_use-sha512.patch.old | 21 +++++++++++++++++++++ SRC/patches/04_mailpath.patch | 12 ++++++++++++ 5 files changed, 49 insertions(+), 25 deletions(-) create mode 100644 SRC/patches/03_use-sha512.patch.old create mode 100644 SRC/patches/04_mailpath.patch diff --git a/Makefile b/Makefile index b2213ad..8b3d384 100644 --- a/Makefile +++ b/Makefile @@ -8,13 +8,13 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -DEPENDS = +DEPENDS = acl,attr,glibc ARCH = x86_64 URL = http://pkg-shadow.alioth.debian.org/ DESC = This package includes the programs necessary to convert traditional \ V7 UNIX password files to the SVR4 shadow password format and additional \ tools to work with shadow passwords. -SNAPVER = sr1 +SNAPVER = sr3 ARCHIVE := $(PWD)/SRC/$(shell ls SRC|egrep '(bz2|gz|tar|xz)$$'|tail -1) TYPE := $(shell file -ib $(ARCHIVE)|cut -d';' -f1|tr -d '\n') @@ -22,10 +22,6 @@ SRCDIR := $(shell tar -tf $(ARCHIVE)|head -1|sed 's/\/.*//') PATCHDIR := $(PWD)/SRC/patches VERSION := $(shell echo $(SRCDIR)|egrep -o '\-[0-9].*'|sed 's/^-//')$(SNAPVER) -MAKE = make -MAKEINST = make install -SNAPHACKS = - include /usr/share/snap/Makefile.snaplinux $(SRCDIR)/configure: $(ARCHIVE) @@ -44,7 +40,9 @@ $(SRCDIR)/configure: $(ARCHIVE) @touch $(SRCDIR)/configure $(SRCDIR)/config.log: $(SRCDIR)/configure - @cd $(SRCDIR) && for patch in `find $(PATCHDIR) -name \*.patch`; do \ + @cd $(SRCDIR) && \ + for patch in `find $(PATCHDIR) -name \*.patch|sort`; do \ + echo "WTF: $$patch"; \ patch --verbose -Np1 -i $$patch; \ done @cd $(SRCDIR); \ @@ -56,8 +54,7 @@ $(SRCDIR)/config.log: $(SRCDIR)/configure --target=x86_64-snap-linux-gnu $(SRCDIR)/src/vipw: $(SRCDIR)/config.log - @cd $(SRCDIR); \ - $(MAKE) + @cd $(SRCDIR) && make $(ROOT): $(SRCDIR)/src/vipw @if [ -d $(ROOT) ]; then \ @@ -66,8 +63,7 @@ $(ROOT): $(SRCDIR)/src/vipw mkdir -v $(ROOT); \ fi - @cd $(SRCDIR); \ - $(MAKEINST) DESTDIR=$(ROOT) + @cd $(SRCDIR) && make install DESTDIR=$(ROOT) @$(SNAPHACKS) diff --git a/SNAP/usher b/SNAP/usher index e86003b..e14875f 100755 --- a/SNAP/usher +++ b/SNAP/usher @@ -9,18 +9,22 @@ case $1 in postinst) if [[ ${TARGET} ]]; then if [ ! -f ${TARGET}/etc/shadow ]; then + echo "Converting /etc/passwd to shadow for ${TARGET}" chroot ${TARGET} pwconv fi if [ ! -f ${TARGET}/etc/gshadow ]; then + echo "Converting /etc/group to gshadow for ${TARGET}" chroot ${TARGET} grpconv fi else if [ ! -f /etc/shadow ]; then + echo "Converting /etc/passwd to shadow" pwconv fi if [ ! -f /etc/gshadow ]; then + echo "Converting /etc/group to gshadow for ${TARGET}" grpconv fi fi diff --git a/SRC/patches/03_use-sha512.patch b/SRC/patches/03_use-sha512.patch index 7451a19..663e0db 100644 --- a/SRC/patches/03_use-sha512.patch +++ b/SRC/patches/03_use-sha512.patch @@ -1,21 +1,12 @@ -diff -Naur c/etc/login.defs d/etc/login.defs ---- c/etc/login.defs 2016-10-04 14:54:27.116000000 -0500 -+++ d/etc/login.defs 2014-05-09 05:20:28.000000000 -0500 -@@ -118,7 +118,7 @@ - # Directory where mailboxes reside, _or_ name of file, relative to the - # home directory. If you _do_ define both, MAIL_DIR takes precedence. - # --MAIL_DIR /var/mail -+MAIL_DIR /var/spool/mail - #MAIL_FILE .mail - - # +diff -Naur a/etc/login.defs b/etc/login.defs +--- a/etc/login.defs 2014-05-09 05:20:28.000000000 -0500 ++++ b/etc/login.defs 2016-11-02 23:27:40.712000000 -0500 @@ -317,7 +317,7 @@ # Note: If you use PAM, it is recommended to use a value consistent with # the PAM modules configuration. # --ENCRYPT_METHOD SHA512 -+#ENCRYPT_METHOD DES +-#ENCRYPT_METHOD DES ++ENCRYPT_METHOD SHA512 # # Only works if ENCRYPT_METHOD is set to SHA256 or SHA512. diff --git a/SRC/patches/03_use-sha512.patch.old b/SRC/patches/03_use-sha512.patch.old new file mode 100644 index 0000000..7451a19 --- /dev/null +++ b/SRC/patches/03_use-sha512.patch.old @@ -0,0 +1,21 @@ +diff -Naur c/etc/login.defs d/etc/login.defs +--- c/etc/login.defs 2016-10-04 14:54:27.116000000 -0500 ++++ d/etc/login.defs 2014-05-09 05:20:28.000000000 -0500 +@@ -118,7 +118,7 @@ + # Directory where mailboxes reside, _or_ name of file, relative to the + # home directory. If you _do_ define both, MAIL_DIR takes precedence. + # +-MAIL_DIR /var/mail ++MAIL_DIR /var/spool/mail + #MAIL_FILE .mail + + # +@@ -317,7 +317,7 @@ + # Note: If you use PAM, it is recommended to use a value consistent with + # the PAM modules configuration. + # +-ENCRYPT_METHOD SHA512 ++#ENCRYPT_METHOD DES + + # + # Only works if ENCRYPT_METHOD is set to SHA256 or SHA512. diff --git a/SRC/patches/04_mailpath.patch b/SRC/patches/04_mailpath.patch new file mode 100644 index 0000000..74b4b4b --- /dev/null +++ b/SRC/patches/04_mailpath.patch @@ -0,0 +1,12 @@ +diff -Naur a/etc/login.defs b/etc/login.defs +--- a/etc/login.defs 2016-11-02 23:27:40.712000000 -0500 ++++ b/etc/login.defs 2016-11-02 23:31:00.536000000 -0500 +@@ -118,7 +118,7 @@ + # Directory where mailboxes reside, _or_ name of file, relative to the + # home directory. If you _do_ define both, MAIL_DIR takes precedence. + # +-MAIL_DIR /var/spool/mail ++MAIL_DIR /var/mail + #MAIL_FILE .mail + + #