aboutsummaryrefslogblamecommitdiffstats
path: root/community/shadow/APKBUILD
blob: dca8b5c60c995e9f08b147c8f00fe00f5cb29a4a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
              
                                               
                                                          
              
          
        
                                                                      


                                          

                           
                                                       
                                                                                              
                     
                  
                      
                               
                         
         
           





                    
 
              
                                 

         

                      




                                   



                                           
                               






                                   

                                               

 




                      
           

                      
                                      
 
                                                                        
                                





                                                             
                                                 
            
                                            
                                 



                                                 
 
                                             
                                                         
 


                                                                             
                                                                                      
                                   
                                                             
 
                                        
                                                     
                                                      








                                                               

                                               
 
                                                    

                                   

 
                                                                                                                                                               
                                                                                                                                               
                                                                                                                                            
                                                                                                                                                
                                                                                                                                                         
                                                                                                                                                    
# Contributor:
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=shadow
pkgver=4.6
pkgrel=2
pkgdesc="PAM-using login and passwd utilities (usermod, useradd, ...)"
url="http://pkg-shadow.alioth.debian.org/"
arch="all"
license="GPL"
depends=""
makedepends="linux-pam-dev"
subpackages="$pkgname-doc $pkgname-dbg $pkgname-uidmap"
source="https://github.com/shadow-maint/shadow/releases/download/$pkgver/shadow-$pkgver.tar.xz
	chpasswd.pamd
	login.pamd
	defaults.patch
	dots-in-usernames.patch
	pam-useradd.patch
	"
# secfixes:
#   4.5-r0:
#   - CVE-2017-12424
#   4.2.1-r11:
#   - CVE-2017-2616
#   4.2.1-r7:
#   - CVE-2016-6252

options="suid"
builddir="$srcdir/shadow-$pkgver"

build() {
	cd "$builddir"

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--target=$CTARGET \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-nls \
		--with-libpam \
		--without-audit \
		--without-selinux \
		--without-acl \
		--without-attr \
		--without-tcb \
		--without-nscd \
		--without-group-name-max-length
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"

	make DESTDIR="$pkgdir" install

	# Do not install these pam.d files they are broken and outdated.
	rm "$pkgdir"/etc/pam.d/*

	# install some pam.d files based on a patched useradd
	for pamf in groupadd groupdel groupmems groupmod \
		 useradd userdel usermod
	do
		install -m0644 etc/pam.d/useradd \
			"$pkgdir/etc/pam.d/$pamf"
	done
	# nologin is provided by util-linux.
	rm "$pkgdir"/sbin/nologin
	rm "$pkgdir"/usr/share/man/man8/nologin.*

	# avoid conlict with coreutils-doc
	rm "$pkgdir"/usr/share/man/man1/groups.*

	# However, install our own for login.
	cp "$srcdir"/login.pamd "$pkgdir"/etc/pam.d/login

	# Also install custom pam configuration for chpasswd (see bug #10209)
	cp "$srcdir"/chpasswd.pamd "$pkgdir"/etc/pam.d/chpasswd

	# /etc/login.defs is not very useful - replace it with an *almost* blank file.
	rm "$pkgdir"/etc/login.defs
	echo "USERGROUPS_ENAB yes" > "$pkgdir"/etc/login.defs

	# Avoid conflict with man-pages.
	rm "$pkgdir"/usr/share/man/man3/getspnam.3* \
		"$pkgdir"/usr/share/man/man5/passwd.5*
}

uidmap() {
	pkgdesc="Utilities for using subordinate UIDs and GIDs"

	mkdir -p "$subpkgdir"
	cd "$subpkgdir"

	mkdir -p usr/bin
	mv "$pkgdir"/usr/bin/new*idmap usr/bin/
	chmod 4711 usr/bin/new*idmap

	# Used e.g. for unprivileged LXC containers.
	mkdir etc
	touch etc/subuid etc/subgid
}

sha512sums="e8eee52c649d9973f724bc2d5aeee71fa2e6a2e41ec3487cd6cf6d47af70c32e0cdf304df29b32eae2b6eb6f9066866b5f2c891add0ec87ba583bea3207b3631  shadow-4.6.tar.xz
38e78aade316350dc26000b35335a778f12f5deb0f54ea23f84000ad92a683c519c7814165b5ed7e63187d11677993082d35dc6c21f7f66c6aee8e3fd4b3694b  chpasswd.pamd
46a6f83f3698e101b58b8682852da749619412f75dfa85cecad03d0847f6c3dc452d984510db7094220e4570a0565b83b0556e16198ad894a3ec84b3e513d58d  login.pamd
999eb67be2c1d6bcf752ce217ddbed868e4415d3e60676872db1b3da79b1c7d7da6b5d03335297d6358c41e7d21c32ba2df1bd6834ac4ba364b999ed7170f846  defaults.patch
745eea04c054226feba165b635dbb8570b8a04537d41e914400a4c54633c3a9cf350da0aabfec754fb8cf3e58fc1c8cf597b895506312f19469071760c11f31d  dots-in-usernames.patch
0b4587e263cb6be12fa5ae6bc3b3fc4d3696dae355bc67d085dc58c52ff96edb4d163b95db2092b8c2f3310839430cac03c7af356641b42e24ee4aa6410f5cf1  pam-useradd.patch"