summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* update various URLsHEADmasterMike Frysinger2022-12-301-1/+1
|
* Remove PATH_MAX usage which does not exist on GNU/HurdGuillem Jover2022-11-122-11/+2
| | | | | | The Hurd is intended to have no hardcoded limits, and POSIX makes it possible for a system to not define PATH_MAX. Switch to the simpler solution which is to generate the constants at compile time.
* test: fix out of tree testsv2.2.53Mike Frysinger2018-06-181-1/+1
| | | | | The run script is in $srcdir, not $PWD (aka $builddir). This fixes `make distcheck`.
* test: add regression testDmitry V. Levin2018-01-211-0/+1
| | | | This is for the recent "Fix acl_from_text() returning NULL on all input".
* Enable large-file support on systems that do not enable it by defaultDmitry V. Levin2018-01-212-0/+8
| | | | | | | | | | | | | Invoke AC_SYS_LARGEFILE to enable large-file support. This fixes acl_get_fd and acl_get_file that invoke *stat functions, as well their users, perm_copy_fd and perm_copy_file. The tools are the most spectacularly affected because without the fix they just cannot process large files, e.g. $ truncate -s2G large-file && getfacl large-file getfacl: large-file: Value too large for defined data type
* setfacl: Preserve special mode bits on filesystems without POSIX ACL supportAndreas Gruenbacher2016-08-231-0/+1
| | | | | | | | | When the ACL to be set is equivalent to a file mode, on filesystems without POSIX ACL support, setfacl falls back to chmod(1) for setting the file mode to the equivalent of the ACL. Unfortunately it did not preserve the set-user-ID, set-group-ID, and sticky bits in that case; fix that.
* permissions.test: Fix umaskAndreas Gruenbacher2016-05-181-0/+1
| | | | | | | | The root/permissions test can fail if run by a root user with umask 077, because the "d" temporary directory ends up unreadable/unexecutable by bin or daemon. Reported anonymously on Savannah: http://savannah.nongnu.org/bugs/?47949
* Add additional group names for root-specific testsAndreas Gruenbacher2016-03-072-2/+2
| | | | | | The root-specific tests use two additional groups. Add them to test/test.group and don't create / delete the non-standard group with groupadd / groupdel.
* libtestlookup: Add missing EXPORT and static declarationsAndreas Gruenbacher2016-03-072-14/+22
|
* test: fixups on SELinux machines for root testcasesHe Zhe2016-03-023-6/+6
| | | | | | | ls adds a '.' at the end of the permission field list on SELinux machines, filter this out so root tests work on SELinux machines. Signed-off-by: He Zhe <zhe.he@windriver.com>
* Rework config.h usageYury Usishchev2016-02-152-0/+2
| | | | | | | | | Move #include "config.h" from misc.h to every source file. It's incorrect to include it after a system header file because it does things like: Those must come before you include any system header file in order for them to work properly. It hasn't bitten us so far, but we still should fix the files to do the right thing.
* quote: escape literal backslashesJeff Mahoney2015-12-051-0/+39
| | | | | | | | | | | | | | | | | The octal unquote code can't handle escaping backslashes except by specifying the octal code for the backslash. That's not exactly a user-friendly interface for a scenario that may not be that uncommon. The unquote code isn't documented in the man page and can result in confusion when specifying names via a Windows domain that are entirely numeric (e.g. WINDOM\1234). This patch adds handling to allow literal escaping of the backslash (\\) as both input and output and documents the quoting rules in the setfacl man page. Also included are test cases for escaped backslashes followed by letters, escaped backslashes followed by numbers, and the original use case of escaped character literals. [Minor fixes by Andreas Gruenbacher.]
* test: Add helper library to fake passwd/group filesJeff Mahoney2015-12-057-4/+341
| | | | | | | | | | | | | | | The requirements for testing are currently that the system have several users and groups predefined. The chosen users and groups are typically found on every system so that's a safe bet. However, tests for the quote code may involve more esoteric names that include backslashes or other quoted characters. This patch adds a helper library that implements the passwd and group calls and redirects the reads to project-defined passwd and group files. That way, we know for certain that those usernames and groups will be found during testing. The helper library is enabled using LD_PRELOAD via a wrapper script. The library will not be installed as part of the project's make install. Since the local user might not be found in the local test.{group,passwd}, we extend test/run to use numeric uid/gids if the lookup fails.
* cp.test: Check permissions of the right fileAndreas Gruenbacher2014-08-131-1/+1
| | | | | | | After "cp -p", the cp.test case was checking the permissions of the source file instead of the target file. Reported by: Nic <nic.henke@versity.com>
* modernize build systemMike Frysinger2014-01-138-52/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deletes the hand rolled build system and replaces it entirely with autotools. The overall diffstat shows that this is a clear win, and it makes the package build/install like every other autotool package out there which makes the lives of distro maintainers a lot easier. This should also be faster by virtue of using a non-recursive build. Things to note: - to generate autotools: ./autogen.sh - to see full compile output: make V=1 - to build specific targets: make attr getfattr ... - to run tests: make check - to create a release: make distcheck -j Other non-developer things: - man pages are no longer compressed as this is uncommon in the autotools world and distros don't need it anyways (they already handle it automatically for most pakages) - the minor # of the shared library is now based on the package version so it'll be much bigger ... this isn't a problem, and is actually a bugfix (older releases didn't change when they should have) (Again, this is all using the standard autotool targets.)
* test: make running parallel/out-of-tree safeMike Frysinger2014-01-133-8/+35
| | | | | | | | | | Change the run program to update PATH to find the tools locally automatically. This lets us avoid having to always build in the tree and allows for direct running. Also update the program to create a tempdir for each test to run inside of. This way we can run all the tests in parallel without randomly clobbering each other.
* libacl: fix SIGSEGV of getfacl -e on overly long group nameKamil Dudka2013-11-011-0/+17
| | | | We simply make sure that at least one tab is used for indentation.
* test: fix insufficient quoting of '\'Kamil Dudka2013-05-203-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to 7f2c91b8369242a8dbc2b304a5b71b2a85f5b855, which caused sbits-restore.test to fail in the following way in case SELinux was disabled: *** sbits-restore.test *** [3] $ umask 022 -- ok [4] $ mkdir d -- ok [5] $ touch d/g -- ok [6] $ touch d/u -- ok [7] $ chmod u+s d/u -- ok [8] $ chmod g+s d/g -- ok [9] $ chmod +t d -- ok [10] $ getfacl -R d > d.acl -- ok [11] $ rm -R d -- ok [12] $ mkdir d -- ok [13] $ touch d/g -- ok [14] $ touch d/u -- ok [15] $ setfacl --restore d.acl -- ok [16] $ ls -dl d | awk '{print $1}' | sed 's/.$//g' -- failed drwxr-xr- != drwxr-xr-t [18] $ ls -dl d/u | awk '{print $1}' | sed 's/.$//g' -- failed -rwSr--r- != -rwSr--r-- [20] $ ls -dl d/g | awk '{print $1}' | sed 's/.$//g' -- failed -rw-r-Sr- != -rw-r-Sr-- [22] $ rm -Rf d -- ok 17 commands (14 passed, 3 failed)
* test: getfacl-recursive: set umaskBrandon Philips2013-05-181-0/+1
| | | | umask 022 is expected on some of the tests. Set it.
* test: fixups on SELinux machinesBrandon Philips2013-05-183-7/+7
| | | | | ls adds a '.' at the end of the permission field list on SELinux machines, filter this out so tests work on SELinux machines.
* test: Makefile remove directory prefix from malformed-restore-double-owner.aclBrandon Philips2011-04-191-1/+1
| | | | test/ isn't necessary as this is in test/Makefile
* test/misc.test: rm f from the top of the testBrandon Philips2011-04-191-0/+1
| | | | | f might exist before this test is ran. remove it first so the test always starts from the same state.
* Prevent setfacl --restore from SIGSEGV on malformed restore fileKamil Dudka2010-03-241-0/+6
| | | | | originally reported at: https://bugzilla.redhat.com/576550
* setfacl: make sure that -R only calls stat(2) on symlinks when it needs toM. Steinborn2010-01-221-0/+28
| | | | | | Fixes http://savannah.nongnu.org/bugs/?28131 Signed-off-by: Brandon Philips <bphilips@suse.de>
* setfacl: fix restore crash on malformed inputMarkus Steinborn2009-12-173-1/+29
| | | | | | | | | | | | Malformed input to setfacl --restore can cause a crash due to a double free. Ensure that freed memory is set to NULL. Fixes this bug: https://savannah.nongnu.org/bugs/index.php?28185 Signed-off-by: Brandon Philips <bphilips@suse.de>
* setfacl: changing owner and when S_ISUID should be set --restore fixBrandon Philips2009-12-171-0/+23
| | | | | | | | | | | | | | | | | | | | | Fix a problem in setfacl --restore when the owner or group is changed and the S_ISUID and S_ISGID are to be set. The root of the problem is that chown() can clear the S_ISUID and S_ISGID bits as described in chown(2): When the owner or group of an executable file are changed by a non- superuser, the S_ISUID and S_ISGID mode bits are cleared. POSIX does not specify whether this also should happen when root does the chown(); the Linux behavior depends on the kernel version. In case of a non- group-executable file (i.e., one for which the S_IXGRP bit is not set) the S_ISGID bit indicates mandatory locking, and is not cleared by a chown(). To fix the issue re-stat() the file after chown() so that the logic surrounding the chmod() has the updated mode of the file. Signed-off-by: Brandon Philips <bphilips@suse.de>
* Makefile: add missing files to LSRCFILESBrandon Philips2009-11-191-1/+1
| | | | | | | tests/sort-getfacl-output and examples/copyperm.c were missing from respective Makefiles Signed-off-by: Brandon Philips <bphilips@suse.de>
* test/run: fix lt- prefix from libtool wrappersBrandon Philips2009-06-291-0/+2
| | | | | | | | | On some platforms libtool prefixes the in-tree binaries under .libs with "lt-". This causes the tests to break. This patch removes the lt- prefix from program error output. A discussion on the issue is here: http://lists.gnu.org/archive/html/libtool/2009-05/msg00042.html
* Fix otherwise harmless syntax errors in the root and nfs testsAndreas Gruenbacher2009-06-231-2/+2
|
* Include the S_ISUID, S_ISGID, S_ISVTX flags in the getfacl output, and ↵Brandon Philips2009-06-231-0/+22
| | | | restore them with "setfacl --restore=file".
* More license updatesAndreas Gruenbacher2009-06-081-0/+14
| | | | | Add license headers to a number of small files which were only licenses as GPLv2+ implicitly so far.
* Make this test readdir order independentAndreas Gruenbacher2009-02-232-6/+10
| | | | | | | | When reading directories, different filesystems return files in different orders. Some tests depended on a specific order; remove this dependency by sorting the results before checking them. Signed-off: Andreas Gruenbacher <agruen@suse.de>
* acl: add make tests target and use make to run testsBrandon Philips2009-02-231-3/+24
| | | | | | | | | | | | | The tests are difficult to run. So, this patch adds a Make target that sets up the path and runs *.test files in the test/ directory. nfs specific tests can be ran from the test directory by running `make nfs-tests` tests requiring root can be ran from the test directory by running `make root-tests` Signed-off-by: Brandon Philips <bphilips@suse.de>
* acl: fix setfacl for long utf8 filenamesEric Sandeen2009-02-231-0/+14
| | | | | | | | | | | | Resolved Red Hat bugs: rh#183181 - Bad: utf8 long filenames - invalid argument rh#287701 - PATH_MAX patch seems incomplete From: Andrey <afletdinov@dc.baikal.ru> From: Thomas Woerner <twoerner@redhat.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Acked-by: Brandon Philips <bphilips@suse.de>
* acl: add getfacl -R -L -P testsBrandon Philips2009-02-231-0/+194
| | | | | | Test fixes to walk_tree.c by Andreas. Signed-off-by: Brandon Philips <bphilips@suse.de>
* acl: minor fix to cp.testBrandon Philips2009-02-231-1/+1
| | | | | | X -> x Signed-off-by: Brandon Philips <bphilips@suse.de>
* acl: move nfs tests to their own folderBrandon Philips2009-02-232-7/+7
| | | | | | | Since these tests require nfs mounts to run move them into a seperate folder so they don't run by default. Signed-off-by: Brandon Philips <bphilips@suse.de>
* acl: move root tests to their own folderBrandon Philips2009-02-232-46/+46
| | | | | | | Since these tests require root perms to run move them into a seperate folder so they don't run by default. Signed-off-by: Brandon Philips <bphilips@suse.de>
* Create two ENV variables TUSER and TGROUP to get the user/group running the testBrandon Philips2009-02-231-0/+3
| | | | | Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
* Update the run script to a more recent versionAndreas Gruenbacher2009-02-231-18/+69
| | | | | | | | | | | | | Avoid a warning: main::process_test() called too early to check prototype at ./run line 47. main::process_test() called too early to check prototype at ./run line 60. Add a >~ test line that is similar to > but is interpreted as a regular expression. Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
* Update copyright annotations and license boilerplates to correspond with SGI ↵Nathan Scott2005-11-091-28/+0
| | | | | | Legals preferences. Merge of master-melb:xfs-cmds:24326a by kenmcd.
* ACL updates from Andreas.Nathan Scott2004-08-261-0/+119
|
* ACL update from AG - libmisc routines, numerous test updatesNathan Scott2003-07-2914-819/+1197
|
* Updates from AndreasG.Nathan Scott2002-09-071-3/+3
|
* minor updates from Andreas.Nathan Scott2002-09-042-1/+4
|
* Update copyright dates (again)Eric Sandeen2002-06-041-1/+1
|
* Undoes mod: xfs-cmds:slinx:120772aEric Sandeen2002-06-041-1/+1
| | | | Undo xfs-cmds:slinx:120772a, inadvertently whacked a previous mod.
* Update copyright datesEric Sandeen2002-06-041-1/+1
|
* __acl_to_any_text bug fix from Andreas, test updates.Nathan Scott2002-04-301-4/+4
|
* man page and test script updates from Andreas.Nathan Scott2002-03-111-0/+13
|