Date: Mon, 15 Jun 2009 11:19:29 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 164416 for review Message-ID: <200906151119.n5FBJTl3075949@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=164416 Change 164416 by rwatson@rwatson_freebsd_capabilities on 2009/06/15 11:19:11 Complete libcapability_io.3 break-out. Affected files ... .. //depot/projects/trustedbsd/capabilities/src/lib/libcapability/Makefile#11 edit .. //depot/projects/trustedbsd/capabilities/src/lib/libcapability/libcapability.3#18 edit .. //depot/projects/trustedbsd/capabilities/src/lib/libcapability/libcapability_host.3#2 edit .. //depot/projects/trustedbsd/capabilities/src/lib/libcapability/libcapability_sandbox.3#2 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/lib/libcapability/Makefile#11 (text+ko) ==== @@ -18,7 +18,8 @@ WARNS?= 6 MAN= libcapability.3 -MAN+= libcapability_io.3 +MAN+= libcapability_host.3 +MAN+= libcapability_sandbox.3 MLINKS= libcapability.3 libcapabilitym.3 \ libcapability.3 lc_limitfd.3 \ libcapability.3 lch_start.3 \ @@ -31,16 +32,16 @@ libcapability.3 lch_getprocdesc.3 \ libcapability.3 lcs_get.3 \ libcapability.3 lcs_getsock.3 \ - libcapability_io.3 lch_recv.3 \ - libcapability_io.3 lch_recv_rights.3 \ - libcapability_io.3 lch_rpc.3 \ - libcapability_io.3 lch_send.3 \ - libcapability_io.3 lch_send_rights.3 \ - libcapability_io.3 lcs_recv.3 \ - libcapability_io.3 lcs_recv_rights.3 \ - libcapability_io.3 lcs_recvrpc.3 \ - libcapability_io.3 lcs_send.3 \ - libcapability_io.3 lcs_send_rights.3 \ - libcapability_io.3 lcs_sendrpc.3 + libcapability_host.3 lch_recv.3 \ + libcapability_host.3 lch_recv_rights.3 \ + libcapability_host.3 lch_rpc.3 \ + libcapability_host.3 lch_send.3 \ + libcapability_host.3 lch_send_rights.3 \ + libcapability_sandbox.3 lcs_recv.3 \ + libcapability_sandbox.3 lcs_recv_rights.3 \ + libcapability_sandbox.3 lcs_recvrpc.3 \ + libcapability_sandbox.3 lcs_send.3 \ + libcapability_sandbox.3 lcs_send_rights.3 \ + libcapability_sandbox.3 lcs_sendrpc.3 .include <bsd.lib.mk> ==== //depot/projects/trustedbsd/capabilities/src/lib/libcapability/libcapability.3#18 (text+ko) ==== @@ -169,7 +169,7 @@ .Nm implements a number of I/O functions as part of the host API, which are documented in -.Xr libcapability_io 3 . +.Xr libcapability_host 3 . .Sh SANDBOX API The .Nm @@ -189,14 +189,15 @@ .Nm implements a number of I/O functions as part of the sandbox API, which are documented in -.Xr libcapability_io 3 . +.Xr libcapability_sandbox 3 . .Sh SEE ALSO .Xr rpcgen 1 , .Xr cap_enter 2 , .Xr cap_new 2 , .Xr close 2 , .Xr dup2 2 , -.Xr libcapability_io 3 , +.Xr libcapability_host 3 , +.Xr libcapability_sandbox 3 , .Xr unix 4 .Sh HISTORY Support for capabilities and capabilities mode was developed as part of the ==== //depot/projects/trustedbsd/capabilities/src/lib/libcapability/libcapability_host.3#2 (text+ko) ==== @@ -34,7 +34,7 @@ .\" .Dd June 11, 2009 .Os -.Dt LIBCAPABILITY_IO 3 +.Dt LIBCAPABILITY_HOST 3 .Sh NAME .Nm libcapability .Nd "library interface to capability-mode services" @@ -56,22 +56,6 @@ .Fn lch_send "struct lc_sandbox *lcsp" "const void *msg" "size_t len" "int flags" .Ft ssize_t .Fn lch_send_rights "struct lc_sandbox *lcsp" "const void *msg" "size_t len" "int flags" "int *fdp" "int fdcount" -.Ft ssize_t -.Fn lcs_recv "struct lc_host *lchp" "void *buf" "size_t len" "int flags" -.Ft ssize_t -.Fn lcs_recv_rights "struct lc_host *lchp" "void *buf" "size_t len" "int flags" "int *fdp" "int *fdcountp" -.Ft int -.Fn lcs_recvrpc "struct lc_host *lchp" "u_int32_t *opnop" "u_int32_t *seqnop" "u_char **bufferp" "size_t *lenp" -.Ft int -.Fn lcs_recvrpc_rights "struct lc_host *lchp" "u_int32_t *opnop" "u_int32_t *seqnop" "u_char **bufferp" "size_t *lenp" "int *fdp" "int *fdcountp" -.Ft ssize_t -.Fn lcs_send "struct lc_host *lchp" "const void *msg" "size_t len" "int flags" -.Ft ssize_t -.Fn lcs_send_rights "struct lc_host *lchp" "const void *msg" "size_t len" "int flags" "int *fdp" "int fdcount" -.Ft int -.Fn lcs_sendrpc "struct lc_host *lchp" "u_int32_t opno" "u_int32_t seqno" "struct iovec *rep" "int repcount" -.Ft int -.Fn lcs_sendrpc_rights "struct lc_host *lchp" "u_int32_t opno" "u_int32_t seqno" "struct iovec *rep" "int repcount" "int *fdp" "int fdcount" .Sh DESCRIPTION The .Nm @@ -86,9 +70,11 @@ .Xr rpcgen 1 to build event handling and marshaling code. .Pp -This man page describes these I/O facilities; information on setting up +This man page describes host I/O facilities; information on setting up and managing sandboxes may be found in -.Xr libcapability 3 . +.Xr libcapability 3 ; +information on sandbox I/O facilities may be found in +.Xr libcapability_sandbox 3 . .Sh HOST API .Fn lch_recv and @@ -142,50 +128,6 @@ If the RPC fails, -1 will be returned, or 0 and the size of any reply will be returned by reference using .Va replenp . -.Sh SANDBOX API -.Fn lcs_recv -and -.Fn lcs_send -provide simple wrappers around -.Xr recv 2 -and -.Xr send 2 -to avoid sandboxes having to query host socket file descriptors before use. -.Pp -.Fn lcs_recv_rights -and -.Fn lcs_send_rights -similarly allow receiving and sending file descriptors with messages. -.Pp -.Fn lcs_recvrpc -and -.Fn lcs_sendrpc -may be used to implement a simple RPC system, in coordination with a host -using -.Fn lch_rpc . -.Fn lcs_recvrpc -blocks awaiting the receipt of an RPC request, which will be returned in a -buffer allocated using -.Xr malloc 3 , -.Va bufferp , -and with a data size returned via -.Va lenp . -The caller will also receive an operation number and a sequence number via -.Va opnop -and -.Va seqnop . -.Pp -When an RPC is complete, it should be returned to the host via -.Fn lcs_sendrpc , -which accepts the same operation and sequence number as arguments, as well as -reply data via the -.Vt iovec -.Va rep -and -.Va repcount . -When the sandbox is done with the request data, it should free the memory -using -.Xr free 3 . .Sh SEE ALSO .Xr rpcgen 1 , .Xr recv 2 , @@ -193,6 +135,7 @@ .Xr writev 2 , .Xr free 3 , .Xr libcapability 3 , +.Xr libcapability_sandbox 3 , .Xr malloc 3 , .Xr unix 4 .Sh HISTORY ==== //depot/projects/trustedbsd/capabilities/src/lib/libcapability/libcapability_sandbox.3#2 (text+ko) ==== @@ -34,7 +34,7 @@ .\" .Dd June 11, 2009 .Os -.Dt LIBCAPABILITY_IO 3 +.Dt LIBCAPABILITY_SANDBOX 3 .Sh NAME .Nm libcapability .Nd "library interface to capability-mode services" @@ -45,18 +45,6 @@ .In sys/capability.h .In libcapability.h .Ft ssize_t -.Fn lch_recv "struct lc_sandbox *lcsp, void *buf" "size_t len" "int flags" -.Ft ssize_t -.Fn lch_recv_rights "struct lc_sandbox *lcsp" "void *buf" "size_t len" "int flags" "int *fdp" "int *fdcountp" -.Ft int -.Fn lch_rpc "struct lc_sandbox *lcsp" "u_int32_t opno" "struct iovec *req" "int reqcount" "struct iovec *rep" "int repcount" "size_t *replenp" -.Ft int -.Fn lch_rpc_rights "struct lc_sandbox *lcsp" "u_int32_t opno" "struct iovec *req" "int reqcount" "int *req_fdp" "int req_fdcount" "struct iovec *rep" "int repcount" "size_t *replenp" "int *rep_fdp" "int *rep_fdcountp" -.Ft ssize_t -.Fn lch_send "struct lc_sandbox *lcsp" "const void *msg" "size_t len" "int flags" -.Ft ssize_t -.Fn lch_send_rights "struct lc_sandbox *lcsp" "const void *msg" "size_t len" "int flags" "int *fdp" "int fdcount" -.Ft ssize_t .Fn lcs_recv "struct lc_host *lchp" "void *buf" "size_t len" "int flags" .Ft ssize_t .Fn lcs_recv_rights "struct lc_host *lchp" "void *buf" "size_t len" "int flags" "int *fdp" "int *fdcountp" @@ -86,9 +74,11 @@ .Xr rpcgen 1 to build event handling and marshaling code. .Pp -This man page describes these I/O facilities; information on setting up +This man page describes sandbox I/O facilities; information on setting up and managing sandboxes may be found in -.Xr libcapability 3 . +.Xr libcapability 3 ; +information on host I/O facilities may be found in +.Xr libcapability_host 3 . .Sh HOST API .Fn lch_recv and @@ -193,6 +183,7 @@ .Xr writev 2 , .Xr free 3 , .Xr libcapability 3 , +.Xr libcapability_host 3 , .Xr malloc 3 , .Xr unix 4 .Sh HISTORY
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906151119.n5FBJTl3075949>