From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 651F73844062 for ; Thu, 11 Mar 2021 08:25:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 651F73844062 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12B82lTR165695 for ; Thu, 11 Mar 2021 03:25:34 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3774mdyfcf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 11 Mar 2021 03:25:34 -0500 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 12B82p0D165881 for ; Thu, 11 Mar 2021 03:25:34 -0500 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3774mdyfbw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Mar 2021 03:25:33 -0500 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 12B8NGxJ018960; Thu, 11 Mar 2021 08:25:31 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06ams.nl.ibm.com with ESMTP id 3768ursqkr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Mar 2021 08:25:31 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 12B8PTtK46072218 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Mar 2021 08:25:29 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67D42A4057; Thu, 11 Mar 2021 08:25:29 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 37F0BA4053; Thu, 11 Mar 2021 08:25:29 +0000 (GMT) Received: from li-ab9d22cc-354d-11b2-a85c-e984af76f811.ibm.com (unknown [9.171.43.109]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 11 Mar 2021 08:25:29 +0000 (GMT) Subject: Re: [PATCH] Ensure that nsswitch.conf for nss/tst-reload[12] are really synced. To: "H.J. Lu" Cc: GNU C Library References: <20210310152250.3777297-1-stli@linux.ibm.com> From: Stefan Liebler Message-ID: <39960ab1-da0a-e934-e692-2ccbf78234b9@linux.ibm.com> Date: Thu, 11 Mar 2021 09:25:28 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761 definitions=2021-03-11_02:2021-03-10, 2021-03-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 clxscore=1015 mlxscore=0 malwarescore=0 spamscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103110044 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Mar 2021 08:25:37 -0000 On 3/10/21 5:26 PM, H.J. Lu wrote: > On Wed, Mar 10, 2021 at 8:06 AM Stefan Liebler via Libc-alpha > wrote: >> >> Both tests, nss/tst-reload1 and nss/tst-reload2 are test-container >> tests and both provide a root directory for the container. >> >> Unfortunately on a fresh git clone, all the nsswitch files have >> the same size of 40bytes and timestamp: >> nss/tst-reload1.root/etc/nsswitch.conf2 >> nss/tst-reload2.root/etc/nsswitch.conf >> nss/tst-reload2.root/subdir/etc/nsswitch.conf >> nss/tst-reload1.root/etc/nsswitch.conf >> >> After running tst-reload1, the /testroot.root/etc/nsswitch.conf >> file has the content of nss/tst-reload1.root/etc/nsswitch.conf2. >> >> Rerunning with "make t=nss/tst-reload1 test" leads to fails >> as nsswitch.conf is not synced by test-container.c. >> >> Therefore this patch just adds different comments to those files >> to ensure that test-container.c is always syncing them. >> --- >> nss/tst-reload1.root/etc/nsswitch.conf | 4 ++++ >> nss/tst-reload1.root/etc/nsswitch.conf2 | 3 +++ >> nss/tst-reload2.root/etc/nsswitch.conf | 2 ++ >> 3 files changed, 9 insertions(+) >> >> diff --git a/nss/tst-reload1.root/etc/nsswitch.conf b/nss/tst-reload1.root/etc/nsswitch.conf >> index 606d8f51d6..56248fc8a3 100644 >> --- a/nss/tst-reload1.root/etc/nsswitch.conf >> +++ b/nss/tst-reload1.root/etc/nsswitch.conf >> @@ -1,3 +1,7 @@ >> +# This nsswitch.conf file should be synced by test-container.c while starting >> +# tst-reload1. Ensure that the size differs compared to the other >> +# nsswitch.conf[2] files of tst-reload1 or tst-reload2. Otherwise >> +# test-container.c won't sync it. >> passwd: test1 >> group: test1 >> hosts: test1 >> diff --git a/nss/tst-reload1.root/etc/nsswitch.conf2 b/nss/tst-reload1.root/etc/nsswitch.conf2 >> index 2e93977efb..762dcc3f36 100644 >> --- a/nss/tst-reload1.root/etc/nsswitch.conf2 >> +++ b/nss/tst-reload1.root/etc/nsswitch.conf2 >> @@ -1,3 +1,6 @@ >> +# This nsswitch.conf will be used while running tst-reload2. >> +# Ensure that the size differs compared to the other nsswitch.conf[2] files of >> +# tst-reload1 or tst-reload2. Otherwise test-container.c won't sync it. >> passwd: test2 >> group: test2 >> hosts: test2 >> diff --git a/nss/tst-reload2.root/etc/nsswitch.conf b/nss/tst-reload2.root/etc/nsswitch.conf >> index 688a589519..fbe057480f 100644 >> --- a/nss/tst-reload2.root/etc/nsswitch.conf >> +++ b/nss/tst-reload2.root/etc/nsswitch.conf >> @@ -1,3 +1,5 @@ >> +# Ensure that the size differs compared to the other nsswitch.conf[2] files of >> +# tst-reload1 or tst-reload2. Otherwise test-container.c won't sync it. >> passwd: test1 >> group: test2 >> hosts: files >> -- >> 2.28.0 >> > > Does this fix > > https://sourceware.org/bugzilla/show_bug.cgi?id=27537 > > If yes, please mention it in the commit log. > > Thanks. > I'm getting the same output as mentioned in the bugzilla: $ cd $ rm -f testroot.root/etc/nsswitch.conf $ make t=nss/tst-reload1 test PASS: nss/tst-reload1 $ cat testroot.root/etc/nsswitch.conf passwd: test2 group: test2 hosts: test2 $ make t=nss/tst-reload2 test tst-reload2.c:112: numeric comparison failure left: 5 (0x5); from: pw->pw_uid right: 1234 (0x4d2); from: 1234 error: tst-reload2.c:130: not true: pw->pw_uid != 2468 tst-reload2.c:136: numeric comparison failure left: 5 (0x5); from: pw->pw_uid right: 1234 (0x4d2); from: 1234 error: tst-reload2.c:146: not true: he != NULL error: 4 test failures $ cat testroot.root/etc/nsswitch.conf passwd: test2 group: test2 hosts: test2 According to tst-reload2.c and current nsswitch.conf, it is using pwd_table2, which is PWD_N (5, "test1"). According to the nss/tst-reload2.root/etc/nsswitch.conf, it should use PWD_N (1234, "test1") of pwd_table1. Thus, yes, I assume this is the same issue. Bye, Stefan