From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 04CA713877A for ; Fri, 20 Jun 2014 20:41:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6DDCFE08FE; Fri, 20 Jun 2014 20:41:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 036D3E08FE for ; Fri, 20 Jun 2014 20:41:23 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0E180340001 for ; Fri, 20 Jun 2014 20:41:23 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id BBA181831E for ; Fri, 20 Jun 2014 20:41:21 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1403296900.c94180900d99e4deb4d47d21e92224e05d80be0f.blueness@gentoo> Subject: [gentoo-commits] proj/hardened-dev:musl commit in: sys-libs/libutempter/, sys-libs/libutempter/files/ X-VCS-Repository: proj/hardened-dev X-VCS-Files: sys-libs/libutempter/files/libutempter-remove-glibc-assumption.patch sys-libs/libutempter/libutempter-1.1.6-r99.ebuild sys-libs/libutempter/metadata.xml X-VCS-Directories: sys-libs/libutempter/ sys-libs/libutempter/files/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: c94180900d99e4deb4d47d21e92224e05d80be0f X-VCS-Branch: musl Date: Fri, 20 Jun 2014 20:41:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 177a9603-7419-4974-9394-64b3844af0bb X-Archives-Hash: 316f74eebf48403f326a399aa10df413 commit: c94180900d99e4deb4d47d21e92224e05d80be0f Author: Anthony G. Basile gentoo org> AuthorDate: Fri Jun 20 20:41:40 2014 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Fri Jun 20 20:41:40 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=c9418090 sys-libs/libutempter: remove assumption that libc = glibc Package-Manager: portage-2.2.8-r1 Manifest-Sign-Key: 0xF52D4BBA --- .../libutempter-remove-glibc-assumption.patch | 81 ++++++++++++++++++++++ sys-libs/libutempter/libutempter-1.1.6-r99.ebuild | 72 +++++++++++++++++++ sys-libs/libutempter/metadata.xml | 6 ++ 3 files changed, 159 insertions(+) diff --git a/sys-libs/libutempter/files/libutempter-remove-glibc-assumption.patch b/sys-libs/libutempter/files/libutempter-remove-glibc-assumption.patch new file mode 100644 index 0000000..6ed9335 --- /dev/null +++ b/sys-libs/libutempter/files/libutempter-remove-glibc-assumption.patch @@ -0,0 +1,81 @@ +diff -Naur libutempter-1.1.6.orig/utempter.c libutempter-1.1.6/utempter.c +--- libutempter-1.1.6.orig/utempter.c 2010-11-04 13:14:53.000000000 -0400 ++++ libutempter-1.1.6/utempter.c 2014-06-20 16:37:09.762403323 -0400 +@@ -34,13 +34,7 @@ + #include + #include + +-#ifdef __GLIBC__ + # include +-#elif defined(__FreeBSD__) +-# include +-#else +-# error Unsupported platform +-#endif /* __GLIBC__ || __FreeBSD__ */ + + #define DEV_PREFIX "/dev/" + #define DEV_PREFIX_LEN (sizeof(DEV_PREFIX)-1) +@@ -106,17 +100,12 @@ + + static int + write_uwtmp_record(const char *user, const char *term, const char *host, +-#ifdef __GLIBC__ + pid_t pid, +-#endif + int add) + { + struct utmp ut; + struct timeval tv; +- +-#ifdef __GLIBC__ + size_t offset; +-#endif + + memset(&ut, 0, sizeof(ut)); + +@@ -128,8 +117,6 @@ + if (host) + strncpy(ut.ut_host, host, sizeof(ut.ut_host)); + +-#ifdef __GLIBC__ +- + offset = (strlen(term) <= sizeof(ut.ut_id)) ? 0 : + strlen(term) - sizeof(ut.ut_id); + strncpy(ut.ut_id, term + offset, sizeof(ut.ut_id)); +@@ -156,27 +143,6 @@ + + (void) updwtmp(_PATH_WTMP, &ut); + +-#elif defined(__FreeBSD__) +- +- ut.ut_time = tv.tv_sec; +- +- if (add) +- { +- login(&ut); +- } else +- { +- if (logout(term) != 1) +- { +-#ifdef UTEMPTER_DEBUG +- fprintf(stderr, "utempter: logout: %s\n", +- strerror(errno)); +-#endif +- exit(EXIT_FAILURE); +- } +- } +- +-#endif /* __GLIBC__ || __FreeBSD__ */ +- + #ifdef UTEMPTER_DEBUG + fprintf(stderr, + "utempter: DEBUG: utmp/wtmp record %s for terminal '%s'\n", +@@ -255,8 +221,6 @@ + validate_device(device); + + return write_uwtmp_record(pw->pw_name, device + DEV_PREFIX_LEN, host, +-#ifdef __GLIBC__ + pid, +-#endif + add); + } diff --git a/sys-libs/libutempter/libutempter-1.1.6-r99.ebuild b/sys-libs/libutempter/libutempter-1.1.6-r99.ebuild new file mode 100644 index 0000000..65dcc7c --- /dev/null +++ b/sys-libs/libutempter/libutempter-1.1.6-r99.ebuild @@ -0,0 +1,72 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/libutempter/libutempter-1.1.6-r2.ebuild,v 1.1 2014/05/06 12:52:04 chainsaw Exp $ + +EAPI="4" + +inherit eutils user multilib flag-o-matic + +DESCRIPTION="Library that allows non-privileged apps to write utmp (login) info, which need root access" +HOMEPAGE="http://altlinux.org/index.php?module=sisyphus&package=libutempter" +SRC_URI="ftp://ftp.altlinux.org/pub/people/ldv/${PN}/${P}.tar.bz2" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux" +IUSE="static-libs elibc_FreeBSD" + +RDEPEND="!sys-apps/utempter" + +pkg_setup() { + enewgroup utmp 406 +} + +src_prepare() { + local args=( + -e "/^libdir /s:/usr/lib:${EPREFIX}/usr/$(get_libdir):" + -e '/^libexecdir /s:=.*:= $(libdir)/misc:' + -e '/^CFLAGS = $(RPM_OPT_FLAGS)/d' + -e 's:,-stats::' + -e "/^includedir /s:/usr/include:${EPREFIX}/usr/include:" + -e "/^mandir /s:=.*:= ${EPREFIX}/usr/share/man:" + ) + use static-libs || args+=( + -e '/^STATICLIB/d' + -e '/INSTALL.*STATICLIB/d' + ) + sed -i "${args[@]}" Makefile || die + + epatch "${FILESDIR}"/${PN}-remove-glibc-assumption.patch +} + +src_configure() { + use elibc_FreeBSD && append-libs -lutil + tc-export AR CC +} + +src_compile() { + emake LDLIBS="${LIBS}" +} + +src_install() { + default + + if ! use prefix ; then + fowners root:utmp /usr/$(get_libdir)/misc/utempter/utempter + fperms 2755 /usr/$(get_libdir)/misc/utempter/utempter + fi + dodir /usr/sbin + dosym ../$(get_libdir)/misc/utempter/utempter /usr/sbin/utempter +} + +pkg_postinst() { + if [ -f "${EROOT}/var/log/wtmp" ] ; then + chown root:utmp "${EROOT}/var/log/wtmp" + chmod 664 "${EROOT}/var/log/wtmp" + fi + + if [ -f "${EROOT}/var/run/utmp" ] ; then + chown root:utmp "${EROOT}/var/run/utmp" + chmod 664 "${EROOT}/var/run/utmp" + fi +} diff --git a/sys-libs/libutempter/metadata.xml b/sys-libs/libutempter/metadata.xml new file mode 100644 index 0000000..5aafc10 --- /dev/null +++ b/sys-libs/libutempter/metadata.xml @@ -0,0 +1,6 @@ + + + + base-system + x11 +