AI-2007-09-02 Austin-388 Page 1 of 1 Submitted by Ulrich Drepper, Red Hat. Sep 10, 2007 XBD fcntl(), page 227: Change from O_EXEC Open for execute only (non-directory files). Use of this flag on directories is currently unspecified. to O_EXEC Open for execute only (non-directory files). The result is unspecified if this flag is applied to a directory. Add after line 7728: O_SEARCH Open directory for search only. The result is unspecified if this flag is applied to a non-directory file. Change l7800 FUTURE DIRECTIONS The meaning of the O_EXEC flag on directories may be specified in a future version. to None. XSH, page 539, access(), line 19128 Change It is unspecified whether directory searches are permitted based on whether the file was opened with search permission or on the current permissions of the directory underlying the file descriptor. To If the file descriptor was opened without O_SEARCH, the function shall check whether directory searches are permitted using the current permissions of the directory underlying the file descriptor. If the file descripter was opened with O_SEARCH, the function shall not perform the check. Add after line 19152: [EACCES] /fd/ was not opened with O_SEARCH and the permissions of the directory underlying /fd/ do not permit directory searches. XSH, page 631, chmod(), line 21798 Change It is unspecified whether directory searches are permitted based on whether the file was opened with search permission or on the current permissions of the directory underlying the file descriptor. To If the file descriptor was opened without O_SEARCH the function shall check whether directory searches are permitted using the current permissions of the directory underlying the file descriptor. If the file descripter was opened with O_SEARCH, the function shall not perform the check. Add after line 21823: [EACCES] /fd/ was not opened with O_SEARCH and the permissions of the directory underlying /fd/ do not permit directory searches. XSH, page 635, chown(), line 21953 Change It is unspecified whether directory searches are permitted based on whether the file was opened with search permission or on the current permissions of the directory underlying the file descriptor. To If the file descriptor was opened without O_SEARCH the function shall check whether directory searches are permitted using the current permissions of the directory underlying the file descriptor. If the file descripter was opened with O_SEARCH, the function shall not perform the check. Add after line 21982: [EACCES] /fd/ was not opened with O_SEARCH and the permissions of the directory underlying /fd/ do not permit directory searches. XSH, page 915, fstatat(), line 31104 Change It is unspecified whether directory searches are permitted based on whether the file was opened with search permission or on the current permissions of the directory underlying the file descriptor. To If the file descriptor was opened without O_SEARCH the function shall check whether directory searches are permitted using the current permissions of the directory underlying the file descriptor. If the file descripter was opened with O_SEARCH, the function shall not perform the check. Add after line 31131: [EACCES] /fd/ was not opened with O_SEARCH and the permissions of the directory underlying /fd/ do not permit directory searches. XSH, page 936, futimens() Add in line 31779 before "If utimensat() is passed..." If the file descriptor was opened without O_SEARCH the function shall check whether directory searches are permitted using the current permissions of the directory underlying the file descriptor. If the file descripter was opened with O_SEARCH, the function shall not perform the check. Start new paragraph before "If utimensat() is passed..." Add after line 31822: [EACCES] /fd/ was not opened with O_SEARCH and the permissions of the directory underlying /fd/ do not permit directory searches. XSH, page 1259, mkfifo(), line 41863 Change It is unspecified whether directory searches are permitted based on whether the file was opened with search permission or on the current permissions of the directory underlying the file descriptor. To If the file descriptor was opened without O_SEARCH the function shall check whether directory searches are permitted using the current permissions of the directory underlying the file descriptor. If the file descripter was opened with O_SEARCH, the function shall not perform the check. Add after line 41887: [EACCES] /fd/ was not opened with O_SEARCH and the permissions of the directory underlying /fd/ do not permit directory searches. XSH, page 1264, mknod(), line 42015 Change It is unspecified whether directory searches are permitted based on whether the file was opened with search permission or on the current permissions of the directory underlying the file descriptor. To If the file descriptor was opened without O_SEARCH the function shall check whether directory searches are permitted using the current permissions of the directory underlying the file descriptor. If the file descripter was opened with O_SEARCH, the function shall not perform the check. Add after line 42044: [EACCES] /fd/ was not opened with O_SEARCH and the permissions of the directory underlying /fd/ do not permit directory searches. XSH, page 1346, open() Change line 44439 first four values to first five values Change O_EXEC Open for execute only (non-directory files). Use of this flag on directories is currently unspecified. to O_EXEC Open for execute only (non-directory files). The result is unspecified if this flag is applied to a directory. Add after line 44446 O_SEARCH Open directory for search only. The result is unspecified if this flag is applied to a non-directory file. Change line 44532 It is unspecified whether directory searches are permitted based on whether the file was opened with search permission or on the current permissions of the directory underlying the file descriptor. To If the file descriptor was opened without O_SEARCH the function shall check whether directory searches are permitted using the current permissions of the directory underlying the file descriptor. If the file descripter was opened with O_SEARCH, the function shall not perform the check. Add after line 44582: [EACCES] /fd/ was not opened with O_SEARCH and the permissions of the directory underlying /fd/ do not permit directory searches. Change FUTURE DIRECTIONS The meaning of the O_EXEC flag on directories may be specified in a future version. To FUTURE DIRECTIONS None. RATIONALE (p1349) change from O_EXEC is specified as one of the four file access modes. On implementations where none of O_RDONLY, O_WRONLY, or O_RDWR is zero, applications may open a directory with O_EXEC OR’d in with one of the other three file access modes. On many historical implementations, this cannot be done since O_RDONLY has been defined to be zero. to O_EXEC and O_SEARCH are specified as two of the five file access modes. Since O_EXEC does not apply to directories and O_SEARCH only applies to directories, their values need not be distinct. Since O_RDONLY has historically had the value zero, implementations are not able to distinguish between O_SEARCH and O_SEARCH | O_RDONLY, and similarly for O_EXEC. XSH, page 1708, readlink(), line 54780 Change It is unspecified whether directory searches are permitted based on whether the file was opened with search permission or on the current permissions of the directory underlying the file descriptor. To If the file descriptor was opened without O_SEARCH the function shall check whether directory searches are permitted using the current permissions of the directory underlying the file descriptor. If the file descripter was opened with O_SEARCH, the function shall not perform the check. Add after line 54804: [EACCES] /fd/ was not opened with O_SEARCH and the permissions of the directory underlying /fd/ do not permit directory searches. XSH, page 1740, rename(), line 55865 Change It is unspecified whether directory searches are permitted based on whether the file was opened with search permission or on the current permissions of the directory underlying the file descriptor. To If the file descriptor was opened using without O_SEARCH the function shall check whether directory searches are permitted using the current permissions of the directory underlying the file descriptor. If the file descripter was opened with O_SEARCH, the function shall not perform the check. Add after line 55915: [EACCES] /oldfd/ or /newfd/ was not opened with O_SEARCH and the permissions of the directory underlying /oldfd/ or /newfd/ respectively do not permit directory searches. XSH, page 2005, symlink(), line 63684 Change It is unspecified whether directory searches are permitted based on whether the file was opened with search permission or on the current permissions of the directory underlying the file descriptor. To If the file descriptor was opened without O_SEARCH the function shall check whether directory searches are permitted using the current permissions of the directory underlying the file descriptor. If the file descripter was opened with O_SEARCH, the function shall not perform the check. Add after line 63714: [EACCES] /fd/ was not opened with O_SEARCH and the permissions of the directory underlying /fd/ do not permit directory searches. XSH, page 2104, unlink(), line 66581 Change It is unspecified whether directory searches are permitted based on whether the file was opened with search permission or on the current permissions of the directory underlying the file descriptor. To If the file descriptor was opened without O_SEARCH the function shall check whether directory searches are permitted using the current permissions of the directory underlying the file descriptor. If the file descripter was opened with O_SEARCH, the function shall not perform the check. Add after line 66617: [EACCES] /fd/ was not opened with O_SEARCH and the permissions of the directory underlying /fd/ do not permit directory searches. for every *at() function The EBADF error needs to change from "for reading" to "for reading or searching"