pts-args-checking-when-calling-com-err-20010314
authorNickolai Zeldovich <kolya@mit.edu>
Thu, 15 Mar 2001 17:50:34 +0000 (17:50 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 15 Mar 2001 17:50:34 +0000 (17:50 +0000)
"This prevents pts from crashing like this:

  pepsi-one~> pts createg a:b -id -1234
  /bin/athena/pts: Permission denied ; unable to create group a:b with id -1234
owned by 'Segmentation fault
"

src/ptserver/pts.c

index 23b9884..bb19f1e 100644 (file)
@@ -125,8 +125,11 @@ CreateGroup (as)
        if (code) {
            if (owner || id) 
                com_err (whoami, code,
-                        "; unable to create group %s with id %d owned by '%s' %s",
-                        namei->data, id, owner, (force?"(ignored)":""));
+                        "; unable to create group %s with id %d%s%s%s%s",
+                        namei->data, id, owner ? " owned by '" : "",
+                        owner ? owner : "",
+                        owner ? "'" : "",
+                        (force ? " (ignored)" : ""));
            else com_err (whoami, code,
                         "; unable to create group %s %s", namei->data, (force?"(ignored)":""));
            if (!force)