Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/810219/?format=api
{ "id": 810219, "url": "http://patchwork.ozlabs.org/api/1.2/patches/810219/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170905160027.15081-4-groug@kaod.org/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.2/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170905160027.15081-4-groug@kaod.org>", "list_archive_url": null, "date": "2017-09-05T16:00:26", "name": "[PULL,v2,3/4] 9pfs: local: clarify fchmodat_nofollow() implementation", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "364700abe8ac8d7358545c43501892417e577b8c", "submitter": { "id": 69178, "url": "http://patchwork.ozlabs.org/api/1.2/people/69178/?format=api", "name": "Greg Kurz", "email": "groug@kaod.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170905160027.15081-4-groug@kaod.org/mbox/", "series": [ { "id": 1604, "url": "http://patchwork.ozlabs.org/api/1.2/series/1604/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=1604", "date": "2017-09-05T16:00:25", "name": "[PULL,v2,1/4] 9pfs: avoid sign conversion error simplifying the code", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/1604/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/810219/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/810219/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=208.118.235.17; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from lists.gnu.org (lists.gnu.org [208.118.235.17])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xms9Y5WWvz9t16\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 6 Sep 2017 02:09:36 +1000 (AEST)", "from localhost ([::1]:59995 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dpGPu-0004Ae-1m\n\tfor incoming@patchwork.ozlabs.org; Tue, 05 Sep 2017 12:09:34 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:34555)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1dpGHK-0006Kf-SW\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 12:00:50 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <groug@kaod.org>) id 1dpGHD-0000KQ-8c\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 12:00:42 -0400", "from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59703\n\thelo=mx0a-001b2d01.pphosted.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <groug@kaod.org>) id 1dpGHD-0000JV-3V\n\tfor qemu-devel@nongnu.org; Tue, 05 Sep 2017 12:00:35 -0400", "from pps.filterd (m0098420.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv85Fwo23017495\n\tfor <qemu-devel@nongnu.org>; Tue, 5 Sep 2017 12:00:34 -0400", "from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2csweq59vg-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Tue, 05 Sep 2017 12:00:34 -0400", "from localhost\n\tby e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <groug@kaod.org>;\n\tTue, 5 Sep 2017 17:00:32 +0100", "from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197)\n\tby e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tTue, 5 Sep 2017 17:00:30 +0100", "from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com\n\t[9.149.105.62])\n\tby b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v85G0UhS14876868; Tue, 5 Sep 2017 16:00:30 GMT", "from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id D3A29AE045;\n\tTue, 5 Sep 2017 16:55:46 +0100 (BST)", "from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id C1138AE04D;\n\tTue, 5 Sep 2017 16:55:46 +0100 (BST)", "from smtp.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.1])\n\tby d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP;\n\tTue, 5 Sep 2017 16:55:46 +0100 (BST)", "from bahia.lab.toulouse-stg.fr.ibm.com\n\t(bahia.lab.toulouse-stg.fr.ibm.com [9.101.4.41])\n\tby smtp.lab.toulouse-stg.fr.ibm.com (Postfix) with ESMTP id\n\tCAF4A22040A; Tue, 5 Sep 2017 18:00:29 +0200 (CEST)" ], "From": "Greg Kurz <groug@kaod.org>", "To": "qemu-devel@nongnu.org", "Date": "Tue, 5 Sep 2017 18:00:26 +0200", "X-Mailer": "git-send-email 2.13.5", "In-Reply-To": "<20170905160027.15081-1-groug@kaod.org>", "References": "<20170905160027.15081-1-groug@kaod.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "X-TM-AS-GCONF": "00", "x-cbid": "17090516-0020-0000-0000-000003B3C613", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "17090516-0021-0000-0000-000042443047", "Message-Id": "<20170905160027.15081-4-groug@kaod.org>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-05_07:, , signatures=0", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=1\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709050229", "Content-Transfer-Encoding": "quoted-printable", "X-MIME-Autoconverted": "from 8bit to quoted-printable by\n\tmx0b-001b2d01.pphosted.com id v85Fwo23017495", "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]", "X-Received-From": "148.163.158.5", "Subject": "[Qemu-devel] [PULL v2 3/4] 9pfs: local: clarify fchmodat_nofollow()\n\timplementation", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.21", "Precedence": "list", "List-Id": "<qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Cc": "Peter Maydell <peter.maydell@linaro.org>, Greg Kurz <groug@kaod.org>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>" }, "content": "Since fchmodat(2) on Linux doesn't support AT_SYMLINK_NOFOLLOW, we have to\nimplement it using workarounds. There are two different ways, depending on\nwhether the system supports O_PATH or not.\n\nIn the case O_PATH is supported, we rely on the behavhior of openat(2)\nwhen passing O_NOFOLLOW | O_PATH and the file is a symbolic link. Even\nif openat_file() already adds O_NOFOLLOW to the flags, this patch makes\nit explicit that we need both creation flags to obtain the expected\nbehavior.\n\nThis is only cleanup, no functional change.\n\nSigned-off-by: Greg Kurz <groug@kaod.org>\nReviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>\n---\n hw/9pfs/9p-local.c | 12 ++++++++----\n 1 file changed, 8 insertions(+), 4 deletions(-)", "diff": "diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c\nindex efb0b79a74bf..e51af87309c6 100644\n--- a/hw/9pfs/9p-local.c\n+++ b/hw/9pfs/9p-local.c\n@@ -349,11 +349,11 @@ static int fchmodat_nofollow(int dirfd, const char *name, mode_t mode)\n return -1;\n }\n \n- /* Access modes are ignored when O_PATH is supported. We try O_RDONLY and\n- * O_WRONLY for old-systems that don't support O_PATH.\n- */\n- fd = openat_file(dirfd, name, O_RDONLY | O_PATH_9P_UTIL, 0);\n+ fd = openat_file(dirfd, name, O_RDONLY | O_PATH_9P_UTIL | O_NOFOLLOW, 0);\n #if O_PATH_9P_UTIL == 0\n+ /* Fallback for systems that don't support O_PATH: we depend on the file\n+ * being readable or writable.\n+ */\n if (fd == -1) {\n /* In case the file is writable-only and isn't a directory. */\n if (errno == EACCES) {\n@@ -368,6 +368,10 @@ static int fchmodat_nofollow(int dirfd, const char *name, mode_t mode)\n }\n ret = fchmod(fd, mode);\n #else\n+ /* Access modes are ignored when O_PATH is supported. If name is a symbolic\n+ * link, O_PATH | O_NOFOLLOW causes openat(2) to return a file descriptor\n+ * referring to the symbolic link.\n+ */\n if (fd == -1) {\n return -1;\n }\n", "prefixes": [ "PULL", "v2", "3/4" ] }