~ubuntu-branches/ubuntu/lucid/openssh/lucid

« back to all changes in this revision

Viewing changes to debian/tests/getpid.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-09-30 23:09:58 UTC
  • mfrom: (1.13.3 upstream) (29 hardy)
  • mto: This revision was merged to the branch mainline in revision 43.
  • Revision ID: james.westby@ubuntu.com-20080930230958-o6vsgn8c4mm959s0
Tags: 1:5.1p1-3
* Remove unnecessary ssh-vulnkey output in non-verbose mode when no
  compromised or unknown keys were found (closes: #496495).
* Configure with --disable-strip; dh_strip will deal with stripping
  binaries and will honour DEB_BUILD_OPTIONS (thanks, Bernhard R. Link;
  closes: #498681).
* Fix handling of zero-length server banners (thanks, Tomas Mraz; closes:
  #497026).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Compile:
 
3
 
 
4
gcc -fPIC -c getpid.c -o getpid.o
 
5
gcc -shared -o getpid.so getpid.o
 
6
 
 
7
 * Use:
 
8
 
 
9
FORCE_PID=1234 LD_PRELOAD=./getpid.so bash
 
10
 
 
11
#
 
12
# Copyright (C) 2001-2008 Kees Cook
 
13
# kees@outflux.net, http://outflux.net/
 
14
 
15
# This program is free software; you can redistribute it and/or
 
16
# modify it under the terms of the GNU General Public License
 
17
# as published by the Free Software Foundation; either version 2
 
18
# of the License, or (at your option) any later version.
 
19
 
20
# This program is distributed in the hope that it will be useful,
 
21
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
22
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
23
# GNU General Public License for more details.
 
24
 
25
# You should have received a copy of the GNU General Public License
 
26
# along with this program; if not, write to the Free Software
 
27
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
28
# http://www.gnu.org/copyleft/gpl.html
 
29
 
 
30
*/
 
31
 
 
32
#include <sys/types.h>
 
33
#include <unistd.h>
 
34
#include <stdlib.h>
 
35
 
 
36
pid_t getpid(void)
 
37
{
 
38
    return atoi(getenv("FORCE_PID"));
 
39
}