9ns: Set eve's name to "eve"
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 1 Mar 2018 17:47:01 +0000 (12:47 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 6 Apr 2018 19:23:01 +0000 (15:23 -0400)
Previously, it was "", which was annoying to debug.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/drivers/dev/cons.c
kern/src/process.c

index 90d9890..4cb0527 100644 (file)
@@ -64,7 +64,7 @@ int iseve(void)
        return strcmp(eve.name, current->user.name) == 0;
 }
 
        return strcmp(eve.name, current->user.name) == 0;
 }
 
-struct username eve = {.name = "", .name_lock = SPINLOCK_INITIALIZER};
+struct username eve = {.name = "eve", .name_lock = SPINLOCK_INITIALIZER};
 char hostdomain[256] = "akaros.org";
 
 static struct {
 char hostdomain[256] = "akaros.org";
 
 static struct {
index d1b617d..f63b19a 100644 (file)
@@ -392,11 +392,8 @@ error_t proc_alloc(struct proc **pp, struct proc *parent, int flags)
                cv_unlock(&parent->child_wait);
        } else {
                p->ppid = 0;
                cv_unlock(&parent->child_wait);
        } else {
                p->ppid = 0;
-               memset(p->user.name, 0, sizeof(p->user.name));
-               if (strcmp(p->user.name, eve.name) != 0) {
-                       printk("Parentless process assigned username \"\"\n");
-                       printk("User \"\" does not have hostowner privileges\n");
-               }
+               strlcpy(p->user.name, eve.name, sizeof(p->user.name));
+               printk("Parentless process assigned username '%s'\n", p->user.name);
        }
        TAILQ_INIT(&p->children);
        cv_init(&p->child_wait);
        }
        TAILQ_INIT(&p->children);
        cv_init(&p->child_wait);