X-Original-To: alpine-devel@lists.alpinelinux.org Received: from mail.wilcox-tech.com (mail.wilcox-tech.com [45.32.83.9]) by lists.alpinelinux.org (Postfix) with ESMTP id 73D1EF81458 for ; Wed, 20 Feb 2019 18:18:41 +0000 (UTC) Received: (qmail 13703 invoked from network); 20 Feb 2019 18:18:35 -0000 Received: from localhost (HELO ?IPv6:2600:1702:2a80:1b90::25?) (awilcox@wilcox-tech.com@127.0.0.1) by localhost with ESMTPA; 20 Feb 2019 18:18:35 -0000 To: alpine-dev From: "A. Wilcox" Subject: [alpine-devel] APK Tools does not ensure fchmodat/fchownat succeed Openpgp: preference=signencrypt Organization: =?UTF-8?Q?Ad=c3=a9lie_Linux?= Message-ID: Date: Wed, 20 Feb 2019 12:18:57 -0600 User-Agent: Mozilla/5.0 (X11; Linux ppc64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5RxbDdii5eXXlJ9fAt57DWTaAKwRjMsbt" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --5RxbDdii5eXXlJ9fAt57DWTaAKwRjMsbt Content-Type: multipart/mixed; boundary="dZvx6OJAUEIRWsAXxL89WFFuk0TOzXht8"; protected-headers="v1" From: "A. Wilcox" To: alpine-dev Message-ID: Subject: APK Tools does not ensure fchmodat/fchownat succeed --dZvx6OJAUEIRWsAXxL89WFFuk0TOzXht8 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable update_permissions in src/database.c does not check the return value of fchmodat nor fchownat. There are a number of reasons it could fail: - EIO, disk I/O error - ENOMEM, memory was exhausted while apk was running - others, though they are much more theoretical (abuild-apk shim hitting EPERM, a bad package causing ELOOP, a filesystem corruption causing the FS to go R/O while apk is running causing EROFS) This also causes a build failure when building on glibc (because glibc marks these functions as having return values that cannot be ignored). I think it would be a good idea to ensure these calls succeed and set the package as having an error if it isn't (so that a reinstallation can be attempted). But I don't know if there is a reason they are ignored. I also am not familiar enough with apk-tools to be confident in the proper way to set error (don't even know if ipkg is accessible from update_permissions which seems like the main way an error is set). Thanks, --arw --=20 A. Wilcox (awilfox) Project Lead, Ad=C3=A9lie Linux https://www.adelielinux.org --dZvx6OJAUEIRWsAXxL89WFFuk0TOzXht8-- --5RxbDdii5eXXlJ9fAt57DWTaAKwRjMsbt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjNyWOYPU1SaTSMHHyynLUZIrnRQFAlxtmhQACgkQyynLUZIr nRTl1xAAhDufVhwcAf4q7MDzE1cNLJ+8mdlTtiErkdZ9gM+2hab96GnU+bGdRIAI Ku5uCTD9Lg4Eqbzu6yNUsxd27Nfs87n4AsiGqixmDfcP5uKCS3p2KsByAL05Eqid waxWIBrxMYuhPXKCnTdtQqRjf1zfNLPEBoq8cIWHSDlXnYdrG4wZ25w9mU4sLH4/ DPUbgIDudR8VPr5Ny54if7rfFGtSW0OAn7ek6RhK6IPfCDoe5zinz6MpbiKLsUvm EXsdxh6G/oj3KHZaMLKpHZeCvq3UhEMbnFQMDKyglDJ79zd23GoG2uszKhLPqjui VHs6C1sHa3vF9KCPEgs4N5GjDbXvOf97DNCLyycrvN9Qj9WPqXk1bNYwIrVTreHM +m+NyashDjSkinnJyagGypJynU9Xs0MzmXcUxXgDgvdrqSfJioESFbgTNbborz/t zrxJGKhtHVdmKcWdG4CiZCmqRvfwTzIqevdxX2fVC8NgyE5QgOsPSYMOpqQXzeIw +QBBkaLxnXei1KIuhoEr4qGgZdNxqi3GDurgDjVORU0IkG6tBkuJlsDIaK3VTEUs d9JIzxaT/vMC7Fx0wqHaWaSRVV8qCLww9b5OXNmivbKNHeC4JZwjF175uNNEdKVn 9t1QT/63fkDJY+Rbs/W4YQ3qi93R4gn8+u1w+lm9I8QjsfLjSSE= =xiIg -----END PGP SIGNATURE----- --5RxbDdii5eXXlJ9fAt57DWTaAKwRjMsbt-- --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---