From: smcv Date: Wed, 21 Mar 2018 23:07:17 +0000 (-0400) Subject: Indent patch (fenced blocks don't work on this particular ikiwiki installation) X-Git-Tag: 3.20190207~186 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/0b81eac00e46b1c918ddd871a4a4380c89c331f7 Indent patch (fenced blocks don't work on this particular ikiwiki installation) --- diff --git a/doc/bugs/ikiwiki-mass-rebuild_has_probably_never_worked_portably.mdwn b/doc/bugs/ikiwiki-mass-rebuild_has_probably_never_worked_portably.mdwn index 2cc7ae957..4b1394a67 100644 --- a/doc/bugs/ikiwiki-mass-rebuild_has_probably_never_worked_portably.mdwn +++ b/doc/bugs/ikiwiki-mass-rebuild_has_probably_never_worked_portably.mdwn @@ -2,21 +2,19 @@ As best as I can recall, running ikiwiki-mass-rebuild as root has never worked f The following patch works much better on the aforementioned platforms, as well as CentOS 6: -``` -diff --git ikiwiki-mass-rebuild ikiwiki-mass-rebuild -index ce4e084e8..2ff33b493 100755 ---- ikiwiki-mass-rebuild -+++ ikiwiki-mass-rebuild -@@ -32,7 +32,7 @@ sub processuser { - my $user=shift; - return if $user=~/^-/ || $users{$user}; - $users{$user}=1; -- my $ret=system("su", $user, "-s", "/bin/sh", "-c", "--", "$0 --nonglobal @ARGV"); -+ my $ret=system("su", "-m", $user, "-c", "/bin/sh -c -- '$0 --nonglobal @ARGV'"); - if ($ret != 0) { - print STDERR "warning: processing for $user failed with code $ret\n"; - } -``` + diff --git ikiwiki-mass-rebuild ikiwiki-mass-rebuild + index ce4e084e8..2ff33b493 100755 + --- ikiwiki-mass-rebuild + +++ ikiwiki-mass-rebuild + @@ -32,7 +32,7 @@ sub processuser { + my $user=shift; + return if $user=~/^-/ || $users{$user}; + $users{$user}=1; + - my $ret=system("su", $user, "-s", "/bin/sh", "-c", "--", "$0 --nonglobal @ARGV"); + + my $ret=system("su", "-m", $user, "-c", "/bin/sh -c -- '$0 --nonglobal @ARGV'"); + if ($ret != 0) { + print STDERR "warning: processing for $user failed with code $ret\n"; + } The `-m` may be overzealous. I have some sites running as users with `/sbin/nologin` for a shell, and this allows running a command as those users, though without some typical environment variables. This is probably wrong. Maybe I should be doing something else to limit shell access for those users, and the su arg should instead be `-`.