2000-02-09 03:58:47 +08:00
|
|
|
/* vi: set sw=4 ts=4: */
|
2000-01-16 06:28:50 +08:00
|
|
|
/*
|
|
|
|
* Mini whoami implementation for busybox
|
|
|
|
*
|
|
|
|
* Copyright (C) 2000 Edward Betts <edward@debian.org>.
|
|
|
|
*
|
2006-07-12 15:56:04 +08:00
|
|
|
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
2000-01-16 06:28:50 +08:00
|
|
|
*/
|
|
|
|
|
2003-03-19 17:13:01 +08:00
|
|
|
/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */
|
2001-03-10 05:28:09 +08:00
|
|
|
|
2007-05-27 03:00:18 +08:00
|
|
|
#include "libbb.h"
|
2000-01-16 06:28:50 +08:00
|
|
|
|
2007-04-10 23:43:37 +08:00
|
|
|
/* This is a NOFORK applet. Be very careful! */
|
|
|
|
|
2007-10-11 18:05:36 +08:00
|
|
|
int whoami_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
|
2008-07-05 17:18:54 +08:00
|
|
|
int whoami_main(int argc, char **argv UNUSED_PARAM)
|
2000-02-09 03:58:47 +08:00
|
|
|
{
|
|
|
|
if (argc > 1)
|
2003-03-19 17:13:01 +08:00
|
|
|
bb_show_usage();
|
2000-01-16 06:28:50 +08:00
|
|
|
|
2007-07-27 19:20:10 +08:00
|
|
|
/* Will complain and die if username not found */
|
2008-12-03 06:56:59 +08:00
|
|
|
puts(xuid2uname(geteuid()));
|
2007-04-10 23:43:37 +08:00
|
|
|
|
2009-11-02 21:19:51 +08:00
|
|
|
return fflush_all();
|
2000-01-16 06:28:50 +08:00
|
|
|
}
|