tailhook / unshare

The low-level linux containers creation library for rust
Apache License 2.0
124 stars 27 forks source link

Allow changing namespaces for child process #6

Closed anti-social closed 8 years ago

anti-social commented 8 years ago

We need to implement support for setns syscall.

Documentation says that setns supports 0 as nstype argument:

0      Allow any type of namespace to be joined.

How we can implement this?

Specific method:

cmd.setns_any(fd);

Or using Option:

cmd.setns(fd, None)

Or with special type:

cmd.setns(fd, SetNs::Any)
tailhook commented 8 years ago

I don't think it's a good idea to introduce another type just for this task. And I think that Option<Namespace> describes the idea of verifying that this is of certain kind of namespace or not verifying at all, just well (given the argument is named well and documented).

tailhook commented 8 years ago

Closed in #7