Email List: Xaustin-review-lX
[All Lists]

Defect in XSH readdir

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XSH readdir
From: yyyyyy@xxxxxxxxxxx
Date: Sun, 27 Aug 2006 18:24:43 +0100 (BST)
        Defect report from : Paul Eggert , UCLA

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page 1197 line 37475 section readdir objection {20060827b}

Problem:

Edition of Specification (Year): 2004

Defect code :  2. Omission

POSIX (with the XSI extension) currently allows readdir to return
junk for the d_ino members of directory entries that correspond to
symbolic links.  This would make the d_ino members relatively
useless for practical applications, as one must lstat the entry to
find out whether the d_ino value is valid, and if lstat is always
required then what was the point of d_ino?  In practice all
implementations that support the XSI d_ino extension use inode
numbers for symbolic links, so POSIX should specify the behavior
here.

There is also an editorial bug in the readdir spec; it talks about
the d_ino member in text that is not XSI-shaded, but d_ino is an
XSI extension.

This issue is related to XSH ERN 155.  The action proposed below
supersedes the first proposed action of XSH ERN 155.


Action:

After XSH page 1197 line 37475 (readdir), append the following
sentence with XSI highlighting:

  The value of the structure's d_ino member shall be the file
  serial number of the corresponding file.  If the entry names a
  symbolic link, the value of the d_ino member is the file serial
  number of the symbolic link.

In XSH page 1197 line 37489, remove:

  If the entry names a symbolic link, the value of the d_ino
  member is unspecified.

In XSH page 740 line 24393 (lstat), after:

  the st_size member shall contain the length of the pathname
  contained in the symbolic link.

insert the following with XSI shading:

  The members st_ino, st_dev, st_uid, st_gid, st_atime, st_ctime,
  and st_mtime shall have meaningful values.

In XBD page 360 line 12730 <sys/stat.h>, after:

  The st_size member shall contain the length, in bytes, of the
  pathname contained in the symbolic link.

insert the following with XSI shading:

  The members st_ino, st_dev, st_uid, st_gid, st_atime, st_ctime,
  and st_mtime shall have meaningful values.

<Prev in Thread] Current Thread [Next in Thread>