FreeBSD/usr.sbin/jail/jail.c
/*
 * Set jail parameters and possibly print them out.
 */
Set jail parameters and possibly print them out.
Set jail parameters and possibly print them out .
static int
jailparam_set_note(const struct cfjail *j, struct jailparam *jp, unsigned njp,
    int flags)
{
	char *value;
	int jid;
	unsigned i;
	jid = jailparam_set(jp, njp, flags);
	if (verbose > 0) {
		jail_note(j, "jail_set(%s%s)",
		    (flags & (JAIL_CREATE | JAIL_UPDATE)) == JAIL_CREATE
		    ? "JAIL_CREATE" : "JAIL_UPDATE",
		    (flags & JAIL_DYING) ? " | JAIL_DYING" : "");
		for (i = 0; i < njp; i++) {
			printf(" %s", jp[i].jp_name);
			if (jp[i].jp_value == NULL)
				continue;
			putchar('=');
			value = jailparam_export(jp + i);
			if (value == NULL)
				err(1, "jailparam_export");
			quoted_print(stdout, value);
			free(value);
		}
		if (jid < 0)
			printf(": %s", strerror(errno));
		printf("\n");
	}
	return jid;
}
static int jailparam_set_note ( const struct cfjail * j , struct jailparam * jp , unsigned njp , int flags ) { char * value ; int jid ; unsigned i ; jid = jailparam_set ( jp , njp , flags ) ; if ( verbose > 0 ) { jail_note ( j , " " , ( flags & ( JAIL_CREATE | JAIL_UPDATE ) ) == JAIL_CREATE ? " " : " " , ( flags & JAIL_DYING ) ? " " : " " ) ; for ( i = 0 ; i < njp ; i ++ ) { printf ( " " , jp [ i ] . jp_name ) ; if ( jp [ i ] . jp_value == NULL ) continue ; putchar ( ' ' ) ; value = jailparam_export ( jp + i ) ; if ( value == NULL ) err ( 1 , " " ) ; quoted_print ( stdout , value ) ; free ( value ) ; } if ( jid < 0 ) printf ( " " , strerror ( errno ) ) ; printf ( " \n " ) ; } return jid ; }
Set jail parameters and possibly print them out.
Set jail parameters and possibly print them out .