Bug 14361

Summary: locate bogusly converts to network byte order in error messages
Product: Base System Reporter: Marc Slemko <marcs>
Component: binAssignee: Mike Heffner <mikeh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Marc Slemko 1999-10-16 19:50:00 UTC
Locate tries to magically figure out what byte order the locate database
is in.  If the length of a path is not between -MAXPATHLEN and MAXPATHLEN,
it tries converting it from network to host byte order.  If that is
still bogus, it prints an error.  However, it prints the error using the
converted length, which results in something like:

locate: integer out of +-MAXPATHLEN (1024): 100925440

instead of:

locate: integer out of +-MAXPATHLEN (1024): 1030

in the normal case.  I think it is far more reasonble to assume that, if
it doesn't fit network or host byte order, then the host one should
be displayed in the error.  That isn't perfect either, but it is a more
common.  The whole concept of trying to magically figure out what byte
order to use is a bit bogus, but this change makes it so that users don't
see the odd results of it unless they are trying to use a database built
in network byte order.

How-To-Repeat: 
Create a pathname longer than MAXPATHLEN and get it into your locate
database.  Then when locate hits it, it will spit out an error.
Comment 1 Mike Heffner freebsd_committer freebsd_triage 2001-08-16 17:21:57 UTC
Responsible Changed
From-To: freebsd-bugs->mikeh

I'll look into this.
Comment 2 Mike Heffner freebsd_committer freebsd_triage 2001-12-13 01:49:14 UTC
State Changed
From-To: open->closed

Fix committed.