aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/octal_umask_setting_is_unintuitive.mdwn
diff options
context:
space:
mode:
authorhttp://smcv.pseudorandom.co.uk/ <smcv@web>2011-11-27 09:44:48 -0400
committeradmin <admin@branchable.com>2011-11-27 09:44:48 -0400
commit6e42d2bee0acc11d8ba0ae584646e66ce918c978 (patch)
tree83ccdb4e34dd4fc412e99ba0994ea6b721b03297 /doc/bugs/octal_umask_setting_is_unintuitive.mdwn
parent964be6671f0ec51c97cb9123f409ada7a446345c (diff)
downloadikiwiki-6e42d2bee0acc11d8ba0ae584646e66ce918c978.tar
ikiwiki-6e42d2bee0acc11d8ba0ae584646e66ce918c978.tar.gz
when octal and YAML collide...
Diffstat (limited to 'doc/bugs/octal_umask_setting_is_unintuitive.mdwn')
-rw-r--r--doc/bugs/octal_umask_setting_is_unintuitive.mdwn45
1 files changed, 45 insertions, 0 deletions
diff --git a/doc/bugs/octal_umask_setting_is_unintuitive.mdwn b/doc/bugs/octal_umask_setting_is_unintuitive.mdwn
new file mode 100644
index 000000000..0a63940ce
--- /dev/null
+++ b/doc/bugs/octal_umask_setting_is_unintuitive.mdwn
@@ -0,0 +1,45 @@
+To make ikiwiki publish world-readable files (usually what you want)
+regardless of your umask, you override the `umask` setting to 022
+octal (which is 18 in decimal). So far so good.
+
+However, because it's interpreted as a plain number in Perl, the
+way you set it varies between formats. In `IkiWiki::Setup::Standard`
+you can use either
+
+ umask => 022
+
+or (less obviously) one of
+
+ umask => 18
+ umask => "18"
+
+but if you use
+
+ umask => "022"
+
+you get the less than helpful umask of 026 octal (22 decimal).
+
+Similarly, in `IkiWiki::Setup::Yaml` (the default for
+[ikiwiki-hosting](http://ikiwiki-hosting.branchable.com/)
+you have to use one of
+
+ umask: 18
+ umask: "18"
+
+and if you try to say 022 you'll get 22 decimal = 026 octal.
+
+Perhaps the best way to solve this would be to have keywords
+for the few values of `umask` that are actually useful?
+
+* `private` (= 077 octal = 63 decimal)
+* `group` (= 027 octal = 23 decimal)
+* `public` (= 022 octal = 18 decimal)
+
+I don't think g+w is a good idea in any case, because as
+documented on [[security]], if ikiwiki makes its `srcdir`
+group-writeable then any member of the group can "cause
+trouble" (escalate privileges to those of the wiki user?)
+via a symlink attack. So I don't think we need keywords
+for those.
+
+--[[smcv]]