Displaying 2 results from an estimated 2 matches for "cap_value_t".
2007 Feb 23
0
Simple patch
.../wait.h>
+#ifdef HAVE_LIBCAP
+#include <sys/capability.h>
+#endif
const char *process_names[PROCESS_TYPE_MAX] = {
"unknown",
@@ -36,6 +39,15 @@
"dict"
};
+/* the capabilities that we *need* in order to operate */
+#ifdef HAVE_LIBCAP
+cap_t caps;
+cap_value_t suidcaps[] = {
+ CAP_SETUID,
+ CAP_NET_BIND_SERVICE
+};
+#endif
+
static const char *configfile = SYSCONFDIR "/" PACKAGE ".conf";
static const char *env_tz;
@@ -583,6 +595,18 @@
if (log_error)
i_fatal("This is Dovecot's error l...
2004 Jan 26
1
patch for linux capabilities
...ys/capability.h>
+#define _POSIX_SOURCE
+#else
+#include <sys/prctl.h>
+#include <sys/capability.h>
+#endif
+#endif
+
#include "rsync.h"
extern int module_id;
@@ -217,6 +229,10 @@
int start_glob=0;
int ret;
char *request=NULL;
+#ifdef HAVE_LINUX_CAPS
+ cap_t cp;
+ cap_value_t newcaps[2] = { CAP_SYS_CHROOT, CAP_DAC_READ_SEARCH };
+#endif
extern int am_sender;
extern int am_server;
extern int am_daemon;
@@ -373,12 +389,46 @@
}
#endif
+#ifdef HAVE_LINUX_CAPS
+ if (setreuid(uid, 0)) {
+ rsyserr(FERROR, errno, "setreuid(%d,0) failed", (int) uid);
+...