NetBSD Problem Report #57191

From www@netbsd.org  Fri Jan 20 04:40:05 2023
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 617791A9239
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 20 Jan 2023 04:40:05 +0000 (UTC)
Message-Id: <20230120044004.396CF1A923B@mollari.NetBSD.org>
Date: Fri, 20 Jan 2023 04:40:04 +0000 (UTC)
From: hakan.engvall@gmail, com@netbsd.org
Reply-To: hakan.engvall@gmail.com
To: gnats-bugs@NetBSD.org
Subject: locate.updatedb fails to create the locate.database file
X-Send-Pr-Version: www-1.0

>Number:         57191
>Category:       misc
>Synopsis:       locate.updatedb fails to create the locate.database file
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 20 04:45:00 +0000 2023
>Closed-Date:    Sun Apr 30 03:04:06 +0000 2023
>Last-Modified:  Sun Apr 30 03:04:06 +0000 2023
>Originator:     Håkan Engvall
>Release:        NetBSD-9.3_STABLE from Nov 11, 2022
>Organization:
>Environment:
NetBSD carolina.local 9.3_STABLE NetBSD 9.3_STABLE (CAROLINA) #1: Thu Jan 19 10:04:05 EST 2023  root@syn.local:/usr/src/sys/arch/i386/compile/CAROLINA i386
>Description:
The locate.updatedb script fails to generate the locate.database file when trying to execute locate.code with a bigram string beginning with a dash ('-').
>How-To-Repeat:
It will be hard to recreate a data set that will generate a bigram string beginning with a dash ('-') without providing the full file listing from my system. I don't really want to do that for privacy reasons. But the bigram string from my system was: 
"- htmp.mp3jpJP.herine 2.tm1.ml3.ongi4.py.pe.5.re6..3enanstte7.8.s.he -10thn 9.ngt lear0.1 oresnd2 vet.atmes pd3 llder ta4 setir.ntalri5 itraouman.li6 y neTh.J7 PG.j8 etpgisrsroch Stod.9 d il01a io M Tun telophoeadfla/0ckrtomy.o geptockeurtrg lonaniodedss20"
>Fix:

Apply the following patch to locate.updatedb:

--- /usr/libexec/locate.updatedb.orig   2023-01-19 23:23:12.655056582 -0500
+++ /usr/libexec/locate.updatedb        2014-08-04 13:33:00.000000000 -0400
@@ -192,6 +192,6 @@
        echo 'locate: updatedb failed' >&2
        exit 1
 else
-       $LIBDIR/locate.code "$BIGRAMS" <"$FILELIST" >"$FCODES"
+       $LIBDIR/locate.code -- "$BIGRAMS" <"$FILELIST" >"$FCODES"
        chmod 644 "$FCODES"
 fi

This patch is against:
head -4 /usr/libexec/locate.updatedb
#!/bin/sh
#
#       $NetBSD: updatedb.sh,v 1.15 2014/08/04 21:56:30 apb Exp $
#

But should work for the HEAD version (1.17) with adjustment for line  numbers.

>Release-Note:

>Audit-Trail:
From: "Valeriy E. Ushakov" <uwe@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57191 CVS commit: src/usr.bin/locate/locate
Date: Fri, 20 Jan 2023 13:07:09 +0000

 Module Name:	src
 Committed By:	uwe
 Date:		Fri Jan 20 13:07:09 UTC 2023

 Modified Files:
 	src/usr.bin/locate/locate: updatedb.sh

 Log Message:
 locate.updatedb: Add -- to the invocation of locate.code

 A bigram can start with a dash/minus, don't let getopt misinterpret it
 as an option.

 From Hakan Engvall in PR misc/57191


 To generate a diff of this commit:
 cvs rdiff -u -r1.17 -r1.18 src/usr.bin/locate/locate/updatedb.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57191 CVS commit: [netbsd-8] src/usr.bin/locate/locate
Date: Mon, 23 Jan 2023 13:16:18 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Jan 23 13:16:18 UTC 2023

 Modified Files:
 	src/usr.bin/locate/locate [netbsd-8]: updatedb.sh

 Log Message:
 Pull up following revision(s) (requested by uwe in ticket #1793):

 	usr.bin/locate/locate/updatedb.sh: revision 1.18

 locate.updatedb: Add -- to the invocation of locate.code

 A bigram can start with a dash/minus, don't let getopt misinterpret it
 as an option.

 From Hakan Engvall in PR misc/57191


 To generate a diff of this commit:
 cvs rdiff -u -r1.15 -r1.15.16.1 src/usr.bin/locate/locate/updatedb.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57191 CVS commit: [netbsd-9] src/usr.bin/locate/locate
Date: Mon, 23 Jan 2023 13:17:28 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Jan 23 13:17:28 UTC 2023

 Modified Files:
 	src/usr.bin/locate/locate [netbsd-9]: updatedb.sh

 Log Message:
 Pull up following revision(s) (requested by uwe in ticket #1576):

 	usr.bin/locate/locate/updatedb.sh: revision 1.18

 locate.updatedb: Add -- to the invocation of locate.code

 A bigram can start with a dash/minus, don't let getopt misinterpret it
 as an option.

 From Hakan Engvall in PR misc/57191


 To generate a diff of this commit:
 cvs rdiff -u -r1.15 -r1.15.26.1 src/usr.bin/locate/locate/updatedb.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57191 CVS commit: [netbsd-10] src/usr.bin/locate/locate
Date: Mon, 23 Jan 2023 13:18:33 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Jan 23 13:18:33 UTC 2023

 Modified Files:
 	src/usr.bin/locate/locate [netbsd-10]: updatedb.sh

 Log Message:
 Pull up following revision(s) (requested by uwe in ticket #58):

 	usr.bin/locate/locate/updatedb.sh: revision 1.18

 locate.updatedb: Add -- to the invocation of locate.code

 A bigram can start with a dash/minus, don't let getopt misinterpret it
 as an option.

 From Hakan Engvall in PR misc/57191


 To generate a diff of this commit:
 cvs rdiff -u -r1.17 -r1.17.6.1 src/usr.bin/locate/locate/updatedb.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 30 Apr 2023 03:04:06 +0000
State-Changed-Why:
Patch was committed and pulled up, thanks.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.