From: Chen Linxuan Date: Sun, 2 Feb 2025 13:57:33 +0000 (+0800) Subject: man/man2/mkdir.2: ERRORS: Add EOVERFLOW X-Git-Tag: man-pages-6.11~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2904e040ded291a898aa5e74b361d12ec90d5a2d;p=thirdparty%2Fman-pages.git man/man2/mkdir.2: ERRORS: Add EOVERFLOW mkdir(2) and mkdirat(2) might set errno to EOVERFLOW when UID or GID mapping has not been configured. Here's a small program that shows this behavior: #define _GNU_SOURCE #include #include #include #include #include #include #include #include static int childFunc(void *_) { if (mount("tmpfs", "/tmp", "tmpfs", 0, NULL)) err(EXIT_FAILURE, "mount"); if (mkdir("/tmp/test", 0755) == -1) err(EXIT_FAILURE, "mkdir"); return 0; } #define STACK_SIZE (1024 * 1024) int main(void) { char *stack; /* Start of stack buffer */ char *stackTop; /* End of stack buffer */ pid_t pid; stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0); if (stack == MAP_FAILED) err(EXIT_FAILURE, "mmap"); stackTop = stack + STACK_SIZE; pid = clone(childFunc, stackTop, CLONE_NEWUSER | CLONE_NEWNS | SIGCHLD, NULL); if (munmap(stack, STACK_SIZE) == -1) err(EXIT_FAILURE, "munmap"); if (pid == -1) err(EXIT_FAILURE, "clone"); if (waitpid(pid, NULL, 0) == -1) err(EXIT_FAILURE, "waitpid"); exit(EXIT_SUCCESS); } Link: Signed-off-by: Chen Linxuan Message-ID: [alx: wfix] Signed-off-by: Alejandro Colomar --- diff --git a/man/man2/mkdir.2 b/man/man2/mkdir.2 index d84dbc27e..3c3fad6ee 100644 --- a/man/man2/mkdir.2 +++ b/man/man2/mkdir.2 @@ -203,6 +203,10 @@ does not support the creation of directories. .B EROFS .I pathname refers to a file on a read-only filesystem. +.B EOVERFLOW +UID or GID mappings (see +.BR user_namespaces (7)) +have not been configured. .SH VERSIONS Under Linux, apart from the permission bits, the .B S_ISVTX