FreeBSD/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c
/*
 * If the __ZFS_POOL_RESTRICT environment variable is set we only iterate over
 * pools it lists.
 *
 * This is an undocumented feature for use during testing only.
 *
 * This function returns B_TRUE if the pool should be skipped
 * during iteration.
 */
If the __ZFS_POOL_RESTRICT environment variable is set we only iterate over
pools it lists.

This is an undocumented feature for use during testing only.

This function returns B_TRUE if the pool should be skipped
during iteration.
If the __ZFS_POOL_RESTRICT environment variable is set we only iterate over pools it lists . This is an undocumented feature for use during testing only . This function returns B_TRUE if the pool should be skipped during iteration .
static boolean_t
check_restricted(const char *poolname)
{
	static boolean_t initialized = B_FALSE;
	static char *restricted = NULL;
	const char *cur, *end;
	int len, namelen;
	if (!initialized) {
		initialized = B_TRUE;
		restricted = getenv("__ZFS_POOL_RESTRICT");
	}
	if (NULL == restricted)
		return (B_FALSE);
	cur = restricted;
	namelen = strlen(poolname);
	do {
		end = strchr(cur, ' ');
		len = (NULL == end) ? strlen(cur) : (end - cur);
		if (len == namelen && 0 == strncmp(cur, poolname, len)) {
			return (B_FALSE);
		}
		cur += (len + 1);
	} while (NULL != end);
	return (B_TRUE);
}
static boolean_t check_restricted ( const char * poolname ) { static boolean_t initialized = B_FALSE ; static char * restricted = NULL ; const char * cur , * end ; int len , namelen ; if ( ! initialized ) { initialized = B_TRUE ; restricted = getenv ( " " ) ; } if ( NULL == restricted ) return ( B_FALSE ) ; cur = restricted ; namelen = strlen ( poolname ) ; do { end = strchr ( cur , ' ' ) ; len = ( NULL == end ) ? strlen ( cur ) : ( end - cur ) ; if ( len == namelen && 0 == strncmp ( cur , poolname , len ) ) { return ( B_FALSE ) ; } cur += ( len + 1 ) ; } while ( NULL != end ) ; return ( B_TRUE ) ; }
If the __ZFS_POOL_RESTRICT environment variable is set we only iterate over
 pools it lists.
If the __ZFS_POOL_RESTRICT environment variable is set we only iterate over pools it lists .