summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2017-08-08 20:50:25 +1000
committerAmitay Isaacs <amitay@samba.org>2017-08-10 06:43:13 +0200
commit769e889e0e617b503a3a7574b4cd2f0bf9909065 (patch)
treea60a0d89a2abe90de3b61ad515714996b523685e /buildtools
parent68a02d18c135a30adf0f67ec370d5e2db5ea136e (diff)
downloadsamba-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.py2
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)