Bug 25490 - [PATCH] fix various bugs in stat(1)
Summary: [PATCH] fix various bugs in stat(1)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sam Lawrance
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-03-02 09:50 UTC by Tony Finch
Modified: 2005-12-20 06:25 UTC (History)
0 users

See Also:


Attachments
file.diff (21.29 KB, patch)
2001-03-02 09:50 UTC, Tony Finch
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Finch 2001-03-02 09:50:01 UTC
The program is chock-a-block with buffer overflows.
It prints the symbolic mode incorrectly in a few cases.
It handles backslashes in a bogus fashion.

Fix: In adittion to fixing the above bugs, this also extends the format
syntax so that you can specify in more detail how the filename,
symlink target, device major and minor numbers, and times are
printed.
How-To-Repeat: 
fanf@hand.dotat.at:/FreeBSD/ports/sysutils/stat
:; stat -f `perl -e 'print "."x1028'` .
  File: "."
....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Segmentation fault (core dumped)
fanf@hand.dotat.at:/FreeBSD/ports/sysutils/stat
:; touch it
fanf@hand.dotat.at:/FreeBSD/ports/sysutils/stat
:; chmod +s it
fanf@hand.dotat.at:/FreeBSD/ports/sysutils/stat
:; ll it
-rwSr-Sr--   1 fanf     fanf            0 Mar  2 09:31 it
fanf@hand.dotat.at:/FreeBSD/ports/sysutils/stat
:; stat it
  File: "it"
  Size: 0       Allocated Blocks: 0     Filetype: Regular File
  Mode: (6644/-rw-s-sr--)       Uid: (1014/fanf) Gid: (1014/fanf)
Device: 160771  Inode: 435037   Links: 1
Access: Fri Mar  2 09:31:21 2001
Modify: Fri Mar  2 09:31:21 2001
Change: Fri Mar  2 09:31:32 2001
fanf@hand.dotat.at:/FreeBSD/ports/sysutils/stat
:; stat -f '%f\n' .
  File: "."
Directoryn
Comment 1 FUJISHIMA Satsuki freebsd_committer freebsd_triage 2001-03-03 21:05:06 UTC
Responsible Changed
From-To: freebsd-ports->wosch

Over to maintainer.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2005-09-30 03:05:55 UTC
State Changed
From-To: open->suspended

With bugmeister hat on, mark this as 'suspended' since nothing has 
happened with it in quite some time.
Comment 3 Pav Lucistnik freebsd_committer freebsd_triage 2005-11-26 01:21:55 UTC
State Changed
From-To: suspended->feedback

The patch does not apply
Comment 4 Sam Lawrance freebsd_committer freebsd_triage 2005-12-17 11:48:18 UTC
Responsible Changed
From-To: wosch->lawrance

I've been poking around in stat today.  Investigate.
Comment 5 Sam Lawrance freebsd_committer freebsd_triage 2005-12-20 06:22:07 UTC
State Changed
From-To: feedback->closed

stat is now in the base system with comparable functionality 
(from FreeBSD 4.10 onwards).  Since the software provided by 
this port is buggy and also redundant, I have marked it 
DEPRECATED with an expiration date 3 months ahead.