Skip to content

Commit ea2c8e6

Browse files
committed
btrfs-progs: receive: make receive fall back on EPERM
For non-root usage, receive can't write compressed data and will get EPERM, but falling back to writing uncompressed data may work and allows receive as a normal user, which is safer. Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
1 parent 682f676 commit ea2c8e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmds/receive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ static int process_encoded_write(const char *path, const void *data, u64 offset,
12851285
if (ret >= 0)
12861286
return 0;
12871287
/* Fall back for these errors, fail hard for anything else. */
1288-
if (errno != ENOSPC && errno != ENOTTY && errno != EINVAL) {
1288+
if (errno != ENOSPC && errno != ENOTTY && errno != EINVAL && errno != EPERM) {
12891289
ret = -errno;
12901290
error("encoded_write: writing to %s failed: %m", path);
12911291
return ret;

0 commit comments

Comments
 (0)