Commit a2fd4c4e authored by Natanael Copa's avatar Natanael Copa

testing/accountsservice: upgrade to 0.6.50, modernize

parent 506c4f44
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=accountsservice
pkgver=0.6.39
pkgver=0.6.50
pkgrel=0
pkgdesc="D-Bus interface for user account query and manipulation"
url="http://www.freedesktop.org/software/accountsservice/"
......@@ -10,24 +10,16 @@ license="GPL-3.0-or-later"
depends=""
depends_dev="glib-dev gobject-introspection-dev polkit-dev"
makedepends="$depends_dev intltool gnome-doc-utils"
install=""
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="http://www.freedesktop.org/software/accountsservice/accountsservice-$pkgver.tar.xz"
_builddir="$srcdir"/accountsservice-$pkgver
prepare() {
local i
cd "$_builddir"
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
}
source="http://www.freedesktop.org/software/accountsservice/accountsservice-$pkgver.tar.xz
musl-fgetspent_r.patch
"
builddir="$srcdir"/$pkgname-$pkgver
build() {
cd "$_builddir"
./configure \
cd "$builddir"
# Hack to check for /var/log/wtmp instead of /var/log/utx.log
sed -i configure -e "s;utx\.log;wtmp;g"
ac_cv_file__var_log_utx_log=yes ./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
......@@ -36,17 +28,19 @@ build() {
--infodir=/usr/share/info \
--localstatedir=/var \
--disable-systemd \
--enable-introspection=yes \
|| return 1
# hack to disable utmpx
sed -i -e '/#define HAVE_UTMPX_H 1/d' config.h
--enable-introspection=yes
make
}
make || return 1
check() {
cd "$builddir"
make check
}
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
cd "$builddir"
make DESTDIR="$pkgdir" install
}
sha512sums="b72f2edf95b7df5b38c75fbe4be2581384f7ff3631248a9fd2a523a13638e2c9c8933f195b8991a7138a556786531258b00878dc1a68863b616d2d2a17cbcf33 accountsservice-0.6.39.tar.xz"
sha512sums="6e07cd318452b1cbedeacd729f0ebb200525caf1b09981abb2bac16fd90756a790ebec08aca0a0cea016f14ab27c159a68fe1332ef4bc636c5863b8c61040f64 accountsservice-0.6.50.tar.xz
469392beca8f5941eafaa193c4fcb0472770ee4183ce520416a1b5d6abafe0e201990eb74d06bfbd9e20af08e55aff5f0031f267083f6c6879f0fe4e5028103c musl-fgetspent_r.patch"
diff --git a/src/daemon.c b/src/daemon.c
index 312394a..e7b3c58 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -140,6 +140,28 @@ error_get_type (void)
#define MAX_LOCAL_USERS 50
#endif
+#ifndef __GLIBC__
+ /* Musl libc does not support fgetspent_r(), write own
+ * wrapper
+ */
+static int fgetspent_r(FILE *fp, struct spwd *spbuf, char *buf, size_t buflen, struct spwd **spbufp) {
+ struct spwd *shadow_entry = fgetspent(fp);
+ if(!shadow_entry)
+ return -1;
+ size_t namplen = strlen(shadow_entry->sp_namp);
+ size_t pwdplen = strlen(shadow_entry->sp_pwdp);
+
+ if(namplen + pwdplen + 2 > buflen)
+ return -1;
+
+ *spbufp = memcpy(spbuf, shadow_entry, sizeof(struct spwd));
+ spbuf->sp_namp = strncpy(buf, shadow_entry->sp_namp, namplen + 1);
+ spbuf->sp_pwdp = strncpy(buf + namplen + 1, shadow_entry->sp_pwdp, pwdplen + 1);
+
+ return 0;
+}
+#endif
+
static struct passwd *
entry_generator_fgetpwent (Daemon *daemon,
GHashTable *users,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment