Subject: [nfsv4] [PATCH 0/3] Update inter-server server to server copy

From: <[email-masked]>
Date: Fri, 20 Jun 2014 12:29:38 -0400

From: Andy Adamson <[email-masked]>

The first patch updates the spec to draft-ietf-nfsv4-rpcsec-gssv3-08
name change of "compound authentication" to "multi-principal authentication"

The second patch is inspired by the linux inter-server SSC prototype where the
netaddr4 did not provide enough information to mount the source server from
the destination server acting as a client.

Andy Adamson (3):
  Change rpcsec_gss3 compound authentication to multi-principal
    authentication
  Replace NL4_NETADDR with NL4_EXPORT
  ctap_source must be a list

 dotx.d/spit_types.sh   | 14 +++++++++-----
 nfsv42_middle_copy.xml | 34 ++++++++++++++++++++++++----------
 2 files changed, 33 insertions(+), 15 deletions(-)

-- 
1.8.5.2 (Apple Git-48)

---

From: <[email-masked]>
Date: Fri, 20 Jun 2014 12:29:39 -0400

From: Andy Adamson <[email-masked]>

Signed-off-by: Andy Adamson <[email-masked]>
---
 nfsv42_middle_copy.xml | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/nfsv42_middle_copy.xml b/nfsv42_middle_copy.xml
index 46466bc..2c456c6 100644
--- a/nfsv42_middle_copy.xml
+++ b/nfsv42_middle_copy.xml
@@ -653,7 +653,7 @@
         <t>
           Instead, a combination of two features of the RPCSEC_GSSv3
           <xref target="rpcsec_gssv3" /> protocol can be used:
-          compound authentication and RPC application defined
+          multi-principal authentication and RPC application defined
           structured privilege assertions. These features allow the
           destination server to authenticate to the source server
           as acting on behalf of the user principal, and to authorize
@@ -710,7 +710,7 @@
               value used to establish the copy_from_auth privilege with
               the source principal.  ctap_handle, ctap_handle_vers,
               ctap_nounce, and ctap_nounce_mic are used to construct the
-              compound authentication portion of the copy_confirm_auth
+              multi-principal authentication portion of the copy_confirm_auth
               RPCSEC_GSSv3 context between the destination server and
               the source server (See <xref target="sec:SSC-sec-estab" />).
             </t>
@@ -738,7 +738,8 @@
 
         <section title="Establishing a Security Context" anchor="sec:SSC-sec-estab">
           <t>
-            The RPCSEC_GSSv3 compound authentication feature allows a server
+            The RPCSEC_GSSv3 multi-principal authentication feature
+            allows a server
             to act on behalf of a user if the server identifies the user
             and trusts the client. In the inter-server server side copy
             case, the server is the source server, and the client is the
@@ -937,7 +938,7 @@
 
               <t>
                 The copy_confirm_auth RPCSEC_GSS3_CREATE call also
-                includes a compound authentication component. The
+                includes a multi-principal authentication component. The
                 rpc_gss3_gss_binding fields are filled in with information
                 from the established "copy_to_auth" privilege (see <xref
                 target="sec:SSC-sec-estab" />).  The ctap_handle_vers,
@@ -967,8 +968,8 @@
                 handle version&gt;, and the resultant child handle
                 is noted to be acting on behalf of the user principal.
                 If the source server fails to verify either the privilege
-                or the compound_binding, the COPY operation will be rejected
-                with NFS4ERR_PARTNER_NO_AUTH.
+                or the multi-principal binding, the COPY operation will
+                be rejected with NFS4ERR_PARTNER_NO_AUTH.
               </t>
 
               <t>
@@ -1012,7 +1013,7 @@
           </t>
 
           <t>
-            The copy_confirm_auth privilege and compound authentication
+            The copy_confirm_auth privilege and multi-principal authentication
             RPCSEC_GSSv3 handle is constructed from information held
             by the copy_to_auth privilege, and MUST be destroyed by the
             destination server (via an RPCSEC_GSS3_DESTROY call) when the
-- 
1.8.5.2 (Apple Git-48)

---

From: <[email-masked]>
Date: Fri, 20 Jun 2014 12:29:40 -0400

Prototype work showed a need for an export path.  For inter-server
server to server copy, the destination server acting as a client needs
to mount the source server at a valid export in order for the source server
to be able to interpret the source filehandle specified as the SAVE_FH in the
COPY operation args.

Providing a server name and an export path enables the use of normal NFS
mount interfaces.

The fs_export4 data type is base on the fs_location4 data type from section
11.6 in RFC 5661, and allows the server name to be a netaddr4 universal
address (minus the netid).

Signed-off-by: Andy Adamson <[email-masked]>
---
 dotx.d/spit_types.sh   | 12 ++++++++----
 nfsv42_middle_copy.xml | 19 ++++++++++++++++---
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/dotx.d/spit_types.sh b/dotx.d/spit_types.sh
index c18e540..4117e85 100755
--- a/dotx.d/spit_types.sh
+++ b/dotx.d/spit_types.sh
@@ -1281,12 +1281,16 @@ cat << EOF > $i
 enum netloc_type4 {
 	NL4_NAME	= 0,
 	NL4_URL		= 1,
-	NL4_NETADDR	= 2
+	NL4_EXPORT	= 2
+};
+struct fs_export4 {
+	utf8str_cis	server;
+	pathname4	export;
 };
 union netloc4 switch (netloc_type4 nl_type) {
-	case NL4_NAME:		utf8str_cis nl_name;
-	case NL4_URL:		utf8str_cis nl_url;
-	case NL4_NETADDR:	netaddr4    nl_addr;
+	case NL4_NAME:		utf8str_cis	nl_name;
+	case NL4_URL:		utf8str_cis	nl_url;
+	case NL4_EXPORT:	fs_export4	nl_export;
 };
 EOF
 	;;
diff --git a/nfsv42_middle_copy.xml b/nfsv42_middle_copy.xml
index 2c456c6..e8bff69 100644
--- a/nfsv42_middle_copy.xml
+++ b/nfsv42_middle_copy.xml
@@ -559,9 +559,22 @@
       or some other means. If the netloc4 is of type NL4_URL, a
       server URL <xref target="RFC3986" /> appropriate for the
       server-to-server copy operation is specified as a UTF-8 string.
-      If the netloc4 is of type NL4_NETADDR, the nl_addr field MUST
-      contain a valid netaddr4 as defined in Section 3.3.9 of
-      <xref target="RFC5661" />.
+      If the netloc4 is of type NL4_EXPORT, the nl_export field MUST
+      contain a valid fs_export4.
+    </t>
+    <t>
+      The fs_export4 data type is used to
+      represent the location of an exported file system by providing a
+      server name, and an export path within that server's namespace.
+      It is similar to the fs_location4 data type as defined in
+      Section 11.9 of <xref target="RFC5661" /> in that the server
+      is a UTF-8 string and represents one of a traditional DNS host name,
+      IPv4 address, or IPv6 address.  An IPv4 or IPv6 address is
+      represented as a netaddr4 universal address (see Section 3.3.9
+      of <xref target="RFC5661" />), minus the netid, and either
+      with or without the trailing ".p1.p2" suffix that represents the port
+      number.  If the suffix is omitted, then the default port, 2049,
+      SHOULD be assumed.
     </t>
 
     <t>
-- 
1.8.5.2 (Apple Git-48)

---

From: <[email-masked]>
Date: Fri, 20 Jun 2014 12:29:41 -0400

MUST be the same as the COPY ca_source_server list

Signed-off-by: Andy Adamson <[email-masked]>
---
 dotx.d/spit_types.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dotx.d/spit_types.sh b/dotx.d/spit_types.sh
index 4117e85..c65ee23 100755
--- a/dotx.d/spit_types.sh
+++ b/dotx.d/spit_types.sh
@@ -1336,7 +1336,7 @@ cat << EOF > $i
 struct copy_to_auth_priv {
 	/* equal to cfap_shared_secret */
 	secret4              ctap_shared_secret;
-	netloc4              ctap_source;
+	netloc4              ctap_source<>;
 	/* the NFSv4 user name that the user principal maps to */
 	utf8str_mixed        ctap_username;
 	/*
-- 
1.8.5.2 (Apple Git-48)