diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2009-04-18 09:43:58 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-04-18 09:43:58 -0400 |
commit | 8c94296bc84f3a204f2061c0391a1d2350e4f37e (patch) | |
tree | 0ec8b0644473604b8c13ab71f4aebfe36791666f /support/include | |
parent | 41eb279c2f46ca020bc3b8d17811555f74b99d2e (diff) | |
download | nfs-utils-8c94296bc84f3a204f2061c0391a1d2350e4f37e.tar.gz nfs-utils-8c94296bc84f3a204f2061c0391a1d2350e4f37e.tar.xz nfs-utils-8c94296bc84f3a204f2061c0391a1d2350e4f37e.zip |
support: Provide an API for creating a privileged RPC client
We needed to guarantee that some RPC programs, such as PMAP, got an
unprivileged port, to prevent exhausting the local privileged port
space sending RPC requests that don't need such privileges.
nfs_get_rpcclient() provides that feature.
However, some RPC programs, such as MNT and UMNT, require a privileged
port. So, let's provide an additional API for this that also supports
IPv6 and setting a destination port.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/include')
-rw-r--r-- | support/include/nfsrpc.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/support/include/nfsrpc.h b/support/include/nfsrpc.h index 097debb..543c35b 100644 --- a/support/include/nfsrpc.h +++ b/support/include/nfsrpc.h @@ -24,6 +24,7 @@ #define __NFS_UTILS_NFSRPC_H #include <rpc/types.h> +#include <rpc/clnt.h> /* * Conventional RPC program numbers @@ -54,7 +55,7 @@ extern rpcprog_t nfs_getrpcbyname(const rpcprog_t, const char *table[]); /* - * Acquire an RPC CLIENT * + * Acquire an RPC CLIENT * with an ephemeral source port */ extern CLIENT *nfs_get_rpcclient(const struct sockaddr *, const socklen_t, const unsigned short, @@ -62,6 +63,14 @@ extern CLIENT *nfs_get_rpcclient(const struct sockaddr *, struct timeval *); /* + * Acquire an RPC CLIENT * with a privileged source port + */ +extern CLIENT *nfs_get_priv_rpcclient( const struct sockaddr *, + const socklen_t, const unsigned short, + const rpcprog_t, const rpcvers_t, + struct timeval *); + +/* * Convert a socket address to a universal address */ extern char *nfs_sockaddr2universal(const struct sockaddr *, |