{"thread":{"id":"3142","subject":"[PATCH] Parametrize asciidoc and add --unsafe","startedAt":"2006-01-24T22:15:46Z","lastAt":"2006-01-25T06:52:22Z","messageCount":3,"participants":["Pavel Roskin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"15093","messageId":"1138140946.19065.2.camel@dv","threadId":"3142","inReplyTo":null,"subject":"[PATCH] Parametrize asciidoc and add --unsafe","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-01-24T22:15:46Z","receivedAt":"2006-01-24T22:15:46Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Including files from the parent directory is considered unsafe by\nasciidoc 7.1.0.  This is used in git.txt, which includes ../README.\n\nSince git is developed openly, we shouldn't be afraid of exploits\nlurking in the docs.  Create a make variable ASCIIDOC and use it to\nalways call asciidoc with the --unsafe option.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n Documentation/Makefile |   12 +++++++-----\n 1 files changed, 7 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex a65fb1b..391f583 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -28,6 +28,8 @@ man7=$(mandir)/man7\n \n INSTALL?=install\n \n+ASCIIDOC = asciidoc --unsafe\n+\n #\n # Please note that there is a minor bug in asciidoc.\n # The version after 6.0.3 _will_ include the patch found here:\n@@ -69,20 +71,20 @@ clean:\n \trm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep\n \n %.html : %.txt\n-\tasciidoc -b xhtml11 -d manpage -f asciidoc.conf $<\n+\t$(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $<\n \n %.1 %.7 : %.xml\n \txmlto man $<\n \n %.xml : %.txt\n-\tasciidoc -b docbook -d manpage -f asciidoc.conf $<\n+\t$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $<\n \n git.html: git.txt ../README\n \n glossary.html : glossary.txt sort_glossary.pl\n \tcat $< | \\\n \tperl sort_glossary.pl | \\\n-\tasciidoc -b xhtml11 - > glossary.html\n+\t$(ASCIIDOC) -b xhtml11 - > glossary.html\n \n howto-index.txt: howto-index.sh $(wildcard howto/*.txt)\n \trm -f $@+ $@\n@@ -90,13 +92,13 @@ howto-index.txt: howto-index.sh $(wildca\n \tmv $@+ $@\n \n $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt\n-\tasciidoc -b xhtml11 $*.txt\n+\t$(ASCIIDOC) -b xhtml11 $*.txt\n \n WEBDOC_DEST = /pub/software/scm/git/docs\n \n $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt\n \trm -f $@+ $@\n-\tsed -e '1,/^$$/d' $? | asciidoc -b xhtml11 - >$@+\n+\tsed -e '1,/^$$/d' $? | $(ASCIIDOC) -b xhtml11 - >$@+\n \tmv $@+ $@\n \n install-webdoc : html\n\n\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"15098","messageId":"7vzmll2h5h.fsf@assigned-by-dhcp.cox.net","threadId":"3142","inReplyTo":"1138140946.19065.2.camel@dv","subject":"Re: [PATCH] Parametrize asciidoc and add --unsafe","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-25T02:08:42Z","receivedAt":"2006-01-25T02:08:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pavel Roskin <proski@gnu.org> writes:\n\n> Including files from the parent directory is considered unsafe by\n> asciidoc 7.1.0.  This is used in git.txt, which includes ../README.\n\nIs copying/linking README down when we build documentation a\nmore conservative option, I wonder?\n\nDoes asciidoc prior to 7.1.0 do sensible thing given an --unsafe\noption?  If not, how does one override ASCIIDOC from the command\nline to the toplevel \"make\"?\n"},{"id":"15105","messageId":"1138171942.27366.104.camel@dv","threadId":"3142","inReplyTo":"7vzmll2h5h.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Parametrize asciidoc and add --unsafe","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-01-25T06:52:22Z","receivedAt":"2006-01-25T06:52:22Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"On Tue, 2006-01-24 at 18:08 -0800, Junio C Hamano wrote:\n> Pavel Roskin <proski@gnu.org> writes:\n> \n> > Including files from the parent directory is considered unsafe by\n> > asciidoc 7.1.0.  This is used in git.txt, which includes ../README.\n> \n> Is copying/linking README down when we build documentation a\n> more conservative option, I wonder?\n\nI considered this possibility.  I don't have a strong preference.  The\nargument in favor of \"--unsafe\" is that adding a make target is more\nintrusive that adding a switch.  Besides, we may want to include more\nfiles from other directories.\n\n> Does asciidoc prior to 7.1.0 do sensible thing given an --unsafe\n> option?  If not, how does one override ASCIIDOC from the command\n> line to the toplevel \"make\"?\n\nGood question.  I misunderstood the asciidoc changelog.  Older versions\n(before 7.0.4) understand \"--safe\", but not \"--unsafe\".  Since version\n7.0.4 is less than 2 months old, it would be reasonable not to go ahead\nwith my patch right now.\n\nLet's make a copy for now.  Symbolic linking doesn't work - asciidoc\nrecognizes and rejects symlinks.\n\n---\n[PATCH] Don't include ../README in git.txt - make a local copy\n\nasciidoc 7.0.4 and newer considers such includes from parent directory\nunsafe.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n Documentation/.gitignore |    1 +\n Documentation/Makefile   |    9 ++++++---\n Documentation/git.txt    |    2 +-\n 3 files changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/.gitignore b/Documentation/.gitignore\nindex 9fef490..c87c61a 100644\n--- a/Documentation/.gitignore\n+++ b/Documentation/.gitignore\n@@ -4,3 +4,4 @@\n *.7\n howto-index.txt\n doc.dep\n+README\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex a65fb1b..a3bca86 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -62,11 +62,14 @@ doc.dep : $(wildcard *.txt) build-docdep\n \n -include doc.dep\n \n-git.7: ../README\n+git.7: README\n+\n+README: ../README\n+\tcp $< $@\n \n \n clean:\n-\trm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep\n+\trm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html doc.dep README\n \n %.html : %.txt\n \tasciidoc -b xhtml11 -d manpage -f asciidoc.conf $<\n@@ -77,7 +80,7 @@ clean:\n %.xml : %.txt\n \tasciidoc -b docbook -d manpage -f asciidoc.conf $<\n \n-git.html: git.txt ../README\n+git.html: git.txt README\n \n glossary.html : glossary.txt sort_glossary.pl\n \tcat $< | \\\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 25bcb84..e8ef3ef 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -586,7 +586,7 @@ git Diffs\n \n Discussion[[Discussion]]\n ------------------------\n-include::../README[]\n+include::README[]\n \n Authors\n -------\n\n\n-- \nRegards,\nPavel Roskin\n"}]}