Commit da6f135c authored by Pontus Freyhult's avatar Pontus Freyhult
Browse files

(unix_current_user): New function, return

username of current user.

Rev: src/unix_user.c:1.61
parent 25a8dbc1
......@@ -1182,3 +1182,13 @@ make_unix_user_db(struct reaper *reaper,
return &self->super;
}
struct lsh_string * unix_current_user(void)
{
struct passwd *p = getpwuid(getuid());
if (p)
return make_string(p->pw_name);
return NULL;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment