Opened 13 years ago

Closed 13 years ago

#81 closed defect (invalid)

Тест -f (rewrite)

Reported by: Максим Щелоков Owned by: somebody
Priority: minor Milestone:
Component: nginx-module Version:
Keywords: rewrite, if, -f Cc:
uname -a: Linux
nginx -V: 0.7.x - 1.0.x

Description

Доброго времени.
Баг или фича, то что -f делает stat() и не отличает обычный файл от линков, может быть нужен lstat() ?
По крайней мере, согласно документации, -f должен быть true только на обычных файлах.

Change History (1)

comment:1 by Maxim Dounin, 13 years ago

Resolution: invalid
Status: newclosed

Correct definition of what "-f" does may be found in POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html

-f pathname
True if pathname resolves to an existing directory entry for a regular file. False if pathname cannot be resolved, or if pathname resolves to an existing directory entry for a file that is not a regular file.

I.e. it is expected to use stat(), not lstat(). No bug here.

Note: See TracTickets for help on using tickets.