]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/Insecure_dependency_in_mkdir.mdwn
properly encode and decode from/to utf8 when sending rpc to ikiwiki
[ikiwiki.git] / doc / bugs / Insecure_dependency_in_mkdir.mdwn
1 Joey, please see RecentChanges and note that this is my second bug report,
2 because the first was unsuccessfully (bad characters in post title?).
3 Could you please tidy it up?
4
5 > I've fixed that and the bug that caused the dup.
6
7 >> Thanks a lot! :)
8
9 I've just upgraded my ikiwiki from version 2.11 to the latest version 2.15.
10 I use my own rebuilt ikiwiki package for Ubuntu Gutsy box. Now I can't rebuild
11 all my ikiwiki pages, because of the following bug:
12
13     ptecza@anahaim:~/blog$ ikiwiki --setup ikiwiki.setup --getctime --verbose
14     [...]
15     scanning post/2007/12/09/pink-freud-w-cafe-kulturalna.mdwn
16     ikiwiki.setup: Insecure dependency in mkdir while running with -T switch at /usr/share/perl5/IkiWiki.pm line 355.
17     BEGIN failed--compilation aborted at (eval 5) line 151.
18
19 I have a write permission to the ikiwiki destination directory:
20
21     ptecza@anahaim:~/blog$ ls -ld /var/www/blog/
22     drwxr-xr-x 2 ptecza ptecza 4096 2007-12-17 10:48 /var/www/blog/
23
24 I've read ikiwiki changelog for the previous releases and unfortunately
25 I can't see any related entries. Any ideas?
26
27 --[[Paweł|ptecza]]
28
29 > **Update**: I've came back to ikiwiki 2.11 and... the bug still exists!
30 > Probably the reason is that I've removed all content of `/var/www/blog/`
31 > before mass rebuilding. --[[Paweł|ptecza]]
32
33 > I can't reproduce this bug with a setup file that tells ikiwiki to
34 > write to /var/www/blog, which doesn't exist. I get a "Permission denied"
35 > since I can't write to /var/www. If I make the permissions allow me to
36 > write to /var/www, it happily creates the blog subdirectory. If the blog
37 > subdirectory is already there and I can write to it, that of course also
38 > works.
39
40 > I'll need enough information to reproduce the problem before I can fix
41 > it. Probably a copy of your setup file, wiki source, and information
42 > about how your /var/www is set up. --[[Joey]]
43
44 >> Thanks for your efforts, Joey! I sent my `ikiwiki.setup` file to you.
45 >> What source do you need? Entire my ikiwiki or only some pages?
46 >>
47 >> There are settings of `/var/www/` directory on my Ubuntu Gutsy box:
48 >>
49 >>        ptecza@anahaim:~$ ls -al /var/www/
50 >>        total 16
51 >>        drwxr-xr-x  4 root   root   4096 2007-11-06 16:25 .
52 >>        drwxr-xr-x 14 root   root   4096 2007-11-06 16:13 ..
53 >>        drwxr-xr-x  2 root   root   4096 2007-11-06 16:13 apache2-default
54 >>        drwxr-xr-x  5 ptecza ptecza 4096 2007-12-17 16:54 blog
55 >>
56 >> --[[Paweł|ptecza]]
57
58 >> I need a set of files that you know I can use to reproduce the bug.
59 >> --[[Joey]]
60
61 >>> OK, I've just sent you the URL where you can find all files you need :)
62 >>>
63 >>> Probably I know how to reproduce the bug. You have to erase all files from
64 >>> `/var/www/blog` before mass rebuilding. This is my `mass-rebuild.sh` script:
65 >>>
66 >>>        #!/bin/bash
67 >>>        
68 >>>        rm -rf /var/www/blog/*
69 >>>        ikiwiki --setup ikiwiki.setup --getctime --verbose
70 >>>
71 >>> I noticed that the bug was "resolved" when I added to my blog new entry
72 >>> and commited the changes. Before I created all directories and touched
73 >>> empty `*.html` files in `/var/www/blog` directory. Probably it's not
74 >>> necessary, because without a new blog revision the bug still existed
75 >>> and `ikiwiki` still failed.
76 >>>
77 >>> --[[Paweł|ptecza]]
78
79 >> I'd forgotten about [this perl bug](http://bugs.debian.org/411786).
80 >> All I can do is work around it by disabling the taint checking. :-(
81 >> (Which I've [[done]].) --[[Joey]]
82
83 >>> Ubuntu Gutsy also has Perl 5.8.8-7, so probably it has the bug too.
84 >>> --[[Paweł|ptecza]]
85
86 >>>> I just got it while building my latest version of git.ikiwiki.info + my stuff.
87 >>>> Only thing different in my version in IkiWiki.pm is that I moved a </a> over
88 >>>> a word (for createlink), and disabled the lowercasing of created pages. Running
89 >>>> Lenny's Perl. --[[simonraven]]
90
91 >>>> Simon, I'm not clear what version of ikiwiki you're using.
92 >>>> Since version 2.40, taint checking has been disabled by
93 >>>> default due to the underlying perl bug. Unless you
94 >>>> build ikiwiki with NOTAINT=0. --[[Joey]] 
95
96 >>>> Hi, nope not doing this. Um, sorry, v. 3.13. I've no idea why it suddenly started doing this.
97 >>>> It wasn't before. I've been messing around IkiWiki.pm to see if I can set
98 >>>> a umask for `mkdir`.
99
100 line 775 and down:
101 +                               umask ($config{umask} || 0022);
102
103 >>>> I figured it *might* be the `umask`, but I'll see in a few when / if it gets past that in the build. No; I keep getting garbage during the brokenlinks test
104
105 <pre>
106 t/basewiki_brokenlinks.....Insecure dependency in mkdir while running with -T switch at IkiWiki.pm line 776.
107
108 #   Failed test at t/basewiki_brokenlinks.t line 11.
109
110 #   Failed test at t/basewiki_brokenlinks.t line 19.
111
112
113 broken links found
114 &lt;li>shortcut from &lt;a href="./shortcuts/">shortcuts&lt;/a>&lt;/li>&lt;/ul>
115
116
117
118 #   Failed test at t/basewiki_brokenlinks.t line 25.
119 Insecure dependency in mkdir while running with -T switch at IkiWiki.pm line 776.
120
121 #   Failed test at t/basewiki_brokenlinks.t line 11.
122
123 #   Failed test at t/basewiki_brokenlinks.t line 25.
124 # Looks like you failed 5 tests of 12.
125 dubious
126         Test returned status 5 (wstat 1280, 0x500)
127 </pre>
128
129 >>>> I get this over and over... I haven't touched that AFAICT, at all. --[[simonraven]]
130
131 >>>>> Take a look at your `/usr/bin/ikiwiki`. The first
132 >>>>> line should not contain -T. If it does, remove it,
133 >>>>> and maybe try to work out or give details about how
134 >>>>> you installed ikiwiki and why it got the -T in there,
135 >>>>> which certianly doesn't happen by default when ikiwiki
136 >>>>> is installed by the Makefile.PL or by any package I know of.
137 >>>>> (If there's
138 >>>>> no -T, then something *really* weird is going on..)
139 >>>>> --[[Joey]] 
140
141 >>>>>> nope, no -T in the hashbang line at all. Haven't added any;
142 >>>>>> only thing I did there was change `use lib` to `/usr/share/perl5`,
143 >>>>>> otherwise I'd get bogus errors about CGI::Cookie_al or some such thing.
144 >>>>>>
145 >>>>>> How I installed it was in non-public directories in various sites, then
146 >>>>>> make it publish stuff to a public dir in the relevant site. Or do you
147 >>>>>> mean installed, as in the whole thing? From a .deb I made based on the git tree, with `git-buildpackage`.
148 >>>>>>
149 >>>>>> This issue is recent, after a `git pull` IIRC. It has never happened before. It's also puzzling me.
150 >>>>>>
151 >>>>>> You can check it out for yourself by pulling my fork of this, at github or my local repo.
152 >>>>>> github will probably be faster for you: git://github.com/kjikaqawej/ikiwiki-simon.git --[[simonraven]]
153
154 >>>>>>> I don't know what I'm supposed to see in your github tree.. it
155 >>>>>>> looks identical to an old snapshot of ikiwiki's regular git repo?
156 >>>>>>> If you want to put up the .deb you're using, I could examine that.
157 >>>>>>>
158 >>>>>>> I was in fact able to reproduce the insecure dependency in mkdir
159 >>>>>>> message -- but only if I run 'perl -T ikiwiki'.
160 >>>>>>> --[[Joey]]