projects
/
liboping.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
79027c3
)
Build system: Automatically set capabilities flag / set-UID bit when installing as...
author
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Sun, 6 Mar 2011 08:34:22 +0000
(09:34 +0100)
committer
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Sun, 6 Mar 2011 08:34:22 +0000
(09:34 +0100)
src/Makefile.am
patch
|
blob
|
history
diff --git
a/src/Makefile.am
b/src/Makefile.am
index
bc35a78
..
29e7d92
100644
(file)
--- a/
src/Makefile.am
+++ b/
src/Makefile.am
@@
-51,3
+51,16
@@
if BUILD_WITH_LIBRT
noping_LDADD += -lrt
endif
endif # BUILD_WITH_LIBNCURSES
+
+install-exec-hook:
+ @if test "x0" = "x$$UID"; then \
+ if test "xLinux" = "x`uname -s`"; then \
+ echo "Setting CAP_NET_RAW capability on binaries."; \
+ setcap cap_net_raw=ep $(DESTDIR)$(bindir)/oping; \
+ setcap cap_net_raw=ep $(DESTDIR)$(bindir)/noping; \
+ else \
+ echo "Setting set-UID bit on binaries."; \
+ chmod u+s $(DESTDIR)$(bindir)/oping; \
+ chmod u+s $(DESTDIR)$(bindir)/noping; \
+ fi; \
+ fi