diff options
author | Martin Schwenke <martin@meltin.net> | 2017-08-08 20:50:25 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2017-08-10 06:43:13 +0200 |
commit | 769e889e0e617b503a3a7574b4cd2f0bf9909065 (patch) | |
tree | a60a0d89a2abe90de3b61ad515714996b523685e /buildtools | |
parent | 68a02d18c135a30adf0f67ec370d5e2db5ea136e (diff) | |
download | samba-769e889e0e617b503a3a7574b4cd2f0bf9909065.tar.gz |
build: Do not recurse on symlinks to directories when building tarballs
DIST_FILES() causes all files in any specified directory to be
recursively added to the tarball. However, a symbolic link to a
directory is detected as a regular directory so is also subject to
recursion. This means that a symbolic link to a directory is
dereferenced and the directory of files beyond it are added to the
tarball under a directory corresponding to the link. This is almost
certainly not what is intended because it will usually result in
duplicate files. This is because the contents of a symbolic link's
target directory will already be present in the tarball.
Instead, do not treat symbolic links to directories as directories,
but add them to the tarball like normal files.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'buildtools')
-rw-r--r-- | buildtools/wafsamba/samba_dist.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/buildtools/wafsamba/samba_dist.py b/buildtools/wafsamba/samba_dist.py index 4dacba23d2e..2e52820697b 100644 --- a/buildtools/wafsamba/samba_dist.py +++ b/buildtools/wafsamba/samba_dist.py @@ -182,7 +182,7 @@ def dist(appname='', version=''): absfile = os.path.join(srcdir, file) - if os.path.isdir(absfile): + if os.path.isdir(absfile) and not os.path.islink(absfile): destdir = destfile dir = file files = list_directory_files(dir) |