]> sourceware.org Git - systemtap.git/commitdiff
PR 12540 (rework) - Could not obtain information on password file" build error
authorDave Brolley <brolley@redhat.com>
Tue, 8 Mar 2011 21:10:30 +0000 (16:10 -0500)
committerDave Brolley <brolley@redhat.com>
Tue, 8 Mar 2011 21:10:30 +0000 (16:10 -0500)
We should only attempt to sign the uprobes.ko module if we are root or
stap-server.

runtime/uprobes/Makefile

index d360fe5138faca087f02003bed35b3d1b41a84f7..686e70d8694afd2b79aa104435f022fc5c0c96b1 100644 (file)
@@ -10,26 +10,29 @@ CLEAN_FILES += Module.markers modules.order Module.symvers
 CLEAN_DIRS  := .tmp_versions
 
 LIBEXECDIR = ../../../../libexec/systemtap
-CERTFILE = ~/.systemtap/ssl/server/stap.cert
 CERTDB = ../../../../etc/systemtap/staprun
 
-# Build the module and sign it.
+# Build the module and, if we are root or stap-server, sign it.
+# Make sure that all the required tools and resources are available
+# before attempting to sign the module. 
 # Ensure that the generated files are writeable by the group which
 # owns this build directory. This is so that the stap-server service
 # can rebuild the module, if necessary.
-# Make sure that all the required tools and resources are available
-# before attempting to sign the module. 
 default:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
-       if test -x $(LIBEXECDIR)/stap-sign-module; then \
-               if test -x `which certutil`; then \
-                       if ! test -f $(CERTFILE); then \
+       if test `id -u` = 0 -o `id -un` = stap-server; then \
+               if test -x $(LIBEXECDIR)/stap-sign-module; then \
+                       stap_dir=${SYSTEMTAP_DIR}; \
+                       if test -z "$$stap_dir"; then \
+                               stap_dir=~/.systemtap; \
+                       fi; \
+                       certfile=$$stap_dir/ssl/server/stap.cert; \
+                       if ! test -f $$certfile; then \
                                $(LIBEXECDIR)/stap-gen-cert; \
                        fi; \
-                       if ! test -d $(CERTDB); then \
-                               mkdir -p $(CERTDB); \
+                       if test `id -u` = 0; then \
+                               $(LIBEXECDIR)/stap-authorize-cert $$certfile $(CERTDB); \
                        fi; \
-                       certutil -A -n stap-server -d $(CERTDB) -i $(CERTFILE) -t "P,P,P"; \
                        for f in *.ko; do \
                                if test ! -e $$f.sgn -o $$f.sgn -ot $$f; then \
                                        $(LIBEXECDIR)/stap-sign-module $$f; \
This page took 0.026602 seconds and 5 git commands to generate.