aboutsummaryrefslogtreecommitdiff
path: root/lib/libcasper
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2020-04-07 16:40:41 +0000
committerConrad Meyer <cem@FreeBSD.org>2020-04-07 16:40:41 +0000
commitb30c6ac9f9222ee574d54075e73581f8d141033f (patch)
treed86a982b3ba2a0ec9051830bf506dbf94db385bb /lib/libcasper
parentab2b8d671bb3764e2b00d49f82819d571572a2d2 (diff)
Notes
Diffstat (limited to 'lib/libcasper')
-rw-r--r--lib/libcasper/services/cap_dns/cap_dns.h5
-rw-r--r--lib/libcasper/services/cap_fileargs/cap_fileargs.h6
-rw-r--r--lib/libcasper/services/cap_grp/cap_grp.h7
-rw-r--r--lib/libcasper/services/cap_pwd/cap_pwd.h7
-rw-r--r--lib/libcasper/services/cap_sysctl/cap_sysctl.h7
-rw-r--r--lib/libcasper/services/cap_syslog/cap_syslog.h7
6 files changed, 39 insertions, 0 deletions
diff --git a/lib/libcasper/services/cap_dns/cap_dns.h b/lib/libcasper/services/cap_dns/cap_dns.h
index d9d12bfd2c49..cda821a4459b 100644
--- a/lib/libcasper/services/cap_dns/cap_dns.h
+++ b/lib/libcasper/services/cap_dns/cap_dns.h
@@ -36,12 +36,15 @@
#define WITH_CASPER
#endif
+#include <sys/cdefs.h>
#include <sys/socket.h> /* socklen_t */
struct addrinfo;
struct hostent;
#ifdef WITH_CASPER
+__BEGIN_DECLS
+
struct hostent *cap_gethostbyname(cap_channel_t *chan, const char *name);
struct hostent *cap_gethostbyname2(cap_channel_t *chan, const char *name,
int type);
@@ -58,6 +61,8 @@ int cap_dns_type_limit(cap_channel_t *chan, const char * const *types,
size_t ntypes);
int cap_dns_family_limit(cap_channel_t *chan, const int *families,
size_t nfamilies);
+
+__END_DECLS
#else
#define cap_gethostbyname(chan, name) gethostbyname(name)
#define cap_gethostbyname2(chan, name, type) gethostbyname2(name, type)
diff --git a/lib/libcasper/services/cap_fileargs/cap_fileargs.h b/lib/libcasper/services/cap_fileargs/cap_fileargs.h
index c00f84375ac2..03ff5c29d6c0 100644
--- a/lib/libcasper/services/cap_fileargs/cap_fileargs.h
+++ b/lib/libcasper/services/cap_fileargs/cap_fileargs.h
@@ -31,6 +31,7 @@
#ifndef _FILEARGS_H_
#define _FILEARGS_H_
+#include <sys/cdefs.h>
#include <sys/dnv.h>
#include <sys/nv.h>
@@ -44,6 +45,8 @@ struct fileargs;
typedef struct fileargs fileargs_t;
struct stat;
+__BEGIN_DECLS
+
fileargs_t *fileargs_init(int argc, char *argv[], int flags, mode_t mode,
cap_rights_t *rightsp, int operations);
fileargs_t *fileargs_cinit(cap_channel_t *cas, int argc, char *argv[],
@@ -57,6 +60,9 @@ FILE *fileargs_fopen(fileargs_t *fa, const char *name, const char *mode);
fileargs_t *fileargs_wrap(cap_channel_t *chan, int fdflags);
cap_channel_t *fileargs_unwrap(fileargs_t *fa, int *fdflags);
+
+__END_DECLS
+
#else
typedef struct fileargs {
int fa_flags;
diff --git a/lib/libcasper/services/cap_grp/cap_grp.h b/lib/libcasper/services/cap_grp/cap_grp.h
index ab755015304c..138488fdf839 100644
--- a/lib/libcasper/services/cap_grp/cap_grp.h
+++ b/lib/libcasper/services/cap_grp/cap_grp.h
@@ -36,7 +36,11 @@
#define WITH_CASPER
#endif
+#include <sys/cdefs.h>
+
#ifdef WITH_CASPER
+__BEGIN_DECLS
+
struct group *cap_getgrent(cap_channel_t *chan);
struct group *cap_getgrnam(cap_channel_t *chan, const char *name);
struct group *cap_getgrgid(cap_channel_t *chan, gid_t gid);
@@ -58,6 +62,9 @@ int cap_grp_limit_fields(cap_channel_t *chan, const char * const *fields,
size_t nfields);
int cap_grp_limit_groups(cap_channel_t *chan, const char * const *names,
size_t nnames, const gid_t *gids, size_t ngids);
+
+__END_DECLS
+
#else
#define cap_getgrent(chan) getgrent()
#define cap_getgrnam(chan, name) getgrnam(name)
diff --git a/lib/libcasper/services/cap_pwd/cap_pwd.h b/lib/libcasper/services/cap_pwd/cap_pwd.h
index 99b643174910..74b9de098e2d 100644
--- a/lib/libcasper/services/cap_pwd/cap_pwd.h
+++ b/lib/libcasper/services/cap_pwd/cap_pwd.h
@@ -36,7 +36,11 @@
#define WITH_CASPER
#endif
+#include <sys/cdefs.h>
+
#ifdef WITH_CASPER
+__BEGIN_DECLS
+
struct passwd *cap_getpwent(cap_channel_t *chan);
struct passwd *cap_getpwnam(cap_channel_t *chan, const char *login);
struct passwd *cap_getpwuid(cap_channel_t *chan, uid_t uid);
@@ -58,6 +62,9 @@ int cap_pwd_limit_fields(cap_channel_t *chan, const char * const *fields,
size_t nfields);
int cap_pwd_limit_users(cap_channel_t *chan, const char * const *names,
size_t nnames, uid_t *uids, size_t nuids);
+
+__END_DECLS
+
#else
#define cap_getpwent(chan) getpwent()
#define cap_getpwnam(chan, login) getpwnam(login)
diff --git a/lib/libcasper/services/cap_sysctl/cap_sysctl.h b/lib/libcasper/services/cap_sysctl/cap_sysctl.h
index 641becf45368..226d7766a95e 100644
--- a/lib/libcasper/services/cap_sysctl/cap_sysctl.h
+++ b/lib/libcasper/services/cap_sysctl/cap_sysctl.h
@@ -36,12 +36,16 @@
#define WITH_CASPER
#endif
+#include <sys/cdefs.h>
+
#ifdef WITH_CASPER
#define CAP_SYSCTL_READ 0x01
#define CAP_SYSCTL_WRITE 0x02
#define CAP_SYSCTL_RDWR (CAP_SYSCTL_READ | CAP_SYSCTL_WRITE)
#define CAP_SYSCTL_RECURSIVE 0x04
+__BEGIN_DECLS
+
int cap_sysctl(cap_channel_t *chan, const int *name, u_int namelen, void *oldp,
size_t *oldlenp, const void *newp, size_t newlen);
int cap_sysctlbyname(cap_channel_t *chan, const char *name, void *oldp,
@@ -58,6 +62,9 @@ cap_sysctl_limit_t *cap_sysctl_limit_name(cap_sysctl_limit_t *limit,
cap_sysctl_limit_t *cap_sysctl_limit_mib(cap_sysctl_limit_t *limit,
const int *mibp, u_int miblen, int flags);
int cap_sysctl_limit(cap_sysctl_limit_t *limit);
+
+__END_DECLS
+
#else /* !WITH_CASPER */
#define cap_sysctl(chan, name, namelen, oldp, oldlenp, newp, newlen) \
sysctl((name), (namelen), (oldp), (oldlenp), (newp), (newlen))
diff --git a/lib/libcasper/services/cap_syslog/cap_syslog.h b/lib/libcasper/services/cap_syslog/cap_syslog.h
index 55ca4b355e16..fbcb31662154 100644
--- a/lib/libcasper/services/cap_syslog/cap_syslog.h
+++ b/lib/libcasper/services/cap_syslog/cap_syslog.h
@@ -29,7 +29,11 @@
#ifndef _CAP_SYSLOG_H_
#define _CAP_SYSLOG_H_
+#include <sys/cdefs.h>
+
#ifdef WITH_CASPER
+__BEGIN_DECLS
+
void cap_syslog(cap_channel_t *chan, int pri,
const char *fmt, ...) __printflike(3, 4);
void cap_vsyslog(cap_channel_t *chan, int priority, const char *fmt,
@@ -40,6 +44,9 @@ void cap_openlog(cap_channel_t *chan, const char *ident, int logopt,
void cap_closelog(cap_channel_t *chan);
int cap_setlogmask(cap_channel_t *chan, int maskpri);
+
+__END_DECLS
+
#else
#define cap_syslog(chan, pri, ...) syslog(pri, __VA_ARGS__)
#define cap_vsyslog(chan, pri, fmt, ap) vsyslog(pri, fmt, ap)