Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Sep 1998 14:44:10 -0700 (PDT)
From:      Ron Echeverri <rone@B1FF.nas.nasa.gov>
To:        questions@FreeBSD.ORG
Subject:   need help compiling GPG 0.3.5
Message-ID:  <199809172144.OAA07015@B1FF.nas.nasa.gov>

next in thread | raw e-mail | index | archive | help
I'm trying to compile GNU Privacy Guard (a free replacement for PGP
<URL:http://www.d.shuttle.de/isil/crypt/gnupg.html>) 0.3.5 on my
FreeBSD 2.2.7-stable box.  It fails here:

    B1FF:rone /home/rone/gnupg-0.3.5/g10 195 > make
    gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I../intl -I../intl  -g -Wall -c status.c
    status.c: In function `init_shm_coprocessing':
    status.c:145: `SHM_LOCK' undeclared (first use this function)
    status.c:145: (Each undeclared identifier is reported only once
    status.c:145: for each function it appears in.)
    *** Error code 1

The code in question:

    if( lock_mem ) {
        if ( shmctl (shm_id, SHM_LOCK, 0) )
            log_info("Locking shared memory %d failed: %s\n",
                                shm_id, strerror(errno));
        else
            shm_is_locked = 1;
    }

I sent the GPG author the part of /usr/src/sys/kern/sysv_shm.c which contains:

    #if 0
            case SHM_LOCK:
            case SHM_UNLOCK:
    #endif

He emailed me and asked:

    Is it possible for you to check whether it works if you mlock() the
    shared memory later (see util/secmem.c how to do this).

I don't have a clue what he means.  I am hoping someone here can help me.

>From gnupg-0.3.5/util/secmem.c:

    static void
    lock_pool( void *p, size_t n )
    {
      #ifdef HAVE_MLOCK
        uid_t uid;
        int err;

        err = mlock( p, n );
        if( err && errno )
            err = errno;

        uid = getuid();
        if( uid && !geteuid() ) {
            if( setuid( uid ) )
                log_fatal("failed to reset uid: %s\n", strerror(errno));
        }

        if( err ) {
            if( errno != EPERM
              #ifdef EAGAIN  /* OpenBSD returns this */
                && errno != EAGAIN
              #endif
              )
                log_error("canīt lock memory: %s\n", strerror(err));
            show_warning = 1;
        }

      #else
        log_info("Please note that you don't have secure memory on this system\n");
      #endif
    }

If anyone can give me a hand with this, i will greatly appreciate it.
Please be sure to email me a copy of your response as i'm not
subscribed to -questions (yeah, i know, how lame).

thanks
rone
-- 
Ron Echeverri			Numerical Aerodynamic Simulation Facility
DSS/Usenet Administrator	NASA Ames Research Center
Internet Sysop			Mountain View, CA
<rone@nas.nasa.gov>		x42771

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



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