Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-57019

tar x --no-overwrite-dir breaks since update to 1.30-9

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-8.8.0, rhel-8.10
    • tar
    • None
    • Yes
    • Important
    • sst_cs_plumbers
    • ssg_core_services
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • All
    • None

      What were you trying to do that didn't work?

      Extracting tar archive using --no-overwrite-dir as a user fails when the target directory is owned by root, whereas it was a success with up to tar-1.30-6.el8_7.1 included.

      Please provide the package NVR for which bug is seen:

      tar-1.30-9.el8

      How reproducible:

      Always

      Steps to reproduce

      1. Create a dummy archive as a user
        $ mkdir tartest
        $ touch tartest/foo
        $ tar cf tartest.tar -C tartest .
        $ tar tvf tartest.tar 
        drwxrwxr-x admin/admin       0 2024-09-04 08:46 ./
        -rw-rw-r-- admin/admin       0 2024-09-04 08:46 ./foo
      2. Extract it to /tmp
        $ tar xf tartest.tar -C /tmp --no-overwrite-dir
        tar: .: Cannot change mode to rwxrwxrwx: Operation not permitted
        tar: Exiting with failure status due to previous errors

      Expected results

      Success

      Actual results

      Failure on fchmodat():

      16524 08:48:46.671958 fchmodat(4</tmp>, ".", 0777) = -1 EPERM (Operation not permitted) <0.000005>

      The failing patch is tar-1.30-Fix-the-no-overwrite-dir-option

            jamartis@redhat.com Jakub Martisko
            rhn-support-rmetrich Renaud Métrich
            Jakub Martisko Jakub Martisko
            qe-baseos-daemons qe-baseos-daemons
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: