1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

* Sync with the trunk.

This commit is contained in:
Eelco Dolstra 2010-04-20 09:20:29 +00:00
commit d66ea83a76
16 changed files with 107 additions and 34 deletions

View file

@ -809,7 +809,8 @@ void killUser(uid_t uid)
case 0:
try { /* child */
if (setuid(uid) == -1) abort();
if (setuid(uid) == -1)
throw SysError("setting uid");
while (true) {
if (kill(-1, SIGKILL) == 0) break;
@ -819,7 +820,7 @@ void killUser(uid_t uid)
}
} catch (std::exception & e) {
std::cerr << format("killing processes beloging to uid `%1%': %1%")
std::cerr << format("killing processes belonging to uid `%1%': %2%")
% uid % e.what() << std::endl;
quickExit(1);
}
@ -827,8 +828,9 @@ void killUser(uid_t uid)
}
/* parent */
if (pid.wait(true) != 0)
throw Error(format("cannot kill processes for uid `%1%'") % uid);
int status = pid.wait(true);
if (status != 0)
throw Error(format("cannot kill processes for uid `%1%': %2%") % uid % statusToString(status));
/* !!! We should really do some check to make sure that there are
no processes left running under `uid', but there is no portable

View file

@ -91,6 +91,7 @@ void XMLWriter::writeAttrs(const XMLAttrs & attrs)
char c = i->second[j];
if (c == '"') output << "&quot;";
else if (c == '<') output << "&lt;";
else if (c == '>') output << "&gt;";
else if (c == '&') output << "&amp;";
/* Escape newlines to prevent attribute normalisation (see
XML spec, section 3.3.3. */