Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jun 2002 23:34:41 -0400
From:      Kevin Way <kevin.way@overtone.org>
To:        Brian Behlendorf <brian@hyperreal.org>
Cc:        freebsd-security@freebsd.org
Subject:   Re: FreeBSD Security Advisory FreeBSD-SA-02:28.resolv
Message-ID:  <20020627033441.GA99268@overtone.org>
In-Reply-To: <20020626152851.Q310-100000@yez.hyperreal.org>
References:  <Pine.NEB.3.96L.1020626162041.16603B-100000@fledge.watson.org> <20020626152851.Q310-100000@yez.hyperreal.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 26, 2002 at 03:29:45PM -0700, Brian Behlendorf wrote:
> Sorry for the newbie question here, but is there a way to programmatically
> determine which binaries on a system static-linked libc?  I tried "nm" but
> that needs non-stripped executables...

quick, dirty, evil, and maybe even effective?

-Kevin Way

#!/usr/local/bin/bash

function dir_walk()
{
    for test in $1/*
    do
        if [ $test = '.' -o $test = '..' ]
        then
            break
        elif [ -d $test ]
        then
            dir_walk $test
        else
            do_something $test
        fi
    done
}

function do_something()
{
    if file $1 | grep 'statically linked' > /dev/null 2>&1
    then
        echo "well shit, $1 is statically linked"
    fi
}

dir_walk /

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020627033441.GA99268>