From 0f89bb02ef06673365ccb1995bd39983021680b9 Mon Sep 17 00:00:00 2001 From: openEuler-iSula Date: Thu, 26 Dec 2019 15:32:24 +0800 Subject: [PATCH] remove securec functioins --- 0021-remove-securec-functions.patch | 86 +++++++++++++++++++++++++++++ lxcfs.spec | 8 ++- 2 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 0021-remove-securec-functions.patch diff --git a/0021-remove-securec-functions.patch b/0021-remove-securec-functions.patch new file mode 100644 index 0000000..771d939 --- /dev/null +++ b/0021-remove-securec-functions.patch @@ -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: \ No newline at end of file diff --git a/lxcfs.spec b/lxcfs.spec index d1709b8..1aa2db8 100644 --- a/lxcfs.spec +++ b/lxcfs.spec @@ -4,7 +4,7 @@ #Basic Information Name: lxcfs Version: 3.0.2 -Release: 0.5.h1 +Release: 0.5.h2 Summary: FUSE filesystem for LXC License: Apache-2.0 URL: http://linuxcontainers.org @@ -30,10 +30,11 @@ Patch9017: 0017-diskstats-support-devicemapper-device.patch Patch9018: 0018-lxcfs-add-proc-partitions.patch Patch9019: 0019-use-bitwise-operators-only-on-unsigned.patch Patch9020: 0020-lxcfs-proc_diskstats_read-func-obtain-data-from-blki.patch +Patch9021: 0021-remove-securec-functions.patch #Dependency BuildRequires: autoconf automake libtool help2man -BuildRequires: fuse-devel libsecurec libsecurec-devel +BuildRequires: fuse-devel %description lxcfs is a simple userspace filesystem designed to make containers @@ -88,6 +89,9 @@ fi %{_unitdir}/* %changelog +* Thu Dec 26 2019 openEuler Buildteam - 3.0.2-0.5.h2 +- Remove securec functions + * Wed Sep 18 2019 openEuler Buildteam - 3.0.2-0.5.h1 - Package init -- Gitee