aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Receive.pm
Commit message (Collapse)AuthorAge
* IkiWiki::Receive: Avoid using asprintfSimon McVittie2017-10-01
| | | | | | | | | On GNU/Linux, it isn't declared in stdio.h unless we define _GNU_SOURCE, which we don't; using the implicit declaration risks crashes on platforms where sizeof(pointer) != sizeof(int). On other platforms it isn't guaranteed to exist at all. Signed-off-by: Simon McVittie <smcv@debian.org>
* Wrapper: allocate new environment dynamicallySimon McVittie2016-05-11
| | | | | | | | | | | | | | Otherwise, if third-party plugins extend newenviron by more than 3 entries, we could overflow the array. It seems unlikely that any third-party plugin manipulates newenviron in practice, so this is mostly theoretical. Just in case, I have deliberately avoided using "i" as the variable name, so that any third-party plugin that was manipulating newenviron directly will now result in the wrapper failing to compile. I have not assumed that realloc(NULL, ...) works as an equivalent of malloc(...), in case there are still operating systems where that doesn't work.
* Consume all stdin when rcs_receive short-circuits, to avoid git SIPIPE race.Joey Hess2011-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had a weird problem where, after moving to a new, faster server, "git push" would sometimes fail like this: Unpacking objects: 100% (3/3), done. fatal: The remote end hung up unexpectedly fatal: The remote end hung up unexpectedly What turned out to be going on was that git-receive-pack was dying due to an uncaught SIGPIPE. The SIGPIPE occurred when it tried to write to the pre-receive hook's stdin. The pre-receive hook, in this case, was able to do all the checks it needed to do without the input, and so did exit(0) without consuming it. Apparently that causes a race. Most of the time, git forks the hook, writes output to the hook, and then the hook runs, ignores it, and exits. But sometimes, on our new faster server, git forked the hook, and it ran, and exited, before git got around to writing to it, resulting in the SIGPIPE. write(7, "c9f98c67d70a1cfeba382ec27d87644a"..., 100) = -1 EPIPE (Broken pipe) --- SIGPIPE (Broken pipe) @ 0 (0) --- I think git should ignore SIGPIPE when writing to hooks. Otherwise, hooks may have to go out of their way to consume all input, and as I've seen, the races when they fail to do this can lurk undiscovered. I have written to the git mailing list about this. As a workaround, consume all stdin before exiting.
* Fix typo that broke anonymous git push.Joey Hess2010-10-23
|
* refactor check_canchange into IkiWiki libraryJoey Hess2010-10-08
|
* remove debugging dumper codeJoey Hess2010-10-04
|
* indentation and layoutJoey Hess2010-10-04
|
* Complete rcs_preprevert and lightly test.Peter Gammie2010-10-01
|
* revert check_canedit nosubs thingJoey Hess2010-08-30
| | | | | Abstraction violation. I now think the problem should be treated as a bug in httpauth.
* correct logic on error fallthroughJoey Hess2010-08-30
|
* Receive: avoid hiding check_canedit error messagesJoey Hess2010-08-30
| | | | | | | | 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.
* minor typoJoey Hess2010-08-30
|
* add explicit check_canedit calls when checking canattach or canremoveJoey Hess2010-08-30
|
* Avoid trying to log the user in when receiving anonymous pushes from git and ↵Joey Hess2010-08-30
| | | | | | a plugin like httpauth returns a login function. Just use check_canedit in nonfatal mode.
* remove obsolete check to see if check_canedit is availableJoey Hess2010-08-30
| | | | | The function moved from the editpage plugin into IkiWiki core some time ago.
* stop using REMOTE_ADDRJoey Hess2010-06-23
| | | | | | | | | | | 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.
* unfinished file_prune revampJoey Hess2010-04-17
| | | | | | | | | 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.)
* Merge branch 'master' into cvsJoey Hess2009-09-10
|\
| * clean up use of IkiWiki::ReceiveJoey Hess2009-09-10
| | | | | | | | | | | | | | | | | | | | 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.
* | typoJoey Hess2009-09-10
|/
* Coding style change: Remove explcit vim folding markers.Joey Hess2008-12-17
|
* move untrusted committer test into the wrapperJoey Hess2008-10-26
| | | | | This saves around 1/4th second per trusted commit since ikiwiki doesn't need to start up.
* the pre-receive wrapper needs to be suid after allJoey Hess2008-10-24
| | | | It needs to write to the user db.
* can't lock wiki due to permissions (probably)Joey Hess2008-10-24
| | | | luckily, don't really need to here
* include temp file for attachment change tooJoey Hess2008-10-24
|
* really fix calls to check_can*Joey Hess2008-10-24
|
* fix calls to check_*Joey Hess2008-10-23
| | | | These throw errors, do not have useful return codes.
* check_canattach hooked upJoey Hess2008-10-23
|
* more work on untrusted committersJoey Hess2008-10-23
Wired up check_canedit and check_canremove, still need to deal with check_canattach, and test.