diff options
author | Roland McGrath <roland@hack.frob.com> | 2013-05-06 15:58:44 -0700 |
---|---|---|
committer | Roland McGrath <roland@hack.frob.com> | 2013-05-06 15:58:44 -0700 |
commit | ee586a6d5c1f904035b702886466aac2bf3a9ba7 (patch) | |
tree | 0b6b55aad132e1fdeae29bef34234c3e045c7855 /login | |
parent | 355f916505e3101f1952fd1a8e2c4c69b52cc36a (diff) | |
download | glibc-ee586a6d5c1f904035b702886466aac2bf3a9ba7.tar.gz glibc-ee586a6d5c1f904035b702886466aac2bf3a9ba7.tar.xz glibc-ee586a6d5c1f904035b702886466aac2bf3a9ba7.zip |
Move getlogin_r_chk to login/ subdir.
Diffstat (limited to 'login')
-rw-r--r-- | login/Makefile | 2 | ||||
-rw-r--r-- | login/Versions | 1 | ||||
-rw-r--r-- | login/getlogin_r_chk.c | 28 |
3 files changed, 30 insertions, 1 deletions
diff --git a/login/Makefile b/login/Makefile index fa5aa71381..61c9d7efbe 100644 --- a/login/Makefile +++ b/login/Makefile @@ -23,7 +23,7 @@ subdir := login headers := utmp.h bits/utmp.h lastlog.h pty.h -routines := getlogin getlogin_r setlogin \ +routines := getlogin getlogin_r setlogin getlogin_r_chk \ getutent getutent_r getutid getutline getutid_r getutline_r \ utmp_file utmpname updwtmp getpt grantpt unlockpt ptsname \ ptsname_r_chk diff --git a/login/Versions b/login/Versions index f4df7183d5..475fcf063f 100644 --- a/login/Versions +++ b/login/Versions @@ -42,6 +42,7 @@ libc { posix_openpt; } GLIBC_2.4 { + __getlogin_r_chk; __ptsname_r_chk; } } diff --git a/login/getlogin_r_chk.c b/login/getlogin_r_chk.c new file mode 100644 index 0000000000..8e490858a5 --- /dev/null +++ b/login/getlogin_r_chk.c @@ -0,0 +1,28 @@ +/* Copyright (C) 2005-2013 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <unistd.h> + + +int +__getlogin_r_chk (char *buf, size_t buflen, size_t nreal) +{ + if (buflen > nreal) + __chk_fail (); + + return getlogin_r (buf, buflen); +} |