Update to FreeBSD head 2018-11-15

Git mirror commit a18b0830c4be01b39489a891b63d6023ada6358a.

Update #3472.
This commit is contained in:
Sebastian Huber
2018-11-06 15:42:44 +01:00
parent d4bf70e497
commit e0b4edbdcc
106 changed files with 5674 additions and 3386 deletions

View File

@@ -351,6 +351,7 @@ static int
nss_configure(void)
{
static time_t confmod;
static int already_initialized = 0;
struct stat statbuf;
int result, isthreaded;
const char *path;
@@ -368,6 +369,16 @@ nss_configure(void)
if (path == NULL)
#endif
path = _PATH_NS_CONF;
#ifndef NS_REREAD_CONF
/*
* Define NS_REREAD_CONF to have nsswitch notice changes
* to nsswitch.conf(5) during runtime. This involves calling
* stat(2) every time, which can result in performance hit.
*/
if (already_initialized)
return (0);
already_initialized = 1;
#endif /* NS_REREAD_CONF */
if (stat(path, &statbuf) != 0)
return (0);
if (statbuf.st_mtime <= confmod)

View File

@@ -136,6 +136,35 @@ caph_enter(void)
return (0);
}
static __inline int
caph_rights_limit(int fd, const cap_rights_t *rights)
{
if (cap_rights_limit(fd, rights) < 0 && errno != ENOSYS)
return (-1);
return (0);
}
static __inline int
caph_ioctls_limit(int fd, const unsigned long *cmds, size_t ncmds)
{
if (cap_ioctls_limit(fd, cmds, ncmds) < 0 && errno != ENOSYS)
return (-1);
return (0);
}
static __inline int
caph_fcntls_limit(int fd, uint32_t fcntlrights)
{
if (cap_fcntls_limit(fd, fcntlrights) < 0 && errno != ENOSYS)
return (-1);
return (0);
}
static __inline int
caph_enter_casper(void)