


     chroot(XOPEN.os/proRelease	4.4.1 (UniSoftchroot(XOPEN.os/procenv)



     NAME
	  XOPEN.os/procenv/chroot - change root	directory testset

     DESCRIPTION
	  Chroot tests the chroot() system call	interface for
	  conformance to the XSI System	Interfaces Page:chroot()

     TESTS
     Compliance
	  1    The directory name pointed to by	path becomes the
	       starting	point for path searches	beginning with "/";

	  2    There is	no change in the user's	working	directory;

	  3    the parent directory ("..") of the new root points
	       (logically) to the root itself; access to files outside
	       the subtree rooted at the root directory	by processes
	       using this root is denied;

	  4    The root	directory is inherited by all processes
	       created via
	       a. a fork() system call;
	       b. an exec() system call;

     Deviance
	  5    ENOTDIR in errno	root not changed and -1	returned by
	       chroot()	if any component of the	path name is not a
	       directory;

	  6    ENOENT in errno root not	changed	and -1 returned	by
	       chroot()	if the named directory does not	exist;

	  7    If _POSIX_PATH_MAX <= {PATH_MAX}	<= PCTS_PATH_MAX, then
	       ENAMETOOLONG in errno root not changed and -1 returned
	       by chroot() if path argument exceeds PATH_MAX
	       characters;
				      otherwise
	       a call to chroot() when the length of the path argument
	       equals PCTS_PATH_MAX does not give an ENAMETOOLONG
	       error.

	  8    For the XNFS specification:
		   Not in use.
	       For the XSH specification:
		   If _POSIX_NO_TRUNC is in effect:
		       If _POSIX_NAME_MAX <= {NAME_MAX}	<=
		       PCTS_NAME_MAX, then ENAMETOOLONG	in errno root
		       not changed and -1 returned by chroot() if a
		       component of the	path argument exceeds NAME_MAX
		       characters;
					  otherwise
		       a call to chroot() when the length of a



     Page 1					    (printed 2/21/103)






     chroot(XOPEN.os/proRelease	4.4.1 (UniSoftchroot(XOPEN.os/procenv)



		       component of path equals	PCTS_NAME_MAX does not
		       give an ENAMETOOLONG error.

	  9    EPERM in	errno root not changed and -1 returned by
	       chroot()	if the effective user ID is not	super user;

	  10   For the XNFS specification:
		   If {_POSIX_NO_TRUNC}	is defined on the client and
		   {NAME_MAX} on the client is less than or equal to
		   PCTS_NAME_MAX:
		       When the	length of a pathname component of path
		       is longer than {NAME_MAX} on the	client,	then a
		       call to chroot(path) returns a value of -1 and
		       sets errno to ENAMETOOLONG.
	       For the XSH specification:
		   Not in use.

	  11   For the XNFS specification:
		   If {_POSIX_NO_TRUNC}	is defined on the server and
		   {NAME_MAX} on the server is less than or equal to
		   PCTS_NAME_MAX and {NAME_MAX}	on the server is less
		   than	NFS_MAXNAMLEN and {NAME_MAX} on	the server is
		   less	than {NAME_MAX}	on the client:
		       When the	length of a pathname component of path
		       is longer than {NAME_MAX} on the	server,	then a
		       call to chroot(path) returns a value of -1 and
		       sets errno to ENAMETOOLONG.
	       For the XSH specification:
		   Not in use.

	  12   For the XNFS specification:
		   If {_POSIX_NO_TRUNC}	is defined on the client and
		   {NAME_MAX} on the client is greater than or equal
		   to NFS_MAXNAMLEN and	{_POSIX_NO_TRUNC} is defined
		   on the server and {NAME_MAX}	on the server is
		   greater than	or equal to NFS_MAXNAMLEN:
		       When the	length of a pathname component of path
		       is equal	to NFS_MAXNAMLEN, then a call to
		       chroot(path) does not give an ENAMETOOLONG
		       error.
	       For the XSH specification:
		   Not in use.

	  13   For the XNFS specification:
		   If {_POSIX_NO_TRUNC}	is defined on the client and
		   {NAME_MAX} on the client is greater than or equal
		   to NFS_MAXNAMLEN and	{_POSIX_NO_TRUNC} is not
		   defined on the server:
		       When the	length of a pathname component of path
		       is equal	to NFS_MAXNAMLEN, then a call to
		       chroot(path) does not give an ENAMETOOLONG
		       error.



     Page 2					    (printed 2/21/103)






     chroot(XOPEN.os/proRelease	4.4.1 (UniSoftchroot(XOPEN.os/procenv)



	       For the XSH specification:
		   Not in use.

	  14   For the XNFS specification:
		   When	chroot() attempts to change the	root directory
		   to a	directory on a remote file system and the
		   server maps the process's effective user ID and
		   search permission is	denied for a component of the
		   new root directory's	path prefix, then -1 is
		   returned, errno is set to EACCES and	the root
		   directory is	not changed.
	       For the XSH specification:
		   Not in use.

     Untestable	Aspects
	  1    EACCES in errno root not	changed	and -1 returned	by
	       chroot()	if search permission is	denied for a component
	       of path.
	       Reason for omission: This can only occur	on a system
	       where appropriate privileges deny search	permission
	       while allowing a	process	to change its root directory.
	       On other	systems	an EPERM condition would be expected.

     UNDEFINED ASPECTS
	  1    what happens when the user's current working directory
	       lies outside the	new root subtree? No assumption	made.

     SPECIAL CONDITIONS
	  1    This testset should be run using	a set-user-ID root
	       file.

     OUTPUTS
     Tests:
	  1    Pass/Fail/Unsupported indication	- failure information
	       includes	expected and detected directories;

	  2    Pass/Fail indication - failure information includes
	       expected	and detected directories;

	  3    Pass/Fail indication only;

	  4    Pass/Fail indication - failure information includes
	       expected	and detected values obtained from a stat()
	       system call on the process's root directory;

	  5-9  Pass/Fail indication - failure information includes
	       detected	errno and expected errno.

	  10-14
	       Pass/Fail/Unsupported indication	- failure information
	       includes	detected errno and expected errno.




     Page 3					    (printed 2/21/103)






     chroot(XOPEN.os/proRelease	4.4.1 (UniSoftchroot(XOPEN.os/procenv)



     DELETIONS
	  Test 9 will be deleted if the	calling	process	has super-user
	  privileges.

     PARAMETERS
	  None

     RELEASE
	  4.4.1	(06/09/97)














































     Page 4					    (printed 2/21/103)



