diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-04-23 12:22:53 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2010-04-23 12:27:13 -0400 |
commit | 0a8bd742cc1412e2553f152ee0c3aab8c5570212 (patch) | |
tree | 28e354d0a9f541bb244cb56f93e98e1137aa414a /support/nsm/file.c | |
parent | fbc038b7a5c7f5f102bf2c4fb149030d0092eec8 (diff) | |
download | nfs-utils-0a8bd742cc1412e2553f152ee0c3aab8c5570212.tar.gz nfs-utils-0a8bd742cc1412e2553f152ee0c3aab8c5570212.tar.xz nfs-utils-0a8bd742cc1412e2553f152ee0c3aab8c5570212.zip |
Make capabilities support optional
The new code using libcap is quite minor, so rather than always reqiure
libcap support, make it a normal --enable type flag. Current default
behavior is retained -- if libcap is found, it is enabled, else it is
disabled like every nfs-utils version in the past.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/nsm/file.c')
-rw-r--r-- | support/nsm/file.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/support/nsm/file.c b/support/nsm/file.c index d469219..f4baeb9 100644 --- a/support/nsm/file.c +++ b/support/nsm/file.c @@ -67,7 +67,9 @@ #endif #include <sys/types.h> +#ifdef HAVE_SYS_CAPABILITY_H #include <sys/capability.h> +#endif #include <sys/prctl.h> #include <sys/stat.h> @@ -347,6 +349,7 @@ nsm_is_default_parentdir(void) static _Bool nsm_clear_capabilities(void) { +#ifdef HAVE_SYS_CAPABILITY_H cap_t caps; caps = cap_from_text("cap_net_bind_service=ep"); @@ -362,6 +365,7 @@ nsm_clear_capabilities(void) } (void)cap_free(caps); +#endif return true; } |