Bug 219967 - lib/libc/gen/setdomainname_test changes the nisdomain and fails to clean up
Summary: lib/libc/gen/setdomainname_test changes the nisdomain and fails to clean up
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: tests (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Alan Somers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-13 21:16 UTC by Alan Somers
Modified: 2017-08-25 12:16 UTC (History)
1 user (show)

See Also:
asomers: mfc-stable11?
asomers: mfc-stable10?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2017-06-13 21:16:56 UTC
If you run either setdomainname_test:setdomainname_limit or setdomainname_test:setdomainname_basic, it will change the system's nisdomain and fail to clean it up.  The former leave the nisdomain blank, while the latter sets it to a bunch of dashes.  This is a problem, because if the tests are run on a system that uses NIS, logins will become impossible.

[alans@stealthy /usr/tests/lib/libc/gen]$ domainname 
eng-nis2
[alans@stealthy /usr/tests/lib/libc/gen]$ sudo kyua debug setdomainname_test:setdomainname_basic
setdomainname_test:setdomainname_basic  ->  passed
[alans@stealthy /usr/tests/lib/libc/gen]$ domainname 
--------------------------------------------------------------------

The bug affects both 12.0-CURRENT and 11.1-BETA1
Comment 1 Alan Somers freebsd_committer freebsd_triage 2017-06-13 21:30:25 UTC
Don't sweat it ngie.  I'm already halfway done with the fix.
Comment 2 Alan Somers freebsd_committer freebsd_triage 2017-06-14 00:02:25 UTC
Upstream bug report.

https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=52297
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-07-06 14:48:59 UTC
A commit references this bug:

Author: asomers
Date: Thu Jul  6 14:47:59 UTC 2017
New revision: 320737
URL: https://svnweb.freebsd.org/changeset/base/320737

Log:
  Fix cleanup in lib/libc/gen/setdomainname_test

  ATF cleanup routines run in separate processes from the tests themselves, so
  they can't share global variables.

  Also, setdomainname_test needs to be is_exclusive because the test cases
  access a global resource.

  PR:		219967
  Reviewed by:	ngie
  MFC after:	3 weeks
  Sponsored by:	Spectra Logic Corp
  Differential Revision:	https://reviews.freebsd.org/D11188

Changes:
  head/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c
  head/lib/libc/tests/gen/Makefile
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-08-01 16:00:37 UTC
A commit references this bug:

Author: asomers
Date: Tue Aug  1 16:00:21 UTC 2017
New revision: 321878
URL: https://svnweb.freebsd.org/changeset/base/321878

Log:
  MFC r320737, r320914

  r320737:
  Fix cleanup in lib/libc/gen/setdomainname_test

  ATF cleanup routines run in separate processes from the tests themselves, so
  they can't share global variables.

  Also, setdomainname_test needs to be is_exclusive because the test cases
  access a global resource.

  PR:		219967
  Reviewed by:	ngie
  Sponsored by:	Spectra Logic Corp
  Differential Revision:	https://reviews.freebsd.org/D11188

  r320914:
  Remove an extraneous strlen from t_setdomainname.c

  Reported by:	Coverity
  CID:		1377568
  X-MFC-With:	320737
  Sponsored by:	Spectra Logic Corp

Changes:
_U  stable/10/
  stable/10/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c
  stable/10/lib/libc/tests/gen/Makefile
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-08-25 12:16:23 UTC
A commit references this bug:

Author: asomers
Date: Fri Aug 25 12:16:04 UTC 2017
New revision: 322887
URL: https://svnweb.freebsd.org/changeset/base/322887

Log:
  MFC r320737, r320914

  r320737:
  Fix cleanup in lib/libc/gen/setdomainname_test

  ATF cleanup routines run in separate processes from the tests themselves, so
  they can't share global variables.

  Also, setdomainname_test needs to be is_exclusive because the test cases
  access a global resource.

  PR:		219967
  Reviewed by:	ngie
  Sponsored by:	Spectra Logic Corp
  Differential Revision:	https://reviews.freebsd.org/D11188

  r320914:
  Remove an extraneous strlen from t_setdomainname.c

  Reported by:	Coverity
  CID:		1377568
  X-MFC-With:	320737
  Sponsored by:	Spectra Logic Corp

Changes:
_U  stable/11/
  stable/11/contrib/netbsd-tests/lib/libc/gen/t_setdomainname.c
  stable/11/lib/libc/tests/gen/Makefile