diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-11-18 17:52:12 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-08-23 21:07:00 -0400 |
commit | f8ebfdf7b1f33f88007d107791a661a17827be43 (patch) | |
tree | e577c3ebc1ed54d2ce75c345c761e28665b4de6b /unittests | |
parent | b7245d3f273dd6ddadc1fe2c2d06dbe25c1b9b5f (diff) | |
download | meson-f8ebfdf7b1f33f88007d107791a661a17827be43.zip meson-f8ebfdf7b1f33f88007d107791a661a17827be43.tar.gz meson-f8ebfdf7b1f33f88007d107791a661a17827be43.tar.bz2 |
install modes should not apply sticky bit to files
This is generally a bad idea, e.g. it causes OSError on freebsd.
It also gets ignored by solaris and thus causes unittest failures.
The proper solution is to simply reject any attempt to set this, and log a
warning.
The install_emptydir function does apply the mode as well, and since it
is a directory it actually does something. This is the only place where
we don't reset the mode.
Although install_subdir also installs directories, and in theory it
could set the mode as well, that would be a new feature. Also it doesn't
provide much granularity and has mixed semantics with files. Better to
let people use install_emptydir + install_subdir.
Fixes #5902
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/linuxliketests.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py index 76721aa..99adeac 100644 --- a/unittests/linuxliketests.py +++ b/unittests/linuxliketests.py @@ -615,7 +615,7 @@ class LinuxlikeTests(BasePlatformTests): f = os.path.join(self.installdir, 'etc', 'etcfile.dat') found_mode = stat.filemode(os.stat(f).st_mode) - want_mode = 'rw------T' + want_mode = 'rw-------' self.assertEqual(want_mode, found_mode[1:]) f = os.path.join(self.installdir, 'usr', 'bin', 'runscript.sh') @@ -650,7 +650,7 @@ class LinuxlikeTests(BasePlatformTests): f = os.path.join(self.installdir, 'usr', 'share', 'sub1', 'second.dat') statf = os.stat(f) found_mode = stat.filemode(statf.st_mode) - want_mode = 'rwxr-x--t' + want_mode = 'rwxr-x--x' self.assertEqual(want_mode, found_mode[1:]) if os.getuid() == 0: # The chown failed nonfatally if we're not root @@ -673,15 +673,15 @@ class LinuxlikeTests(BasePlatformTests): ('bin/trivialprog', '-rwxr-sr-x'), ('include', 'drwxr-x---'), ('include/config.h', '-rw-rwSr--'), - ('include/rootdir.h', '-r--r--r-T'), + ('include/rootdir.h', '-r--r--r--'), ('lib', 'drwxr-x---'), ('lib/libstat.a', '-rw---Sr--'), ('share', 'drwxr-x---'), ('share/man', 'drwxr-x---'), ('share/man/man1', 'drwxr-x---'), - ('share/man/man1/foo.1', '-r--r--r-T'), + ('share/man/man1/foo.1', '-r--r--r--'), ('share/sub1', 'drwxr-x---'), - ('share/sub1/second.dat', '-rwxr-x--t'), + ('share/sub1/second.dat', '-rwxr-x--x'), ('subdir', 'drwxr-x---'), ('subdir/data.dat', '-rw-rwSr--'), ]: |