error compiling gradm

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

error compiling gradm

Postby aiko » Tue Dec 30, 2003 9:22 am

Im currently running kernel 2.4.23.
When i try to compile gradm 1.9.13 or 1.9.11 o got following error:
/usr/bin/gcc -O2 -DGRSEC_DIR=\"/etc/grsec\" -c -o gradm_res.o gradm_res.c
gradm_res.c: In function `add_res_acl':
gradm_res.c:136: error: `NR_OPEN' undeclared (first use in this function)
gradm_res.c:136: error: (Each undeclared identifier is reported only once
gradm_res.c:136: error: for each function it appears in.)
make: *** [gradm_res.o] Error 1
linux/limits.h does have NR_OPEN
and its included from gradm.h.
And gradm.h is include from gradm_res.c. to its a bit strange.
So i #define NR_OPEN 1024 in gradm.h.
And got this:

/usr/bin/gcc -O2 -DGRSEC_DIR=\"/etc/grsec\" -o gradm gradm.tab.o lex.gradm.o learn.tab.o lex.learn.o gradm_misc.o gradm_parse.o gradm_arg.o gradm_pw.o gradm_opt.o gradm_cap.o gradm_sha256.o gradm_adm.o gradm_analyze.o gradm_res.o gradm_human.o gradm_learn.o gradm_net.o -lfl -static
gradm_human.o(.text+0x11c): In function `show_ip_acl':
: Using 'getprotobynumber' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
gradm.tab.o(.text+0x1af): In function `conv_name_to_type':
: Using 'getprotobyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
gradm_parse.o(.text+0x4ec): In function `add_globbing_file':
: undefined reference to `MINOR'
gradm_parse.o(.text+0x505): In function `add_globbing_file':
: undefined reference to `MAJOR'
gradm_parse.o(.text+0x50e): In function `add_globbing_file':
: undefined reference to `MKDEV'
gradm_parse.o(.text+0x5e5): In function `add_globbing_file':
: undefined reference to `MINOR'
gradm_parse.o(.text+0x5fe): In function `add_globbing_file':
: undefined reference to `MAJOR'
gradm_parse.o(.text+0x607): In function `add_globbing_file':
: undefined reference to `MKDEV'
gradm_parse.o(.text+0x67e): In function `add_globbing_file':
: undefined reference to `MINOR'
gradm_parse.o(.text+0x697): In function `add_globbing_file':
: undefined reference to `MAJOR'
gradm_parse.o(.text+0x6a0): In function `add_globbing_file':
: undefined reference to `MKDEV'
gradm_parse.o(.text+0x76f): In function `add_globbing_file':
: undefined reference to `MINOR'
gradm_parse.o(.text+0x788): In function `add_globbing_file':
: undefined reference to `MAJOR'
gradm_parse.o(.text+0x791): In function `add_globbing_file':
: undefined reference to `MKDEV'
gradm_parse.o(.text+0x882): In function `display_all_dupes':
: undefined reference to `MINOR'
gradm_parse.o(.text+0x895): In function `display_all_dupes':
: undefined reference to `MAJOR'
gradm_parse.o(.text+0x89e): In function `display_all_dupes':
: undefined reference to `MKDEV'
gradm_parse.o(.text+0xa11): In function `add_proc_object_acl':
: undefined reference to `MINOR'
gradm_parse.o(.text+0xa24): In function `add_proc_object_acl':
: undefined reference to `MAJOR'
gradm_parse.o(.text+0xa2d): In function `add_proc_object_acl':
: undefined reference to `MKDEV'
gradm_parse.o(.text+0xdbe): In function `add_proc_subject_acl':
: undefined reference to `MINOR'
gradm_parse.o(.text+0xdd1): In function `add_proc_subject_acl':
: undefined reference to `MAJOR'
gradm_parse.o(.text+0xdda): In function `add_proc_subject_acl':
: undefined reference to `MKDEV'
gradm_arg.o(.text+0x88): In function `conv_name_to_num':
: undefined reference to `MINOR'
gradm_arg.o(.text+0x9b): In function `conv_name_to_num':
: undefined reference to `MAJOR'
gradm_arg.o(.text+0xa4): In function `conv_name_to_num':
: undefined reference to `MKDEV'
collect2: ld returned 1 exit status
make: *** [gradm] Error 1

Any ides how could i solve this problem, since I dont have any.
aiko
 
Posts: 1
Joined: Tue Dec 30, 2003 9:07 am

Postby pharazon » Wed Jan 07, 2004 6:16 am

I've got the same problem. I have 3 machines with different architechtures running Debian sid (testing) and kernel 2.4.24 (previously 2.4.23). On all machines I get the same error while compiling gradm 1.9.13 . What could cause it? I'd like to use grsec, but this makes it quite hard.
pharazon
 
Posts: 3
Joined: Wed Jan 07, 2004 5:57 am

Postby goodbyte » Wed Jan 07, 2004 6:31 am

I've not used 1.9.x in a while, but try to copy the #define statements from the end of linux/include/linux/kdev_t.h to gradm.h
goodbyte
 
Posts: 32
Joined: Sun May 12, 2002 4:33 am

Compiling on debian machines

Postby kerb » Thu Jan 08, 2004 5:14 am

Hi,
in order to succesfully compile gradm on debian machines you should add to gradm.h the following lines:

#define NR_OPEN 1024
#define MAJOR(dev) ((dev)>>8)
#define MINOR(dev) ((dev) & 0xff)
#define MKDEV(ma,mi) ((ma)<<8 | (mi))

regards
kerb
 
Posts: 1
Joined: Thu Jan 08, 2004 5:10 am


Return to grsecurity support