about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/util.cc10
-rw-r--r--src/libutil/xml-writer.cc1
2 files changed, 7 insertions, 4 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 3f76be670839..1c1c9a9e5b74 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -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
diff --git a/src/libutil/xml-writer.cc b/src/libutil/xml-writer.cc
index 20351e2c30ac..7d698bf6aed5 100644
--- a/src/libutil/xml-writer.cc
+++ b/src/libutil/xml-writer.cc
@@ -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. */