Hi All!

I have some problems while trying to build commons-daemon on my linux
system. I have built daemon in a solaris machine without problem.

My linux system is a 2.2.16. An uname -a gives following result

Linux dev.qproject.extendnow.com 2.2.16C32_III+VPN #1 Fri Nov 9 23:43:07 PST
2001 i586 unknown

I follow the instructions, use ./configure and create the makefile, but when
i try to compile with make

root unix]# make
make -C native all
make[1]: Entering directory `/tmp/commons-daemon/src/native/unix/native'
gcc -g -O2 -DCPU=\"i386\" -DOS_LINUX -DDSO_DLFCN -I/usr/java/jdk/include
-I/usr/java/jdk/include/linux -Wall -Wstrict-prototypes -c jsvc-unix.c -o
jsvc-unix.o
jsvc-unix.c: In function `linuxset_user_group':
jsvc-unix.c:183: `PR_SET_KEEPCAPS' undeclared (first use in this function)
jsvc-unix.c:183: (Each undeclared identifier is reported only once
jsvc-unix.c:183: for each function it appears in.)
make[1]: *** [jsvc-unix.o] Error 1
make[1]: Leaving directory `/tmp/commons-daemon/src/native/unix/native'
make: *** [native/all] Error 2
[root unix]#

Do you have any hints or suggestions?.

PS: I have libcap working, and i have tried to compile with -lcap.


The source code of the function is

static int linuxset_user_group(char *user, int uid, int gid)
{
    /* set capabilities enough for binding port 80 setuid/getuid */
    if (set_caps(CAPS)!=0)
        return(-1);

    /* make sure they are kept after setuid */
    if (prctl(PR_SET_KEEPCAPS,1,0,0,0) < 0) {
        log_error("prctl failed in linuxset_user_group");
        return(-1);
    }

    /* set setuid/getuid */
    if (set_user_group(user,uid,gid)!=0) {
        log_error("set_user_group failed in linuxset_user_group");
        return(-1);
    }

    /* set capability to binding port 80 read conf */
    if (set_caps(CAPSMIN)!=0)
        return(-1);

    return(0);
}


Thank you very much in advance.

Reply via email to