[Libct] Queries regarding libct_fs_set_private() API
Monali Porob
Monali.Porob at huawei.com
Fri Feb 6 14:59:42 PST 2015
Hi Andrew ,
W.rt the mount namespace libct APIs , I wanted to know a bit more on how the libct_fs_set_private() API is useful .
Qn 1: What is the use case where I need this . Please could you provide some pointers here .
I tried to use this with host bin,lib and lib64 bind mounted in the root of the container with mount namespaces . After that I see these directories (bin,lib and lib64) in the libct_test_private_ns also .
The host directories bind mounted in the root of container which is "libct_test_root_ns" are also listed under the private directory of the container . They are also visible from outside the namespace.
Qn 2 : Is this behavior correct. I have attached my test program which shows how I have used these APIs. Am I missing something obvious here?
Sample output:
root at ubuntu-mona:/home/monali/libct/master-19Jan/libct-master/test# ls -al libct_test_private_ns/
total 32
drw------- 8 root root 4096 Feb 6 05:26 .
drwxr-xr-x 5 root root 4096 Feb 6 06:26 ..
drwxr-xr-x 2 root root 4096 Feb 6 05:26 bin
drwxr-xr-x 2 root root 4096 Feb 6 05:26 lib
drwxr-xr-x 2 root root 4096 Feb 6 05:26 lib64
drwxr-xr-x 2 root root 4096 Feb 6 05:26 libct_test_devpts
---------- 1 root root 0 Feb 6 05:26 libct_test_file_ns
---------- 1 root root 0 Feb 6 05:26 new
drw------- 2 root root 4096 Feb 6 05:26 proc
drw------- 2 root root 4096 Feb 6 05:26 secret-dir
root at ubuntu-mona:/home/monali/libct/master-19Jan/libct-master/test# ls -al libct_test_root_ns/
total 32
drw------- 8 root root 4096 Feb 6 05:26 .
drwxr-xr-x 5 root root 4096 Feb 6 06:26 ..
drwxr-xr-x 2 root root 4096 Feb 6 05:26 bin
drwxr-xr-x 2 root root 4096 Feb 6 05:26 lib
drwxr-xr-x 2 root root 4096 Feb 6 05:26 lib64
drwxr-xr-x 2 root root 4096 Feb 6 05:26 libct_test_devpts
---------- 1 root root 0 Feb 6 05:26 libct_test_file_ns
---------- 1 root root 0 Feb 6 05:26 new
drw------- 2 root root 4096 Feb 6 05:26 proc
drw------- 2 root root 4096 Feb 6 05:26 secret-dir
Thanking you in advance.
Regards,
Monali.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/libct/attachments/20150206/43ef06e5/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ct_namespace_mnt2.c
URL: <http://lists.openvz.org/pipermail/libct/attachments/20150206/43ef06e5/attachment-0001.c>
More information about the Libct
mailing list