subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
Subject svn commit: r1515698 - in /subversion/branches/1.8.x: ./ STATUS subversion/libsvn_ra_serf/util.c
Date Tue, 20 Aug 2013 04:00:48 GMT
Author: svn-role
Date: Tue Aug 20 04:00:48 2013
New Revision: 1515698

URL: http://svn.apache.org/r1515698
Log:
Merge r1514804 from trunk:

 * r1514804
   ra_serf: Format distinguished names properly.
   Justification:
     Displaying "Issuer: (null), (null), (null), Thawte, US (null)"
     in SSL certificate confirmation is bad. Regression from
     Subversion 1.7.x.
   Votes:
     +1: ivan, stefan2, danielsh

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/libsvn_ra_serf/util.c

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1514804

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1515698&r1=1515697&r2=1515698&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Tue Aug 20 04:00:48 2013
@@ -220,15 +220,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1514804
-   ra_serf: Format distinguished names properly.
-   Justification:
-     Displaying "Issuer: (null), (null), (null), Thawte, US (null)"
-     in SSL certificate confirmation is bad. Regression from
-     Subversion 1.7.x.
-   Votes:
-     +1: ivan, stefan2, danielsh
-
  * r1503318
    ra_serf: Do not retry HTTP requests if we started to parse them.
    Discussion: http://svn.haxx.se/dev/archive-2013-07/0290.shtml

Modified: subversion/branches/1.8.x/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_ra_serf/util.c?rev=1515698&r1=1515697&r2=1515698&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_ra_serf/util.c Tue Aug 20 04:00:48 2013
@@ -191,13 +191,55 @@ construct_realm(svn_ra_serf__session_t *
 static char *
 convert_organisation_to_str(apr_hash_t *org, apr_pool_t *pool)
 {
-  return apr_psprintf(pool, "%s, %s, %s, %s, %s (%s)",
-                      (char*)svn_hash_gets(org, "OU"),
-                      (char*)svn_hash_gets(org, "O"),
-                      (char*)svn_hash_gets(org, "L"),
-                      (char*)svn_hash_gets(org, "ST"),
-                      (char*)svn_hash_gets(org, "C"),
-                      (char*)svn_hash_gets(org, "E"));
+  const char *org_unit = svn_hash_gets(org, "OU");
+  const char *org_name = svn_hash_gets(org, "O");
+  const char *locality = svn_hash_gets(org, "L");
+  const char *state = svn_hash_gets(org, "ST");
+  const char *country = svn_hash_gets(org, "C");
+  const char *email = svn_hash_gets(org, "E");
+  svn_stringbuf_t *buf = svn_stringbuf_create_empty(pool);
+
+  if (org_unit)
+    {
+      svn_stringbuf_appendcstr(buf, org_unit);
+      svn_stringbuf_appendcstr(buf, ", ");
+    }
+
+  if (org_name)
+    {
+      svn_stringbuf_appendcstr(buf, org_name);
+      svn_stringbuf_appendcstr(buf, ", ");
+    }
+
+  if (locality)
+    {
+      svn_stringbuf_appendcstr(buf, locality);
+      svn_stringbuf_appendcstr(buf, ", ");
+    }
+
+  if (state)
+    {
+      svn_stringbuf_appendcstr(buf, state);
+      svn_stringbuf_appendcstr(buf, ", ");
+    }
+
+  if (country)
+    {
+      svn_stringbuf_appendcstr(buf, country);
+      svn_stringbuf_appendcstr(buf, ", ");
+    }
+
+  /* Chop ', ' if any. */
+  svn_stringbuf_chop(buf, 2);
+
+  if (email)
+    {
+      svn_stringbuf_appendcstr(buf, "(");
+      svn_stringbuf_appendcstr(buf, email);
+      svn_stringbuf_appendcstr(buf, ")");
+    }
+
+  return buf->data;
 }
 
 /* This function is called on receiving a ssl certificate of a server when



Mime
View raw message