Commit Graph

13240 Commits (e6bba3b3b5c7a99a38f5ae489a8fb7353013debc)

Author SHA1 Message Date
Joey Hess f7d4904fee bugnum 2010-06-15 19:35:17 -04:00
Joey Hess a298959888 fix other cases of unicode mixing issue
and fix underlaydir override attack guard when srcdir is non-absolute
2010-06-15 17:41:26 -04:00
Joey Hess 86a43aefb4 Fix issues with combining unicode srcdirs and source files.
A short story:

  Once there was a unicode string, let's call him Srcdir.

  Along came a crufy old File::Find, who went through a tree and pasted each
  of the leaves in turn onto Srcdir. But this 90's relic didn't decode the
  leaves -- despite some of them using unicode! Poor Srcdir, with these
  leaves stuck on him, tainted them with his nice unicode-ness. They didn't
  look like leaves at all, but instead garbage.

(In other words, perl's unicode support sucks mightily, and drives
us all to drink and bad storytelling. But we knew that..)

So, srcdir is not normally flagged as unicode, because typically it's pure
ascii. And in that case, things work ok; File::Find finds filenames, which
are not yet decoded to unicode, and appends them to the srcdir, and then
decode_utf8 happily converts the whole thing.

But, if the srcdir does contain utf8 characters, that breaks. Or, if a Yaml
setup file is used, Yaml::Syck's implicitunicode sets the unicode flag of
*all* strings, even those containing only ascii. In either case, srcdir
has the unicode flag set; a non-decoded filename is appended, and the flag
remains set; and decode_utf8 sees the flag and does *nothing*. The result
is that the filename is not decoded, so looks valid and gets skipped.

File::Find only sticks the directory and filenames together in no_chdir
mode .. but we need that mode for security. In order to retain the
security, and avoid the problem, I made it not pass srcdir to File::Find.
Instead, chdir to the srcdir, and pass ".". Since "." is ascii, the problem
is avoided.

Note that chdir srcdir is safe because we check for symlinks in the srcdir
path.

Note that it takes care to chdir back to the starting location. Because
the user may have specified relative paths and so staying in the srcdir
might break. A relative path could even be specifed for an underlay dir, so
it chdirs back after each.
2010-06-15 17:13:46 -04:00
Joey Hess 69383fb6b0 Fix issues with combining unicode srcdirs and source files.
A short story:

  Once there was a unicode string, let's call him Srcdir.

  Along came a crufy old File::Find, who went through a tree and pasted each
  of the leaves in turn onto Srcdir. But this 90's relic didn't decode the
  leaves -- despite some of them using unicode! Poor Srcdir, with these
  leaves stuck on him, tainted them with his nice unicode-ness. They didn't
  look like leaves at all, but instead garbage.

In other words, perl's unicode support sucks mightily, and drives
us all to drink and bad storytelling. But we knew that..

So, srcdir is not normally flagged as unicode, because typically it's pure
ascii. And in that case, things work ok; File::Find finds filenames, which
are not yet decoded to unicode, and appends them to the srcdir, and then
decode_utf8 happily converts the whole thing.

But, if the srcdir does contain utf8 characters, that breaks. Or, if a Yaml
setup file is used, Yaml::Syck's implicitunicode sets the unicode flag of
*all* strings, even those containing only ascii. In either case, srcdir
has the unicode flag set; a non-decoded filename is appended, and
decode_utf8 sees the flag and does *nothing*. The result is that the
filename is not decoded, so looks valid and gets skipped.

File::Find only sticks the directory and filenames together in no_chdir
mode .. but we need that mode for security. In order to retain the
security, and avoid the problem, I made it not pass srcdir to File::Find.
Instead, chdir to the srcdir, and pass ".". Since "." is ascii, the problem
is avoided.

Note that it takes care to chdir back to the starting location. Because
the user may have specified relative paths and so staying in the srcdir
might break. A relative path could even be specifed for an underlay dir, so
it chdirs back after each.
2010-06-15 16:40:37 -04:00
Joey Hess 17be286cc3 note 2010-06-15 15:15:39 -04:00
Joey Hess ad858475e7 match only pages in calendar 2010-06-15 14:17:23 -04:00
Joey Hess 3adde7a38c clear floats before comments begin 2010-06-15 13:44:42 -04:00
Joey Hess d541cc854a calendar: Tune archive_pagespec to only match pages, not other files. 2010-06-15 13:38:19 -04:00
Joey Hess d3d63817c8 Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info 2010-06-15 13:34:45 -04:00
Joey Hess 919df4ae9c fix labels for form elements
The label for attribute must correspond to the element id (not name).
And it needs to be unique inside the loop.
2010-06-15 13:33:43 -04:00
privat b39630c16c Thanks 2010-06-15 13:33:16 +00:00
bhobbit b1a7972ea0 typo 2010-06-15 03:43:48 +00:00
bhobbit 696d54545a 2010-06-15 03:41:34 +00:00
Joey Hess 4e18d4415b fix links 2010-06-14 16:36:54 -04:00
Joey Hess ba00ff81c0 add links to mentioned directives
Using the !iki shortcut, since the directive pages may not be included in
the basewiki.
2010-06-14 16:35:12 -04:00
Joey Hess c0bc2d0839 editpage, comments: Fix broken links in sidebar (due to forcebaseurl). (Thanks, privat) 2010-06-14 14:34:52 -04:00
Joey Hess f9dc2bf859 good idea 2010-06-14 14:14:43 -04:00
Joey Hess 98ad266119 Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info 2010-06-14 14:11:35 -04:00
Joey Hess 88b080f8a4 simplify, avoid confusing suggestions
Don't even talk about ACLs, and more strongly discourage directly
committing to ikiwiki's srcdir.
2010-06-14 14:10:59 -04:00
Joey Hess 5071a8eb73 limit blog inlines to pages
This way images attached to blog posts don't show up as enclosures in the
blog by default.
2010-06-14 12:35:21 -04:00
privat 8746480c25 Reopen the bug since it is not fixed 2010-06-14 13:54:43 +00:00
Joey Hess 9f7a118ffc more symetric enable/disable
Removing a plugin from add_plugins is not always enough to disable it.
It may have been redundantly added there and also pulled in via goodstuff.
Always add didabled plugins to disable_plugins.
2010-06-13 10:25:17 -04:00
Joey Hess 17592a951b websetup: Allow enabling plugins listed in disable_plugins.
The bug here was that disabling a plugin included thru goodstuff, like
htmlscrubber, caused it to be added to disable_plugins, and those plugins
were never loaded, so could not be re-enabled. Fix by allowing them to be
force loaded when appropriate. (Also that allows disabled plugins to still
record their setup options when dumping a setup file.)
2010-06-13 10:21:19 -04:00
Joey Hess 89a970bd7d response 2010-06-13 09:11:59 -04:00
Joey Hess a0dbdcad77 Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info 2010-06-13 08:49:32 -04:00
Joey Hess ec3cadb065 remove obsolete ol class=form for editpage and editcomment
The styling of labels on the form largely obsoleted the special styled ol,
so just a few br's sufficed. Using an ol like that was not too semantically
right (probably?) and could cause problems with customized local.css.
2010-06-13 08:47:21 -04:00
http://abhidg.wordpress.com/ c8e5552f84 2010-06-13 12:37:16 +00:00
Joey Hess 85546d570e wording 2010-06-13 01:21:32 -04:00
Joey Hess bbdc69b699 speling 2010-06-13 01:14:24 -04:00
Joey Hess ec06929316 typo 2010-06-13 01:12:04 -04:00
Joey Hess c65658eeb5 attachment: When inserting links, insert img directives for images, if that plugin is enabled. 2010-06-12 23:00:30 -04:00
Joey Hess 35a0715b9a avoid ugly warning if size="" is specified 2010-06-12 22:59:46 -04:00
Joey Hess dccd764871 edittemplate: Look for template pages under templates/ like everything else (still looks in old location for backwards compatability). 2010-06-12 22:43:34 -04:00
Joey Hess c225cdad25 edittemplate: Make silent mode not disable display when the template page does not exist, so it can be easily created. 2010-06-12 22:20:22 -04:00
Joey Hess 31fa7714e7 editpage: Rename "comments" field to avoid CSS conflict with the comments div. 2010-06-12 18:10:33 -04:00
Joey Hess d7cfcef54a img: Support hspace and vspace attributes. 2010-06-12 16:43:24 -04:00
Joey Hess 9923f5db65 attachment: Show files from underlay in attachments list.
While those files cannot be removed or renamed, this allows easy
downloading of them, and a new version can after all be uploaded.
2010-06-12 14:29:56 -04:00
Joey Hess d5181a1977 realm is an url pattern 2010-06-11 14:14:20 -04:00
Joey Hess 0822b0fc34 Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info 2010-06-11 13:54:07 -04:00
Joey Hess 475b4199e1 openid: Add openid_realm and openid_cgiurl configuration options, useful in a few edge case setups. 2010-06-11 13:53:56 -04:00
jwalzer 77a3585e92 2010-06-11 13:53:06 +00:00
zimek 6ba1cf7c3d 2010-06-11 11:14:34 +00:00
dwabot f0f0ba7bac 2010-06-11 04:33:40 +00:00
nil b6d00070a5 use the ikiwiki userdb outside of the ikiwiki edition access control 2010-06-11 02:45:14 +00:00
privat be0f52095b use PARENTLINKS 2010-06-11 01:03:43 +00:00
http://jblevins.org/ 48a1dce15d Update URL 2010-06-10 22:16:55 +00:00
http://jblevins.org/ 15ef976fd2 Update URL 2010-06-10 22:11:00 +00:00
Joey Hess a31ce0e97d remove old 2010-06-10 16:17:38 -04:00
Joey Hess a1e7e62c21 add news item for ikiwiki 3.20100610 2010-06-10 16:15:43 -04:00
Joey Hess c8ce0e2e1c releasing version 3.20100610 2010-06-10 16:15:22 -04:00