Commit Graph

16051 Commits

Author SHA1 Message Date
Andrew Borodin
1f36a3fd80 (copy_dir_dir): clarify get of mode and attributes of source directory.
Use the same way as in copy_file_file().

Signed-off-by: Andrew Borodin <borodin@axion.lan>
2024-10-18 18:37:40 +03:00
Andrew Borodin
5486bdad0e file operations: rename actions and button names:
skip -> ignore
skip all -> ignore all.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-18 18:37:40 +03:00
Andrew Borodin
cbb3c9a372 Clarify messages of get/set ext2 attributes errors.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-18 18:37:39 +03:00
Andrew Borodin
5f5e71b7f8 Ticket #4590: clarify handling of ext2 attributes errors.
Don't show an error message if mc_fgetflags() and mc_fsetflags()
fails and errno set to ENOTSUP, EOPNOTSUPP, ENOSYS, and EINVAL.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-18 18:37:39 +03:00
Andrew Borodin
de7d72cab4 src/vfs/tar/tar-internal.c: define UINTMAX_WIDTH.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-17 21:10:08 +02:00
Yury V. Zaytsev
2c76c23a8f buildsys: fix bootstrapped build on Solaris and systems with LC_ALL != C
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-17 21:10:08 +02:00
Andrew Borodin
54a4c7d55f Merge branch '4598_tar_segfault'
* 4598_tar_segfault:
  tar: initialize variables passed to stoint().
  (decode_num): simplify expression.
  Ticket #4598: fix segfault on open TAR archive.

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-11 17:37:19 +03:00
Andrew Borodin
0c505b9e13 tar: initialize variables passed to stoint().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-10 21:16:32 +03:00
Andrew Borodin
f4740bf0b9 (decode_num): simplify expression.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-10 21:12:21 +03:00
Andrew Borodin
773bb6f60b Ticket #4598: fix segfault on open TAR archive.
(decode_timespec): fix incorrect assignment of variable.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-10 21:08:13 +03:00
Yury V. Zaytsev
b294d650a3 Merge branch '4596_fix_command_v'
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-09 17:26:57 +02:00
Yury V. Zaytsev
f53e9b10bd Ticket #4596: don't suppress command -v output for variable assignments
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-09 09:34:45 +02:00
Andrew Borodin
5e2a484b92 Merge branch '4593_tar_compilation'
* 4593_tar_compilation:
  (user_menu_cmd): minor refactoring.
  (user_menu_cmd): remove unused variable.
  Ticket #4595: tar: fix comparison of integer expressions of different signedness.
  (decode_time): initialize variable.
  Ticket #4593: tar: fix compilation on systems w/o stdckdint.h.

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-08 13:03:34 +03:00
Andrew Borodin
b4f4618994 (user_menu_cmd): minor refactoring.
Fix comparison of integer expressions of different signedness.
Reduce variable scope.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-08 13:02:24 +03:00
Andrew Borodin
1719f3383f (user_menu_cmd): remove unused variable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-08 13:02:24 +03:00
Andrew Borodin
4b1cdccb48 Ticket #4595: tar: fix comparison of integer expressions of different signedness.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-08 13:02:17 +03:00
Andrew Borodin
9d462b135c (decode_time): initialize variable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-08 13:02:17 +03:00
Andrew Borodin
d7b85ed9c9 Ticket #4593: tar: fix compilation on systems w/o stdckdint.h.
* lib/intprops.h: new file.
  * src/vfs/tar/tar-internal.h: include intprops.h, remove macros
    defined there.
  * src/vfs/tar/tar-sparse.c: remove macro, defined in intprops.h.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-08 13:02:17 +03:00
Andrew Borodin
f46406473e Merge branch '4572_cleanup'
* 4572_cleanup: (53 commits)
  doc: fix typos in comments
  Update po/*.po fiies.
  (mcview_display_hex): refactor, fix coding style.
  src/vfs/cpio/cpio.c: fix coding style.
  lib/vfs/path.h: fix coding style.
  (setup__is_cfg_group_must_panel_config): fix coding style.
  (check_format_var): fix coding stile.
  (copy_file_file): handling "Abort" button on chown/chmod/chattr error.
  buildsys: remove orphaned rpc checks after samba was deleted
  src/filemanager/chattr.c: fix coding style.
  (chattrboxes_rename): reduce variable scope.
  (files_error): fix coding style.
  (show_version): add output of uintmax_t size.
  lib/vfs/direntry.c: fix coding style.
  lib/vfs/vfs.c: fix coding style.
  (spell_dialog_spell_suggest_show): refactoring.
  tar: avoid need for base64_init and extra table.
  (tar_from_header): reword to avoid a cast to unsigned char.
  tar: avoid casts in tar_checksum.
  tar: prefer stoint to strtoul and variants.
  ...
2024-10-06 12:11:29 +03:00
Yury V. Zaytsev
d11faea07d doc: fix typos in comments
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-05 18:55:01 +02:00
Andrew Borodin
699312f9b6 Update po/*.po fiies. 2024-10-05 15:13:07 +03:00
Andrew Borodin
aa4e5019f9 (mcview_display_hex): refactor, fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
918d386172 src/vfs/cpio/cpio.c: fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
c5379ab36e lib/vfs/path.h: fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
a92de91616 (setup__is_cfg_group_must_panel_config): fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
4b49c82198 (check_format_var): fix coding stile.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
51ff7dc13c (copy_file_file): handling "Abort" button on chown/chmod/chattr error.
The "Abort" buton must interrupt the copy/move of a directory
mot a file only.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Yury V. Zaytsev
901a1a98a9 buildsys: remove orphaned rpc checks after samba was deleted
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2024-10-05 15:07:14 +03:00
Andrew Borodin
6e95a0be43 src/filemanager/chattr.c: fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
b0ce42e55b (chattrboxes_rename): reduce variable scope.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
602a2edf60 (files_error): fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
03a1a9c95b (show_version): add output of uintmax_t size.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
d3c26320d4 lib/vfs/direntry.c: fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
de9551be13 lib/vfs/vfs.c: fix coding style.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
54d4dfc534 (spell_dialog_spell_suggest_show): refactoring.
Reduce variable scope. Get rid of extra NULL check: g_strdup() handles
NULL correctly. Remove intermediate variable.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
80f7a162c3 tar: avoid need for base64_init and extra table.
Simplify the code by assuming C99 initializers.

  * (base_64_digits): Remove; no longer needed.
  * (base64_map): Now a constant. Initialized statically,
    and with invalid entries being 0 not 64, and with valid
    entries being 1 greater than before.
  * (tar_base64_init): Remove; only use removed.
  * (tar_from_header): Adjust to new values in base64_map.

Sync with GNU tar 43231ae554d0dacbcc32e2d0fe574c9d0e183258.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
aadedc361d (tar_from_header): reword to avoid a cast to unsigned char.
Sync with GNU tar b201a3742162adcb2cf1e9618c4c4f4db0d239ae.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
b6483b8a47 tar: avoid casts in tar_checksum.
* (tar_checksum): recode to avoid casts.
  * (tar_from_header): likewise.

Sync with GNU tar 1521d3dae01f91606c639eb745ea565ef723e38d.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:14 +03:00
Andrew Borodin
7d8deb89c8 tar: prefer stoint to strtoul and variants.
When parsing numbers prefer using strtosysint() (renamed stoint)
to using strtoul() and its variants.
This is simpler and faster and likely more reliable than
relying on quirks of the system strtoul() etc,
and it standardizes how tar deals with parsing integers.
Among other things, the C standard and POSIX don't specify
what strtol() does to errno when conversions cannot be performed,
and it requires strtoul() to support "-" before unsigned numbers.

  * (stoint): rename from strtosysint, move to tar-internal.c and add
    a gboollean * argument for reporting overflow.  All callers changed.
  * (decode_num): prefer stoint() to strtol() etc. Don't rely on
    errno == EINVAL as the standards don't guarantee it.
  * (decode_signed_num): likewise.
  * (decode_record): likewise.
  * (sparse_map_decoder): likewise.
  * (decode_timespec): Simplify by using ckd_sub() rather than checking
    for overflow by hand.
  * tar-sparse.c: remove include of errno.h, it's no lomger used.
  * tar-xheader.c: likewise

Sync with GNU tar d1e72a536f26188230a147d948b9057714fd0b6b.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00
Andrew Borodin
5bb5442cd1 src/vfs/tar/tar-xheader.c: indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00
Andrew Borodin
465d8b962a (blocking_factor, record_size): change type.
Don't limit blocking factor to INT_MAX.
Prefer signed type for record_size.
Do not exceed IDX_MAX or SSIZE_MAX for record_size;
the SSIZE_MAX limit is needed so that "read" calls behave sensibly.

Sync with GNU tar 3ffe2eb0738504aabee0d3b4d0c03e01739b9d6c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00
Andrew Borodin
ebbff2266a configure.ac: default to GNU/Linux dev_t, ino_t, major_t, minor_t.
This shouldn't affect behavior; it's just a cleanup.

Sync with GNU tar eb9bb9bf8049522230a0654c3f32e6373b945254.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00
Andrew Borodin
20b617a8ab tar: avoid strtoul().
This is part of the general trend to prefer signed integer types,
to allow better runtime checking with -fsanitize=undefined etc.

  * (struct tar_stat_info): ue intmax_t, not unsigned, for sparse major
    and minor.
  * (tar_sparse_major): likewise.
  * (tar_sparse_minor): likewise.

Sync with GNU tar 4642cd04edbd57414e004920fa4976d9f3be6206.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00
Andrew Borodin
79b10fc8a7 (tar_from_header): ckd_mul() and ckd_add() rather than doing it by hand.
(LG_64): Remove; no longer used.

Sync with GNU tar 414f635d8bba4c8894855040b1e6b77b07dc07bd.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00
Andrew Borodin
b9e7ab2f08 (pax_decode_header): use SIZE_MAX.
Sync with GNU tar 281e03ec6ccb9e6da134f8f6b9a9ff51c42f5737.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00
Andrew Borodin
c9288158bc (tar_from_header): minor width cleanup.
Use UINTMAX_WIDTH rather than computing it by hand.

Sync with GNU tar fbc60c2334326fc2f748226abe76190ecf39a26b.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00
Andrew Borodin
2aeff547ca tar: include stdckdint.h via tar-internal.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00
Andrew Borodin
ed99e93019 src/vrs/tar/tar-sparse.c: prefer stdckdint.h to intprops.h.
* (oldgnu_add_sparse): prefer ckd_add and ckd_mul to the intprops.h
    equivalents, since stdckdint.h is now standard.
  * (pax_decode_header): likewise.

Remove macros defined in lib/intprops-internal.h.

Sync with GNU tar a9372cf08a05723b2a06efff3402077598138238.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00
Andrew Borodin
730fdef61d (tar_read_header): simplify read_header overflow checking.
Use ckd_add instead of doing overflow checking by hand.
Although the old code was correct on all practical hosts,
the new code is simpler and works even on weird hosts
where SIZE_MAX <= INT_MAX.

Sync with GNU tar 8a3fc529729acf38276b27f6b7bc50962dfab799.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00
Andrew Borodin
40c912b9b7 (tar_xheader_read): cleaner overflow checking.
Prefer ckd_add() to doing overflow checking by hand.

Sync with GNU tar 927d67855e2e83b6b06eb9095f65e4e695d6af7e.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2024-10-05 15:07:13 +03:00