bugfindutils - Bugs: bug #49147, Tab character replaced by question...

 
 

bug #49147: Tab character replaced by question mark ("?") when locate outputs to tty

Submitter:  Yuval S <yuvals>
Submitted:  Wed 21 Sep 2016 11:13:23 AM UTC
   
 
Category:  locate Severity:  3 - Normal
Item Group:  Wrong result Status:  Invalid
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Open
Release:  4.6.0 Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 01 Sep 2019 01:20:49 PM UTC, comment #3: 

 

> Well that's a design option which we don't take.  We quote them, for several reasons, including user security.  IOW the tool is operating as intended here.


Can you elaborate, on the security benefits of not outputting tabs to the terminal? Especially as this is easily circumvented using `cat` I don't see the benefit. I would be happy to learn here.

Anyway, I do suggest adding this to the documentation.

I would also be glad with an answer of "good idea, why don't you implement it?", but I don't understand this answer.

Yuval S <yuvals>
Sun 01 Sep 2019 07:50:04 AM UTC, comment #2: 


> Output piped via `cat` should be identical to direct terminal output.


Well that's a design option which we don't take.  We quote them, for several reasons, including user security.  IOW the tool is operating as intended here.


James Youngman <jay>
Group administrator
Wed 21 Sep 2016 11:16:33 AM UTC, comment #1: 

The second call to `locate` should have `/path/to/locate` as well, of course. I used the exact same executable (4.6.0).

Yuval S <yuvals>
Wed 21 Sep 2016 11:13:23 AM UTC, original submission:  

Version: 4.6.0

What I am trying to do:
I added size information after a tab character at the end of each locatedb entry (this allows me to use locate to find files by size).

The exact command lines I was using: (up to absolute paths)


$ mkdir test-locatedb && cd test-locatedb
$ touch a b c d e f g
$ du -a | awk -v 'OFS=\t' '{print $2,$1}' | /path/to/frcode > test.locatedb
$ /path/to/locate --database=test.locatedb a
./test.locatedb?1
./a?1
$ locate --database=test.locatedb a | cat
./a     1
./test.locatedb 1
$ /path/to/locate --version
locate (GNU findutils) 4.6.0
...


What I expected to happen:
I expect the tab character to be displayed when `locate` outputs results to the terminal.

What did happen:
`locate` replaces tabs with question marks ("?")

More information:
Output piped via `cat` should be identical to direct terminal output. Alternatively, the behavior should be documented in the `man` page.

Relevant code:

Yuval S <yuvals>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jay (Posted a comment)
  • -email is unavailable- added by yuvals (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-09-01 jay Open/ClosedClosed Open
    2019-09-01 jay StatusNone Invalid
        Assigned toNone jay
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code