From: Chris Hofstaedtler Date: Tue, 21 Jan 2025 17:58:48 +0000 (+0100) Subject: fallocate: forbid --posix with special options X-Git-Tag: v2.42-start~78^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b85feb999c505222d4815638344c8883d5e4ab58;p=thirdparty%2Futil-linux.git fallocate: forbid --posix with special options Option --posix picks posix_fallocate, which does not have a mode flag. Forbid using any options that set mode flags when also giving --posix. Signed-off-by: Chris Hofstaedtler --- diff --git a/sys-utils/fallocate.1.adoc b/sys-utils/fallocate.1.adoc index edcca8e0a..44ee0ef4c 100644 --- a/sys-utils/fallocate.1.adoc +++ b/sys-utils/fallocate.1.adoc @@ -28,7 +28,7 @@ The exit status returned by *fallocate* is 0 on success and 1 on failure. The _length_ and _offset_ arguments may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB, and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB, and YB. -The options *--collapse-range*, *--dig-holes*, *--punch-hole*, and *--zero-range* are mutually exclusive. +The options *--collapse-range*, *--dig-holes*, *--punch-hole*, *--zero-range* and *--posix* are mutually exclusive. *-c*, *--collapse-range*:: Removes a byte range from a file, without leaving a hole. The byte range to be collapsed starts at _offset_ and continues for _length_ bytes. At the completion of the operation, the contents of the file starting at the location __offset__+_length_ will be appended at the location _offset_, and the file will be _length_ bytes smaller. The option *--keep-size* may not be specified for the collapse-range operation. diff --git a/sys-utils/fallocate.c b/sys-utils/fallocate.c index ac7c687f2..ded62f4b0 100644 --- a/sys-utils/fallocate.c +++ b/sys-utils/fallocate.c @@ -315,7 +315,7 @@ int main(int argc, char **argv) static const ul_excl_t excl[] = { /* rows and cols in ASCII order */ { 'c', 'd', 'p', 'z' }, { 'c', 'n' }, - { 'x', 'c', 'd', 'i', 'n', 'p', 'z'}, + { 'c', 'd', 'i', 'n', 'p', 'x', 'z'}, { 0 } }; int excl_st[ARRAY_SIZE(excl)] = UL_EXCL_STATUS_INIT;