gradm makefile won't work for distributions

Discuss and suggest new grsecurity features

gradm makefile won't work for distributions

Postby devillinux » Tue Jan 25, 2005 12:34 pm

Brad,

the makefile for the latest gradm tries to run gradm, which fails when there is no /dev/grsec existing.
Please do not try to execute it, when DESTDIR is not empty. This should be the easiest way to find out if it is being compiled for a distribution.

Thx
Heiko

make[1]: Entering directory `/data/build/tmp/gradm2'
mkdir -p /data/build/tmp/tmp/sbin
/usr/bin/install -c -m 0755 gradm /data/build/tmp/tmp/sbin
/usr/bin/strip /data/build/tmp/tmp/sbin/gradm
/usr/bin/install -c -m 0700 grlearn /data/build/tmp/tmp/sbin
/usr/bin/strip /data/build/tmp/tmp/sbin/grlearn
mkdir -p -m 700 /data/build/tmp/tmp/etc/grsec
mkdir -p /data/build/tmp/tmp/usr/share/man/man8
/usr/bin/install -c -m 0644 gradm.8 /data/build/tmp/tmp/usr/share/man/man8/gradm.8
Could not open /dev/grsec.
open: No such file or directory


@if [ -x $(DESTDIR)/sbin/$(GRADM_BIN) ] ; then \
$(FIND) $(DESTDIR)$(GRSEC_DIR) -type f -name pw -size 48c -exec rm -f $(DESTDIR)$(GRSEC_DIR)/pw \; ; \
if [ ! -f $(DESTDIR)$(GRSEC_DIR)/pw ] ; then \
$(DESTDIR)/sbin/$(GRADM_BIN) -P ; \
fi \
fi
devillinux
 
Posts: 30
Joined: Tue Dec 24, 2002 6:55 pm

Postby miah » Tue Jan 25, 2005 4:35 pm

And its really easy to patch around. I probably commented out more than I needed to, but whatever it works.

miah@build:~/rpm_build/os/gradm$ cat Makefile2.patch
--- Makefile.orig 2005-01-25 20:29:36.000000000 +0500
+++ Makefile 2005-01-25 20:30:36.000000000 +0500
@@ -115,11 +115,11 @@
fi
mkdir -p $(DESTDIR)$(MANDIR)/man8
$(INSTALL) -m 0644 gradm.8 $(DESTDIR)$(MANDIR)/man8/$(GRADM_BIN).8
- @if [ -x $(DESTDIR)/sbin/$(GRADM_BIN) ] ; then \
- $(FIND) $(DESTDIR)$(GRSEC_DIR) -type f -name pw -size 48c -exec rm -f $(DESTDIR)$(GRSEC_DIR)/pw \; ; \
- if [ ! -f $(DESTDIR)$(GRSEC_DIR)/pw ] ; then \
- $(DESTDIR)/sbin/$(GRADM_BIN) -P ; \
- fi \
- fi
+# @if [ -x $(DESTDIR)/sbin/$(GRADM_BIN) ] ; then \
+# $(FIND) $(DESTDIR)$(GRSEC_DIR) -type f -name pw -size 48c -exec rm -f $(DESTDIR)$(GRSEC_DIR)/pw \; ; \
+ #if [ ! -f $(DESTDIR)$(GRSEC_DIR)/pw ] ; then \
+ # $(DESTDIR)/sbin/$(GRADM_BIN) -P ; \
+ #fi \
+# fi
clean:
rm -f core *.o $(GRADM_BIN) lex.*.c *.tab.c *.tab.h grlearn
miah
 
Posts: 1
Joined: Tue Jan 25, 2005 4:31 pm


Return to grsecurity development