1 /* vi: set sw=4 ts=4: */
4 * Copyright (C) 2000-2006 by Erik Andersen <andersen@uclibc.org>
5 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
14 /* uClibc makes it policy to not mess with the utmp file whenever
15 * possible, since I consider utmp a complete waste of time. Since
16 * getlogin() should never be used for security purposes, we kindly let
17 * the user specify whatever they want via the LOGNAME environment
18 * variable, or we return NULL if getenv() fails to find anything */
22 return (getenv("LOGNAME"));
24 libc_hidden_def(getlogin)
26 int getlogin_r(char *name, size_t len)
28 char * foo = getenv("LOGNAME");
33 strncpy(name, foo, len);
38 char *cuserid(char *s)
40 char *name = getlogin();
42 return(strcpy(s, name ? name : ""));