Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162308827
D16000.id44399.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D16000.id44399.diff
View Options
Index: tests/sys/audit/administrative.c
===================================================================
--- tests/sys/audit/administrative.c
+++ tests/sys/audit/administrative.c
@@ -163,7 +163,7 @@
snprintf(adregex, sizeof(adregex), "nfs_getfh.*%d.*ret.*success", pid);
/* File needs to exist to call getfh(2) */
- ATF_REQUIRE(filedesc = open(path, O_CREAT, mode) != -1);
+ ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1);
FILE *pipefd = setup(fds, auclass);
ATF_REQUIRE_EQ(0, getfh(path, &fhp));
check_audit(fds, adregex, pipefd);
Index: tests/sys/audit/file-attribute-access.c
===================================================================
--- tests/sys/audit/file-attribute-access.c
+++ tests/sys/audit/file-attribute-access.c
@@ -46,7 +46,6 @@
static char extregex[80];
static struct stat statbuff;
static struct statfs statfsbuff;
-static const char *buff = "ezio";
static const char *auclass = "fa";
static const char *name = "authorname";
static const char *path = "fileforaudit";
@@ -814,15 +813,15 @@
/* File needs to exist to call extattr_get_file(2) */
ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1);
/* Set an extended attribute to be retrieved later on */
- ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path,
- EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff)));
+ ATF_REQUIRE_EQ(0, extattr_set_file(path,
+ EXTATTR_NAMESPACE_USER, name, NULL, 0));
/* Prepare the regex to be checked in the audit record */
snprintf(extregex, sizeof(extregex),
"extattr_get_file.*%s.*%s.*return,success", path, name);
FILE *pipefd = setup(fds, auclass);
- ATF_REQUIRE_EQ(sizeof(buff), extattr_get_file(path,
+ ATF_REQUIRE_EQ(0, extattr_get_file(path,
EXTATTR_NAMESPACE_USER, name, NULL, 0));
check_audit(fds, extregex, pipefd);
close(filedesc);
@@ -872,15 +871,15 @@
/* File needs to exist to call extattr_get_fd(2) */
ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1);
/* Set an extended attribute to be retrieved later on */
- ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path,
- EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff)));
+ ATF_REQUIRE_EQ(0, extattr_set_file(path,
+ EXTATTR_NAMESPACE_USER, name, NULL, 0));
/* Prepare the regex to be checked in the audit record */
snprintf(extregex, sizeof(extregex),
"extattr_get_fd.*%s.*return,success", name);
FILE *pipefd = setup(fds, auclass);
- ATF_REQUIRE_EQ(sizeof(buff), extattr_get_fd(filedesc,
+ ATF_REQUIRE_EQ(0, extattr_get_fd(filedesc,
EXTATTR_NAMESPACE_USER, name, NULL, 0));
check_audit(fds, extregex, pipefd);
close(filedesc);
@@ -930,15 +929,15 @@
/* Symbolic link needs to exist to call extattr_get_link(2) */
ATF_REQUIRE_EQ(0, symlink("symlink", path));
/* Set an extended attribute to be retrieved later on */
- ATF_REQUIRE_EQ(sizeof(buff), extattr_set_link(path,
- EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff)));
+ ATF_REQUIRE_EQ(0, extattr_set_link(path,
+ EXTATTR_NAMESPACE_USER, name, NULL, 0));
/* Prepare the regex to be checked in the audit record */
snprintf(extregex, sizeof(extregex),
"extattr_get_link.*%s.*%s.*return,success", path, name);
FILE *pipefd = setup(fds, auclass);
- ATF_REQUIRE_EQ(sizeof(buff), extattr_get_link(path,
+ ATF_REQUIRE_EQ(0, extattr_get_link(path,
EXTATTR_NAMESPACE_USER, name, NULL, 0));
check_audit(fds, extregex, pipefd);
}
Index: tests/sys/audit/file-attribute-modify.c
===================================================================
--- tests/sys/audit/file-attribute-modify.c
+++ tests/sys/audit/file-attribute-modify.c
@@ -46,7 +46,6 @@
static struct pollfd fds[1];
static mode_t mode = 0777;
static char extregex[80];
-static const char *buff = "ezio";
static const char *auclass = "fm";
static const char *name = "authorname";
static const char *path = "fileforaudit";
@@ -959,8 +958,8 @@
"extattr_set_file.*%s.*%s.*return,success", path, name);
FILE *pipefd = setup(fds, auclass);
- ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path,
- EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff)));
+ ATF_REQUIRE_EQ(0, extattr_set_file(path,
+ EXTATTR_NAMESPACE_USER, name, NULL, 0));
check_audit(fds, extregex, pipefd);
close(filedesc);
}
@@ -1014,8 +1013,8 @@
"extattr_set_fd.*%s.*return,success", name);
FILE *pipefd = setup(fds, auclass);
- ATF_REQUIRE_EQ(sizeof(buff), extattr_set_fd(filedesc,
- EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff)));
+ ATF_REQUIRE_EQ(0, extattr_set_fd(filedesc,
+ EXTATTR_NAMESPACE_USER, name, NULL, 0));
check_audit(fds, extregex, pipefd);
close(filedesc);
}
@@ -1068,8 +1067,8 @@
"extattr_set_link.*%s.*%s.*return,success", path, name);
FILE *pipefd = setup(fds, auclass);
- ATF_REQUIRE_EQ(sizeof(buff), extattr_set_link(path,
- EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff)));
+ ATF_REQUIRE_EQ(0, extattr_set_link(path,
+ EXTATTR_NAMESPACE_USER, name, NULL, 0));
check_audit(fds, extregex, pipefd);
}
@@ -1116,8 +1115,8 @@
{
/* File needs to exist to call extattr_delete_file(2) */
ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1);
- ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path,
- EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff)));
+ ATF_REQUIRE_EQ(0, extattr_set_file(path,
+ EXTATTR_NAMESPACE_USER, name, NULL, 0));
FILE *pipefd = setup(fds, auclass);
ATF_REQUIRE((retval = extattr_delete_file(path,
@@ -1172,8 +1171,8 @@
{
/* File needs to exist to call extattr_delete_fd(2) */
ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1);
- ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path,
- EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff)));
+ ATF_REQUIRE_EQ(0, extattr_set_file(path,
+ EXTATTR_NAMESPACE_USER, name, NULL, 0));
FILE *pipefd = setup(fds, auclass);
ATF_REQUIRE((retval = extattr_delete_fd(filedesc,
@@ -1227,8 +1226,8 @@
{
/* Symbolic link needs to exist to call extattr_delete_link(2) */
ATF_REQUIRE_EQ(0, symlink("symlink", path));
- ATF_REQUIRE_EQ(sizeof(buff), extattr_set_link(path,
- EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff)));
+ ATF_REQUIRE_EQ(0, extattr_set_link(path,
+ EXTATTR_NAMESPACE_USER, name, NULL, 0));
FILE *pipefd = setup(fds, auclass);
ATF_REQUIRE((retval = extattr_delete_link(path,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 12, 10:21 PM (14 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35013783
Default Alt Text
D16000.id44399.diff (6 KB)
Attached To
Mode
D16000: Fix wrong sizeof() argument and descriptor leak reported by Coverity
Attached
Detach File
Event Timeline
Log In to Comment