From d8e7a9222b38f699ea00af9182a9b2c335a59b0c Mon Sep 17 00:00:00 2001 From: yang_zhuang_zhuang <1162011203@qq.com> Date: Sat, 28 Nov 2020 10:57:22 +0800 Subject: [PATCH] have wall not write to non-ttys --- Do-not-excute-Utmp-testcases.patch | 26 ++++++++++++++++++++++++++ util-linux.spec | 13 +++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 Do-not-excute-Utmp-testcases.patch diff --git a/Do-not-excute-Utmp-testcases.patch b/Do-not-excute-Utmp-testcases.patch new file mode 100644 index 0000000..8850484 --- /dev/null +++ b/Do-not-excute-Utmp-testcases.patch @@ -0,0 +1,26 @@ +From b629f0e02c2ac6283012131404380acc56beb5e8 Mon Sep 17 00:00:00 2001 +From: yang_zhuang_zhuang +Date: Mon, 2 Nov 2020 17:17:13 +0800 +Subject: Do not excute Utmp testcases. + +The compilation environment and test cases are vulnerable.As a result,the Utmp testcase fail to be compiled.Therefore,the Utmp testcases are commented out. +--- + tests/commands.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/commands.sh b/tests/commands.sh +index 5f34452..ad3edb2 100644 +--- a/tests/commands.sh ++++ b/tests/commands.sh +@@ -100,7 +100,7 @@ TS_CMD_SWAPOFF=${TS_CMD_SWAPOFF:-"${ts_commandsdir}swapoff"} + TS_CMD_SWAPON=${TS_CMD_SWAPON:-"${ts_commandsdir}swapon"} + TS_CMD_UL=${TS_CMD_UL-"${ts_commandsdir}ul"} + TS_CMD_UMOUNT=${TS_CMD_UMOUNT:-"${ts_commandsdir}umount"} +-TS_CMD_UTMPDUMP=${TS_CMD_UTMPDUMP-"${ts_commandsdir}utmpdump"} ++#TS_CMD_UTMPDUMP=${TS_CMD_UTMPDUMP-"${ts_commandsdir}utmpdump"} + TS_CMD_UUIDD=${TS_CMD_UUIDD-"${ts_commandsdir}uuidd"} + TS_CMD_UUIDGEN=${TS_CMD_UUIDGEN-"${ts_commandsdir}uuidgen"} + TS_CMD_UUIDPARSE=${TS_CMD_UUIDPARSE-"${ts_commandsdir}uuidparse"} +-- +1.8.3.1 + diff --git a/util-linux.spec b/util-linux.spec index 51bd864..3b0d0a4 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Name: util-linux Version: 2.35.2 -Release: 1 +Release: 2 Summary: A random collection of Linux utilities License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git @@ -39,6 +39,7 @@ Patch1: libmount-move-already-mounted-code-to-separate-funct.patch Patch2: libmount-try-read-only-mount-on-write-protected-supe.patch Patch3: libmount-parser-fix-memory-leak-on-error-before-end-.patch Patch4: tests-Fix-mountpoint-test-failure-in-build-chroots.patch +Patch5: Do-not-excute-Utmp-testcases.patch %description The util-linux package contains a random collection of files that @@ -292,6 +293,7 @@ fi %attr(4755,root,root) %{_bindir}/su %attr(755,root,root) %{_bindir}/login %attr(2755,root,tty) %{_bindir}/write +%attr(2555,root,tty) %{_bindir}/wall %ghost %attr(0644,root,root) %verify(not md5 size mtime) /var/log/lastlog %ghost %verify(not md5 size mtime) %config(noreplace,missingok) /etc/mtab %{_unitdir}/fstrim.* @@ -299,7 +301,7 @@ fi %{_bindir}/{flock,getopt,hexdump,ionice,ipcmk,ipcrm,ipcs,isosize,kill,last,lastb,logger,hardlink} %{_bindir}/{look,lsblk,lscpu,lsipc,lslocks,lslogins,lsmem,lsns,mcookie,mesg,more,mountpoint} %{_bindir}/{namei,nsenter,prlimit,raw,rename,renice,rev,script,scriptreplay,setarch,setpriv} -%{_bindir}/{setsid,setterm,taskset,ul,unshare,utmpdump,uuidgen,uuidparse,wall,wdctl,whereis,scriptlive,hardlink} +%{_bindir}/{setsid,setterm,taskset,ul,unshare,utmpdump,uuidgen,uuidparse,wdctl,whereis,scriptlive,hardlink} %{_sbindir}/{addpart,agetty,blkdiscard,blkid,blkzone,blockdev,chcpu,ctrlaltdel,delpart,fdisk} %{_sbindir}/{findfs,fsck,fsck.cramfs,fsck.minix,fsfreeze,fstrim,ldattach,losetup,mkfs,mkfs.cramfs} %{_sbindir}/{mkfs.minix,mkswap,nologin,partx,pivot_root,readprofile,resizepart,rfkill,rtcwake} @@ -385,6 +387,13 @@ fi %{_mandir}/man8/{swapoff.8*,swapon.8*,switch_root.8*,umount.8*,wdctl.8.gz,wipefs.8*,zramctl.8*} %changelog +* Sun Nov 28 2020 yangzhuangzhuang - 2.35.2-2 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:have wall not write to non-ttys(#65412) + Do not excute Utmp testcases + * Thu Jul 23 2020 yang_zhuang_zhuang - 2.35.2-1 - Type:enhancement - ID:NA -- Gitee