Commit Graph

21 Commits (7475f90be2c1941d4449791e9e9cd5f3dc3bbb71)

Author SHA1 Message Date
Joey Hess 2df0999e40 revert check_canedit nosubs thing
Abstraction violation. I now think the problem should be treated as a bug
in httpauth.
2010-08-30 18:31:56 -04:00
Joey Hess 70db57134a correct logic on error fallthrough 2010-08-30 18:20:34 -04:00
Joey Hess 8030ecac02 Receive: avoid hiding check_canedit error messages
Avoid the generic "you are not allowed to change" message,
and instead allow check_canedit to propigate out useful error messages.

Went back to calling check_canedit in fatal mode, but added a parameter to
avoid calling the troublesome subs that might cause a login attempt.
2010-08-30 17:58:00 -04:00
Joey Hess 426b3ad747 minor typo 2010-08-30 16:26:01 -04:00
Joey Hess 3b84ea2f53 add explicit check_canedit calls when checking canattach or canremove 2010-08-30 16:17:33 -04:00
Joey Hess a330b1ee74 Avoid trying to log the user in when receiving anonymous pushes from git and a plugin like httpauth returns a login function.
Just use check_canedit in nonfatal mode.
2010-08-30 16:05:15 -04:00
Joey Hess 69fc0f427e remove obsolete check to see if check_canedit is available
The function moved from the editpage plugin into IkiWiki core some time
ago.
2010-08-30 15:44:55 -04:00
Joey Hess 4292802ee5 stop using REMOTE_ADDR
Everywhere that REMOTE_ADDR was used, a session object is available, so
instead use its remote_addr method.

In IkiWiki::Receive, stop setting a dummy REMOTE_ADDR.

Note that it's possible for a session cookie to be obtained using one IP
address, and then used from another IP. In this case, the first IP will now
be used. I think that should be ok.
2010-06-23 16:35:51 -04:00
Joey Hess a97964688b unfinished file_prune revamp
Many calls to file_prune were incorrectly calling it with 2 parameters.
In cases where the filename being checked is relative to the srcdir,
that is not needed.

Made absolute filenames be pruned. (This won't work for the 2 parameter call
style.)
2010-04-17 19:05:40 -04:00
Joey Hess 93cd30bc0a Merge branch 'master' into cvs 2009-09-10 16:18:23 -04:00
Joey Hess 26dae8f049 clean up use of IkiWiki::Receive
Loading and use of IkiWiki::Receive can all be pushed into the git plugin,
rather than scattered around.

I had at first wanted to make a receive plugin and move it there,
but a plugin was not a good fit; you don't want users to have to manually
load it, and making the git plugin load the receive plugin at the right
times would need more, and ugly code.
2009-09-10 16:15:48 -04:00
Joey Hess f5bd1cf3cd typo 2009-09-10 13:49:42 -04:00
Joey Hess bb93fccf06 Coding style change: Remove explcit vim folding markers. 2008-12-17 15:22:16 -05:00
Joey Hess 7ddea03684 move untrusted committer test into the wrapper
This saves around 1/4th second per trusted commit since ikiwiki
doesn't need to start up.
2008-10-26 14:03:18 -04:00
Joey Hess 146192d5b0 the pre-receive wrapper needs to be suid after all
It needs to write to the user db.
2008-10-24 15:47:42 -04:00
Joey Hess 739e2ca0b4 can't lock wiki due to permissions (probably)
luckily, don't really need to here
2008-10-24 15:02:54 -04:00
Joey Hess 1a883b3c50 include temp file for attachment change too 2008-10-24 13:44:03 -04:00
Joey Hess fbcb8553df really fix calls to check_can* 2008-10-24 13:29:30 -04:00
Joey Hess f349e4ef36 fix calls to check_*
These throw errors, do not have useful return codes.
2008-10-23 18:05:12 -04:00
Joey Hess ad9e443f22 check_canattach hooked up 2008-10-23 16:56:40 -04:00
Joey Hess 4669eab596 more work on untrusted committers
Wired up check_canedit and check_canremove, still need to deal with
check_canattach, and test.
2008-10-23 16:29:50 -04:00