Gentoo Archives: gentoo-commits

From: Michael Palimaka <kensington@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: kde-apps/kwalletd-pam/files/, kde-apps/kwalletd-pam/
Date: Tue, 01 Mar 2016 11:52:18
Message-Id: 1456833121.591a6dd170e989be53af3e6e7fc55be53a6c7695.kensington@gentoo
1 commit: 591a6dd170e989be53af3e6e7fc55be53a6c7695
2 Author: Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
3 AuthorDate: Sun Feb 28 20:19:02 2016 +0000
4 Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 1 11:52:01 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=591a6dd1
7
8 kde-apps/kwalletd-pam: Add pkg_postinst instructions, coverity patch
9
10 Package-Manager: portage-2.2.27
11
12 .../files/kwalletd-pam-5.5.4-coverity.patch | 31 +++++++++++
13 kde-apps/kwalletd-pam/kwalletd-pam-5.5.3.ebuild | 36 -------------
14 kde-apps/kwalletd-pam/kwalletd-pam-5.5.4.ebuild | 63 ++++++++++++++++++++++
15 3 files changed, 94 insertions(+), 36 deletions(-)
16
17 diff --git a/kde-apps/kwalletd-pam/files/kwalletd-pam-5.5.4-coverity.patch b/kde-apps/kwalletd-pam/files/kwalletd-pam-5.5.4-coverity.patch
18 new file mode 100644
19 index 0000000..4cfd513
20 --- /dev/null
21 +++ b/kde-apps/kwalletd-pam/files/kwalletd-pam-5.5.4-coverity.patch
22 @@ -0,0 +1,31 @@
23 +From: Michael Pyne <mpyne@×××.org>
24 +Date: Mon, 28 Dec 2015 01:33:23 +0000
25 +Subject: Check sockaddr_un buffer size before strcpy()ing into it.
26 +X-Git-Url: http://quickgit.kde.org/?p=kwallet-pam.git&a=commitdiff&h=9543cc4058b24e4e5bfe8d324de309ca7050058b
27 +---
28 +Check sockaddr_un buffer size before strcpy()ing into it.
29 +
30 +Coverity strikes again, and notes in CID 1335116 that copying the socket name
31 +into a fixed-size buffer here could overflow the buffer. I don't see any reason
32 +it would be wrong in all cases, so best to double-check.
33 +
34 +REVIEW:126539
35 +---
36 +
37 +
38 +--- a/pam_kwallet.c
39 ++++ b/pam_kwallet.c
40 +@@ -422,6 +422,12 @@
41 +
42 + struct sockaddr_un local;
43 + local.sun_family = AF_UNIX;
44 ++
45 ++ if ((size_t)len > sizeof(local.sun_path)) {
46 ++ pam_syslog(pamh, LOG_ERR, "%s: socket path %s too long to open",
47 ++ logPrefix, fullSocket);
48 ++ return;
49 ++ }
50 + strcpy(local.sun_path, fullSocket);
51 + unlink(local.sun_path);//Just in case it exists from a previous login
52 +
53 +
54
55 diff --git a/kde-apps/kwalletd-pam/kwalletd-pam-5.5.3.ebuild b/kde-apps/kwalletd-pam/kwalletd-pam-5.5.3.ebuild
56 deleted file mode 100644
57 index 9fc7022..0000000
58 --- a/kde-apps/kwalletd-pam/kwalletd-pam-5.5.3.ebuild
59 +++ /dev/null
60 @@ -1,36 +0,0 @@
61 -# Copyright 1999-2016 Gentoo Foundation
62 -# Distributed under the terms of the GNU General Public License v2
63 -# $Id$
64 -
65 -EAPI=5
66 -
67 -MY_PN="kwallet-pam"
68 -inherit cmake-utils multilib
69 -
70 -DESCRIPTION="KWallet PAM module to not enter password again"
71 -HOMEPAGE="https://www.kde.org/"
72 -SRC_URI="mirror://kde/stable/plasma/${PV}/${MY_PN}-${PV}.tar.xz"
73 -
74 -LICENSE="LGPL-2.1"
75 -SLOT="4"
76 -KEYWORDS="~amd64 ~x86"
77 -IUSE=""
78 -
79 -DEPEND="
80 - dev-libs/libgcrypt:0=
81 - virtual/pam
82 -"
83 -RDEPEND="${DEPEND}
84 - net-misc/socat
85 -"
86 -
87 -S="${WORKDIR}/${MY_PN}-${PV}"
88 -
89 -src_configure() {
90 - local mycmakeargs=(
91 - -DCMAKE_INSTALL_LIBDIR="/$(get_libdir)"
92 - -DKWALLET4=1
93 - )
94 -
95 - cmake-utils_src_configure
96 -}
97
98 diff --git a/kde-apps/kwalletd-pam/kwalletd-pam-5.5.4.ebuild b/kde-apps/kwalletd-pam/kwalletd-pam-5.5.4.ebuild
99 new file mode 100644
100 index 0000000..4be7775
101 --- /dev/null
102 +++ b/kde-apps/kwalletd-pam/kwalletd-pam-5.5.4.ebuild
103 @@ -0,0 +1,63 @@
104 +# Copyright 1999-2016 Gentoo Foundation
105 +# Distributed under the terms of the GNU General Public License v2
106 +# $Id$
107 +
108 +EAPI=6
109 +
110 +MY_PN="kwallet-pam"
111 +inherit cmake-utils multilib
112 +
113 +DESCRIPTION="KWallet PAM module to not enter password again"
114 +HOMEPAGE="https://www.kde.org/"
115 +SRC_URI="mirror://kde/stable/plasma/${PV}/${MY_PN}-${PV}.tar.xz"
116 +
117 +LICENSE="LGPL-2.1"
118 +SLOT="4"
119 +KEYWORDS="~amd64 ~x86"
120 +IUSE=""
121 +
122 +DEPEND="
123 + dev-libs/libgcrypt:0=
124 + virtual/pam
125 +"
126 +RDEPEND="${DEPEND}
127 + net-misc/socat
128 +"
129 +
130 +S="${WORKDIR}/${MY_PN}-${PV}"
131 +
132 +PATCHES=( "${FILESDIR}/${P}-coverity.patch" )
133 +
134 +src_configure() {
135 + local mycmakeargs=(
136 + -DCMAKE_INSTALL_LIBDIR="/$(get_libdir)"
137 + -DKWALLET4=1
138 + )
139 +
140 + cmake-utils_src_configure
141 +}
142 +
143 +pkg_postinst() {
144 + check_dm() {
145 + if [[ -e "${ROOT}${2}" ]] && \
146 + [[ -n $(egrep "auth\s+optional\s+pam_kwallet.so" "${ROOT}${2}") ]] && \
147 + [[ -n $(egrep "session\s+optional\s+pam_kwallet.so" "${ROOT}${2}") ]]; then
148 + elog " ${1} - ${2} ...GOOD"
149 + else
150 + ewarn " ${1} - ${2} ...BAD"
151 + fi
152 + }
153 + elog
154 + elog "This package enables auto-unlocking of kde-apps/kwalletd:4."
155 + elog "List of things to make it work:"
156 + elog "1. Use same password for login and kwallet"
157 + elog "2. A display manager with support for PAM"
158 + elog "3.a Have the following lines in the display manager's pam.d file:"
159 + elog " -auth optional pam_kwallet.so kdehome=.kde4"
160 + elog " -session optional pam_kwallet.so"
161 + elog "3.b Checking installed DMs..."
162 + has_version "x11-misc/sddm" && check_dm "SDDM" "/etc/pam.d/sddm"
163 + has_version "x11-misc/lightdm" && check_dm "LightDM" "/etc/pam.d/lightdm"
164 + has_version "kde-base/kdm" && check_dm "KDM" "/etc/pam.d/kde"
165 + elog
166 +}