From patchwork Tue Nov 6 16:11:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandeep Patil X-Patchwork-Id: 150280 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4073746ljp; Tue, 6 Nov 2018 08:11:45 -0800 (PST) X-Google-Smtp-Source: AJdET5cPE/1KL24SVeroz8XX1lKMYM3xAXB5hnoZ3NZuDIh405wsk9LKy6ZU3JCblvMOdk9GkElu X-Received: by 2002:a50:fc17:: with SMTP id i23-v6mr14369565edr.153.1541520705370; Tue, 06 Nov 2018 08:11:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541520705; cv=none; d=google.com; s=arc-20160816; b=lQ3t4GfmmlYet/qhMSZrjrBfhkD+gI6Tz0FdkYRaQrDNv6J+seAUVon/EhFlKPiMwT hjaAUWEitQ8+A6OxWbgHi2FRe5QkhoP3yl04Oj6mJHa3y6laS/2HGT7BKPewC5g+ZiDH X3nWIUIKIcBkU2SZtrQKcNX3Pbr74WRbi4TMOGPlp8zQyrkolgqMsm9h1BDohkAwdgnK woe6xwPvSrlHBoKcPCuLDlSrSKVCvS6CwUx01KAALO5bjYVri98go/ijt/kOPSmbCT6X Osxi/Acr6D0okV7n7pB86fPDuxVmGGiTRqcPtZIUGH/4q3ytonTtEK3tJFFKvJXwPgp3 eGcg== 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=V33Yp2kaSZEUaNyYogu+iOJxZGH5AJCQBsa6mMm3BjD//bxzWpDwZtYVU/jmjGyZ9V GumoGgl+J2WpXJhkwPVEV3GzdAdNR7wQd5PQpld/pdsci/ydzhs2kNRACiBEJRlKkEME 0CqGzEnF4dZIz5xfBEMq7eDdPPG4oDj0G8qHz9EnS9JN4EoqGkQOYesaTyQgCB14fTuZ ZJI7CgJb74V+BcOU9L8hwkzG2cETQOgnpewimcPDo3rf6tFRphaqywGUyzttxWQ5xKU4 sfpF715cBviFOwYPBl7PQi1JkzUW6MndSW46f6FuKA541AXzXpt44IymZcHaqD93eUGk n/5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=LRzgpqxK; 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 l15-v6si1195629ejc.183.2018.11.06.08.11.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 08:11:45 -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=LRzgpqxK; 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 096703E7681 for ; Tue, 6 Nov 2018 17:11:45 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) by picard.linux.it (Postfix) with ESMTP id D708E3E7723 for ; Tue, 6 Nov 2018 17:11:41 +0100 (CET) Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id 2114D1A01072 for ; Tue, 6 Nov 2018 17:11:41 +0100 (CET) Received: by mail-pf1-x444.google.com with SMTP id g7-v6so4053368pfo.10 for ; Tue, 06 Nov 2018 08:11:41 -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=LRzgpqxKiNyVjoNEgeenMSgk4QBdYKqWx7aqU9Mr+2K7dse9u60XbomdIv/v0O5OCD 3PQ3zM4HUvCOd+vpKgml1UGUNhDyODMgQjxt/3NAou6YTfuFVqr3e5jnBRSJ/YNqvEbf isYZfd2PVt8EvOspsN81C61QbtS614l8OZaXd05CwQRpudbUbKfbNcxI+2cvGiWQGZlp GnEx8qcspU59BNypZOuGCl8ya6PxniEKF5NzVoC7/7xywKHZZMFAmwEmBykZimods6Wg jbpPFV1A+Sb1o0noq90Z6H6/jRQf5Ar7FwlvSjBYAvPEXgb2PJepaKHjsyEwdKp/1itN /PAQ== 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=ThDEoaBPMGMkWmYZ4LiHpPIwSyWnkB5ARIb1+179cJZllXwFAkcnSh1RktA8UipV5F sl86HiaJFmqk0vlFfuah3bTExEmwG/guZlOIW06lLYZHM8Ef11c2XLnuAeS+eS6MQVxn VBDkuRXeBKqwuU8RVpPSO5juyFC8XACq5Mr6GD+ZdeYW2AJv21/JepnaGcZjULvlLfiP RsCPMqsCUoeOxb7f012Rx1jGYBbAO3WHuizLVO6kVI9YI+aL/dN2mrEeLktWqhUsJ100 70SbUi/91dTyhQHjz6FoCppVyOFxaJWmr0s3BWolKSI5hBrRo4Gct1v0VWUL/NAh1iYT 2dIQ== X-Gm-Message-State: AGRZ1gLvhNBaFV6GvserCE4/9WJ/Fif9j5u07RG0pO+ORXMlQpOwthyY GV/Efmy0brLLiwH3lvrG8dz2/mZHZ2yo1w== X-Received: by 2002:a62:1b4f:: with SMTP id b76-v6mr24458618pfb.96.1541520698748; Tue, 06 Nov 2018 08:11:38 -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 m7-v6sm52232602pgq.59.2018.11.06.08.11.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 08:11:34 -0800 (PST) From: Sandeep Patil To: ltp@lists.linux.it Date: Tue, 6 Nov 2018 08:11:25 -0800 Message-Id: <20181106161126.251484-2-sspatil@google.com> X-Mailer: git-send-email 2.19.1.930.g4563a0d9d0-goog In-Reply-To: <20181106161126.251484-1-sspatil@google.com> References: <20181106161126.251484-1-sspatil@google.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.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-3.smtp.seeweb.it Cc: kernel-team@android.com, rpalethorpe@suse.com Subject: [LTP] [PATCH 1/2] 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);