mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-05-01 19:45:58 -04:00
Make sure we call setgroups() after setuid(). (Ethan Benson)
This commit is contained in:
5
NEWS
5
NEWS
@@ -1,5 +1,10 @@
|
||||
rsync 2.5.3 (not released yet)
|
||||
|
||||
SECURITY FIXES:
|
||||
|
||||
* Make sure that supplementary groups are removed from a server
|
||||
process after changing uid and gid. (Ethan Benson)
|
||||
|
||||
ENHANCEMENTS:
|
||||
|
||||
* Command to initiate connections is only shown with -vv, rather
|
||||
|
||||
@@ -294,6 +294,16 @@ static int rsync_module(int fd, int i)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SETGROUPS
|
||||
/* Get rid of any supplementary groups this process
|
||||
* might have inheristed. */
|
||||
if (setgroups(0, NULL)) {
|
||||
rsyserr(FERROR, errno, "setgroups failed");
|
||||
io_printf(fd, "@ERROR: setgroups failed\n");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
am_root = (getuid() == 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -351,7 +351,7 @@ AC_FUNC_UTIME_NULL
|
||||
AC_CHECK_FUNCS(waitpid wait4 getcwd strdup strerror chown chmod mknod)
|
||||
AC_CHECK_FUNCS(fchmod fstat strchr readlink link utime utimes strftime)
|
||||
AC_CHECK_FUNCS(memmove lchown vsnprintf snprintf asprintf setsid glob strpbrk)
|
||||
AC_CHECK_FUNCS(strlcat strlcpy mtrace mallinfo)
|
||||
AC_CHECK_FUNCS(strlcat strlcpy mtrace mallinfo setgroups)
|
||||
|
||||
AC_CACHE_CHECK([for working socketpair],rsync_cv_HAVE_SOCKETPAIR,[
|
||||
AC_TRY_RUN([
|
||||
|
||||
Reference in New Issue
Block a user