| skipped 381 lines |
382 | 382 | | static int tmpfs_dump(struct mount_info *pm) |
383 | 383 | | { |
384 | 384 | | int ret = -1, fd = -1, userns_pid = -1; |
385 | | - | char tmpfs_path[PSFDS]; |
386 | 385 | | struct cr_img *img; |
387 | 386 | | int tmp_fds[3], ntmp_fds = 0, i; |
388 | 387 | | |
| skipped 28 lines |
417 | 416 | | if (!img) |
418 | 417 | | goto out; |
419 | 418 | | |
420 | | - | sprintf(tmpfs_path, "/proc/self/fd/%d", fd); |
421 | | - | |
422 | 419 | | if (root_ns_mask & CLONE_NEWUSER) |
423 | 420 | | userns_pid = root_item->pid->real; |
424 | 421 | | |
425 | | - | ret = cr_system_userns(-1, img_raw_fd(img), -1, "tar", (char *[]) |
| 422 | + | ret = cr_system_userns(fd, img_raw_fd(img), -1, "tar", (char *[]) |
426 | 423 | | { "tar", "--create", |
427 | 424 | | "--gzip", |
428 | 425 | | "--no-unquote", |
| skipped 3 lines |
432 | 429 | | "--preserve-permissions", |
433 | 430 | | "--sparse", |
434 | 431 | | "--numeric-owner", |
435 | | - | "--directory", tmpfs_path, ".", NULL }, 0, userns_pid); |
| 432 | + | "--directory", "/proc/self/fd/0", ".", NULL }, 0, userns_pid); |
436 | 433 | | |
437 | 434 | | if (ret) |
438 | 435 | | pr_err("Can't dump tmpfs content\n"); |
| skipped 436 lines |