hashicorp / hashicorp/nomad

Nomad inproperly unpack tar.gz artifact archives with symlinks

Open
#2,292 14 comments 0 reactions 0 assignees View on GitHub
stage/accepted theme/artifact theme/client type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
Nomad v0.5.4

We've made artifact with many symlinks in it. Is our case this links goes to so(shared objects), like in this sample:

```
lrwxrwxrwx 1 root root 18 Feb 8 15:40 libcrypto.so -> libcrypto.so.1.0.0
-r-xr-xr-x 1 root root 2308736 Feb 8 14:42 libcrypto.so.1.0.0
lrwxrwxrwx 1 root root 17 Feb 8 15:40 libcurses.so -> libncurses.so.5.9
-rwxrwxr-x 1 root root 142920 Feb 8 15:41 libncurses.so.5.9
lrwxrwxrwx 1 root root 21 Feb 8 15:40 libecpg_compat.so -> libecpg_compat.so.3.5
lrwxrwxrwx 1 root root 21 Feb 8 15:40 libecpg_compat.so.3 -> libecpg_compat.so.3.5
-rwxr-xr-x 1 root root 19024 Feb 8 14:42 libecpg_compat.so.3.5
```

Then in job file we've specifed follow atrifact declaration:

```
artifact
{
source = "http://docker.local/td-agent.3.tar.gz"
}
```

Artifact was successfully downloaded, and was extracted, but the contents of extracted dir, differs from
that which was in tar.gz archive:

```
-rwxrwxrwx 1 root root 0 Feb 8 15:41 libcrypto.so
-r-xr-xr-x 1 root root 2308736 Feb 8 15:41 libcrypto.so.1.0.0
-rwxrwxrwx 1 root root 0 Feb 8 15:41 libcurses.so
-rwxrwxr-x 1 root root 142920 Feb 8 15:41 libncurses.so.5.9
-rwxrwxrwx 1 root root 0 Feb 8 15:41 libecpg_compat.so
-rwxrwxrwx 1 root root 0 Feb 8 15:41 libecpg_compat.so.3
-rwxr-xr-x 1 root root 19024 Feb 8 15:41 libecpg_compat.so.3.5
```

As you can see, all symlinks after extract turn into simple files with zero length

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.