mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-24 19:21:38 +01:00
Merge branch 'freebsd/current/main' into hardened/current/master
This commit is contained in:
commit
266a9ca738
@ -471,6 +471,7 @@ transmit(
|
||||
return;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* [Bug 3851] drop pool servers which can no longer be reached. */
|
||||
if (MDF_PCLNT & peer->cast_flags) {
|
||||
if ( (IS_IPV6(&peer->srcadr) && !nonlocal_v6_addr_up)
|
||||
@ -479,6 +480,7 @@ transmit(
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* In unicast modes the dance is much more intricate. It is
|
||||
|
@ -1,4 +1,4 @@
|
||||
PACKAGE= clibs-dev
|
||||
PACKAGE?= clibs-dev
|
||||
|
||||
NO_WMISSING_VARIABLE_DECLARATIONS=
|
||||
# Can't instrument these files since that breaks non-sanitized programs.
|
||||
|
@ -1,3 +1,5 @@
|
||||
PACKAGE= tests
|
||||
|
||||
SUBDIR= dso
|
||||
TESTS_SUBDIRS= dynamic
|
||||
TESTS_SUBDIRS+= dynamiclib
|
||||
|
@ -1,4 +1,4 @@
|
||||
INCSDIR= ${INCLUDEDIR}/bsnmp
|
||||
PACKAGE= bsnmp
|
||||
PACKAGE?= bsnmp
|
||||
|
||||
.include "../Makefile.inc"
|
||||
|
@ -1,5 +1,7 @@
|
||||
.include <bsd.own.mk>
|
||||
|
||||
PACKAGE= tests
|
||||
|
||||
ATF_TESTS_C+= bsnmpd_test
|
||||
|
||||
SRCS.bsmpd_test= bsnmpd_test.c
|
||||
|
@ -1,4 +1,4 @@
|
||||
BINDIR?= /usr/libexec
|
||||
PACKAGE= ssh
|
||||
PACKAGE?= ssh
|
||||
|
||||
.include "../Makefile.inc"
|
||||
|
@ -1,4 +1,5 @@
|
||||
.PATH: ${SRCTOP}/tests
|
||||
KYUAFILE= yes
|
||||
PACKAGE= tests
|
||||
|
||||
.include <bsd.test.mk>
|
||||
|
@ -565,7 +565,7 @@ fuse_vfsop_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
|
||||
error = fdisp_wait_answ(&fdi);
|
||||
|
||||
if (error)
|
||||
return error;
|
||||
goto out;
|
||||
|
||||
feo = (struct fuse_entry_out *)fdi.answ;
|
||||
if (feo->nodeid == 0) {
|
||||
|
@ -144,6 +144,36 @@ TEST_F(Fhstat, lookup_dot)
|
||||
EXPECT_EQ(mode, sb.st_mode);
|
||||
}
|
||||
|
||||
/* Gracefully handle failures to lookup ".". */
|
||||
TEST_F(Fhstat, lookup_dot_error)
|
||||
{
|
||||
const char FULLPATH[] = "mountpoint/some_dir/.";
|
||||
const char RELDIRPATH[] = "some_dir";
|
||||
fhandle_t fhp;
|
||||
struct stat sb;
|
||||
const uint64_t ino = 42;
|
||||
const mode_t mode = S_IFDIR | 0755;
|
||||
const uid_t uid = 12345;
|
||||
|
||||
EXPECT_LOOKUP(FUSE_ROOT_ID, RELDIRPATH)
|
||||
.WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) {
|
||||
SET_OUT_HEADER_LEN(out, entry);
|
||||
out.body.entry.attr.mode = mode;
|
||||
out.body.entry.nodeid = ino;
|
||||
out.body.entry.generation = 1;
|
||||
out.body.entry.attr.uid = uid;
|
||||
out.body.entry.attr_valid = UINT64_MAX;
|
||||
out.body.entry.entry_valid = 0;
|
||||
})));
|
||||
|
||||
EXPECT_LOOKUP(ino, ".")
|
||||
.WillOnce(Invoke(ReturnErrno(EDOOFUS)));
|
||||
|
||||
ASSERT_EQ(0, getfh(FULLPATH, &fhp)) << strerror(errno);
|
||||
ASSERT_EQ(-1, fhstat(&fhp, &sb));
|
||||
EXPECT_EQ(EDOOFUS, errno);
|
||||
}
|
||||
|
||||
/* Use a file handle whose entry is still cached */
|
||||
TEST_F(Fhstat, cached)
|
||||
{
|
||||
|
@ -436,14 +436,12 @@ substitute(struct s_command *cp)
|
||||
* and at the end of the line, terminate.
|
||||
*/
|
||||
if (match[0].rm_so == match[0].rm_eo) {
|
||||
if (*s == '\0' || *s == '\n')
|
||||
slen = -1;
|
||||
else
|
||||
slen--;
|
||||
if (*s != '\0') {
|
||||
if (slen > 0) {
|
||||
cspace(&SS, s++, 1, APPEND);
|
||||
slen--;
|
||||
le++;
|
||||
}
|
||||
} else
|
||||
slen = -1;
|
||||
lastempty = 1;
|
||||
} else
|
||||
lastempty = 0;
|
||||
|
@ -159,6 +159,41 @@ minus_e_body()
|
||||
atf_check -o 'inline:--\nab\n' sed $'1 i\\\n--' a
|
||||
}
|
||||
|
||||
atf_test_case command_c
|
||||
command_c_head()
|
||||
{
|
||||
atf_set "descr" "Verify that the 'c' command starts a new cycle"
|
||||
}
|
||||
command_c_body()
|
||||
{
|
||||
printf "%s\n" a b c d e f > a
|
||||
printf "%s\n" x c d e f > expected
|
||||
|
||||
atf_check -o file:expected sed '
|
||||
/a/,/b/c\
|
||||
x
|
||||
' a
|
||||
|
||||
atf_check -o file:expected sed '
|
||||
/a/,/b/c\
|
||||
x
|
||||
$!N
|
||||
' a
|
||||
}
|
||||
|
||||
atf_test_case command_D
|
||||
command_D_head()
|
||||
{
|
||||
atf_set "descr" "Test handling of an empty pattern space"
|
||||
}
|
||||
command_D_body()
|
||||
{
|
||||
printf "hello\n\nworld\n" > a
|
||||
|
||||
atf_check -o file:a sed -e 's/^//;P;D' a
|
||||
atf_check -o file:a sed -e 's/^//;$!N;P;D' a
|
||||
}
|
||||
|
||||
atf_init_test_cases()
|
||||
{
|
||||
atf_add_test_case inplace_command_q
|
||||
@ -169,4 +204,6 @@ atf_init_test_cases()
|
||||
atf_add_test_case hex_subst
|
||||
atf_add_test_case bracket_y
|
||||
atf_add_test_case minus_e
|
||||
atf_add_test_case command_c
|
||||
atf_add_test_case command_D
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user