NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/48864: Incorrect symbolic link size on some filesystems



>Number:         48864
>Category:       kern
>Synopsis:       Incorrect symbolic link size on some filesystems
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 02 13:00:01 +0000 2014
>Originator:     Nicolas Joly
>Release:        NetBSD 6.99.43
>Organization:
Insitut Pasteur
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 6.99.43 NetBSD 6.99.43 (LANFEUST) #3: 
Mon Jun 2 11:29:06 CEST 2014 
njoly%lanfeust.sis.pasteur.fr@localhost:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/LANFEUST
 amd64
Architecture: x86_64
Machine: amd64
>Description:
According to the Opengroup online specification for lstat[1], for a symbolic
link, "the value of the st_size member shall be set to the length of the
pathname contained in the symbolic link not including any terminating null
byte."

At least tmpfs, udf and v7fs report wrong values for symlink size.

By example, tmpfs is off by one :

njoly@lanfeust [/tmp/lstat]> df -h .
Filesystem         Size       Used      Avail %Cap Mounted on
tmpfs              107G       7.0M       107G   0% /tmp
njoly@lanfeust [/tmp/lstat]> ln -s source destination
njoly@lanfeust [/tmp/lstat]> ls -l 
total 8
lrwxr-xr-x  1 njoly  wheel  7 Jun  2 14:30 destination -> source
njoly@lanfeust [/tmp/lstat]> stat -x destination
  File: "destination"
  Size: 7            FileType: Symbolic Link
  Mode: (0755/lrwxr-xr-x)         Uid: ( 1000/   njoly)  Gid: (    0/   wheel)
Device: 171,1   Inode: 85401585340920951    Links: 1
Access: Mon Jun  2 14:30:50 2014
Modify: Mon Jun  2 14:30:47 2014
Change: Mon Jun  2 14:30:47 2014

The reported size is 7 where it should be only 6.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/lstat.html

>How-To-Repeat:
Create a symbolic link on tmpfs/udf/v7fs filesystems and check its size.
>Fix:
Please.



Home | Main Index | Thread Index | Old Index