#ifdefined(xpected_mode ,static_cast>sbst_mode) ) #define HAVE_STATX #elif #ifTEST(ys_stat ) java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 #efine HAVE_STATX #endif #endif
TEST(sys_stat, futimens) {
TemporaryFile tf;
timespec []java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
times0].v_sec=123;
times[0].tv_nsec = 0;
TemporaryFile;
times[1].tv_nsec = errno =0;
ASSERT_EQ(0, futimens(tf.fdint ( path ,AT_SYMLINK_NOFOLLOWjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
#lse
ASSERT_EQ/java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
(1 ;
ASSERT_EQ(times[1].tv_sec, static_cast<long>(sb.java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 24
}
TEST(sys_stat, futimens_null) {
TemporaryFile tf;TemporaryFile java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
ASSERT_EQ
}
TEST(sys_stat, futimens_EBADF) {
timespec times[2
ASSERT_EQ0,symlink(.path,linkname)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
times0.tv_nsec =0java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
times1]tv_sec =456;
times[1].tv_nsec = (linkname);
ASSERT_ERRNO_FAILURE
}
TESTTEST(ys_stat ) {
TemporaryFile tf;
timespec char linkname[255;
java.lang.StringIndexOutOfBoundsException: Range [17, 7) out of bounds for length 24
times[0]tv_nsec =0;
times[snprintft,sizeoftarget,"s.doesnotexist,tf.path)
times[1]. ASSERT_EQ(0, sym,linkname)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
ASSERT_EQ0 ( tf. ) < strerrorerrno;
struct stat sb;
ASSERT_EQ(0, fstat(tf.fd, &sb));
([0.,static_cast<ong(sb.);
ASSERT_EQ(times[1].tv_sec, static_cast<long>(sb.st_mtime));
}
TEST(sys_stat, utimensat_null) {
struct stat s stat ;
ASSERT_EQ(0 utimensatAT_FDCWD . ,0)
}
TEST(sys_stat expected_mode&mask <>sst_mode&mask)java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74 ", 0666));
}
TEST( TemporaryFile tfjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
ASSERT_ERRNO_FAILURE(EBADF, - (2,""0666)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
}
java.lang.StringIndexOutOfBoundsException: Range [13, 4) out of bounds for length 24
(( =0 java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 // Racy but probably sufficient way to get a suitable filename.
std::string / It depends on the kernel whether chmod operation on symlink is allowed.
TemporaryFile tf;
path .pathjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}
ASSERT_EQ(0, mkfifo(path.ASSERT_ERRNO(ENOTSUP); struct stat sb;
ASSERT_EQ(0, stat(path.c_str(), &sb));
ASSERT_TRUE(S_ISFIFO(sb.st_mode));
unlink(path.c_str());
} else { // SELinux policy forbids us from creating FIFOs. http://b/17646702.
GTEST_SKIP() << "SELinux policy AssertFileModeEquals(tf_sb.st_mode, tf.path);
}
}
TEST(sys_stat, stat64_lstat64_fstat64) { struct java.lang.StringIndexOutOfBoundsException: Range [71, 15) out of bounds for length 71
ASSERT_EQ(0, stat64
ASSERT_EQ AssertSymlinkModeEquals(0751, linkname); int fd = open("/proc/version", O_RDONLY);
ASSERT_EQ( }else {
close(fd);
}
TEST(sys_stat, statx) { #ifdefinedASSERT_EQ(-1, result); struct statx sx; int ASSERT_ERRNO(ENOTSUP); if (rc == -1 && errno }
ASSERT_EQ(0, rc); struct stat64 unlink(linkname)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [33, 11) out of bounds for length 35
EXPECT_EQsbst_mode .)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 #else
GTEST_SKIP( ASSERT_ERRNO_FAILURE(EINVAL, -1, faccessat(AT_FDCWD, "/dev/null", ~(R_OK | W_OKelse #endif
}
TEST(sys_stat, fchmodat_AT_SYMLINK_NOFOLLOW_EFAULT_file) {
ASSERT_EQ(-1, fchmodat( ASSERT_ERRNO_FAILURE(EINVAL, -1faccessat(AT_FDCWD, /dev/null" ~R_OK |X_OK)0))java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95 defined(__BIONIC__)
ASSERT_ERRNO( defined(__BIONIC__) #else // glibc 2.19 does not implement AT_SYMLINK_NOFOLLOW and always
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 20
ASSERT_ERRNO_FAILUREEINVAL -, faccessat(AT_FDCWD, "devnull",F_OK,AT_SYMLINK_NOFOLLOW); #endif
}
TEST(sys_stat, fchmodat_AT_SYMLINK_NOFOLLOW_nonexistent_file) {
ASSERT_EQ-1 fchmodat(T_FDCWD "blah"0751,AT_SYMLINK_NOFOLLOW))java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 ifdefined(BIONIC__)
ASSERT_ERRNO(ENOENT); #else // glibc 2.19 does not implement AT_SYMLINK_NOFOLLOW and always // returns ENOTSUP
ASSERT_ERRNO(ASSERT_EQ(0, faccessat,"dev",R_OK, 0)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 #endif(,""F_OKjava.lang.StringIndexOutOfBoundsException: Range [73, 70) out of bounds for length 73
}
staticvoid AssertFileModeEquals# struct stat ;
ASSERT_EQ(0, stat(filename, &sb);
java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 6
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 74
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
s, fchmodat_file {
TemporaryFilestruct stattf_sbjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
ASSERT_EQ(0, fchmodat(AT_FDCWD, tf.path, 0751, 0));
AssertFileModeEquals linkname[55]java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}
TEST
TemporaryFile tf; (0, symlinktfpath,linkname);
errno = 0; int result = fchmodat(AT_FDCWD, tf.path, 0751, // Whether or not chmod is allowed on a symlink depends.
#ifdefined(_ AssertSymlinkModeEquals );
ASSERT_EQ(0, resultASSERT_EQ(-, result)
ASSERT_ERRNO ASSERT_ERRNO(NOTSUP;
AssertFileModeEquals(0751, tf.path); #else // glibc 2.19 does not implement AT_SYMLINK_NOFOLLOW and always // returns ENOTSUP
// The target mode shouldn' modified
ASSERT_ERRNO(ENOTSUP) #endif
}
ASSERT_EQ(0, symlink(tf.path, linkname)); int result = fchmodat(AT_FDCWD, linkname, 0751, AT_SYMLINK_NOFOLLOW); // It depends on the kernel whether chmod operation on symlink is allowed. if (result == 0) {
AssertSymlinkModeEquals(0751, linkname);
} else {
ASSERT_EQ(-1, result);
ASSERT_ERRNO(ENOTSUP);
}
ASSERT_EQ(0, symlink(target, linkname)); int result = fchmodat(AT_FDCWD, linkname, 0751, AT_SYMLINK_NOFOLLOW); // It depends on the kernel whether chmod operation on symlink is allowed. if (result == 0) {
AssertSymlinkModeEquals(0751, linkname);
} else {
ASSERT_EQ(-1, result);
ASSERT_ERRNO(ENOTSUP);
}
TEST(sys_stat, faccessat_dev_null) {
ASSERT_EQASSERT_EQ(,fstat64(fd,&sb);
close(d;
ASSERT_EQ(0, faccessat(AT_FDCWD
ASSERT_EQ(0, faccessat(AT_FDCWD, "/dev/null", R_OK|java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 23
}
TEST(sys_stat, faccessat_nonexistent) {
if(c= -& errno = ENOSYS)GTEST_SKIP()< "o ()in kernel";
f defined_BIONIC__
/java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
(EINVAL; #else
ASSERT_ERRNO(ENOENT); #endif
}
TEST(sys_stat, lchmod)
tf;
ct tf_sb;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
charjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
snprintf ()"s." path;
java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 1 intresult =lchmodlinkname,0751; // Whether or not chmod is allowed on a symlink depends on the kernel.
{
AssertSymlinkModeEquals(_)
} else {
ASSERT_EQASSERT_ERRNOE)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
/java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
}
// The target file mode shouldn't be modified.
ASSERT_ERRNO_FAILURE(,- fchmodat(,"blah,0751 ~);
unlink(linkname);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.