From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id E14B93870904 for ; Thu, 11 Mar 2021 08:25:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E14B93870904 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 12B83wPD148379 for ; Thu, 11 Mar 2021 03:25:38 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3774m5ffx4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 11 Mar 2021 03:25:38 -0500 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 12B843fh149194 for ; Thu, 11 Mar 2021 03:25:38 -0500 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 3774m5ffwp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Mar 2021 03:25:38 -0500 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 12B8NRTa030850; Thu, 11 Mar 2021 08:25:36 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma02fra.de.ibm.com with ESMTP id 376aqsrusu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Mar 2021 08:25:36 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 12B8PISY27263382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Mar 2021 08:25:18 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C06C5A4080; Thu, 11 Mar 2021 08:25:33 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A16F3A405B; Thu, 11 Mar 2021 08:25:33 +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:33 +0000 (GMT) Subject: Re: [PATCH] Ensure that nsswitch.conf for nss/tst-reload[12] are really synced. To: DJ Delorie Cc: libc-alpha@sourceware.org References: From: Stefan Liebler Message-ID: <442a55d4-accc-e736-1fd0-62b2c729d167@linux.ibm.com> Date: Thu, 11 Mar 2021 09:25:33 +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 lowpriorityscore=0 mlxlogscore=999 spamscore=0 adultscore=0 malwarescore=0 phishscore=0 clxscore=1015 impostorscore=0 mlxscore=0 bulkscore=0 suspectscore=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:42 -0000 On 3/10/21 8:06 PM, DJ Delorie wrote: > >> Unfortunately on a fresh git clone, all the nsswitch files have >> the same size of 40bytes and timestamp: > > Please try this: > > diff --git a/support/test-container.c b/support/test-container.c > index 28cc44d9f1..94498d3901 100644 > --- a/support/test-container.c > +++ b/support/test-container.c > @@ -481,7 +481,7 @@ need_sync (char *ap, char *bp, struct stat *a, struct stat *b) > } > > static void > -rsync_1 (path_buf * src, path_buf * dest, int and_delete) > +rsync_1 (path_buf * src, path_buf * dest, int and_delete, int force_copies) > { > DIR *dir; > struct dirent *de; > @@ -491,8 +491,9 @@ rsync_1 (path_buf * src, path_buf * dest, int and_delete) > r_append ("/", dest); > > if (verbose) > - printf ("sync %s to %s %s\n", src->buf, dest->buf, > - and_delete ? "and delete" : ""); > + printf ("sync %s to %s%s%s\n", src->buf, dest->buf, > + and_delete ? " and delete" : "", > + force_copies ? " (forced)" : ""); > > size_t staillen = src->len; > > @@ -521,10 +522,10 @@ rsync_1 (path_buf * src, path_buf * dest, int and_delete) > missing. */ > lstat (dest->buf, &d); > > - if (! need_sync (src->buf, dest->buf, &s, &d)) > + if (! force_copies && ! need_sync (src->buf, dest->buf, &s, &d)) > { > if (S_ISDIR (s.st_mode)) > - rsync_1 (src, dest, and_delete); > + rsync_1 (src, dest, and_delete, force_copies); > continue; > } > > @@ -559,7 +560,7 @@ rsync_1 (path_buf * src, path_buf * dest, int and_delete) > if (verbose) > printf ("+D %s\n", dest->buf); > maybe_xmkdir (dest->buf, (s.st_mode & 0777) | 0700); > - rsync_1 (src, dest, and_delete); > + rsync_1 (src, dest, and_delete, force_copies); > break; > > case S_IFLNK: > @@ -639,12 +640,12 @@ rsync_1 (path_buf * src, path_buf * dest, int and_delete) > } > > static void > -rsync (char *src, char *dest, int and_delete) > +rsync (char *src, char *dest, int and_delete, int force_copies) > { > r_setup (src, &spath); > r_setup (dest, &dpath); > > - rsync_1 (&spath, &dpath, and_delete); > + rsync_1 (&spath, &dpath, and_delete, force_copies); > } > > > @@ -846,11 +847,11 @@ main (int argc, char **argv) > do_ldconfig = true; > > rsync (pristine_root_path, new_root_path, > - file_exists (concat (command_root, "/preclean.req", NULL))); > + file_exists (concat (command_root, "/preclean.req", NULL)), 0); > > if (stat (command_root, &st) >= 0 > && S_ISDIR (st.st_mode)) > - rsync (command_root, new_root_path, 0); > + rsync (command_root, new_root_path, 0, 1); > > new_objdir_path = xstrdup (concat (new_root_path, > support_objdir_root, NULL)); > @@ -1044,7 +1045,7 @@ main (int argc, char **argv) > > /* Child has exited, we can post-clean the test root. */ > printf("running post-clean rsync\n"); > - rsync (pristine_root_path, new_root_path, 1); > + rsync (pristine_root_path, new_root_path, 1, 0); > > if (WIFEXITED (status)) > exit (WEXITSTATUS (status)); > Hi DJ, with your patch, the files are synced and I've successfully rerun nss/tst-reload1 multiple times. Rerunning nss/tst-reload2 after nss/tst-reload1 and the other way around is also fine. Please commit your patch and also mention "Bug 27537 - [2.33/2.34 Regression] FAIL: nss/tst-reload2" (I've just added a comment there) Then my patch is not needed anymore. Bye, Stefan