Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  GNU tar 1.35 and incorrect handling of symlinks with umask set to 022/027

    Posted yesterday

    Issue Summary

    When extracting an archive with GNU tar version 1.35 that contains symbolic links, the extracted symlink permissions incorrectly respect the user's umask instead of defaulting to 777. This behavior occurs under specific conditions and differs from previous versions (e.g., 1.33), where symlinks were always created with mode 777 as expected.


    Conditions

    • Extraction is performed by a non-root user.
    • umask is set to 027 (or 022).
    • Archive contains symbolic links.

    Expected Behavior

    By definition, symbolic links should always have permissions lrwxrwxrwx (mode 777), regardless of umask.


    Observed Behavior

    The extracted symlink inherits permissions based on umask. For example:

    • With umask 027, the symlink is created as lrwxr-x--- (mode 750).

    This causes issues for operations that expect standard symlink permissions, such as cp -hrp.


    Steps to Reproduce

    # run under non-root local user
    mkdir symlink_test && cd symlink_test
    TAR=/opt/freeware/bin/tar
    $TAR --version  # returns 1.35

    ln -s /etc/resolv.conf symlink

    # ls -l symlink returns:
    # lrwxrwxrwx    1 test_user  test_user          16 Dec 08 14:41 symlink -> /etc/resolv.conf

    $TAR cvf archive.tar symlink

    rm symlink

    umask 027
    $TAR xvf archive.tar symlink

    # lrwxr-x---    1 test_user  test_user          16 Dec 08 14:45 symlink -> /etc/resolv.conf

    cp -hrp symlink symlink2
    cp: not all requested changes were made to symlink2

    ls -l symlink*
    lrwxr-x---    1 test_user  test_user          16 Dec 08 14:55 symlink -> /etc/resolv.conf
    lrwxrwxrwx    1 test_user  test_user          16 Dec 08 14:56 symlink2 -> /etc/resolv.conf


    Impact

    • Breaks scripts and tools relying on standard symlink permissions.
    • Causes unexpected permission errors during file operations.

    Workaround

    Downgrading to GNU tar 1.33 or earlier resolves the issue.

    We have not seen the same issue on Linux (gnu tar 1.35, Ubuntu 24.04).



    ------------------------------
    Jozef Riha
    ------------------------------


  • 2.  RE: GNU tar 1.35 and incorrect handling of symlinks with umask set to 022/027

    Posted yesterday

    Also, both 32-bit and 64-bit version is affected.



    ------------------------------
    Jozef Riha
    ------------------------------



  • 3.  RE: GNU tar 1.35 and incorrect handling of symlinks with umask set to 022/027

    Posted 21 hours ago

    Thanks for reporting this. We are looking into it. 



    ------------------------------
    Ayappan P
    ------------------------------