Displaying 1 result from an estimated 1 matches for "newcap".
Did you mean:
newca
2004 Jan 26
1
patch for linux capabilities
...y.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);
+ io_pri...