From 4d2d9a106f330ce7c08fbb48f6779efb38a23ea3 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Tue, 19 Feb 2013 11:52:30 +0100 Subject: [PATCH] namespaces.7: Add further EINVAL cases for writes to userspace map files Signed-off-by: Michael Kerrisk --- man7/namespaces.7 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/man7/namespaces.7 b/man7/namespaces.7 index fbf41f492..a2f1d8df2 100644 --- a/man7/namespaces.7 +++ b/man7/namespaces.7 @@ -633,6 +633,13 @@ Lines are terminated by newline characters. .IP * There is an (arbitrary) limit on the number of lines in the file. As at Linux 3.8, the limit is five lines. +In addition, +the number of bytes written to the file cannot exceed the system page size, +and the write must be performed at the start of the file (i.e., +.BR lseek (2) +and +.BR pwrite (2) +can't be used to write to nonzero offsets in the file). .IP * The range of user IDs specified in each line cannot overlap with the ranges in any other lines. @@ -641,6 +648,8 @@ satisfied by a simplistic implementation that imposes the further requirement that the values in both field 1 and field 2 of successive lines must be in ascending numerical order. +.IP * +At least one line mist be written to the file. .PP Writes that violate the above rules fail with the error .BR EINVAL .