Re: Need some help understanding a jail system call.

2009-08-31 Thread Robert Watson

On Wed, 26 Aug 2009, Dag-Erling Smørgrav wrote:

Here is the link i used to find this code 
http://www.watson.org/~robert/freebsd/jailng/


You realize that this is eight years old, right?  And that the jail 
infrastructure has been extensively modified since then, and is currently 
being rewritten again?


As DES points out, that jail work has been superceded by other, more 
interesting, work in the base tree.  My suggestion would be to read the 
jail(2) man page, both the current 7.x version, and the forthcoming 8.x 
version which has been substantially enhanced, and disregard the jailng page. 
I should more clearly mark it as being of historic interest only.


Robert N M Watson
Computer Laboratory
University of Cambridge___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org

Need some help understanding a jail system call.

2009-08-26 Thread bert wiley
Hello
   I found this code under a project called jailNG which has some system
calls for doing jail stuff. Im still new to freebsd and im stumped on what
this code is actually doing. In the source from the project there are few
function calls that look like it creates and access the jail layer. Here is
an example




#define JAIL_CREATE 1
#define JAIL_DESTROY2
#define JAIL_JOIN   3

extern char *environ[];

static void
usage(void)
{

  fprintf(stderr, usage:\n);
  fprintf(stderr,   jailctl create [jailname]\n);
  fprintf(stderr,   jailctl destroy [jailname]\n);
  fprintf(stderr,   jailctl join [jailname] [-c chrootpath] [path] 
  [cmd] [args...]\n);

  exit(-1);
}

static int
jail_create(int argc, char *argv[])
{
  int error;

  if (argc  2)
usage();

  error = syscall(375, JAIL_CREATE, argv[1]);
  if (error)
perror(jailconf().create);
  return (error);
}



No where in the code do i ever see any access to the jail.h type systems
calls, so does the syscall(375, JAIL_CREATE, argv[1]); actually access the
jail subsystem and create a jail?

Here is the link i used to find this code
http://www.watson.org/~robert/freebsd/jailng/



Any help on this question is appreciated thanks.
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: Need some help understanding a jail system call.

2009-08-26 Thread Dag-Erling Smørgrav
bert wiley bertwi...@gmail.com writes:
 No where in the code do i ever see any access to the jail.h type systems
 calls

Because at that stage in the development process, the system calls in
sys/jail.h belong to the old implementation.

 so does the syscall(375, JAIL_CREATE, argv[1]); actually access the
 jail subsystem and create a jail?

It calls the new system call, which at that stage hasn't been added to
libc yet, because it would conflict with the existing system calls.

 Here is the link i used to find this code
 http://www.watson.org/~robert/freebsd/jailng/

You realize that this is eight years old, right?  And that the jail
infrastructure has been extensively modified since then, and is
currently being rewritten again?

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org