From patchwork Mon Nov 5 23:50:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandeep Patil X-Patchwork-Id: 150231 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3231200ljp; Mon, 5 Nov 2018 15:51:06 -0800 (PST) X-Google-Smtp-Source: AJdET5dN/Z31Rl50YgeVRGa2Tg6dSIVHJqSORe/q+AvoyzU9+HB+KMi3XzMWTySZPD8Z40FXHdg0 X-Received: by 2002:aa7:cf1a:: with SMTP id a26-v6mr19132617edy.91.1541461866685; Mon, 05 Nov 2018 15:51:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541461866; cv=none; d=google.com; s=arc-20160816; b=MlOqQLJLH9IibiJYQ/z/wXX+6sbLbgDJTC3Uq1NgS4O3H6DzEYUl6F03k3FV91SvGx WmR6h/v3oj7VhFPEjNk7saKOj/bi0a7Xmc3rR0Wki27jUq4BOZJoZ6vTWchWZSicopdA ZhqDszo8MllYCbwyNLPHnT4AKQ28rnWaydPOTGU7oO5VI6REVLIVrb8LsPdN7Hb3OWn/ 6hW+FBskwS8y2kZxaFrmVgPsWQKOgZvW98qNK5HS6vjLkNmtXe72XN7Q5t/ZfZ8W9ONN aFQE2ziEmuTwKn3mGtj3p/ZDvStt/dZ0npPbGQ2tkvgB6mv1fQ76PijSARhiUVTMSNJN yL5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:delivered-to; bh=I8y+j/3Arhim0VYfW/OlROTofQ5M7vM2+UuKNl7pCwA=; b=tYyEfyOiOnjGLFjQRKiF+5X1Mb+f4/+cJ9Y6VQRrGN+zIFWx07NDB9yXxbizw4W8mp sYm1qWoFGzE3ERbvZkYu0Fyu7oWJuJIVgBSTvfmGb3Qox+zxP/OC7bg0jRPdcucmN0ff DQkMYb4bmfO9VyRt/dGTbTLgVGVK3s5/hrGlEfZPTe003t54bWJtsd6tuw5VazLMXO02 hNbyRD1CYc/oFq1TZvy2wHEPRUIK5JnsMEdE3D6FQYzMSxznuI5jaSjT/qloln/xlcUt +XP2BrSh5bu/RihVYmiWax3YzXARnT0bUzSpmsuf2Xzer7kd5QjUl2B2bguc0Dt3XC3d Ry2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=rNyD7wT+; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=REJECT sp=REJECT dis=QUARANTINE) header.from=google.com Return-Path: Received: from picard.linux.it (picard.linux.it. [2001:1418:10:5::2]) by mx.google.com with ESMTPS id e1-v6si3088375eja.164.2018.11.05.15.51.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 15:51:06 -0800 (PST) Received-SPF: pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) client-ip=2001:1418:10:5::2; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=rNyD7wT+; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=REJECT sp=REJECT dis=QUARANTINE) header.from=google.com Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 57E4E3E78EC for ; Tue, 6 Nov 2018 00:51:06 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [217.194.8.7]) by picard.linux.it (Postfix) with ESMTP id D056D3E7847 for ; Tue, 6 Nov 2018 00:50:53 +0100 (CET) Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id 37974200A03 for ; Tue, 6 Nov 2018 00:50:53 +0100 (CET) Received: by mail-pg1-x543.google.com with SMTP id w7so4936074pgp.13 for ; Mon, 05 Nov 2018 15:50:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EY5+fCIcAYaDYRl3gZpnxIBfpRx+tzQagGkEakksPRA=; b=rNyD7wT+T+6MzugwnmBbsxqHhcsU4wL3qLpTEVegU2tUNDc+V/Qh5MiTvALnF+TLxD arfOAKIS1h3YFZ0vAaiTn1LldAOWGLAzFYkg7ZMJ7KiI0+bTVK1r7bgQX4sL1CNP6hQh UOuJTySkIVs4OfCz5EnPFzGTAmfXC3rB5Be3zXljtISQOG3TXHUG30sggHotDtUGUplf RD6ucsLFrjr+9XyB4ZD7nPnYstNB8Tj4hS92ZFVGqr4i8U9tD2Lxm/udGcyr6WygbOPM ez9xwoL3lB/rD7Fu2AIy7ZZsKR+mHuXF5O2nvF/+yy1UhGH/4fHF79U4kgn6kDJlX9zH UZnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EY5+fCIcAYaDYRl3gZpnxIBfpRx+tzQagGkEakksPRA=; b=JujXgxQLExQpQ+7N2d1Zn1hUdQyRxf0KGvkNYVVDvEZdhbO1Guy+Zz4N0WzIl6KbBy VJJ23lasohjpETwO2rk8avpd8q1jNz5QVNo2W0e9FsOEELkRczYJ/pQl0vNXOQQXPT/x +OUmq10LmuL5jetYerCc93qkXnyidMNxpUaAwoaNSrEOz6U9BM9DVyeV2OgLA5VIIWDA AG9NbeoAmCxM4yGdkQO0yOuSBZglf3q+xTyKzZxC0VhyZF20TwuOaBlPfhd3PvJgkSpB eqdtEChyn/ATEqy81bnt30PD6PCUimMZbRDpbTa+RHL9ay2thlePs76tEmHxD3318WBA 5Q9Q== X-Gm-Message-State: AGRZ1gIfr8h2eetYl/xfJUgERPDNSB0SOaeVGUqlpy9uVei/YbGyL0GJ 1eIB3IwAFKfM8qmgVD2cDsvwEPQrhjOklQ== X-Received: by 2002:a62:1308:: with SMTP id b8-v6mr23382302pfj.215.1541461850743; Mon, 05 Nov 2018 15:50:50 -0800 (PST) Received: from sspatil-workstation.mtv.corp.google.com ([2620:0:1000:1601:1a43:e60e:c432:d19c]) by smtp.gmail.com with ESMTPSA id c70-v6sm27133925pfg.97.2018.11.05.15.50.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 15:50:49 -0800 (PST) From: Sandeep Patil To: ltp@lists.linux.it Date: Mon, 5 Nov 2018 15:50:17 -0800 Message-Id: <20181105235019.254846-4-sspatil@google.com> X-Mailer: git-send-email 2.19.1.930.g4563a0d9d0-goog In-Reply-To: <20181105235019.254846-1-sspatil@google.com> References: <20181105235019.254846-1-sspatil@google.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-14.9 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,ENV_AND_HDR_SPF_MATCH,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-7.smtp.seeweb.it Cc: kernel-team@android.com, rpalethorpe@suse.com Subject: [LTP] [PATCH 3/5] syscalls/fchmod02: fall back to use "daemon" group if "users" is absent. X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+patch=linaro.org@lists.linux.it Sender: "ltp" This makes the test work successfully on Android systems where "users" group doesn't exist. Signed-off-by: Sandeep Patil --- testcases/kernel/syscalls/fchmod/fchmod02.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/testcases/kernel/syscalls/fchmod/fchmod02.c b/testcases/kernel/syscalls/fchmod/fchmod02.c index d0b35db12..e60cb33a6 100644 --- a/testcases/kernel/syscalls/fchmod/fchmod02.c +++ b/testcases/kernel/syscalls/fchmod/fchmod02.c @@ -22,9 +22,6 @@ #include "tst_test.h" #include "fchmod.h" -#define LTPUSER "nobody" -#define LTPGRP "users" - static int fd; static void verify_fchmod(void) @@ -53,8 +50,8 @@ static void setup(void) struct passwd *ltpuser; struct group *ltpgroup; - ltpuser = SAFE_GETPWNAM(LTPUSER); - ltpgroup = SAFE_GETGRNAM(LTPGRP); + ltpuser = SAFE_GETPWNAM("nobody"); + ltpgroup = SAFE_GETGRNAM_FALLBACK("users", "daemon"); fd = SAFE_OPEN(TESTFILE, O_RDWR | O_CREAT, FILE_MODE); SAFE_CHOWN(TESTFILE, ltpuser->pw_uid, ltpgroup->gr_gid);