Re: [PATCH] open, path_resolution: specify PATH_MAX and ELOOP limits

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

 



* Shawn Landden <shawn@xxxxxxx>, 2018-08-12, 07:51:
-Too many symbolic links were encountered in resolving
+Too many (more than 40) symbolic links were encountered in resolving

The actual limit is system-dependent. For contemporary versions of Linux it's indeed 40, but the limit used to be lower. Linux limits are explained in the path_resolution(7) man page.

I don't think we need so much details in the open(3) man page. But if we're going to add it, man pages for other syscalls that can fail with ELOOP should be updated.

.B ENAMETOOLONG
.I pathname
-was too long.
+was too long. (longer than 4096 bytes)

This limit is system-dependent, too.

PATH_MAX on Linux is indeed 4096, but that's the length including terminating null byte. So the longest allowed pathname on Linux has 4095 bytes.

Most of relevant man pages (with exception of realpath(3)) don't seem to mention that there might be also a limit on path component length.

-There is a maximum length for pathnames.
-If the pathname (or some
-intermediate pathname obtained while resolving symbolic links)
-is too long, an
+There is a maximum length for pathnames. (4096 bytes)
+If the pathname is too long, an

Hmm, why did you remove the parenthetical?

-error is returned ("Filename too long").
+error is returned ("File name too long")

POSIX uses the term "filename", and this is also this project's preferred term (see man-pages(7)). Admittedly glibc uses "file name" in this error message; but I'm not sure faithfully reproducing glibc error messages was the goal here.

+..SS Indirection Limit
+There is a maximum length for symlinks that will be dereferenced, (40)
+at which point
+.B ELOOP
+will be returned ("Too many symbolic links encountered").

As mentioned earlier, this is already explained elsewhere in this man page.

--
Jakub Wilk



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux