From 7ab87febe805d86b81c393b13e8de69f2ab9b684 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 17 Aug 2007 02:05:42 +0000 Subject: 2007-08-16 Frank Ch. Eigler * Makefile.am (install-exec-hook): Only make staprun setuid if "make install" is being run as root. * Makefile.in: Regenerated. --- ChangeLog | 6 ++++++ Makefile.am | 6 +++++- Makefile.in | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f2b5371..d50fe5d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-08-16 Frank Ch. Eigler + + * Makefile.am (install-exec-hook): Only make staprun setuid if + "make install" is being run as root. + * Makefile.in: Regenerated. + 2007-08-16 Josh Stone PR 4591 diff --git a/Makefile.am b/Makefile.am index 9d50c6c8..4c5b2312 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,7 +68,11 @@ stapio_CFLAGS = @PROCFLAGS@ $(AM_CFLAGS) stapio_LDADD = @PROCFLAGS@ -lpthread install-exec-hook: - chmod 04111 "$(DESTDIR)$(bindir)/staprun" + if [ `id -u` -eq 0 ]; then chmod 04111 "$(DESTDIR)$(bindir)/staprun"; fi + +# Why the "id -u" condition? This way, an unprivileged user can run +# make install, and have "sudo stap ...." or "sudo staprun ...." work later. + pkglibexec_PROGRAMS = stapio CLEANFILES += $(pkglibexec_PROGRAMS) diff --git a/Makefile.in b/Makefile.in index a203dcc5..e9837f60 100644 --- a/Makefile.in +++ b/Makefile.in @@ -67,7 +67,7 @@ DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \ $(top_srcdir)/man/stapprobes.tcp.5.in \ $(top_srcdir)/man/stapprobes.udp.5.in AUTHORS COPYING \ ChangeLog INSTALL NEWS compile config.guess depcomp install-sh \ - missing + ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -1464,7 +1464,7 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 @BUILD_ELFUTILS_TRUE@install-exec-local: install-elfutils install-exec-hook: - chmod 04111 "$(DESTDIR)$(bindir)/staprun" + if [ `id -u` -eq 0 ]; then chmod 04111 "$(DESTDIR)$(bindir)/staprun"; fi @BUILD_CRASHMOD_TRUE@$(STAPLOG): staplog.c @BUILD_CRASHMOD_TRUE@ $(CC) -shared -rdynamic $(LDFLAGS) $(CFLAGS) -fPIC -o $@ $< -- cgit