mirror of
https://git.freebsd.org/ports.git
synced 2025-06-05 21:00:30 -04:00
- Fix build on HEAD.
- Do not allow the user to send signals to arbitrary processes if setuid binary is used. PR: ports/141852 Submitted by: Denis Barov <dindin@dindin.ru> Security: http://www.freebsd.org/ports/portaudit/4d6076fe-ee7a-11de-9cd0-001a926c7637.html
This commit is contained in:
parent
17bb5918e7
commit
c3c507c2cf
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=246395
3 changed files with 47 additions and 2 deletions
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
PORTNAME= fuser
|
PORTNAME= fuser
|
||||||
PORTVERSION= 1142334561
|
PORTVERSION= 1142334561
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= sysutils
|
CATEGORIES= sysutils
|
||||||
MASTER_SITES= http://mbsd.msk.ru/dist/
|
MASTER_SITES= http://mbsd.msk.ru/dist/
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ EXTRA_PATCHES+= ${FILESDIR}/extra::patch-fuser.c \
|
||||||
EXTRA_PATCHES+= ${FILESDIR}/extra::patch-msdosfs.c
|
EXTRA_PATCHES+= ${FILESDIR}/extra::patch-msdosfs.c
|
||||||
.endif
|
.endif
|
||||||
.if ${OSVERSION} >= 800101
|
.if ${OSVERSION} >= 800101
|
||||||
BROKEN= does not compile on 8.X
|
EXTRA_PATCHES+= ${FILESDIR}/extra::patch-nfs.c
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
do-install:
|
do-install:
|
||||||
|
|
10
sysutils/fuser/files/extra::patch-nfs.c
Normal file
10
sysutils/fuser/files/extra::patch-nfs.c
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
--- nfs.c.orig 2009-12-21 13:33:10.000000000 -0800
|
||||||
|
+++ nfs.c 2009-12-21 13:33:22.000000000 -0800
|
||||||
|
@@ -44,7 +44,6 @@
|
||||||
|
#include <sys/mount.h>
|
||||||
|
|
||||||
|
#include <nfs/nfsproto.h>
|
||||||
|
-#include <nfs/rpcv2.h>
|
||||||
|
#include <nfsclient/nfs.h>
|
||||||
|
#include <nfsclient/nfsnode.h>
|
||||||
|
|
35
sysutils/fuser/files/patch-fuser.c
Normal file
35
sysutils/fuser/files/patch-fuser.c
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
--- fuser.c.orig 2006-03-14 14:07:08.000000000 +0300
|
||||||
|
+++ fuser.c 2009-12-21 22:51:33.000000000 +0300
|
||||||
|
@@ -608,6 +608,7 @@
|
||||||
|
char *ep;
|
||||||
|
char *kernimg = NULL; /* We are using curr. sys by default */
|
||||||
|
char *mcore = NULL;
|
||||||
|
+ int retvalue = 0;
|
||||||
|
|
||||||
|
while ((ch = getopt(argc, argv, "C:K:cfkms:u")) != -1)
|
||||||
|
switch(ch) {
|
||||||
|
@@ -696,8 +697,13 @@
|
||||||
|
if (ufl != 0) {
|
||||||
|
print_file_info(pinfo->pid, \
|
||||||
|
pinfo->uid, ufl);
|
||||||
|
- if ((flags & KFLAG) != 0)
|
||||||
|
- (void)kill(pinfo->pid, sig);
|
||||||
|
+ if ((flags & KFLAG) != 0) {
|
||||||
|
+ if (geteuid() == getuid() || pinfo->uid == getuid()) {
|
||||||
|
+ (void)kill(pinfo->pid, sig);
|
||||||
|
+ } else {
|
||||||
|
+ retvalue = 1;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(void)fprintf(stderr, "\n");
|
||||||
|
@@ -707,7 +713,7 @@
|
||||||
|
SLIST_FREE(&prclist, next, pinfo_free);
|
||||||
|
(void)kvm_close(kd);
|
||||||
|
|
||||||
|
- return 0;
|
||||||
|
+ return retvalue;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue