generic/381: enable on systems which allows usernames that begin with digits
PATCH 1/1 generic/381: enable on systems which allows usernames that begin with digits
Some systems are not allowing usernames prefixed with a number now, this test however relies on the assumption that you can end up with usernames of such type, given the purpose of the test is to ensure that xfs_quota can differentiate between UIDs and names beginning with numbers.
systemd >= 232 (circa 2017) no longer allows usernames starting with digits [0], there is a systemd exploit (CVE-2017-1000082 [1]) for why that was done, however even upstream shadow useradd also does not allow similar user types since shadow version v4.0.1 (circa 2007) [2] but there no easy way to check shadow's useradd's version.
You can still shoehorn in these types of users by manually editing files, but that's just shooting yourself on the foot given all the precautions taken now by userspace, so just check for the systemd version for now as requirement for running this test.
[0] https://github.com/systemd/systemd/issues/6237
[1] https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-1000082
[2] https://github.com/shadow-maint/shadow/commit/9db6abfa42c946b4046f4b2fe67dc43ba862eb0e
--- README | 7 +++++-- common/config | 1 + common/rc | 42 ++++++++++++++++++++++++++++++++++++++++++ tests/generic/381 | 1 + 4 files changed, 49 insertions(+), 2 deletions(-)
README +5 -2
@@ -20,8 +20,11 @@ _______________________ - run make - run make install - create fsgqa test user ("sudo useradd fsgqa") -- create 123456-fsgqa test user ("sudo useradd 123456-fsgqa") - +- Only on systems which allow usernames that start with a digit (older + than systemd 232 and/or has shadow older than v4.0.1), create the + 123456-fsgqa test user: + sudo useradd 123456-fsgqa + ______________________ USING THE FSQA SUITE ______________________
common/config +1 -0
@@ -199,6 +199,7 @@ export UBIUPDATEVOL_PROG="`set_prog_path ubiupdatevol`" export THIN_CHECK_PROG="$(set_prog_path thin_check)" export PYTHON2_PROG="`set_prog_path python2`" export SQLITE3_PROG="`set_prog_path sqlite3`" +export SYSTEMCTL_PROG="`set_prog_path systemctl`" # use 'udevadm settle' or 'udevsettle' to wait for lv to be settled. # newer systems have udevadm command but older systems like RHEL5 don't.
common/rc +42 -0
48 lines not on this page · raw message
tests/generic/381 +1 -0
@@ -54,6 +54,7 @@ _require_quota _require_xfs_quota_foreign # need user and group named 123456-fsgqa +_require_user_digit_allowed _require_user 123456-fsgqa _require_group 123456-fsgqa
Signature · 1 line
2.15.0
Quoted 33 lines · Luis R. Rodriguez
Some systems are not allowing usernames prefixed with a number now, this test however relies on the assumption that you can end up with usernames of such type, given the purpose of the test is to ensure that
xfs_quotacan differentiate between UIDs and names beginning with numbers.systemd >= 232 (circa 2017) no longer allows usernames starting with digits [0], there is a systemd exploit (CVE-2017-1000082 [1]) for why that was done, however even upstream shadow useradd also does not allow similar user types since shadow version v4.0.1 (circa 2007) [2] but there no easy way to check shadow's useradd's version.
You can still shoehorn in these types of users by manually editing files, but that's just shooting yourself on the foot given all the precautions taken now by userspace, so just check for the systemd version for now as requirement for running this test.
[0] https://github.com/systemd/systemd/issues/6237
[1] https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-1000082
[2] https://github.com/shadow-maint/shadow/commit/9db6abfa42c946b4046f4b2fe67dc43ba862eb0eSigned-off-by Luis R. Rodriguez <[email protected]>--- README | 7 +++++-- common/config | 1 + common/rc | 42 ++++++++++++++++++++++++++++++++++++++++++ tests/generic/381 | 1 + 4 files changed, 49 insertions(+), 2 deletions(-)README +0
-0
README _______________________ · line 27
Quoted 10 lines
README +5
-2@@ -20,8 +20,11 @@ _______________________ - run make - run make install - create fsgqa test user ("sudo useradd fsgqa") -- create 123456-fsgqa test user ("sudo useradd 123456-fsgqa") - +- Only on systems which allow usernames that start with a digit (older + than systemd 232 and/or has shadow older than v4.0.1), create the + 123456-fsgqa test user: + sudo useradd 123456-fsgqa +
IMHO, this doc update is sufficient, generic/381 already _notrun if there's no 123456-fsgqa user present because of
_require_user 123456-fsgqa
And we don't rely on any version check in fstests, usually we check on the actual behavior, e.g. actually mkfs & mount the fs to see if the current kernel and userspace support a given feature.
Thanks,
Eryu
Quoted 48 lines · Eryu Guan
Quoted 33 lines · Luis R. Rodriguez
Some systems are not allowing usernames prefixed with a number now, this test however relies on the assumption that you can end up with usernames of such type, given the purpose of the test is to ensure that
xfs_quotacan differentiate between UIDs and names beginning with numbers.systemd >= 232 (circa 2017) no longer allows usernames starting with digits [0], there is a systemd exploit (CVE-2017-1000082 [1]) for why that was done, however even upstream shadow useradd also does not allow similar user types since shadow version v4.0.1 (circa 2007) [2] but there no easy way to check shadow's useradd's version.
You can still shoehorn in these types of users by manually editing files, but that's just shooting yourself on the foot given all the precautions taken now by userspace, so just check for the systemd version for now as requirement for running this test.
[0] https://github.com/systemd/systemd/issues/6237
[1] https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-1000082
[2] https://github.com/shadow-maint/shadow/commit/9db6abfa42c946b4046f4b2fe67dc43ba862eb0eSigned-off-by Luis R. Rodriguez <[email protected]>--- README | 7 +++++-- common/config | 1 + common/rc | 42 ++++++++++++++++++++++++++++++++++++++++++ tests/generic/381 | 1 + 4 files changed, 49 insertions(+), 2 deletions(-)README +0
-0README _______________________ · line 27
Quoted 10 lines
README +5
-2@@ -20,8 +20,11 @@ _______________________ - run make - run make install - create fsgqa test user ("sudo useradd fsgqa") -- create 123456-fsgqa test user ("sudo useradd 123456-fsgqa") - +- Only on systems which allow usernames that start with a digit (older + than systemd 232 and/or has shadow older than v4.0.1), create the + 123456-fsgqa test user: + sudo useradd 123456-fsgqa +IMHO, this doc update is sufficient, generic/381 already
_notrunif there's no 123456-fsgqa user present because of
Quoted 1 line
_require_user123456-fsgqa
I think the output with the patch is *much* clearer and to the point, it requires less work on the folks analyzing results. Otherwise the results are not clear and only if the user read the README or the brief of the test would be very clear why the test could not run.
Quoted 3 lines
And we don't rely on any version check in fstests, usually we check on the actual behavior, e.g. actually mkfs & mount the fs to see if the current kernel and userspace support a given feature.
We do check for a version check for mkfs, one test only runs on older mkfs versions.
Luis