[defensive-coding-guide] 46/120: Author_Group.xml: Fix
cut-and-paste error
by git repository hosting
This is an automated email from the git hooks/post-receive script.
sparks pushed a commit to branch master
in repository defensive-coding-guide.
commit 7f60c447c3d585b752f2821fcf7a5ebc05ca4b35
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Tue Aug 27 10:02:30 2013 +0200
Author_Group.xml: Fix cut-and-paste error
---
defensive-coding/en-US/Author_Group.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/defensive-coding/en-US/Author_Group.xml b/defensive-coding/en-US/Author_Group.xml
index 6b40228..e00d621 100644
--- a/defensive-coding/en-US/Author_Group.xml
+++ b/defensive-coding/en-US/Author_Group.xml
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE authorgroup PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % BOOK_ENTITIES SYSTEM "UEFI_Secure_Boot_Guide.ent">
+<!ENTITY % BOOK_ENTITIES SYSTEM "Defensive_Coding.ent">
%BOOK_ENTITIES;
]>
<authorgroup>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
7 years, 9 months
[defensive-coding-guide] 45/120: Revision History: Reindent
by git repository hosting
This is an automated email from the git hooks/post-receive script.
sparks pushed a commit to branch master
in repository defensive-coding-guide.
commit bacba9716ec6c81f620da6878d32568437d5f2c3
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Tue Aug 27 10:00:36 2013 +0200
Revision History: Reindent
No other changes.
---
defensive-coding/en-US/Revision_History.xml | 69 ++++++++++++++---------------
1 file changed, 34 insertions(+), 35 deletions(-)
diff --git a/defensive-coding/en-US/Revision_History.xml b/defensive-coding/en-US/Revision_History.xml
index eed3d40..cba22e7 100644
--- a/defensive-coding/en-US/Revision_History.xml
+++ b/defensive-coding/en-US/Revision_History.xml
@@ -4,39 +4,38 @@
%BOOK_ENTITIES;
]>
<appendix id="appe-UEFI_Secure_Boot_Guide-Revision_History">
- <title>Revision History</title>
- <simpara>
- <revhistory>
- <revision>
- <revnumber>1.0-1</revnumber>
- <date>Thu May 09 2013</date>
- <author>
- <firstname>Eric</firstname>
- <surname>Christensen</surname>
- <email>sparks(a)redhat.com</email>
- </author>
- <revdescription>
- <simplelist>
- <member>Added more C and C++ examples.</member>
- <member>TLS Client NSS: Rely on NSS 3.14 cipher suite defaults.</member>
- </simplelist>
- </revdescription>
- </revision>
- <revision>
- <revnumber>0-1</revnumber>
- <date>Thu Mar 7 2013</date>
- <author>
- <firstname>Eric</firstname>
- <surname>Christensen</surname>
- <email>sparks(a)redhat.com</email>
- </author>
- <revdescription>
- <simplelist>
- <member>Initial publication.</member>
- </simplelist>
- </revdescription>
- </revision>
- </revhistory>
- </simpara>
+ <title>Revision History</title>
+ <simpara>
+ <revhistory>
+ <revision>
+ <revnumber>1.0-1</revnumber>
+ <date>Thu May 09 2013</date>
+ <author>
+ <firstname>Eric</firstname>
+ <surname>Christensen</surname>
+ <email>sparks(a)redhat.com</email>
+ </author>
+ <revdescription>
+ <simplelist>
+ <member>Added more C and C++ examples.</member>
+ <member>TLS Client NSS: Rely on NSS 3.14 cipher suite defaults.</member>
+ </simplelist>
+ </revdescription>
+ </revision>
+ <revision>
+ <revnumber>0-1</revnumber>
+ <date>Thu Mar 7 2013</date>
+ <author>
+ <firstname>Eric</firstname>
+ <surname>Christensen</surname>
+ <email>sparks(a)redhat.com</email>
+ </author>
+ <revdescription>
+ <simplelist>
+ <member>Initial publication.</member>
+ </simplelist>
+ </revdescription>
+ </revision>
+ </revhistory>
+ </simpara>
</appendix>
-
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
7 years, 9 months
[defensive-coding-guide] 44/120: C: Add material on global variables
by git repository hosting
This is an automated email from the git hooks/post-receive script.
sparks pushed a commit to branch master
in repository defensive-coding-guide.
commit fa41f38b864810921f947e08904a299928e80223
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Mon Aug 26 16:15:53 2013 +0200
C: Add material on global variables
---
defensive-coding/en-US/C-Language.xml | 46 ++++++++++++++++++++++
.../en-US/snippets/C-Globals-String_Array.xml | 12 ++++++
defensive-coding/src/C-Globals.c | 17 ++++++++
defensive-coding/src/src.mk | 1 +
4 files changed, 76 insertions(+)
diff --git a/defensive-coding/en-US/C-Language.xml b/defensive-coding/en-US/C-Language.xml
index 83f6da0..b039ed2 100644
--- a/defensive-coding/en-US/C-Language.xml
+++ b/defensive-coding/en-US/C-Language.xml
@@ -147,4 +147,50 @@
integer overflow.
</para>
</section>
+
+ <section id="sect-Defensive_Coding-C-Globals">
+ <title>Global variables</title>
+ <para>
+ Global variables should be avoided because they usually lead to
+ thread safety hazards. In any case, they should be declared
+ <literal>static</literal>, so that access is restricted to a
+ single translation unit.
+ </para>
+ <para>
+ Global constants are not a problem, but declaring them can be
+ tricky. <xref linkend="ex-Defensive_Coding-C-Globals-String_Array"/>
+ shows how to declare a constant array of constant strings.
+ The second <literal>const</literal> is needed to make the
+ array constant, and not just the strings. It must be placed
+ after the <literal>*</literal>, and not before it.
+ </para>
+ <example id="ex-Defensive_Coding-C-Globals-String_Array">
+ <title>Declaring a constant array of constant strings</title>
+ <xi:include href="snippets/C-Globals-String_Array.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
+ </example>
+ <para>
+ Sometimes, static variables local to functions are used as a
+ replacement for proper memory management. Unlike non-static
+ local variables, it is possible to return a pointer to static
+ local variables to the caller. But such variables are
+ well-hidden, but effectively global (just as static variables at
+ file scope). It is difficult to add thread safety afterwards if
+ such interfaces are used. Merely dropping the
+ <literal>static</literal> keyword in such cases leads to
+ undefined behavior.
+ </para>
+ <para>
+ Another source for static local variables is a desire to reduce
+ stack space usage on embedded platforms, where the stack may
+ span only a few hundred bytes. If this is the only reason why
+ the <literal>static</literal> keyword is used, it can just be
+ dropped, unless the object is very large (larger than
+ 128 kilobytes on 32 bit platforms). In the latter case, it is
+ recommended to allocate the object using
+ <literal>malloc</literal>, to obtain proper array checking, for
+ the same reasons outlined in <xref
+ linkend="sect-Defensive_Coding-C-Allocators-alloca"/>.
+ </para>
+ </section>
</section>
diff --git a/defensive-coding/en-US/snippets/C-Globals-String_Array.xml b/defensive-coding/en-US/snippets/C-Globals-String_Array.xml
new file mode 100644
index 0000000..2f05b7d
--- /dev/null
+++ b/defensive-coding/en-US/snippets/C-Globals-String_Array.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE programlisting PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<!-- Automatically generated file. Do not edit. -->
+<programlisting language="C">
+static const char *const string_list[] = {
+ "first",
+ "second",
+ "third",
+ NULL
+};
+</programlisting>
diff --git a/defensive-coding/src/C-Globals.c b/defensive-coding/src/C-Globals.c
new file mode 100644
index 0000000..75b33b4
--- /dev/null
+++ b/defensive-coding/src/C-Globals.c
@@ -0,0 +1,17 @@
+#include <stddef.h>
+
+//+ C Globals-String_Array
+static const char *const string_list[] = {
+ "first",
+ "second",
+ "third",
+ NULL
+};
+//-
+
+// Silence compiler warning
+const char *const *
+get_string_list()
+{
+ return string_list;
+}
diff --git a/defensive-coding/src/src.mk b/defensive-coding/src/src.mk
index 219e70b..d47fc09 100644
--- a/defensive-coding/src/src.mk
+++ b/defensive-coding/src/src.mk
@@ -12,6 +12,7 @@ LDFLAGS = -g
compile_only += C-Pointers-remaining
compile_only += C-Arithmetic-add
compile_only += C-Arithmetic-mult
+compile_only += C-Globals
compile_only += Java-JNI-Pointers
CFLAGS_Java-JNI-Pointers = \
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
7 years, 9 months
[defensive-coding-guide] 43/120: Fix up broken file references
by git repository hosting
This is an automated email from the git hooks/post-receive script.
sparks pushed a commit to branch master
in repository defensive-coding-guide.
commit e6ea8ef87ff96736cf26e19a0e6723fa39d8687c
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Mon Aug 26 16:02:33 2013 +0200
Fix up broken file references
---
defensive-coding/en-US/Features-TLS.xml | 68 ++++++++++++-------------
defensive-coding/en-US/Java-Language.xml | 6 +--
defensive-coding/en-US/Java-LowLevel.xml | 2 +-
defensive-coding/en-US/Java-SecurityManager.xml | 8 +--
defensive-coding/en-US/Tasks-Serialization.xml | 22 ++++----
5 files changed, 53 insertions(+), 53 deletions(-)
diff --git a/defensive-coding/en-US/Features-TLS.xml b/defensive-coding/en-US/Features-TLS.xml
index 032bd8a..936910d 100644
--- a/defensive-coding/en-US/Features-TLS.xml
+++ b/defensive-coding/en-US/Features-TLS.xml
@@ -54,7 +54,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Nagle">
<title>Deactivating the TCP Nagle algorithm</title>
- <xi:include href="Featuresnippets/s-TLS-Nagle.xml"
+ <xi:include href="snippets/Features-TLS-Nagle.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</listitem>
@@ -147,7 +147,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Errors">
<title>Obtaining OpenSSL error codes</title>
- <xi:include href="Featuresnippets/s-TLS-OpenSSL-Errors.xml"
+ <xi:include href="snippets/Features-TLS-OpenSSL-Errors.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -374,7 +374,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Init">
<title>OpenSSL library initialization</title>
- <xi:include href="Featuresnippets/s-TLS-Client-OpenSSL-Init.xml"
+ <xi:include href="snippets/Features-TLS-Client-OpenSSL-Init.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -392,7 +392,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-OpenSSL-CTX">
<title>OpenSSL client context creation</title>
- <xi:include href="Featuresnippets/s-TLS-Client-OpenSSL-CTX.xml"
+ <xi:include href="snippets/Features-TLS-Client-OpenSSL-CTX.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -441,7 +441,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-OpenSSL-Connect">
<title>Creating a client connection using OpenSSL</title>
- <xi:include href="Featuresnippets/s-TLS-Client-OpenSSL-Connect.xml"
+ <xi:include href="snippets/Features-TLS-Client-OpenSSL-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -454,7 +454,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Connection-Use">
<title>Using an OpenSSL connection to send and receive data</title>
- <xi:include href="Featuresnippets/s-TLS-Client-OpenSSL-Connection-Use.xml"
+ <xi:include href="snippets/Features-TLS-Client-OpenSSL-Connection-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -471,7 +471,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Connection-Close">
<title>Closing an OpenSSL connection in an orderly fashion</title>
- <xi:include href="Featuresnippets/s-TLS-OpenSSL-Connection-Close.xml"
+ <xi:include href="snippets/Features-TLS-OpenSSL-Connection-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -481,7 +481,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Context-Close">
<title>Closing an OpenSSL connection in an orderly fashion</title>
- <xi:include href="Featuresnippets/s-TLS-OpenSSL-Context-Close.xml"
+ <xi:include href="snippets/Features-TLS-OpenSSL-Context-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -497,7 +497,7 @@
The GNUTLS library needs explicit initialization:
</para>
<informalexample id="ex-Defensive_Coding-TLS-GNUTLS-Init">
- <xi:include href="Featuresnippets/s-TLS-GNUTLS-Init.xml"
+ <xi:include href="snippets/Features-TLS-GNUTLS-Init.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -514,7 +514,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-GNUTLS-Credentials">
<title>Initializing a GNUTLS credentials structure</title>
- <xi:include href="Featuresnippets/s-TLS-Client-GNUTLS-Credentials.xml"
+ <xi:include href="snippets/Features-TLS-Client-GNUTLS-Credentials.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -522,7 +522,7 @@
object should be freed:
</para>
<informalexample>
- <xi:include href="Featuresnippets/s-TLS-GNUTLS-Credentials-Close.xml"
+ <xi:include href="snippets/Features-TLS-GNUTLS-Credentials-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -543,7 +543,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-GNUTLS-Connect">
<title>Establishing a TLS client connection using GNUTLS</title>
- <xi:include href="Featuresnippets/s-TLS-Client-GNUTLS-Connect.xml"
+ <xi:include href="snippets/Features-TLS-Client-GNUTLS-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -558,7 +558,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-GNUTLS-Verify">
<title>Verifying a server certificate using GNUTLS</title>
- <xi:include href="Featuresnippets/s-TLS-Client-GNUTLS-Verify.xml"
+ <xi:include href="snippets/Features-TLS-Client-GNUTLS-Verify.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -576,7 +576,7 @@
<example id="ex-Defensive_Coding-TLS-Client-GNUTLS-Match">
<title>Matching the server host name and certificate in a
GNUTLS client</title>
- <xi:include href="Featuresnippets/s-TLS-Client-GNUTLS-Match.xml"
+ <xi:include href="snippets/Features-TLS-Client-GNUTLS-Match.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -591,7 +591,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-GNUTLS-Use">
<title>Using a GNUTLS session</title>
- <xi:include href="Featuresnippets/s-TLS-GNUTLS-Use.xml"
+ <xi:include href="snippets/Features-TLS-GNUTLS-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -603,7 +603,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-GNUTLS-Disconnect">
<title>Using a GNUTLS session</title>
- <xi:include href="Featuresnippets/s-TLS-GNUTLS-Disconnect.xml"
+ <xi:include href="snippets/Features-TLS-GNUTLS-Disconnect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -614,7 +614,7 @@
classes:
</para>
<informalexample>
- <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-Import.xml"
+ <xi:include href="snippets/Features-TLS-Client-OpenJDK-Import.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -644,7 +644,7 @@
<example id="ex-Defensive_Coding-TLS-Client-OpenJDK-Context">
<title>Setting up an <literal>SSLContext</literal> for OpenJDK TLS
clients</title>
- <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-Context.xml"
+ <xi:include href="snippets/Features-TLS-Client-OpenJDK-Context.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -657,7 +657,7 @@
<example id="ex-Defensive_Coding-TLS-OpenJDK-Parameters">
<title>Setting up <literal>SSLParameters</literal> for TLS use
with OpenJDK</title>
- <xi:include href="Featuresnippets/s-TLS-OpenJDK-Parameters.xml"
+ <xi:include href="snippets/Features-TLS-OpenJDK-Parameters.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -666,7 +666,7 @@
separately, and this is only supported by OpenJDK 7 and later:
</para>
<informalexample>
- <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-Hostname.xml"
+ <xi:include href="snippets/Features-TLS-Client-OpenJDK-Hostname.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -687,7 +687,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-OpenJDK-Connect">
<title>Establishing a TLS connection with OpenJDK</title>
- <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-Connect.xml"
+ <xi:include href="snippets/Features-TLS-Client-OpenJDK-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -704,7 +704,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-OpenJDK-Use">
<title>Using a TLS client socket in OpenJDK</title>
- <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-Use.xml"
+ <xi:include href="snippets/Features-TLS-Client-OpenJDK-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<section>
@@ -726,7 +726,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-MyTrustManager">
<title>A customer trust manager for OpenJDK TLS clients</title>
- <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-MyTrustManager.xml"
+ <xi:include href="snippets/Features-TLS-Client-OpenJDK-MyTrustManager.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -737,7 +737,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-Context_For_Cert">
<title>Using a custom TLS trust manager with OpenJDK</title>
- <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-Context_For_Cert.xml"
+ <xi:include href="snippets/Features-TLS-Client-OpenJDK-Context_For_Cert.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -782,7 +782,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-NSS-Includes">
<title>Include files for NSS</title>
- <xi:include href="Featuresnippets/s-TLS-NSS-Includes.xml"
+ <xi:include href="snippets/Features-TLS-NSS-Includes.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -805,7 +805,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-NSS-Init">
<title>Initializing the NSS library</title>
- <xi:include href="Featuresnippets/s-TLS-NSS-Init.xml"
+ <xi:include href="snippets/Features-TLS-NSS-Init.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -813,7 +813,7 @@
the following function calls:
</para>
<informalexample id="ex-Defensive_Coding-TLS-NSS-Close">
- <xi:include href="Featuresnippets/s-TLS-NSS-Close.xml"
+ <xi:include href="snippets/Features-TLS-NSS-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -849,7 +849,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-NSS-Connect">
<title>Creating a TLS connection with NSS</title>
- <xi:include href="Featuresnippets/s-TLS-Client-NSS-Connect.xml"
+ <xi:include href="snippets/Features-TLS-Client-NSS-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -859,7 +859,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-NSS-Use">
<title>Using NSS for sending and receiving data</title>
- <xi:include href="Featuresnippets/s-TLS-NSS-Use.xml"
+ <xi:include href="snippets/Features-TLS-NSS-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -868,7 +868,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-NSS-Close">
<title>Closing NSS client connections</title>
- <xi:include href="Featuresnippets/s-TLS-Client-NSS-Close.xml"
+ <xi:include href="snippets/Features-TLS-Client-NSS-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -905,7 +905,7 @@
<example id="ex-Defensive_Coding-TLS-Client-Python-check_host_name">
<title>Implementing TLS host name checking Python (without
wildcard support)</title>
- <xi:include href="Featuresnippets/s-TLS-Client-Python-check_host_name.xml"
+ <xi:include href="snippets/Features-TLS-Client-Python-check_host_name.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -962,7 +962,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-Python-Connect">
<title>Establishing a TLS client connection with Python</title>
- <xi:include href="Featuresnippets/s-TLS-Client-Python-Connect.xml"
+ <xi:include href="snippets/Features-TLS-Client-Python-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -970,14 +970,14 @@
be used like a regular socket:
</para>
<informalexample>
- <xi:include href="Featuresnippets/s-TLS-Python-Use.xml"
+ <xi:include href="snippets/Features-TLS-Python-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
Closing the TLS socket is straightforward as well:
</para>
<informalexample>
- <xi:include href="Featuresnippets/s-TLS-Python-Close.xml"
+ <xi:include href="snippets/Features-TLS-Python-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
</section>
diff --git a/defensive-coding/en-US/Java-Language.xml b/defensive-coding/en-US/Java-Language.xml
index 0641250..991720e 100644
--- a/defensive-coding/en-US/Java-Language.xml
+++ b/defensive-coding/en-US/Java-Language.xml
@@ -29,7 +29,7 @@
</para>
<example id="ex-Defensive_Coding-Java-Language-ReadArray">
<title>Incrementally reading a byte array</title>
- <xi:include href="Javsnippets/a-Language-ReadArray.xml"
+ <xi:include href="snippets/Java-Language-ReadArray.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -59,7 +59,7 @@
<example id="ex-Defensive_Coding-Java-Language-Finally">
<title>Resource management with a
<literal>try</literal>-<literal>finally</literal> block</title>
- <xi:include href="Javsnippets/a-Finally.xml"
+ <xi:include href="snippets/Java-Finally.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -81,7 +81,7 @@
<example id="ex-Defensive_Coding-Java-Language-TryWithResource">
<title>Resource management using the
<literal>try</literal>-with-resource construct</title>
- <xi:include href="Javsnippets/a-TryWithResource.xml"
+ <xi:include href="snippets/Java-TryWithResource.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
diff --git a/defensive-coding/en-US/Java-LowLevel.xml b/defensive-coding/en-US/Java-LowLevel.xml
index 1468902..025375f 100644
--- a/defensive-coding/en-US/Java-LowLevel.xml
+++ b/defensive-coding/en-US/Java-LowLevel.xml
@@ -80,7 +80,7 @@
</para>
<example id="ex-Defensive_Coding-Java-JNI-Pointers">
<title>Array length checking in JNI code</title>
- <xi:include href="Javsnippets/a-JNI-Pointers.xml"
+ <xi:include href="snippets/Java-JNI-Pointers.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
diff --git a/defensive-coding/en-US/Java-SecurityManager.xml b/defensive-coding/en-US/Java-SecurityManager.xml
index 5538038..a321573 100644
--- a/defensive-coding/en-US/Java-SecurityManager.xml
+++ b/defensive-coding/en-US/Java-SecurityManager.xml
@@ -126,7 +126,7 @@ grant {
<example id="ex-Defensive_Coding-Java-SecurityManager-Unprivileged">
<title>Using the security manager to run code with reduced
privileges</title>
- <xi:include href="Javsnippets/a-SecurityManager-Unprivileged.xml"
+ <xi:include href="snippets/Java-SecurityManager-Unprivileged.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -136,7 +136,7 @@ grant {
on all files in the current directory) can be used:
</para>
<informalexample>
- <xi:include href="Javsnippets/a-SecurityManager-CurrentDirectory.xml"
+ <xi:include href="snippets/Java-SecurityManager-CurrentDirectory.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<important>
@@ -234,7 +234,7 @@ grant {
<example id="ex-Defensive_Coding-Java-SecurityManager-Privileged">
<title>Using the security manager to run code with increased
privileges</title>
- <xi:include href="Javsnippets/a-SecurityManager-Privileged.xml"
+ <xi:include href="snippets/Java-SecurityManager-Privileged.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -283,7 +283,7 @@ grant {
</para>
<example id="ex-Defensive_Coding-Java-SecurityManager-Callback">
<title>Restoring privileges when invoking callbacks</title>
- <xi:include href="Javsnippets/a-SecurityManager-Callback.xml"
+ <xi:include href="snippets/Java-SecurityManager-Callback.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
diff --git a/defensive-coding/en-US/Tasks-Serialization.xml b/defensive-coding/en-US/Tasks-Serialization.xml
index ce8268c..456da55 100644
--- a/defensive-coding/en-US/Tasks-Serialization.xml
+++ b/defensive-coding/en-US/Tasks-Serialization.xml
@@ -239,7 +239,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Expat-EntityDeclHandler">
<title>Disabling XML entity processing with Expat</title>
- <xi:include href="Tasksnippets/s-Serialization-XML-Expat-EntityDeclHandler.xml"
+ <xi:include href="snippets/Tasks-Serialization-XML-Expat-EntityDeclHandler.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -249,7 +249,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Expat-Create">
<title>Creating an Expat XML parser</title>
- <xi:include href="Tasksnippets/s-Serialization-XML-Expat-Create.xml"
+ <xi:include href="snippets/Tasks-Serialization-XML-Expat-Create.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -279,7 +279,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Qt-NoEntityHandler">
<title>A QtXml entity handler which blocks entity processing</title>
- <xi:include href="Tasksnippets/s-Serialization-XML-Qt-NoEntityHandler.xml"
+ <xi:include href="snippets/Tasks-Serialization-XML-Qt-NoEntityHandler.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -295,7 +295,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Qt-NoEntityReader">
<title>A QtXml XML reader which blocks entity processing</title>
- <xi:include href="Tasksnippets/s-Serialization-XML-Qt-NoEntityReader.xml"
+ <xi:include href="snippets/Tasks-Serialization-XML-Qt-NoEntityReader.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -311,7 +311,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Qt-QDomDocument">
<title>Parsing an XML document with QDomDocument, without entity expansion</title>
- <xi:include href="Tasksnippets/s-Serialization-XML-Qt-QDomDocument.xml"
+ <xi:include href="snippets/Tasks-Serialization-XML-Qt-QDomDocument.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -340,13 +340,13 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK-NoEntityResolver">
<title>Helper class to prevent DTD external entity resolution in OpenJDK</title>
- <xi:include href="Tasksnippets/s-Serialization-XML-OpenJDK-NoEntityResolver.xml"
+ <xi:include href="snippets/Tasks-Serialization-XML-OpenJDK-NoEntityResolver.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK-NoResourceResolver">
<title>Helper class to prevent schema resolution in
OpenJDK</title>
- <xi:include href="Tasksnippets/s-Serialization-XML-OpenJDK-NoResourceResolver.xml"
+ <xi:include href="snippets/Tasks-Serialization-XML-OpenJDK-NoResourceResolver.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -355,7 +355,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK-Imports">
<title>Java imports for OpenJDK XML parsing</title>
- <xi:include href="Tasksnippets/s-Serialization-XML-OpenJDK-Imports.xml"
+ <xi:include href="snippets/Tasks-Serialization-XML-OpenJDK-Imports.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<section id="sect-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-DOM">
@@ -369,7 +369,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-DOM">
<title>DOM-based XML parsing in OpenJDK</title>
- <xi:include href="Tasksnippets/s-Serialization-XML-OpenJDK_Parse-DOM.xml"
+ <xi:include href="snippets/Tasks-Serialization-XML-OpenJDK_Parse-DOM.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -400,7 +400,7 @@
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-XMLSchema_SAX">
<title>SAX-based validation against an XML schema in
OpenJDK</title>
- <xi:include href="Tasksnippets/s-Serialization-XML-OpenJDK_Parse-XMLSchema_SAX.xml"
+ <xi:include href="snippets/Tasks-Serialization-XML-OpenJDK_Parse-XMLSchema_SAX.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -421,7 +421,7 @@
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-XMLSchema_DOM">
<title>Validation of a DOM document against an XML schema in
OpenJDK</title>
- <xi:include href="Tasksnippets/s-Serialization-XML-OpenJDK_Parse-XMLSchema_DOM.xml"
+ <xi:include href="snippets/Tasks-Serialization-XML-OpenJDK_Parse-XMLSchema_DOM.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
7 years, 9 months
[defensive-coding-guide] 42/120: Move generated snippets to a more
approriate directory
by git repository hosting
This is an automated email from the git hooks/post-receive script.
sparks pushed a commit to branch master
in repository defensive-coding-guide.
commit 2a7523f6155f2eefd0b1d43263def3e9e645a157
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Mon Aug 26 15:32:58 2013 +0200
Move generated snippets to a more approriate directory
---
defensive-coding/Makefile | 1 +
defensive-coding/en-US/C-Language.xml | 6 +-
defensive-coding/en-US/C-Libc.xml | 14 ++---
defensive-coding/en-US/Features-TLS.xml | 68 +++++++++++-----------
defensive-coding/en-US/Java-Language.xml | 6 +-
defensive-coding/en-US/Java-LowLevel.xml | 2 +-
defensive-coding/en-US/Java-SecurityManager.xml | 8 +--
defensive-coding/en-US/Tasks-Serialization.xml | 22 +++----
.../C-Arithmetic-add.xml} | 0
.../C-Arithmetic-mult.xml} | 0
.../C-Pointers-remaining.xml} | 0
.../C-String-Functions-format.xml} | 0
.../C-String-Functions-snprintf-incremental.xml} | 0
.../C-String-Functions-snprintf.xml} | 0
.../C-String-Functions-strncat-as-strncpy.xml} | 0
.../C-String-Functions-strncat-emulation.xml} | 0
.../C-String-Functions-strncat-merged.xml} | 0
.../C-String-Functions-strncpy.xml} | 0
.../Features-TLS-Client-GNUTLS-Connect.xml} | 0
.../Features-TLS-Client-GNUTLS-Credentials.xml} | 0
.../Features-TLS-Client-GNUTLS-Match.xml} | 0
.../Features-TLS-Client-GNUTLS-Verify.xml} | 0
.../Features-TLS-Client-NSS-Close.xml} | 0
.../Features-TLS-Client-NSS-Connect.xml} | 0
.../Features-TLS-Client-OpenJDK-Connect.xml} | 0
.../Features-TLS-Client-OpenJDK-Context.xml} | 0
...atures-TLS-Client-OpenJDK-Context_For_Cert.xml} | 0
.../Features-TLS-Client-OpenJDK-Hostname.xml} | 0
.../Features-TLS-Client-OpenJDK-Import.xml} | 0
...Features-TLS-Client-OpenJDK-MyTrustManager.xml} | 0
.../Features-TLS-Client-OpenJDK-Use.xml} | 0
.../Features-TLS-Client-OpenSSL-CTX.xml} | 0
.../Features-TLS-Client-OpenSSL-Connect.xml} | 0
...Features-TLS-Client-OpenSSL-Connection-Use.xml} | 0
.../Features-TLS-Client-OpenSSL-Init.xml} | 0
.../Features-TLS-Client-Python-Connect.xml} | 0
...Features-TLS-Client-Python-check_host_name.xml} | 0
.../Features-TLS-GNUTLS-Credentials-Close.xml} | 0
.../Features-TLS-GNUTLS-Disconnect.xml} | 0
.../Features-TLS-GNUTLS-Init.xml} | 0
.../Features-TLS-GNUTLS-Use.xml} | 0
.../Features-TLS-NSS-Close.xml} | 0
.../Features-TLS-NSS-Includes.xml} | 0
.../Features-TLS-NSS-Init.xml} | 0
.../Features-TLS-NSS-Use.xml} | 0
.../Features-TLS-Nagle.xml} | 0
.../Features-TLS-OpenJDK-Parameters.xml} | 0
.../Features-TLS-OpenSSL-Connection-Close.xml} | 0
.../Features-TLS-OpenSSL-Context-Close.xml} | 0
.../Features-TLS-OpenSSL-Errors.xml} | 0
.../Features-TLS-Python-Close.xml} | 0
.../Features-TLS-Python-Use.xml} | 0
.../Finally.xml => snippets/Java-Finally.xml} | 0
.../Java-JNI-Pointers.xml} | 0
.../Java-Language-ReadArray.xml} | 0
.../Java-SecurityManager-Callback.xml} | 0
.../Java-SecurityManager-CurrentDirectory.xml} | 0
.../Java-SecurityManager-Privileged.xml} | 0
.../Java-SecurityManager-Unprivileged.xml} | 0
.../Java-TryWithResource.xml} | 0
.../Tasks-Serialization-XML-Expat-Create.xml} | 0
...-Serialization-XML-Expat-EntityDeclHandler.xml} | 0
.../Tasks-Serialization-XML-OpenJDK-Errors.xml} | 0
.../Tasks-Serialization-XML-OpenJDK-Imports.xml} | 0
...Serialization-XML-OpenJDK-NoEntityResolver.xml} | 0
...rialization-XML-OpenJDK-NoResourceResolver.xml} | 0
.../Tasks-Serialization-XML-OpenJDK_Parse-DOM.xml} | 0
...ialization-XML-OpenJDK_Parse-XMLSchema_DOM.xml} | 0
...ialization-XML-OpenJDK_Parse-XMLSchema_SAX.xml} | 0
...Tasks-Serialization-XML-Qt-NoEntityHandler.xml} | 0
.../Tasks-Serialization-XML-Qt-NoEntityReader.xml} | 0
.../Tasks-Serialization-XML-Qt-QDomDocument.xml} | 0
defensive-coding/scripts/split-snippets.py | 2 +-
73 files changed, 65 insertions(+), 64 deletions(-)
diff --git a/defensive-coding/Makefile b/defensive-coding/Makefile
index 08a95c1..6220afc 100644
--- a/defensive-coding/Makefile
+++ b/defensive-coding/Makefile
@@ -7,6 +7,7 @@ include src/src.mk
build: build-src build-manual
build-snippets:
+ mkdir -p en-US/snippets
python scripts/split-snippets.py . \
src/*.c src/*.cpp src/*.java src/*.py
diff --git a/defensive-coding/en-US/C-Language.xml b/defensive-coding/en-US/C-Language.xml
index 1f1c7d2..83f6da0 100644
--- a/defensive-coding/en-US/C-Language.xml
+++ b/defensive-coding/en-US/C-Language.xml
@@ -57,7 +57,7 @@
</para>
<example id="ex-Defensive_Coding-C-Pointers-remaining">
<title>Array processing in C</title>
- <xi:include href="C/snippets/Pointers-remaining.xml"
+ <xi:include href="snippets/C-Pointers-remaining.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -83,7 +83,7 @@
</para>
<example id="ex-Defensive_Coding-C-Arithmetic-bad">
<title>Incorrect overflow detection in C</title>
- <xi:include href="C/snippets/Arithmetic-add.xml"
+ <xi:include href="snippets/C-Arithmetic-add.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -119,7 +119,7 @@
</itemizedlist>
<example id="ex-Defensive_Coding-C-Arithmetic-mult">
<title>Overflow checking for unsigned multiplication</title>
- <xi:include href="C/snippets/Arithmetic-mult.xml"
+ <xi:include href="snippets/C-Arithmetic-mult.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
diff --git a/defensive-coding/en-US/C-Libc.xml b/defensive-coding/en-US/C-Libc.xml
index 50abb8a..75be572 100644
--- a/defensive-coding/en-US/C-Libc.xml
+++ b/defensive-coding/en-US/C-Libc.xml
@@ -184,7 +184,7 @@
<function>asprintf</function> instead.)
</para>
<informalexample>
- <xi:include href="C/snippets/String-Functions-snprintf.xml"
+ <xi:include href="snippets/C-String-Functions-snprintf.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -212,7 +212,7 @@
</para>
<example id="ex-Defensive_Coding-C-String-Functions-snprintf-incremental">
<title>Repeatedly writing to a buffer using <function>snprintf</function></title>
- <xi:include href="C/snippets/String-Functions-snprintf-incremental.xml"
+ <xi:include href="snippets/C-String-Functions-snprintf-incremental.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -244,7 +244,7 @@
</para>
<example id="ex-Defensive_Coding-C-String-Functions-format-Attribute">
<title>The <literal>format</literal> function attribute</title>
- <xi:include href="C/snippets/String-Functions-format.xml"
+ <xi:include href="snippets/C-String-Functions-format.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -256,7 +256,7 @@
ensuring NUL termination is:
</para>
<informalexample>
- <xi:include href="C/snippets/String-Functions-strncpy.xml"
+ <xi:include href="snippets/C-String-Functions-strncpy.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -264,7 +264,7 @@
function for this purpose:
</para>
<informalexample>
- <xi:include href="C/snippets/String-Functions-strncat-as-strncpy.xml"
+ <xi:include href="snippets/C-String-Functions-strncat-as-strncpy.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
</section>
@@ -289,7 +289,7 @@
linkend="ex-Defensive_Coding-C-String-Functions-snprintf-incremental"/>:
</para>
<informalexample>
- <xi:include href="C/snippets/String-Functions-strncat-emulation.xml"
+ <xi:include href="snippets/C-String-Functions-strncat-emulation.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -298,7 +298,7 @@
string:
</para>
<informalexample>
- <xi:include href="C/snippets/String-Functions-strncat-merged.xml"
+ <xi:include href="snippets/C-String-Functions-strncat-merged.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
diff --git a/defensive-coding/en-US/Features-TLS.xml b/defensive-coding/en-US/Features-TLS.xml
index 71b9214..032bd8a 100644
--- a/defensive-coding/en-US/Features-TLS.xml
+++ b/defensive-coding/en-US/Features-TLS.xml
@@ -54,7 +54,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Nagle">
<title>Deactivating the TCP Nagle algorithm</title>
- <xi:include href="Features/snippets/TLS-Nagle.xml"
+ <xi:include href="Featuresnippets/s-TLS-Nagle.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</listitem>
@@ -147,7 +147,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Errors">
<title>Obtaining OpenSSL error codes</title>
- <xi:include href="Features/snippets/TLS-OpenSSL-Errors.xml"
+ <xi:include href="Featuresnippets/s-TLS-OpenSSL-Errors.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -374,7 +374,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Init">
<title>OpenSSL library initialization</title>
- <xi:include href="Features/snippets/TLS-Client-OpenSSL-Init.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-OpenSSL-Init.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -392,7 +392,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-OpenSSL-CTX">
<title>OpenSSL client context creation</title>
- <xi:include href="Features/snippets/TLS-Client-OpenSSL-CTX.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-OpenSSL-CTX.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -441,7 +441,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-OpenSSL-Connect">
<title>Creating a client connection using OpenSSL</title>
- <xi:include href="Features/snippets/TLS-Client-OpenSSL-Connect.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-OpenSSL-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -454,7 +454,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Connection-Use">
<title>Using an OpenSSL connection to send and receive data</title>
- <xi:include href="Features/snippets/TLS-Client-OpenSSL-Connection-Use.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-OpenSSL-Connection-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -471,7 +471,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Connection-Close">
<title>Closing an OpenSSL connection in an orderly fashion</title>
- <xi:include href="Features/snippets/TLS-OpenSSL-Connection-Close.xml"
+ <xi:include href="Featuresnippets/s-TLS-OpenSSL-Connection-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -481,7 +481,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Context-Close">
<title>Closing an OpenSSL connection in an orderly fashion</title>
- <xi:include href="Features/snippets/TLS-OpenSSL-Context-Close.xml"
+ <xi:include href="Featuresnippets/s-TLS-OpenSSL-Context-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -497,7 +497,7 @@
The GNUTLS library needs explicit initialization:
</para>
<informalexample id="ex-Defensive_Coding-TLS-GNUTLS-Init">
- <xi:include href="Features/snippets/TLS-GNUTLS-Init.xml"
+ <xi:include href="Featuresnippets/s-TLS-GNUTLS-Init.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -514,7 +514,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-GNUTLS-Credentials">
<title>Initializing a GNUTLS credentials structure</title>
- <xi:include href="Features/snippets/TLS-Client-GNUTLS-Credentials.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-GNUTLS-Credentials.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -522,7 +522,7 @@
object should be freed:
</para>
<informalexample>
- <xi:include href="Features/snippets/TLS-GNUTLS-Credentials-Close.xml"
+ <xi:include href="Featuresnippets/s-TLS-GNUTLS-Credentials-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -543,7 +543,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-GNUTLS-Connect">
<title>Establishing a TLS client connection using GNUTLS</title>
- <xi:include href="Features/snippets/TLS-Client-GNUTLS-Connect.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-GNUTLS-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -558,7 +558,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-GNUTLS-Verify">
<title>Verifying a server certificate using GNUTLS</title>
- <xi:include href="Features/snippets/TLS-Client-GNUTLS-Verify.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-GNUTLS-Verify.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -576,7 +576,7 @@
<example id="ex-Defensive_Coding-TLS-Client-GNUTLS-Match">
<title>Matching the server host name and certificate in a
GNUTLS client</title>
- <xi:include href="Features/snippets/TLS-Client-GNUTLS-Match.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-GNUTLS-Match.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -591,7 +591,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-GNUTLS-Use">
<title>Using a GNUTLS session</title>
- <xi:include href="Features/snippets/TLS-GNUTLS-Use.xml"
+ <xi:include href="Featuresnippets/s-TLS-GNUTLS-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -603,7 +603,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-GNUTLS-Disconnect">
<title>Using a GNUTLS session</title>
- <xi:include href="Features/snippets/TLS-GNUTLS-Disconnect.xml"
+ <xi:include href="Featuresnippets/s-TLS-GNUTLS-Disconnect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -614,7 +614,7 @@
classes:
</para>
<informalexample>
- <xi:include href="Features/snippets/TLS-Client-OpenJDK-Import.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-Import.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -644,7 +644,7 @@
<example id="ex-Defensive_Coding-TLS-Client-OpenJDK-Context">
<title>Setting up an <literal>SSLContext</literal> for OpenJDK TLS
clients</title>
- <xi:include href="Features/snippets/TLS-Client-OpenJDK-Context.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-Context.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -657,7 +657,7 @@
<example id="ex-Defensive_Coding-TLS-OpenJDK-Parameters">
<title>Setting up <literal>SSLParameters</literal> for TLS use
with OpenJDK</title>
- <xi:include href="Features/snippets/TLS-OpenJDK-Parameters.xml"
+ <xi:include href="Featuresnippets/s-TLS-OpenJDK-Parameters.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -666,7 +666,7 @@
separately, and this is only supported by OpenJDK 7 and later:
</para>
<informalexample>
- <xi:include href="Features/snippets/TLS-Client-OpenJDK-Hostname.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-Hostname.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -687,7 +687,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-OpenJDK-Connect">
<title>Establishing a TLS connection with OpenJDK</title>
- <xi:include href="Features/snippets/TLS-Client-OpenJDK-Connect.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -704,7 +704,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-OpenJDK-Use">
<title>Using a TLS client socket in OpenJDK</title>
- <xi:include href="Features/snippets/TLS-Client-OpenJDK-Use.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<section>
@@ -726,7 +726,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-MyTrustManager">
<title>A customer trust manager for OpenJDK TLS clients</title>
- <xi:include href="Features/snippets/TLS-Client-OpenJDK-MyTrustManager.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-MyTrustManager.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -737,7 +737,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-Context_For_Cert">
<title>Using a custom TLS trust manager with OpenJDK</title>
- <xi:include href="Features/snippets/TLS-Client-OpenJDK-Context_For_Cert.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-OpenJDK-Context_For_Cert.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -782,7 +782,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-NSS-Includes">
<title>Include files for NSS</title>
- <xi:include href="Features/snippets/TLS-NSS-Includes.xml"
+ <xi:include href="Featuresnippets/s-TLS-NSS-Includes.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -805,7 +805,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-NSS-Init">
<title>Initializing the NSS library</title>
- <xi:include href="Features/snippets/TLS-NSS-Init.xml"
+ <xi:include href="Featuresnippets/s-TLS-NSS-Init.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -813,7 +813,7 @@
the following function calls:
</para>
<informalexample id="ex-Defensive_Coding-TLS-NSS-Close">
- <xi:include href="Features/snippets/TLS-NSS-Close.xml"
+ <xi:include href="Featuresnippets/s-TLS-NSS-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -849,7 +849,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-NSS-Connect">
<title>Creating a TLS connection with NSS</title>
- <xi:include href="Features/snippets/TLS-Client-NSS-Connect.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-NSS-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -859,7 +859,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-NSS-Use">
<title>Using NSS for sending and receiving data</title>
- <xi:include href="Features/snippets/TLS-NSS-Use.xml"
+ <xi:include href="Featuresnippets/s-TLS-NSS-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -868,7 +868,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-NSS-Close">
<title>Closing NSS client connections</title>
- <xi:include href="Features/snippets/TLS-Client-NSS-Close.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-NSS-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -905,7 +905,7 @@
<example id="ex-Defensive_Coding-TLS-Client-Python-check_host_name">
<title>Implementing TLS host name checking Python (without
wildcard support)</title>
- <xi:include href="Features/snippets/TLS-Client-Python-check_host_name.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-Python-check_host_name.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -962,7 +962,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-Python-Connect">
<title>Establishing a TLS client connection with Python</title>
- <xi:include href="Features/snippets/TLS-Client-Python-Connect.xml"
+ <xi:include href="Featuresnippets/s-TLS-Client-Python-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -970,14 +970,14 @@
be used like a regular socket:
</para>
<informalexample>
- <xi:include href="Features/snippets/TLS-Python-Use.xml"
+ <xi:include href="Featuresnippets/s-TLS-Python-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
Closing the TLS socket is straightforward as well:
</para>
<informalexample>
- <xi:include href="Features/snippets/TLS-Python-Close.xml"
+ <xi:include href="Featuresnippets/s-TLS-Python-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
</section>
diff --git a/defensive-coding/en-US/Java-Language.xml b/defensive-coding/en-US/Java-Language.xml
index eddf7f6..0641250 100644
--- a/defensive-coding/en-US/Java-Language.xml
+++ b/defensive-coding/en-US/Java-Language.xml
@@ -29,7 +29,7 @@
</para>
<example id="ex-Defensive_Coding-Java-Language-ReadArray">
<title>Incrementally reading a byte array</title>
- <xi:include href="Java/snippets/Language-ReadArray.xml"
+ <xi:include href="Javsnippets/a-Language-ReadArray.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -59,7 +59,7 @@
<example id="ex-Defensive_Coding-Java-Language-Finally">
<title>Resource management with a
<literal>try</literal>-<literal>finally</literal> block</title>
- <xi:include href="Java/snippets/Finally.xml"
+ <xi:include href="Javsnippets/a-Finally.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -81,7 +81,7 @@
<example id="ex-Defensive_Coding-Java-Language-TryWithResource">
<title>Resource management using the
<literal>try</literal>-with-resource construct</title>
- <xi:include href="Java/snippets/TryWithResource.xml"
+ <xi:include href="Javsnippets/a-TryWithResource.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
diff --git a/defensive-coding/en-US/Java-LowLevel.xml b/defensive-coding/en-US/Java-LowLevel.xml
index 6bb1190..1468902 100644
--- a/defensive-coding/en-US/Java-LowLevel.xml
+++ b/defensive-coding/en-US/Java-LowLevel.xml
@@ -80,7 +80,7 @@
</para>
<example id="ex-Defensive_Coding-Java-JNI-Pointers">
<title>Array length checking in JNI code</title>
- <xi:include href="Java/snippets/JNI-Pointers.xml"
+ <xi:include href="Javsnippets/a-JNI-Pointers.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
diff --git a/defensive-coding/en-US/Java-SecurityManager.xml b/defensive-coding/en-US/Java-SecurityManager.xml
index 20a4b60..5538038 100644
--- a/defensive-coding/en-US/Java-SecurityManager.xml
+++ b/defensive-coding/en-US/Java-SecurityManager.xml
@@ -126,7 +126,7 @@ grant {
<example id="ex-Defensive_Coding-Java-SecurityManager-Unprivileged">
<title>Using the security manager to run code with reduced
privileges</title>
- <xi:include href="Java/snippets/SecurityManager-Unprivileged.xml"
+ <xi:include href="Javsnippets/a-SecurityManager-Unprivileged.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -136,7 +136,7 @@ grant {
on all files in the current directory) can be used:
</para>
<informalexample>
- <xi:include href="Java/snippets/SecurityManager-CurrentDirectory.xml"
+ <xi:include href="Javsnippets/a-SecurityManager-CurrentDirectory.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<important>
@@ -234,7 +234,7 @@ grant {
<example id="ex-Defensive_Coding-Java-SecurityManager-Privileged">
<title>Using the security manager to run code with increased
privileges</title>
- <xi:include href="Java/snippets/SecurityManager-Privileged.xml"
+ <xi:include href="Javsnippets/a-SecurityManager-Privileged.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -283,7 +283,7 @@ grant {
</para>
<example id="ex-Defensive_Coding-Java-SecurityManager-Callback">
<title>Restoring privileges when invoking callbacks</title>
- <xi:include href="Java/snippets/SecurityManager-Callback.xml"
+ <xi:include href="Javsnippets/a-SecurityManager-Callback.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
diff --git a/defensive-coding/en-US/Tasks-Serialization.xml b/defensive-coding/en-US/Tasks-Serialization.xml
index 71cb67a..ce8268c 100644
--- a/defensive-coding/en-US/Tasks-Serialization.xml
+++ b/defensive-coding/en-US/Tasks-Serialization.xml
@@ -239,7 +239,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Expat-EntityDeclHandler">
<title>Disabling XML entity processing with Expat</title>
- <xi:include href="Tasks/snippets/Serialization-XML-Expat-EntityDeclHandler.xml"
+ <xi:include href="Tasksnippets/s-Serialization-XML-Expat-EntityDeclHandler.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -249,7 +249,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Expat-Create">
<title>Creating an Expat XML parser</title>
- <xi:include href="Tasks/snippets/Serialization-XML-Expat-Create.xml"
+ <xi:include href="Tasksnippets/s-Serialization-XML-Expat-Create.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -279,7 +279,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Qt-NoEntityHandler">
<title>A QtXml entity handler which blocks entity processing</title>
- <xi:include href="Tasks/snippets/Serialization-XML-Qt-NoEntityHandler.xml"
+ <xi:include href="Tasksnippets/s-Serialization-XML-Qt-NoEntityHandler.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -295,7 +295,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Qt-NoEntityReader">
<title>A QtXml XML reader which blocks entity processing</title>
- <xi:include href="Tasks/snippets/Serialization-XML-Qt-NoEntityReader.xml"
+ <xi:include href="Tasksnippets/s-Serialization-XML-Qt-NoEntityReader.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -311,7 +311,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Qt-QDomDocument">
<title>Parsing an XML document with QDomDocument, without entity expansion</title>
- <xi:include href="Tasks/snippets/Serialization-XML-Qt-QDomDocument.xml"
+ <xi:include href="Tasksnippets/s-Serialization-XML-Qt-QDomDocument.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -340,13 +340,13 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK-NoEntityResolver">
<title>Helper class to prevent DTD external entity resolution in OpenJDK</title>
- <xi:include href="Tasks/snippets/Serialization-XML-OpenJDK-NoEntityResolver.xml"
+ <xi:include href="Tasksnippets/s-Serialization-XML-OpenJDK-NoEntityResolver.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK-NoResourceResolver">
<title>Helper class to prevent schema resolution in
OpenJDK</title>
- <xi:include href="Tasks/snippets/Serialization-XML-OpenJDK-NoResourceResolver.xml"
+ <xi:include href="Tasksnippets/s-Serialization-XML-OpenJDK-NoResourceResolver.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -355,7 +355,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK-Imports">
<title>Java imports for OpenJDK XML parsing</title>
- <xi:include href="Tasks/snippets/Serialization-XML-OpenJDK-Imports.xml"
+ <xi:include href="Tasksnippets/s-Serialization-XML-OpenJDK-Imports.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<section id="sect-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-DOM">
@@ -369,7 +369,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-DOM">
<title>DOM-based XML parsing in OpenJDK</title>
- <xi:include href="Tasks/snippets/Serialization-XML-OpenJDK_Parse-DOM.xml"
+ <xi:include href="Tasksnippets/s-Serialization-XML-OpenJDK_Parse-DOM.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -400,7 +400,7 @@
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-XMLSchema_SAX">
<title>SAX-based validation against an XML schema in
OpenJDK</title>
- <xi:include href="Tasks/snippets/Serialization-XML-OpenJDK_Parse-XMLSchema_SAX.xml"
+ <xi:include href="Tasksnippets/s-Serialization-XML-OpenJDK_Parse-XMLSchema_SAX.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -421,7 +421,7 @@
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-XMLSchema_DOM">
<title>Validation of a DOM document against an XML schema in
OpenJDK</title>
- <xi:include href="Tasks/snippets/Serialization-XML-OpenJDK_Parse-XMLSchema_DOM.xml"
+ <xi:include href="Tasksnippets/s-Serialization-XML-OpenJDK_Parse-XMLSchema_DOM.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
diff --git a/defensive-coding/en-US/C/snippets/Arithmetic-add.xml b/defensive-coding/en-US/snippets/C-Arithmetic-add.xml
similarity index 100%
rename from defensive-coding/en-US/C/snippets/Arithmetic-add.xml
rename to defensive-coding/en-US/snippets/C-Arithmetic-add.xml
diff --git a/defensive-coding/en-US/C/snippets/Arithmetic-mult.xml b/defensive-coding/en-US/snippets/C-Arithmetic-mult.xml
similarity index 100%
rename from defensive-coding/en-US/C/snippets/Arithmetic-mult.xml
rename to defensive-coding/en-US/snippets/C-Arithmetic-mult.xml
diff --git a/defensive-coding/en-US/C/snippets/Pointers-remaining.xml b/defensive-coding/en-US/snippets/C-Pointers-remaining.xml
similarity index 100%
rename from defensive-coding/en-US/C/snippets/Pointers-remaining.xml
rename to defensive-coding/en-US/snippets/C-Pointers-remaining.xml
diff --git a/defensive-coding/en-US/C/snippets/String-Functions-format.xml b/defensive-coding/en-US/snippets/C-String-Functions-format.xml
similarity index 100%
rename from defensive-coding/en-US/C/snippets/String-Functions-format.xml
rename to defensive-coding/en-US/snippets/C-String-Functions-format.xml
diff --git a/defensive-coding/en-US/C/snippets/String-Functions-snprintf-incremental.xml b/defensive-coding/en-US/snippets/C-String-Functions-snprintf-incremental.xml
similarity index 100%
rename from defensive-coding/en-US/C/snippets/String-Functions-snprintf-incremental.xml
rename to defensive-coding/en-US/snippets/C-String-Functions-snprintf-incremental.xml
diff --git a/defensive-coding/en-US/C/snippets/String-Functions-snprintf.xml b/defensive-coding/en-US/snippets/C-String-Functions-snprintf.xml
similarity index 100%
rename from defensive-coding/en-US/C/snippets/String-Functions-snprintf.xml
rename to defensive-coding/en-US/snippets/C-String-Functions-snprintf.xml
diff --git a/defensive-coding/en-US/C/snippets/String-Functions-strncat-as-strncpy.xml b/defensive-coding/en-US/snippets/C-String-Functions-strncat-as-strncpy.xml
similarity index 100%
rename from defensive-coding/en-US/C/snippets/String-Functions-strncat-as-strncpy.xml
rename to defensive-coding/en-US/snippets/C-String-Functions-strncat-as-strncpy.xml
diff --git a/defensive-coding/en-US/C/snippets/String-Functions-strncat-emulation.xml b/defensive-coding/en-US/snippets/C-String-Functions-strncat-emulation.xml
similarity index 100%
rename from defensive-coding/en-US/C/snippets/String-Functions-strncat-emulation.xml
rename to defensive-coding/en-US/snippets/C-String-Functions-strncat-emulation.xml
diff --git a/defensive-coding/en-US/C/snippets/String-Functions-strncat-merged.xml b/defensive-coding/en-US/snippets/C-String-Functions-strncat-merged.xml
similarity index 100%
rename from defensive-coding/en-US/C/snippets/String-Functions-strncat-merged.xml
rename to defensive-coding/en-US/snippets/C-String-Functions-strncat-merged.xml
diff --git a/defensive-coding/en-US/C/snippets/String-Functions-strncpy.xml b/defensive-coding/en-US/snippets/C-String-Functions-strncpy.xml
similarity index 100%
rename from defensive-coding/en-US/C/snippets/String-Functions-strncpy.xml
rename to defensive-coding/en-US/snippets/C-String-Functions-strncpy.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-GNUTLS-Connect.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-GNUTLS-Connect.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-GNUTLS-Connect.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-GNUTLS-Connect.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-GNUTLS-Credentials.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-GNUTLS-Credentials.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-GNUTLS-Credentials.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-GNUTLS-Credentials.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-GNUTLS-Match.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-GNUTLS-Match.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-GNUTLS-Match.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-GNUTLS-Match.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-GNUTLS-Verify.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-GNUTLS-Verify.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-GNUTLS-Verify.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-GNUTLS-Verify.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-NSS-Close.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-NSS-Close.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-NSS-Close.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-NSS-Close.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-NSS-Connect.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-NSS-Connect.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-NSS-Connect.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-NSS-Connect.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-Connect.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-Connect.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-Connect.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-Connect.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-Context.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-Context.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-Context.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-Context.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-Context_For_Cert.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-Context_For_Cert.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-Context_For_Cert.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-Context_For_Cert.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-Hostname.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-Hostname.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-Hostname.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-Hostname.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-Import.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-Import.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-Import.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-Import.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-MyTrustManager.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-MyTrustManager.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-MyTrustManager.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-MyTrustManager.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-Use.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-Use.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-OpenJDK-Use.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-OpenJDK-Use.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-OpenSSL-CTX.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-OpenSSL-CTX.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-OpenSSL-CTX.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-OpenSSL-CTX.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-OpenSSL-Connect.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-OpenSSL-Connect.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-OpenSSL-Connect.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-OpenSSL-Connect.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-OpenSSL-Connection-Use.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-OpenSSL-Connection-Use.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-OpenSSL-Connection-Use.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-OpenSSL-Connection-Use.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-OpenSSL-Init.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-OpenSSL-Init.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-OpenSSL-Init.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-OpenSSL-Init.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-Python-Connect.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-Python-Connect.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-Python-Connect.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-Python-Connect.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Client-Python-check_host_name.xml b/defensive-coding/en-US/snippets/Features-TLS-Client-Python-check_host_name.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Client-Python-check_host_name.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Client-Python-check_host_name.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-GNUTLS-Credentials-Close.xml b/defensive-coding/en-US/snippets/Features-TLS-GNUTLS-Credentials-Close.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-GNUTLS-Credentials-Close.xml
rename to defensive-coding/en-US/snippets/Features-TLS-GNUTLS-Credentials-Close.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-GNUTLS-Disconnect.xml b/defensive-coding/en-US/snippets/Features-TLS-GNUTLS-Disconnect.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-GNUTLS-Disconnect.xml
rename to defensive-coding/en-US/snippets/Features-TLS-GNUTLS-Disconnect.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-GNUTLS-Init.xml b/defensive-coding/en-US/snippets/Features-TLS-GNUTLS-Init.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-GNUTLS-Init.xml
rename to defensive-coding/en-US/snippets/Features-TLS-GNUTLS-Init.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-GNUTLS-Use.xml b/defensive-coding/en-US/snippets/Features-TLS-GNUTLS-Use.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-GNUTLS-Use.xml
rename to defensive-coding/en-US/snippets/Features-TLS-GNUTLS-Use.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-NSS-Close.xml b/defensive-coding/en-US/snippets/Features-TLS-NSS-Close.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-NSS-Close.xml
rename to defensive-coding/en-US/snippets/Features-TLS-NSS-Close.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-NSS-Includes.xml b/defensive-coding/en-US/snippets/Features-TLS-NSS-Includes.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-NSS-Includes.xml
rename to defensive-coding/en-US/snippets/Features-TLS-NSS-Includes.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-NSS-Init.xml b/defensive-coding/en-US/snippets/Features-TLS-NSS-Init.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-NSS-Init.xml
rename to defensive-coding/en-US/snippets/Features-TLS-NSS-Init.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-NSS-Use.xml b/defensive-coding/en-US/snippets/Features-TLS-NSS-Use.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-NSS-Use.xml
rename to defensive-coding/en-US/snippets/Features-TLS-NSS-Use.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Nagle.xml b/defensive-coding/en-US/snippets/Features-TLS-Nagle.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Nagle.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Nagle.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-OpenJDK-Parameters.xml b/defensive-coding/en-US/snippets/Features-TLS-OpenJDK-Parameters.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-OpenJDK-Parameters.xml
rename to defensive-coding/en-US/snippets/Features-TLS-OpenJDK-Parameters.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-OpenSSL-Connection-Close.xml b/defensive-coding/en-US/snippets/Features-TLS-OpenSSL-Connection-Close.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-OpenSSL-Connection-Close.xml
rename to defensive-coding/en-US/snippets/Features-TLS-OpenSSL-Connection-Close.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-OpenSSL-Context-Close.xml b/defensive-coding/en-US/snippets/Features-TLS-OpenSSL-Context-Close.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-OpenSSL-Context-Close.xml
rename to defensive-coding/en-US/snippets/Features-TLS-OpenSSL-Context-Close.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-OpenSSL-Errors.xml b/defensive-coding/en-US/snippets/Features-TLS-OpenSSL-Errors.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-OpenSSL-Errors.xml
rename to defensive-coding/en-US/snippets/Features-TLS-OpenSSL-Errors.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Python-Close.xml b/defensive-coding/en-US/snippets/Features-TLS-Python-Close.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Python-Close.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Python-Close.xml
diff --git a/defensive-coding/en-US/Features/snippets/TLS-Python-Use.xml b/defensive-coding/en-US/snippets/Features-TLS-Python-Use.xml
similarity index 100%
rename from defensive-coding/en-US/Features/snippets/TLS-Python-Use.xml
rename to defensive-coding/en-US/snippets/Features-TLS-Python-Use.xml
diff --git a/defensive-coding/en-US/Java/snippets/Finally.xml b/defensive-coding/en-US/snippets/Java-Finally.xml
similarity index 100%
rename from defensive-coding/en-US/Java/snippets/Finally.xml
rename to defensive-coding/en-US/snippets/Java-Finally.xml
diff --git a/defensive-coding/en-US/Java/snippets/JNI-Pointers.xml b/defensive-coding/en-US/snippets/Java-JNI-Pointers.xml
similarity index 100%
rename from defensive-coding/en-US/Java/snippets/JNI-Pointers.xml
rename to defensive-coding/en-US/snippets/Java-JNI-Pointers.xml
diff --git a/defensive-coding/en-US/Java/snippets/Language-ReadArray.xml b/defensive-coding/en-US/snippets/Java-Language-ReadArray.xml
similarity index 100%
rename from defensive-coding/en-US/Java/snippets/Language-ReadArray.xml
rename to defensive-coding/en-US/snippets/Java-Language-ReadArray.xml
diff --git a/defensive-coding/en-US/Java/snippets/SecurityManager-Callback.xml b/defensive-coding/en-US/snippets/Java-SecurityManager-Callback.xml
similarity index 100%
rename from defensive-coding/en-US/Java/snippets/SecurityManager-Callback.xml
rename to defensive-coding/en-US/snippets/Java-SecurityManager-Callback.xml
diff --git a/defensive-coding/en-US/Java/snippets/SecurityManager-CurrentDirectory.xml b/defensive-coding/en-US/snippets/Java-SecurityManager-CurrentDirectory.xml
similarity index 100%
rename from defensive-coding/en-US/Java/snippets/SecurityManager-CurrentDirectory.xml
rename to defensive-coding/en-US/snippets/Java-SecurityManager-CurrentDirectory.xml
diff --git a/defensive-coding/en-US/Java/snippets/SecurityManager-Privileged.xml b/defensive-coding/en-US/snippets/Java-SecurityManager-Privileged.xml
similarity index 100%
rename from defensive-coding/en-US/Java/snippets/SecurityManager-Privileged.xml
rename to defensive-coding/en-US/snippets/Java-SecurityManager-Privileged.xml
diff --git a/defensive-coding/en-US/Java/snippets/SecurityManager-Unprivileged.xml b/defensive-coding/en-US/snippets/Java-SecurityManager-Unprivileged.xml
similarity index 100%
rename from defensive-coding/en-US/Java/snippets/SecurityManager-Unprivileged.xml
rename to defensive-coding/en-US/snippets/Java-SecurityManager-Unprivileged.xml
diff --git a/defensive-coding/en-US/Java/snippets/TryWithResource.xml b/defensive-coding/en-US/snippets/Java-TryWithResource.xml
similarity index 100%
rename from defensive-coding/en-US/Java/snippets/TryWithResource.xml
rename to defensive-coding/en-US/snippets/Java-TryWithResource.xml
diff --git a/defensive-coding/en-US/Tasks/snippets/Serialization-XML-Expat-Create.xml b/defensive-coding/en-US/snippets/Tasks-Serialization-XML-Expat-Create.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/snippets/Serialization-XML-Expat-Create.xml
rename to defensive-coding/en-US/snippets/Tasks-Serialization-XML-Expat-Create.xml
diff --git a/defensive-coding/en-US/Tasks/snippets/Serialization-XML-Expat-EntityDeclHandler.xml b/defensive-coding/en-US/snippets/Tasks-Serialization-XML-Expat-EntityDeclHandler.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/snippets/Serialization-XML-Expat-EntityDeclHandler.xml
rename to defensive-coding/en-US/snippets/Tasks-Serialization-XML-Expat-EntityDeclHandler.xml
diff --git a/defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK-Errors.xml b/defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK-Errors.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK-Errors.xml
rename to defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK-Errors.xml
diff --git a/defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK-Imports.xml b/defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK-Imports.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK-Imports.xml
rename to defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK-Imports.xml
diff --git a/defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK-NoEntityResolver.xml b/defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK-NoEntityResolver.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK-NoEntityResolver.xml
rename to defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK-NoEntityResolver.xml
diff --git a/defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK-NoResourceResolver.xml b/defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK-NoResourceResolver.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK-NoResourceResolver.xml
rename to defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK-NoResourceResolver.xml
diff --git a/defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK_Parse-DOM.xml b/defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK_Parse-DOM.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK_Parse-DOM.xml
rename to defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK_Parse-DOM.xml
diff --git a/defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK_Parse-XMLSchema_DOM.xml b/defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK_Parse-XMLSchema_DOM.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK_Parse-XMLSchema_DOM.xml
rename to defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK_Parse-XMLSchema_DOM.xml
diff --git a/defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK_Parse-XMLSchema_SAX.xml b/defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK_Parse-XMLSchema_SAX.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/snippets/Serialization-XML-OpenJDK_Parse-XMLSchema_SAX.xml
rename to defensive-coding/en-US/snippets/Tasks-Serialization-XML-OpenJDK_Parse-XMLSchema_SAX.xml
diff --git a/defensive-coding/en-US/Tasks/snippets/Serialization-XML-Qt-NoEntityHandler.xml b/defensive-coding/en-US/snippets/Tasks-Serialization-XML-Qt-NoEntityHandler.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/snippets/Serialization-XML-Qt-NoEntityHandler.xml
rename to defensive-coding/en-US/snippets/Tasks-Serialization-XML-Qt-NoEntityHandler.xml
diff --git a/defensive-coding/en-US/Tasks/snippets/Serialization-XML-Qt-NoEntityReader.xml b/defensive-coding/en-US/snippets/Tasks-Serialization-XML-Qt-NoEntityReader.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/snippets/Serialization-XML-Qt-NoEntityReader.xml
rename to defensive-coding/en-US/snippets/Tasks-Serialization-XML-Qt-NoEntityReader.xml
diff --git a/defensive-coding/en-US/Tasks/snippets/Serialization-XML-Qt-QDomDocument.xml b/defensive-coding/en-US/snippets/Tasks-Serialization-XML-Qt-QDomDocument.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/snippets/Serialization-XML-Qt-QDomDocument.xml
rename to defensive-coding/en-US/snippets/Tasks-Serialization-XML-Qt-QDomDocument.xml
diff --git a/defensive-coding/scripts/split-snippets.py b/defensive-coding/scripts/split-snippets.py
index 411fbd3..7244ced 100644
--- a/defensive-coding/scripts/split-snippets.py
+++ b/defensive-coding/scripts/split-snippets.py
@@ -23,7 +23,7 @@ import sys
target_root = sys.argv[1]
def output_file_name(dirname, basename):
- return "{0}/en-US/{1}/snippets/{2}.xml".format(
+ return "{0}/en-US/snippets/{1}-{2}.xml".format(
target_root, dirname, basename)
re_open_file = re.compile(
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
7 years, 9 months
[defensive-coding-guide] 41/120: Use unique XML source file names
(#1000781)
by git repository hosting
This is an automated email from the git hooks/post-receive script.
sparks pushed a commit to branch master
in repository defensive-coding-guide.
commit 8350ea4f6175e074e9d29b223b442e524fc552af
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Mon Aug 26 15:25:46 2013 +0200
Use unique XML source file names (#1000781)
This helps Transifex translations.
---
.../en-US/{C/Allocators.xml => C-Allocators.xml} | 0
.../en-US/{C/Language.xml => C-Language.xml} | 6 +-
defensive-coding/en-US/{C/Libc.xml => C-Libc.xml} | 14 ++---
.../en-US/{C/Other.xml => C-Other.xml} | 0
defensive-coding/en-US/C.xml | 12 ++++
defensive-coding/en-US/C/C.xml | 12 ----
.../en-US/{CXX/Language.xml => CXX-Language.xml} | 0
.../en-US/{CXX/Std.xml => CXX-Std.xml} | 0
defensive-coding/en-US/{CXX => }/CXX.xml | 4 +-
defensive-coding/en-US/CXX/schemas.xml | 4 --
defensive-coding/en-US/Defensive_Coding.xml | 26 ++++-----
...hentication.xml => Features-Authentication.xml} | 0
.../en-US/{Features/TLS.xml => Features-TLS.xml} | 68 +++++++++++-----------
defensive-coding/en-US/Features/schemas.xml | 4 --
.../en-US/{Java/Language.xml => Java-Language.xml} | 6 +-
.../en-US/{Java/LowLevel.xml => Java-LowLevel.xml} | 2 +-
...ecurityManager.xml => Java-SecurityManager.xml} | 8 +--
defensive-coding/en-US/{Java => }/Java.xml | 6 +-
defensive-coding/en-US/Java/schemas.xml | 5 --
.../en-US/{Python/Language.xml => Python.xml} | 0
defensive-coding/en-US/Python/schemas.xml | 4 --
.../Cryptography.xml => Tasks-Cryptography.xml} | 0
.../Descriptors.xml => Tasks-Descriptors.xml} | 0
.../File_System.xml => Tasks-File_System.xml} | 0
...Library_Design.xml => Tasks-Library_Design.xml} | 0
.../en-US/{Tasks/Locking.xml => Tasks-Locking.xml} | 0
.../{Tasks/Processes.xml => Tasks-Processes.xml} | 0
.../Serialization.xml => Tasks-Serialization.xml} | 22 +++----
...mporary_Files.xml => Tasks-Temporary_Files.xml} | 0
defensive-coding/en-US/Tasks/schemas.xml | 4 --
defensive-coding/en-US/{C => }/schemas.xml | 2 +-
31 files changed, 94 insertions(+), 115 deletions(-)
diff --git a/defensive-coding/en-US/C/Allocators.xml b/defensive-coding/en-US/C-Allocators.xml
similarity index 100%
rename from defensive-coding/en-US/C/Allocators.xml
rename to defensive-coding/en-US/C-Allocators.xml
diff --git a/defensive-coding/en-US/C/Language.xml b/defensive-coding/en-US/C-Language.xml
similarity index 97%
rename from defensive-coding/en-US/C/Language.xml
rename to defensive-coding/en-US/C-Language.xml
index db7cc5d..1f1c7d2 100644
--- a/defensive-coding/en-US/C/Language.xml
+++ b/defensive-coding/en-US/C-Language.xml
@@ -57,7 +57,7 @@
</para>
<example id="ex-Defensive_Coding-C-Pointers-remaining">
<title>Array processing in C</title>
- <xi:include href="snippets/Pointers-remaining.xml"
+ <xi:include href="C/snippets/Pointers-remaining.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -83,7 +83,7 @@
</para>
<example id="ex-Defensive_Coding-C-Arithmetic-bad">
<title>Incorrect overflow detection in C</title>
- <xi:include href="snippets/Arithmetic-add.xml"
+ <xi:include href="C/snippets/Arithmetic-add.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -119,7 +119,7 @@
</itemizedlist>
<example id="ex-Defensive_Coding-C-Arithmetic-mult">
<title>Overflow checking for unsigned multiplication</title>
- <xi:include href="snippets/Arithmetic-mult.xml"
+ <xi:include href="C/snippets/Arithmetic-mult.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
diff --git a/defensive-coding/en-US/C/Libc.xml b/defensive-coding/en-US/C-Libc.xml
similarity index 96%
rename from defensive-coding/en-US/C/Libc.xml
rename to defensive-coding/en-US/C-Libc.xml
index 970f5bf..50abb8a 100644
--- a/defensive-coding/en-US/C/Libc.xml
+++ b/defensive-coding/en-US/C-Libc.xml
@@ -184,7 +184,7 @@
<function>asprintf</function> instead.)
</para>
<informalexample>
- <xi:include href="snippets/String-Functions-snprintf.xml"
+ <xi:include href="C/snippets/String-Functions-snprintf.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -212,7 +212,7 @@
</para>
<example id="ex-Defensive_Coding-C-String-Functions-snprintf-incremental">
<title>Repeatedly writing to a buffer using <function>snprintf</function></title>
- <xi:include href="snippets/String-Functions-snprintf-incremental.xml"
+ <xi:include href="C/snippets/String-Functions-snprintf-incremental.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -244,7 +244,7 @@
</para>
<example id="ex-Defensive_Coding-C-String-Functions-format-Attribute">
<title>The <literal>format</literal> function attribute</title>
- <xi:include href="snippets/String-Functions-format.xml"
+ <xi:include href="C/snippets/String-Functions-format.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -256,7 +256,7 @@
ensuring NUL termination is:
</para>
<informalexample>
- <xi:include href="snippets/String-Functions-strncpy.xml"
+ <xi:include href="C/snippets/String-Functions-strncpy.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -264,7 +264,7 @@
function for this purpose:
</para>
<informalexample>
- <xi:include href="snippets/String-Functions-strncat-as-strncpy.xml"
+ <xi:include href="C/snippets/String-Functions-strncat-as-strncpy.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
</section>
@@ -289,7 +289,7 @@
linkend="ex-Defensive_Coding-C-String-Functions-snprintf-incremental"/>:
</para>
<informalexample>
- <xi:include href="snippets/String-Functions-strncat-emulation.xml"
+ <xi:include href="C/snippets/String-Functions-strncat-emulation.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -298,7 +298,7 @@
string:
</para>
<informalexample>
- <xi:include href="snippets/String-Functions-strncat-merged.xml"
+ <xi:include href="C/snippets/String-Functions-strncat-merged.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
diff --git a/defensive-coding/en-US/C/Other.xml b/defensive-coding/en-US/C-Other.xml
similarity index 100%
rename from defensive-coding/en-US/C/Other.xml
rename to defensive-coding/en-US/C-Other.xml
diff --git a/defensive-coding/en-US/C.xml b/defensive-coding/en-US/C.xml
new file mode 100644
index 0000000..4d895f9
--- /dev/null
+++ b/defensive-coding/en-US/C.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='utf-8' ?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+<chapter id="chap-Defensive_Coding-C">
+ <title>The C Programming Language</title>
+
+ <xi:include href="C-Language.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="C-Libc.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="C-Allocators.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="C-Other.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</chapter>
+
diff --git a/defensive-coding/en-US/C/C.xml b/defensive-coding/en-US/C/C.xml
deleted file mode 100644
index e8da3db..0000000
--- a/defensive-coding/en-US/C/C.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version='1.0' encoding='utf-8' ?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-]>
-<chapter id="chap-Defensive_Coding-C">
- <title>The C Programming Language</title>
-
- <xi:include href="Language.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Libc.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Allocators.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Other.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-</chapter>
-
diff --git a/defensive-coding/en-US/CXX/Language.xml b/defensive-coding/en-US/CXX-Language.xml
similarity index 100%
rename from defensive-coding/en-US/CXX/Language.xml
rename to defensive-coding/en-US/CXX-Language.xml
diff --git a/defensive-coding/en-US/CXX/Std.xml b/defensive-coding/en-US/CXX-Std.xml
similarity index 100%
rename from defensive-coding/en-US/CXX/Std.xml
rename to defensive-coding/en-US/CXX-Std.xml
diff --git a/defensive-coding/en-US/CXX/CXX.xml b/defensive-coding/en-US/CXX.xml
similarity index 61%
rename from defensive-coding/en-US/CXX/CXX.xml
rename to defensive-coding/en-US/CXX.xml
index fccfb75..8c55567 100644
--- a/defensive-coding/en-US/CXX/CXX.xml
+++ b/defensive-coding/en-US/CXX.xml
@@ -4,7 +4,7 @@
<chapter id="chap-Defensive_Coding-CXX">
<title>The C++ Programming Language</title>
- <xi:include href="Language.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Std.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="CXX-Language.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="CXX-Std.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</chapter>
diff --git a/defensive-coding/en-US/CXX/schemas.xml b/defensive-coding/en-US/CXX/schemas.xml
deleted file mode 100644
index 8e84245..0000000
--- a/defensive-coding/en-US/CXX/schemas.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
- <include rules="../../schemas.xml"/>
-</locatingRules>
diff --git a/defensive-coding/en-US/Defensive_Coding.xml b/defensive-coding/en-US/Defensive_Coding.xml
index eb6e763..b8ca3de 100644
--- a/defensive-coding/en-US/Defensive_Coding.xml
+++ b/defensive-coding/en-US/Defensive_Coding.xml
@@ -4,25 +4,25 @@
<xi:include href="Book_Info.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<part>
<title>Programming Languages</title>
- <xi:include href="C/C.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="CXX/CXX.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Java/Java.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Python/Language.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="C.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="CXX.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Java.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Python.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</part>
<part>
<title>Specific Programming Tasks</title>
- <xi:include href="Tasks/Library_Design.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Tasks/Descriptors.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Tasks/File_System.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Tasks/Temporary_Files.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Tasks/Processes.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Tasks/Serialization.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Tasks/Cryptography.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Tasks-Library_Design.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Tasks-Descriptors.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Tasks-File_System.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Tasks-Temporary_Files.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Tasks-Processes.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Tasks-Serialization.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Tasks-Cryptography.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</part>
<part>
<title>Implementing Security Features</title>
- <xi:include href="Features/Authentication.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="Features/TLS.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Features-Authentication.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Features-TLS.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</part>
<xi:include href="Revision_History.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</book>
diff --git a/defensive-coding/en-US/Features/Authentication.xml b/defensive-coding/en-US/Features-Authentication.xml
similarity index 100%
rename from defensive-coding/en-US/Features/Authentication.xml
rename to defensive-coding/en-US/Features-Authentication.xml
diff --git a/defensive-coding/en-US/Features/TLS.xml b/defensive-coding/en-US/Features-TLS.xml
similarity index 94%
rename from defensive-coding/en-US/Features/TLS.xml
rename to defensive-coding/en-US/Features-TLS.xml
index 753da69..71b9214 100644
--- a/defensive-coding/en-US/Features/TLS.xml
+++ b/defensive-coding/en-US/Features-TLS.xml
@@ -54,7 +54,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Nagle">
<title>Deactivating the TCP Nagle algorithm</title>
- <xi:include href="snippets/TLS-Nagle.xml"
+ <xi:include href="Features/snippets/TLS-Nagle.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</listitem>
@@ -147,7 +147,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Errors">
<title>Obtaining OpenSSL error codes</title>
- <xi:include href="snippets/TLS-OpenSSL-Errors.xml"
+ <xi:include href="Features/snippets/TLS-OpenSSL-Errors.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -374,7 +374,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Init">
<title>OpenSSL library initialization</title>
- <xi:include href="snippets/TLS-Client-OpenSSL-Init.xml"
+ <xi:include href="Features/snippets/TLS-Client-OpenSSL-Init.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -392,7 +392,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-OpenSSL-CTX">
<title>OpenSSL client context creation</title>
- <xi:include href="snippets/TLS-Client-OpenSSL-CTX.xml"
+ <xi:include href="Features/snippets/TLS-Client-OpenSSL-CTX.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -441,7 +441,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-OpenSSL-Connect">
<title>Creating a client connection using OpenSSL</title>
- <xi:include href="snippets/TLS-Client-OpenSSL-Connect.xml"
+ <xi:include href="Features/snippets/TLS-Client-OpenSSL-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -454,7 +454,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Connection-Use">
<title>Using an OpenSSL connection to send and receive data</title>
- <xi:include href="snippets/TLS-Client-OpenSSL-Connection-Use.xml"
+ <xi:include href="Features/snippets/TLS-Client-OpenSSL-Connection-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -471,7 +471,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Connection-Close">
<title>Closing an OpenSSL connection in an orderly fashion</title>
- <xi:include href="snippets/TLS-OpenSSL-Connection-Close.xml"
+ <xi:include href="Features/snippets/TLS-OpenSSL-Connection-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -481,7 +481,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-OpenSSL-Context-Close">
<title>Closing an OpenSSL connection in an orderly fashion</title>
- <xi:include href="snippets/TLS-OpenSSL-Context-Close.xml"
+ <xi:include href="Features/snippets/TLS-OpenSSL-Context-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -497,7 +497,7 @@
The GNUTLS library needs explicit initialization:
</para>
<informalexample id="ex-Defensive_Coding-TLS-GNUTLS-Init">
- <xi:include href="snippets/TLS-GNUTLS-Init.xml"
+ <xi:include href="Features/snippets/TLS-GNUTLS-Init.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -514,7 +514,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-GNUTLS-Credentials">
<title>Initializing a GNUTLS credentials structure</title>
- <xi:include href="snippets/TLS-Client-GNUTLS-Credentials.xml"
+ <xi:include href="Features/snippets/TLS-Client-GNUTLS-Credentials.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -522,7 +522,7 @@
object should be freed:
</para>
<informalexample>
- <xi:include href="snippets/TLS-GNUTLS-Credentials-Close.xml"
+ <xi:include href="Features/snippets/TLS-GNUTLS-Credentials-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -543,7 +543,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-GNUTLS-Connect">
<title>Establishing a TLS client connection using GNUTLS</title>
- <xi:include href="snippets/TLS-Client-GNUTLS-Connect.xml"
+ <xi:include href="Features/snippets/TLS-Client-GNUTLS-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -558,7 +558,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-GNUTLS-Verify">
<title>Verifying a server certificate using GNUTLS</title>
- <xi:include href="snippets/TLS-Client-GNUTLS-Verify.xml"
+ <xi:include href="Features/snippets/TLS-Client-GNUTLS-Verify.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -576,7 +576,7 @@
<example id="ex-Defensive_Coding-TLS-Client-GNUTLS-Match">
<title>Matching the server host name and certificate in a
GNUTLS client</title>
- <xi:include href="snippets/TLS-Client-GNUTLS-Match.xml"
+ <xi:include href="Features/snippets/TLS-Client-GNUTLS-Match.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -591,7 +591,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-GNUTLS-Use">
<title>Using a GNUTLS session</title>
- <xi:include href="snippets/TLS-GNUTLS-Use.xml"
+ <xi:include href="Features/snippets/TLS-GNUTLS-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -603,7 +603,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-GNUTLS-Disconnect">
<title>Using a GNUTLS session</title>
- <xi:include href="snippets/TLS-GNUTLS-Disconnect.xml"
+ <xi:include href="Features/snippets/TLS-GNUTLS-Disconnect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -614,7 +614,7 @@
classes:
</para>
<informalexample>
- <xi:include href="snippets/TLS-Client-OpenJDK-Import.xml"
+ <xi:include href="Features/snippets/TLS-Client-OpenJDK-Import.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -644,7 +644,7 @@
<example id="ex-Defensive_Coding-TLS-Client-OpenJDK-Context">
<title>Setting up an <literal>SSLContext</literal> for OpenJDK TLS
clients</title>
- <xi:include href="snippets/TLS-Client-OpenJDK-Context.xml"
+ <xi:include href="Features/snippets/TLS-Client-OpenJDK-Context.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -657,7 +657,7 @@
<example id="ex-Defensive_Coding-TLS-OpenJDK-Parameters">
<title>Setting up <literal>SSLParameters</literal> for TLS use
with OpenJDK</title>
- <xi:include href="snippets/TLS-OpenJDK-Parameters.xml"
+ <xi:include href="Features/snippets/TLS-OpenJDK-Parameters.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -666,7 +666,7 @@
separately, and this is only supported by OpenJDK 7 and later:
</para>
<informalexample>
- <xi:include href="snippets/TLS-Client-OpenJDK-Hostname.xml"
+ <xi:include href="Features/snippets/TLS-Client-OpenJDK-Hostname.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -687,7 +687,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-OpenJDK-Connect">
<title>Establishing a TLS connection with OpenJDK</title>
- <xi:include href="snippets/TLS-Client-OpenJDK-Connect.xml"
+ <xi:include href="Features/snippets/TLS-Client-OpenJDK-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -704,7 +704,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-OpenJDK-Use">
<title>Using a TLS client socket in OpenJDK</title>
- <xi:include href="snippets/TLS-Client-OpenJDK-Use.xml"
+ <xi:include href="Features/snippets/TLS-Client-OpenJDK-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<section>
@@ -726,7 +726,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-MyTrustManager">
<title>A customer trust manager for OpenJDK TLS clients</title>
- <xi:include href="snippets/TLS-Client-OpenJDK-MyTrustManager.xml"
+ <xi:include href="Features/snippets/TLS-Client-OpenJDK-MyTrustManager.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -737,7 +737,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-Context_For_Cert">
<title>Using a custom TLS trust manager with OpenJDK</title>
- <xi:include href="snippets/TLS-Client-OpenJDK-Context_For_Cert.xml"
+ <xi:include href="Features/snippets/TLS-Client-OpenJDK-Context_For_Cert.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -782,7 +782,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-NSS-Includes">
<title>Include files for NSS</title>
- <xi:include href="snippets/TLS-NSS-Includes.xml"
+ <xi:include href="Features/snippets/TLS-NSS-Includes.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -805,7 +805,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-NSS-Init">
<title>Initializing the NSS library</title>
- <xi:include href="snippets/TLS-NSS-Init.xml"
+ <xi:include href="Features/snippets/TLS-NSS-Init.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -813,7 +813,7 @@
the following function calls:
</para>
<informalexample id="ex-Defensive_Coding-TLS-NSS-Close">
- <xi:include href="snippets/TLS-NSS-Close.xml"
+ <xi:include href="Features/snippets/TLS-NSS-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
@@ -849,7 +849,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-NSS-Connect">
<title>Creating a TLS connection with NSS</title>
- <xi:include href="snippets/TLS-Client-NSS-Connect.xml"
+ <xi:include href="Features/snippets/TLS-Client-NSS-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -859,7 +859,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-NSS-Use">
<title>Using NSS for sending and receiving data</title>
- <xi:include href="snippets/TLS-NSS-Use.xml"
+ <xi:include href="Features/snippets/TLS-NSS-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -868,7 +868,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-NSS-Close">
<title>Closing NSS client connections</title>
- <xi:include href="snippets/TLS-Client-NSS-Close.xml"
+ <xi:include href="Features/snippets/TLS-Client-NSS-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -905,7 +905,7 @@
<example id="ex-Defensive_Coding-TLS-Client-Python-check_host_name">
<title>Implementing TLS host name checking Python (without
wildcard support)</title>
- <xi:include href="snippets/TLS-Client-Python-check_host_name.xml"
+ <xi:include href="Features/snippets/TLS-Client-Python-check_host_name.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -962,7 +962,7 @@
</para>
<example id="ex-Defensive_Coding-TLS-Client-Python-Connect">
<title>Establishing a TLS client connection with Python</title>
- <xi:include href="snippets/TLS-Client-Python-Connect.xml"
+ <xi:include href="Features/snippets/TLS-Client-Python-Connect.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -970,14 +970,14 @@
be used like a regular socket:
</para>
<informalexample>
- <xi:include href="snippets/TLS-Python-Use.xml"
+ <xi:include href="Features/snippets/TLS-Python-Use.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<para>
Closing the TLS socket is straightforward as well:
</para>
<informalexample>
- <xi:include href="snippets/TLS-Python-Close.xml"
+ <xi:include href="Features/snippets/TLS-Python-Close.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
</section>
diff --git a/defensive-coding/en-US/Features/schemas.xml b/defensive-coding/en-US/Features/schemas.xml
deleted file mode 100644
index 8e84245..0000000
--- a/defensive-coding/en-US/Features/schemas.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
- <include rules="../../schemas.xml"/>
-</locatingRules>
diff --git a/defensive-coding/en-US/Java/Language.xml b/defensive-coding/en-US/Java-Language.xml
similarity index 98%
rename from defensive-coding/en-US/Java/Language.xml
rename to defensive-coding/en-US/Java-Language.xml
index e47df99..eddf7f6 100644
--- a/defensive-coding/en-US/Java/Language.xml
+++ b/defensive-coding/en-US/Java-Language.xml
@@ -29,7 +29,7 @@
</para>
<example id="ex-Defensive_Coding-Java-Language-ReadArray">
<title>Incrementally reading a byte array</title>
- <xi:include href="snippets/Language-ReadArray.xml"
+ <xi:include href="Java/snippets/Language-ReadArray.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -59,7 +59,7 @@
<example id="ex-Defensive_Coding-Java-Language-Finally">
<title>Resource management with a
<literal>try</literal>-<literal>finally</literal> block</title>
- <xi:include href="snippets/Finally.xml"
+ <xi:include href="Java/snippets/Finally.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -81,7 +81,7 @@
<example id="ex-Defensive_Coding-Java-Language-TryWithResource">
<title>Resource management using the
<literal>try</literal>-with-resource construct</title>
- <xi:include href="snippets/TryWithResource.xml"
+ <xi:include href="Java/snippets/TryWithResource.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
diff --git a/defensive-coding/en-US/Java/LowLevel.xml b/defensive-coding/en-US/Java-LowLevel.xml
similarity index 99%
rename from defensive-coding/en-US/Java/LowLevel.xml
rename to defensive-coding/en-US/Java-LowLevel.xml
index 18ba1ad..6bb1190 100644
--- a/defensive-coding/en-US/Java/LowLevel.xml
+++ b/defensive-coding/en-US/Java-LowLevel.xml
@@ -80,7 +80,7 @@
</para>
<example id="ex-Defensive_Coding-Java-JNI-Pointers">
<title>Array length checking in JNI code</title>
- <xi:include href="snippets/JNI-Pointers.xml"
+ <xi:include href="Java/snippets/JNI-Pointers.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
diff --git a/defensive-coding/en-US/Java/SecurityManager.xml b/defensive-coding/en-US/Java-SecurityManager.xml
similarity index 97%
rename from defensive-coding/en-US/Java/SecurityManager.xml
rename to defensive-coding/en-US/Java-SecurityManager.xml
index 2e18ac7..20a4b60 100644
--- a/defensive-coding/en-US/Java/SecurityManager.xml
+++ b/defensive-coding/en-US/Java-SecurityManager.xml
@@ -126,7 +126,7 @@ grant {
<example id="ex-Defensive_Coding-Java-SecurityManager-Unprivileged">
<title>Using the security manager to run code with reduced
privileges</title>
- <xi:include href="snippets/SecurityManager-Unprivileged.xml"
+ <xi:include href="Java/snippets/SecurityManager-Unprivileged.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -136,7 +136,7 @@ grant {
on all files in the current directory) can be used:
</para>
<informalexample>
- <xi:include href="snippets/SecurityManager-CurrentDirectory.xml"
+ <xi:include href="Java/snippets/SecurityManager-CurrentDirectory.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</informalexample>
<important>
@@ -234,7 +234,7 @@ grant {
<example id="ex-Defensive_Coding-Java-SecurityManager-Privileged">
<title>Using the security manager to run code with increased
privileges</title>
- <xi:include href="snippets/SecurityManager-Privileged.xml"
+ <xi:include href="Java/snippets/SecurityManager-Privileged.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -283,7 +283,7 @@ grant {
</para>
<example id="ex-Defensive_Coding-Java-SecurityManager-Callback">
<title>Restoring privileges when invoking callbacks</title>
- <xi:include href="snippets/SecurityManager-Callback.xml"
+ <xi:include href="Java/snippets/SecurityManager-Callback.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
diff --git a/defensive-coding/en-US/Java/Java.xml b/defensive-coding/en-US/Java.xml
similarity index 50%
rename from defensive-coding/en-US/Java/Java.xml
rename to defensive-coding/en-US/Java.xml
index d7bf3ef..3ff75c5 100644
--- a/defensive-coding/en-US/Java/Java.xml
+++ b/defensive-coding/en-US/Java.xml
@@ -4,8 +4,8 @@
<chapter id="chap-Defensive_Coding-Java">
<title>The Java Programming Language</title>
- <xi:include href="Language.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="LowLevel.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="SecurityManager.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Java-Language.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Java-LowLevel.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="Java-SecurityManager.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</chapter>
diff --git a/defensive-coding/en-US/Java/schemas.xml b/defensive-coding/en-US/Java/schemas.xml
deleted file mode 100644
index b18bd04..0000000
--- a/defensive-coding/en-US/Java/schemas.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0"?>
-<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
- <uri resource="Language.xml" uri="../../docbook-schema/docbook.rnc"/>
- <uri resource="LowLevel.xml" uri="../../docbook-schema/docbook.rnc"/>
-</locatingRules>
diff --git a/defensive-coding/en-US/Python/Language.xml b/defensive-coding/en-US/Python.xml
similarity index 100%
rename from defensive-coding/en-US/Python/Language.xml
rename to defensive-coding/en-US/Python.xml
diff --git a/defensive-coding/en-US/Python/schemas.xml b/defensive-coding/en-US/Python/schemas.xml
deleted file mode 100644
index 8e84245..0000000
--- a/defensive-coding/en-US/Python/schemas.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
- <include rules="../../schemas.xml"/>
-</locatingRules>
diff --git a/defensive-coding/en-US/Tasks/Cryptography.xml b/defensive-coding/en-US/Tasks-Cryptography.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/Cryptography.xml
rename to defensive-coding/en-US/Tasks-Cryptography.xml
diff --git a/defensive-coding/en-US/Tasks/Descriptors.xml b/defensive-coding/en-US/Tasks-Descriptors.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/Descriptors.xml
rename to defensive-coding/en-US/Tasks-Descriptors.xml
diff --git a/defensive-coding/en-US/Tasks/File_System.xml b/defensive-coding/en-US/Tasks-File_System.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/File_System.xml
rename to defensive-coding/en-US/Tasks-File_System.xml
diff --git a/defensive-coding/en-US/Tasks/Library_Design.xml b/defensive-coding/en-US/Tasks-Library_Design.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/Library_Design.xml
rename to defensive-coding/en-US/Tasks-Library_Design.xml
diff --git a/defensive-coding/en-US/Tasks/Locking.xml b/defensive-coding/en-US/Tasks-Locking.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/Locking.xml
rename to defensive-coding/en-US/Tasks-Locking.xml
diff --git a/defensive-coding/en-US/Tasks/Processes.xml b/defensive-coding/en-US/Tasks-Processes.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/Processes.xml
rename to defensive-coding/en-US/Tasks-Processes.xml
diff --git a/defensive-coding/en-US/Tasks/Serialization.xml b/defensive-coding/en-US/Tasks-Serialization.xml
similarity index 95%
rename from defensive-coding/en-US/Tasks/Serialization.xml
rename to defensive-coding/en-US/Tasks-Serialization.xml
index 792ea94..71cb67a 100644
--- a/defensive-coding/en-US/Tasks/Serialization.xml
+++ b/defensive-coding/en-US/Tasks-Serialization.xml
@@ -239,7 +239,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Expat-EntityDeclHandler">
<title>Disabling XML entity processing with Expat</title>
- <xi:include href="snippets/Serialization-XML-Expat-EntityDeclHandler.xml"
+ <xi:include href="Tasks/snippets/Serialization-XML-Expat-EntityDeclHandler.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -249,7 +249,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Expat-Create">
<title>Creating an Expat XML parser</title>
- <xi:include href="snippets/Serialization-XML-Expat-Create.xml"
+ <xi:include href="Tasks/snippets/Serialization-XML-Expat-Create.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -279,7 +279,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Qt-NoEntityHandler">
<title>A QtXml entity handler which blocks entity processing</title>
- <xi:include href="snippets/Serialization-XML-Qt-NoEntityHandler.xml"
+ <xi:include href="Tasks/snippets/Serialization-XML-Qt-NoEntityHandler.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -295,7 +295,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Qt-NoEntityReader">
<title>A QtXml XML reader which blocks entity processing</title>
- <xi:include href="snippets/Serialization-XML-Qt-NoEntityReader.xml"
+ <xi:include href="Tasks/snippets/Serialization-XML-Qt-NoEntityReader.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -311,7 +311,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-Qt-QDomDocument">
<title>Parsing an XML document with QDomDocument, without entity expansion</title>
- <xi:include href="snippets/Serialization-XML-Qt-QDomDocument.xml"
+ <xi:include href="Tasks/snippets/Serialization-XML-Qt-QDomDocument.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
@@ -340,13 +340,13 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK-NoEntityResolver">
<title>Helper class to prevent DTD external entity resolution in OpenJDK</title>
- <xi:include href="snippets/Serialization-XML-OpenJDK-NoEntityResolver.xml"
+ <xi:include href="Tasks/snippets/Serialization-XML-OpenJDK-NoEntityResolver.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK-NoResourceResolver">
<title>Helper class to prevent schema resolution in
OpenJDK</title>
- <xi:include href="snippets/Serialization-XML-OpenJDK-NoResourceResolver.xml"
+ <xi:include href="Tasks/snippets/Serialization-XML-OpenJDK-NoResourceResolver.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -355,7 +355,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK-Imports">
<title>Java imports for OpenJDK XML parsing</title>
- <xi:include href="snippets/Serialization-XML-OpenJDK-Imports.xml"
+ <xi:include href="Tasks/snippets/Serialization-XML-OpenJDK-Imports.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<section id="sect-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-DOM">
@@ -369,7 +369,7 @@
</para>
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-DOM">
<title>DOM-based XML parsing in OpenJDK</title>
- <xi:include href="snippets/Serialization-XML-OpenJDK_Parse-DOM.xml"
+ <xi:include href="Tasks/snippets/Serialization-XML-OpenJDK_Parse-DOM.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -400,7 +400,7 @@
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-XMLSchema_SAX">
<title>SAX-based validation against an XML schema in
OpenJDK</title>
- <xi:include href="snippets/Serialization-XML-OpenJDK_Parse-XMLSchema_SAX.xml"
+ <xi:include href="Tasks/snippets/Serialization-XML-OpenJDK_Parse-XMLSchema_SAX.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
<para>
@@ -421,7 +421,7 @@
<example id="ex-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-XMLSchema_DOM">
<title>Validation of a DOM document against an XML schema in
OpenJDK</title>
- <xi:include href="snippets/Serialization-XML-OpenJDK_Parse-XMLSchema_DOM.xml"
+ <xi:include href="Tasks/snippets/Serialization-XML-OpenJDK_Parse-XMLSchema_DOM.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
diff --git a/defensive-coding/en-US/Tasks/Temporary_Files.xml b/defensive-coding/en-US/Tasks-Temporary_Files.xml
similarity index 100%
rename from defensive-coding/en-US/Tasks/Temporary_Files.xml
rename to defensive-coding/en-US/Tasks-Temporary_Files.xml
diff --git a/defensive-coding/en-US/Tasks/schemas.xml b/defensive-coding/en-US/Tasks/schemas.xml
deleted file mode 100644
index 8e84245..0000000
--- a/defensive-coding/en-US/Tasks/schemas.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
- <include rules="../../schemas.xml"/>
-</locatingRules>
diff --git a/defensive-coding/en-US/C/schemas.xml b/defensive-coding/en-US/schemas.xml
similarity index 74%
rename from defensive-coding/en-US/C/schemas.xml
rename to defensive-coding/en-US/schemas.xml
index 8e84245..28b4476 100644
--- a/defensive-coding/en-US/C/schemas.xml
+++ b/defensive-coding/en-US/schemas.xml
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
- <include rules="../../schemas.xml"/>
+ <include rules="../schemas.xml"/>
</locatingRules>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
7 years, 9 months
[defensive-coding-guide] 40/120: Makefile: Do not create
subdirectories automatically
by git repository hosting
This is an automated email from the git hooks/post-receive script.
sparks pushed a commit to branch master
in repository defensive-coding-guide.
commit d7dedb452d6e8f79999801bf1f6aa8640f162617
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Mon Aug 26 15:23:48 2013 +0200
Makefile: Do not create subdirectories automatically
This is not needed because we ship the files in the Git repository.
---
defensive-coding/Makefile | 1 -
1 file changed, 1 deletion(-)
diff --git a/defensive-coding/Makefile b/defensive-coding/Makefile
index 61f4ee5..08a95c1 100644
--- a/defensive-coding/Makefile
+++ b/defensive-coding/Makefile
@@ -7,7 +7,6 @@ include src/src.mk
build: build-src build-manual
build-snippets:
- for p in en-US/* ; do test -d $$p && mkdir -p $$p/snippets; done
python scripts/split-snippets.py . \
src/*.c src/*.cpp src/*.java src/*.py
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
7 years, 9 months
[defensive-coding-guide] 39/120: Java security manager example:
Increase compatibility with OpenJDK 7 javac
by git repository hosting
This is an automated email from the git hooks/post-receive script.
sparks pushed a commit to branch master
in repository defensive-coding-guide.
commit aa79dc501587d6cc38ae3661ea5bb9d271792eb8
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Mon Aug 26 15:22:50 2013 +0200
Java security manager example: Increase compatibility with OpenJDK 7 javac
---
defensive-coding/src/JavaSecurityManagerUnprivileged.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/defensive-coding/src/JavaSecurityManagerUnprivileged.java b/defensive-coding/src/JavaSecurityManagerUnprivileged.java
index 61da297..ec0c2c7 100644
--- a/defensive-coding/src/JavaSecurityManagerUnprivileged.java
+++ b/defensive-coding/src/JavaSecurityManagerUnprivileged.java
@@ -49,7 +49,7 @@ public class JavaSecurityManagerUnprivileged {
//-
}
- private static void withGrant(String path) throws Exception {
+ private static void withGrant(final String path) throws Exception {
Permissions permissions = new Permissions();
//+ Java SecurityManager-CurrentDirectory
permissions.add(new FilePermission(
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
7 years, 9 months
[defensive-coding-guide] 38/120: Correct advice on array allocatoin
(#995595)
by git repository hosting
This is an automated email from the git hooks/post-receive script.
sparks pushed a commit to branch master
in repository defensive-coding-guide.
commit 876a1bcbd0b2687867aded985d142df5030988ae
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Mon Aug 26 11:43:10 2013 +0200
Correct advice on array allocatoin (#995595)
---
defensive-coding/en-US/C/Allocators.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/defensive-coding/en-US/C/Allocators.xml b/defensive-coding/en-US/C/Allocators.xml
index e86b37f..1bff610 100644
--- a/defensive-coding/en-US/C/Allocators.xml
+++ b/defensive-coding/en-US/C/Allocators.xml
@@ -135,8 +135,8 @@
is used, the size check must be written manually. For instance,
to allocate an array of <literal>n</literal> elements of type
<literal>T</literal>, check that the requested size is not
- greater than <literal>n / sizeof(T)</literal>. See <xref
- linkend="sect-Defensive_Coding-C-Arithmetic"/>.
+ greater than <literal>((size_t) -1) / sizeof(T)</literal>. See
+ <xref linkend="sect-Defensive_Coding-C-Arithmetic"/>.
</para>
</section>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
7 years, 9 months
[defensive-coding-guide] 35/120: Deserialization: Warn about Java's
java.beans.XMLDecoder
by git repository hosting
This is an automated email from the git hooks/post-receive script.
sparks pushed a commit to branch master
in repository defensive-coding-guide.
commit 973d0c68891d6943374c06f10bdccf82c12be549
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Thu Aug 8 15:13:11 2013 +0200
Deserialization: Warn about Java's java.beans.XMLDecoder
---
defensive-coding/en-US/Tasks/Serialization.xml | 31 +++++++++++++++++++++-----
1 file changed, 26 insertions(+), 5 deletions(-)
diff --git a/defensive-coding/en-US/Tasks/Serialization.xml b/defensive-coding/en-US/Tasks/Serialization.xml
index 3d4abb1..792ea94 100644
--- a/defensive-coding/en-US/Tasks/Serialization.xml
+++ b/defensive-coding/en-US/Tasks/Serialization.xml
@@ -70,7 +70,9 @@
Perl's <package>Storable</package> package
</para></listitem>
<listitem><para>
- Java serialization (<type>java.io.ObjectInputStream</type>)
+ Java serialization (<type>java.io.ObjectInputStream</type>),
+ even if encoded in other formats (as with
+ <type>java.beans.XMLDecoder</type>)
</para></listitem>
<listitem><para>
PHP serialization (<function>unserialize</function>)
@@ -87,10 +89,13 @@
even when the data members have been manipulated.
</para>
<para>
- JSON decoders do not suffer from this problem. But you must not
- use the <function>eval</function> function to parse JSON objects
- in Javascript; even with the regular expression filter from RFC
- 4627, there are still information leaks remaining.
+ In general, JSON decoders do not suffer from this problem. But
+ you must not use the <function>eval</function> function to parse
+ JSON objects in Javascript; even with the regular expression
+ filter from RFC 4627, there are still information leaks
+ remaining. JSON-based formats can still turn out risky if they
+ serve as an encoding form for any if the serialization
+ frameworks listed above.
</para>
</section>
@@ -420,6 +425,22 @@
xmlns:xi="http://www.w3.org/2001/XInclude" />
</example>
</section>
+ <section id="sect-Defensive_Coding-Tasks-Serialization-XML-OpenJDK_Parse-Other">
+ <title>Other XML parsers in OpenJDK</title>
+ <para>
+ OpenJDK contains additional XML parsing and processing
+ facilities. Some of them are insecure.
+ </para>
+ <para>
+ The class <type>java.beans.XMLDecoder</type> acts as a
+ bridge between the Java object serialization format and XML.
+ It is close to impossible to securely deserialize Java
+ objects in this format from untrusted inputs, so its use is
+ not recommended, as with the Java object serialization
+ format itself. See <xref
+ linkend="sect-Defensive_Coding-Tasks-Serialization-Library"/>.
+ </para>
+ </section>
</section>
</section>
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
7 years, 9 months