!1 lxcfs: remove securec functions
Merge pull request !1 from openEuler-iSula/master
This commit is contained in:
commit
72122ce247
86
0021-remove-securec-functions.patch
Normal file
86
0021-remove-securec-functions.patch
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
diff --git a/Makefile.am b/Makefile.am
|
||||||
|
index ca73156..ac6066d 100644
|
||||||
|
--- a/Makefile.am
|
||||||
|
+++ b/Makefile.am
|
||||||
|
@@ -26,7 +26,7 @@ lxcfs_LTLIBRARIES = liblxcfs.la
|
||||||
|
EXTRA_LTLIBRARIES = liblxcfstest.la
|
||||||
|
|
||||||
|
lxcfs_SOURCES = lxcfs.c
|
||||||
|
-lxcfs_LDADD = -ldl -lsecurec
|
||||||
|
+lxcfs_LDADD = -ldl
|
||||||
|
lxcfs_CFLAGS = $(AM_CFLAGS)
|
||||||
|
lxcfs_LDFLAGS = $(AM_LDFLAGS)
|
||||||
|
bin_PROGRAMS = lxcfs
|
||||||
|
diff --git a/bindings.c b/bindings.c
|
||||||
|
index 446a1d0..9939661 100644
|
||||||
|
--- a/bindings.c
|
||||||
|
+++ b/bindings.c
|
||||||
|
@@ -39,7 +39,6 @@
|
||||||
|
|
||||||
|
#include "bindings.h"
|
||||||
|
#include "config.h" // for VERSION
|
||||||
|
-#include "securec.h"
|
||||||
|
|
||||||
|
/* Maximum number for 64 bit integer is a string with 21 digits: 2^64 - 1 = 21 */
|
||||||
|
#define LXCFS_NUMSTRLEN64 21
|
||||||
|
@@ -4457,7 +4456,6 @@ err:
|
||||||
|
static int proc_partitions_read(char *buf, size_t size, off_t offset,
|
||||||
|
struct fuse_file_info *fi)
|
||||||
|
{
|
||||||
|
- int ret = 0;
|
||||||
|
char dev_name[72] = {0};
|
||||||
|
struct fuse_context *fc = fuse_get_context();
|
||||||
|
struct file_info *d = (struct file_info *)fi->fh;
|
||||||
|
@@ -4481,13 +4479,7 @@ static int proc_partitions_read(char *buf, size_t size, off_t offset,
|
||||||
|
return 0;
|
||||||
|
int left = d->size - offset;
|
||||||
|
total_len = left > size ? size: left;
|
||||||
|
- ret = memcpy_s(buf, size, cache + offset, total_len);
|
||||||
|
- if (ret != 0) {
|
||||||
|
- lxcfs_error("%s\n", "Internal error: memcpy buf failed");
|
||||||
|
- rv = 0;
|
||||||
|
- goto err;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
+ memcpy(buf, cache + offset, total_len);
|
||||||
|
return total_len;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -4512,21 +4504,10 @@ static int proc_partitions_read(char *buf, size_t size, off_t offset,
|
||||||
|
char lbuf[256];
|
||||||
|
|
||||||
|
if (lines < 2) {
|
||||||
|
- ret = strncpy_s(lbuf, sizeof(lbuf), line, sizeof(lbuf)-1);
|
||||||
|
- if (ret != 0) {
|
||||||
|
- lxcfs_error("%s\n", "Internal error: strncpy line failed");
|
||||||
|
- rv = 0;
|
||||||
|
- goto err;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
+ strncpy(lbuf, line, sizeof(lbuf)-1);
|
||||||
|
lines++;
|
||||||
|
} else {
|
||||||
|
- ret = memset_s(dev_name, sizeof(dev_name), 0, sizeof(dev_name));
|
||||||
|
- if (ret != 0) {
|
||||||
|
- lxcfs_error("%s\n", "Internal error: memset devname failed");
|
||||||
|
- rv = 0;
|
||||||
|
- goto err;
|
||||||
|
- }
|
||||||
|
+ memset(dev_name, 0, sizeof(dev_name));
|
||||||
|
|
||||||
|
i = sscanf(line, "%u %u %llu %71s", &major, &minor, &blocks, dev_name);
|
||||||
|
if (i != 4)
|
||||||
|
@@ -4562,12 +4543,7 @@ static int proc_partitions_read(char *buf, size_t size, off_t offset,
|
||||||
|
if (total_len > size )
|
||||||
|
total_len = size;
|
||||||
|
|
||||||
|
- ret = memcpy_s(buf, size, d->buf, total_len);
|
||||||
|
- if (ret != 0) {
|
||||||
|
- lxcfs_error("%s\n", "Internal error: memcpy buf failed");
|
||||||
|
- rv = 0;
|
||||||
|
- goto err;
|
||||||
|
- }
|
||||||
|
+ memcpy(buf, d->buf, total_len);
|
||||||
|
|
||||||
|
rv = total_len;
|
||||||
|
err:
|
||||||
@ -4,7 +4,7 @@
|
|||||||
#Basic Information
|
#Basic Information
|
||||||
Name: lxcfs
|
Name: lxcfs
|
||||||
Version: 3.0.2
|
Version: 3.0.2
|
||||||
Release: 0.5.h1
|
Release: 0.5.h2
|
||||||
Summary: FUSE filesystem for LXC
|
Summary: FUSE filesystem for LXC
|
||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
URL: http://linuxcontainers.org
|
URL: http://linuxcontainers.org
|
||||||
@ -30,10 +30,11 @@ Patch9017: 0017-diskstats-support-devicemapper-device.patch
|
|||||||
Patch9018: 0018-lxcfs-add-proc-partitions.patch
|
Patch9018: 0018-lxcfs-add-proc-partitions.patch
|
||||||
Patch9019: 0019-use-bitwise-operators-only-on-unsigned.patch
|
Patch9019: 0019-use-bitwise-operators-only-on-unsigned.patch
|
||||||
Patch9020: 0020-lxcfs-proc_diskstats_read-func-obtain-data-from-blki.patch
|
Patch9020: 0020-lxcfs-proc_diskstats_read-func-obtain-data-from-blki.patch
|
||||||
|
Patch9021: 0021-remove-securec-functions.patch
|
||||||
|
|
||||||
#Dependency
|
#Dependency
|
||||||
BuildRequires: autoconf automake libtool help2man
|
BuildRequires: autoconf automake libtool help2man
|
||||||
BuildRequires: fuse-devel libsecurec libsecurec-devel
|
BuildRequires: fuse-devel
|
||||||
|
|
||||||
%description
|
%description
|
||||||
lxcfs is a simple userspace filesystem designed to make containers
|
lxcfs is a simple userspace filesystem designed to make containers
|
||||||
@ -88,6 +89,9 @@ fi
|
|||||||
%{_unitdir}/*
|
%{_unitdir}/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Dec 26 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.0.2-0.5.h2
|
||||||
|
- Remove securec functions
|
||||||
|
|
||||||
* Wed Sep 18 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.0.2-0.5.h1
|
* Wed Sep 18 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.0.2-0.5.h1
|
||||||
- Package init
|
- Package init
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user