.
OBS-URL: https://build.opensuse.org/package/show/Base:System/sysvinit?expand=0&rev=139
This commit is contained in:
parent
17b3f918f8
commit
4b80732c88
@ -1,191 +0,0 @@
|
||||
--- libinit.c
|
||||
+++ libinit.c 2011-04-06 13:21:49.212425737 +0000
|
||||
@@ -349,18 +349,24 @@ static int find_mount(const char * path,
|
||||
{
|
||||
const size_t nlen = strlen(path);
|
||||
list_t *ptr;
|
||||
+ int ret = 0;
|
||||
|
||||
list_for_each(ptr, &mounts) {
|
||||
MNTINFO *m = list_entry(ptr, MNTINFO);
|
||||
if (nlen < m->nlen)
|
||||
continue;
|
||||
- if (m->nlen == 1) /* root fs is the last entry */
|
||||
- return (m == s);
|
||||
+ if (m->nlen == 1 && (m == s)) { /* root fs is the last entry */
|
||||
+ ret++;
|
||||
+ break;
|
||||
+ }
|
||||
if (strncmp(path, m->point, m->nlen))
|
||||
continue;
|
||||
- return (m == s);
|
||||
+ if (m == s) {
|
||||
+ ret++;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
- return 0;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
extern inline char * handl_buf(char *restrict buf)
|
||||
@@ -669,6 +675,7 @@ int pidof (const char * inname, const ch
|
||||
boolean isscrpt = false;
|
||||
unsigned num = 0;
|
||||
pid_t pid;
|
||||
+ uid_t uid;
|
||||
char *swapname = NULL;
|
||||
char *fullname = (char *)inname;
|
||||
char *realname = NULL;
|
||||
@@ -677,6 +684,7 @@ int pidof (const char * inname, const ch
|
||||
|
||||
p_pid = getpid();
|
||||
p_ppid = getppid();
|
||||
+ uid = getuid();
|
||||
|
||||
dir = openproc(); /* Open /proc and maybe do mount before */
|
||||
p_pppid = getpppid(p_ppid); /* Requires existence of /proc */
|
||||
@@ -773,6 +781,13 @@ int pidof (const char * inname, const ch
|
||||
|
||||
if (prefix) {
|
||||
if ((rll = readlinkat(dfd, here(d->d_name, "exe"), entry, PATH_MAX)) < 0) {
|
||||
+ if (uid && (errno == EACCES || errno == EPERM)) {
|
||||
+ errno = 0;
|
||||
+ if (fstatat(dfd, d->d_name, &pid_st, 0) < 0)
|
||||
+ continue;
|
||||
+ if (pid_st.st_uid == uid)
|
||||
+ goto risky;
|
||||
+ }
|
||||
if (errno != EPERM && errno != EACCES)
|
||||
goto risky;
|
||||
continue;
|
||||
@@ -809,6 +824,13 @@ int pidof (const char * inname, const ch
|
||||
|
||||
if (!name) {
|
||||
if ((rll = readlinkat(dfd, here(d->d_name, "exe"), entry, PATH_MAX)) < 0) {
|
||||
+ if (uid && (errno == EACCES || errno == EPERM)) {
|
||||
+ errno = 0;
|
||||
+ if (fstatat(dfd, d->d_name, &pid_st, 0) < 0)
|
||||
+ continue;
|
||||
+ if (pid_st.st_uid == uid)
|
||||
+ goto risky;
|
||||
+ }
|
||||
if (errno != EPERM && errno != EACCES)
|
||||
goto risky;
|
||||
continue;
|
||||
@@ -825,7 +847,6 @@ int pidof (const char * inname, const ch
|
||||
if (realname && strncmp(realname, name, PATH_MAX) == 0)
|
||||
found = true;
|
||||
|
||||
-
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -942,12 +963,15 @@ int verify_pidfile (const char * pid_fil
|
||||
ssize_t cnt;
|
||||
boolean isscrpt = false;
|
||||
pid_t pid;
|
||||
+ uid_t uid;
|
||||
char *swapname = NULL, *bufp;
|
||||
char *fullname = (char *)inname;
|
||||
char *realname = NULL;
|
||||
struct stat pid_st, full_st;
|
||||
char buf[BUFSIZ];
|
||||
|
||||
+ uid = getuid();
|
||||
+
|
||||
if (!ignore) {
|
||||
list_t *m, *n;
|
||||
list_for_each_safe(m, n, &remember) {
|
||||
@@ -1041,14 +1065,23 @@ int verify_pidfile (const char * pid_fil
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
- if (!(flags & (KTHREAD|KSHORT)) && !isscrpt &&
|
||||
- (stat(proc(buf, "exe"), &pid_st) == 0)) {
|
||||
-
|
||||
+ if (!(flags & (KTHREAD|KSHORT)) && !isscrpt) {
|
||||
char entry[PATH_MAX+1];
|
||||
const char *name;
|
||||
boolean found;
|
||||
ssize_t rll;
|
||||
|
||||
+ if (stat(proc(buf, "exe"), &pid_st) < 0) {
|
||||
+ if (uid && (errno == EACCES || errno == EPERM)) {
|
||||
+ errno = 0;
|
||||
+ if (stat(proc(buf, ""), &pid_st) < 0)
|
||||
+ goto out;
|
||||
+ if (pid_st.st_uid == uid)
|
||||
+ goto risky;
|
||||
+ }
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
if (pid_st.st_dev != full_st.st_dev)
|
||||
goto out;
|
||||
|
||||
@@ -1087,6 +1120,7 @@ int verify_pidfile (const char * pid_fil
|
||||
|
||||
goto out;
|
||||
}
|
||||
+risky:
|
||||
|
||||
if (errno && errno != ENOENT) {
|
||||
warn("Can not read %s: %s\n", procbuf, strerror(errno));
|
||||
@@ -1162,8 +1196,11 @@ int check_pids (const char * inname, con
|
||||
const char *pid;
|
||||
struct stat pid_st, full_st;
|
||||
list_t *m, *n;
|
||||
+ uid_t uid;
|
||||
int fp;
|
||||
|
||||
+ uid = getuid();
|
||||
+
|
||||
if (!fullname) {
|
||||
warn("program or process name required\n");
|
||||
return -1;
|
||||
@@ -1228,13 +1265,22 @@ int check_pids (const char * inname, con
|
||||
|
||||
/* killproc and daemon/startproc should use the full path */
|
||||
errno = 0;
|
||||
- if (!(flags & (KTHREAD|KSHORT)) && !isscrpt &&
|
||||
- (stat(proc(pid, "exe"), &pid_st) == 0)) {
|
||||
-
|
||||
+ if (!(flags & (KTHREAD|KSHORT)) && !isscrpt) {
|
||||
char entry[PATH_MAX+1];
|
||||
const char *name;
|
||||
ssize_t rll;
|
||||
|
||||
+ if (stat(proc(pid, "exe"), &pid_st) < 0) {
|
||||
+ if (uid && (errno == EACCES || errno == EPERM)) {
|
||||
+ errno = 0;
|
||||
+ if (stat(proc(pid, ""), &pid_st) < 0)
|
||||
+ goto ignore;
|
||||
+ if (pid_st.st_uid == uid)
|
||||
+ goto risky;
|
||||
+ }
|
||||
+ goto ignore;
|
||||
+ }
|
||||
+
|
||||
if (pid_st.st_dev != full_st.st_dev)
|
||||
goto ignore; /* Does not belong to rembered list */
|
||||
|
||||
@@ -1267,6 +1313,7 @@ int check_pids (const char * inname, con
|
||||
|
||||
skip = true; /* No stat entry check needed */
|
||||
}
|
||||
+risky:
|
||||
|
||||
if (!(flags & (KTHREAD|KSHORT)) && isscrpt &&
|
||||
(fp = open(proc(pid, "cmdline"), O_PROCMODE)) != -1) {
|
||||
--- libinit.h
|
||||
+++ libinit.h 2011-04-15 14:43:35.083926074 +0000
|
||||
@@ -91,7 +91,7 @@
|
||||
#define WRGSYNTAX 102 /* usage etc. */
|
||||
#define NOPIDREAD 101 /* trouble */
|
||||
|
||||
-#define LSB_STATUS_PROOF ((errno == EPERM || errno == EACCES) ? LSB_NOPERM : NOPIDREAD )
|
||||
+#define LSB_STATUS_PROOF ((errno == EPERM || errno == EACCES) ? LSB_NOPERM : LSB_STATUS_ISDEAD )
|
||||
#define LSB_STATUS_PROOFX ((errno == ENOENT) ? (flags & KILL) ? LSB_NOENTR : 4 : LSB_STATUS_PROOF )
|
||||
|
||||
#define LOG_OPTIONS (LOG_ODELAY|LOG_CONS)
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1c86ebce3054e9f9e3764d594f2641249e0e1d36af24c2a849409627b214730b
|
||||
size 42597
|
4
killproc-2.20.dif
Normal file
4
killproc-2.20.dif
Normal file
@ -0,0 +1,4 @@
|
||||
--- .#nothing
|
||||
+++ .#nothing 2011-09-01 11:59:52.000000000 +0000
|
||||
@@ -0,0 +1 @@
|
||||
+Please remove if patched
|
3
killproc-2.20.tar.bz2
Normal file
3
killproc-2.20.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6c090a32b4d4c06140b06c9633492cff2a1b0de2f87d48d9c29f0ba72e0f02cc
|
||||
size 42751
|
@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 2 15:43:20 UTC 2011 - werner@suse.de
|
||||
|
||||
- Update to killproc-2.20
|
||||
- Update to showconsole-1.15
|
||||
- Clean spec file
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 1 14:25:56 UTC 2011 - werner@suse.de
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
Name: sysvinit
|
||||
%define MGVER 0.9.6s
|
||||
%define PDVER 2.0.2
|
||||
%define KPVER 2.19
|
||||
%define KPVER 2.20
|
||||
%define SCVER 1.15
|
||||
%define SIVER 2.88+
|
||||
%define START 0.57
|
||||
@ -35,7 +35,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: audit-devel libselinux-devel libsepol-devel pam-devel
|
||||
Url: http://savannah.nongnu.org/projects/sysvinit/
|
||||
Source: http://download.savannah.gnu.org/releases/sysvinit/sysvinit-2.88+dsf.tar.bz2
|
||||
Source2: killproc-2.19.tar.bz2
|
||||
Source2: killproc-2.20.tar.bz2
|
||||
Source3: powerd-2.0.2.tar.bz2
|
||||
Source4: showconsole-1.15.tar.bz2
|
||||
Source5: startpar-0.57.tar.bz2
|
||||
@ -55,7 +55,7 @@ Patch7: sysvinit-2.88+dsf-crypt.patch
|
||||
Patch8: sysvinit-2.88+dsf-blowfish.dif
|
||||
Patch20: powerd-2.0.2.dif
|
||||
Patch21: powerd-2.0.2-getaddrinfo.patch
|
||||
Patch30: killproc-2.19.dif
|
||||
Patch30: killproc-2.20.dif
|
||||
Patch40: showconsole-1.15.dif
|
||||
Patch50: startpar-0.57.dif
|
||||
Requires: sysvinit-tools
|
||||
@ -98,15 +98,21 @@ sysvinit package.
|
||||
%patch7 -p0 -b .crypt
|
||||
%patch8 -p0 -b .blowfish
|
||||
%patch
|
||||
pushd doc
|
||||
mkdir killproc powerd showconsole
|
||||
popd
|
||||
pushd ../powerd-%{PDVER}
|
||||
%patch20
|
||||
%patch21
|
||||
ln -t ../sysvinit-%{SIVER}dsf/doc/powerd README SUPPORTED FAQ powerd.conf.monitor powerd.conf.peer
|
||||
popd
|
||||
pushd ../killproc-%{KPVER}
|
||||
%patch30
|
||||
ln -t ../sysvinit-%{SIVER}dsf/doc/killproc README
|
||||
popd
|
||||
pushd ../showconsole-%{SCVER}
|
||||
%patch40
|
||||
ln -t ../sysvinit-%{SIVER}dsf/doc/showconsole README
|
||||
popd
|
||||
pushd ../startpar-%{START}
|
||||
%patch50
|
||||
@ -165,9 +171,6 @@ popd
|
||||
pushd ../powerd-%{PDVER}
|
||||
%ifnarch s390 s390x
|
||||
make install DESTDIR=${RPM_BUILD_ROOT}
|
||||
cp README README.powerd
|
||||
cp SUPPORTED SUPPORTED.powerd
|
||||
cp FAQ FAQ.powerd
|
||||
echo '# ' > ${RPM_BUILD_ROOT}/etc/powerd.conf
|
||||
echo '# /etc/powerd.conf for powerd version-2.02' >> ${RPM_BUILD_ROOT}/etc/powerd.conf
|
||||
echo '# ' >> ${RPM_BUILD_ROOT}/etc/powerd.conf
|
||||
@ -247,16 +250,13 @@ rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
%files tools
|
||||
%defattr (-,root,root,755)
|
||||
%doc COPYING COPYRIGHT doc/Propaganda
|
||||
%doc doc/Changelog doc/killproc doc/showconsole
|
||||
%ifnarch s390 s390x
|
||||
%config /etc/powerd.conf
|
||||
%config /etc/init.d/powerd
|
||||
%doc ../powerd-%{PDVER}/README.powerd
|
||||
%doc ../powerd-%{PDVER}/SUPPORTED.powerd
|
||||
%doc ../powerd-%{PDVER}/FAQ.powerd
|
||||
%doc ../powerd-%{PDVER}/powerd.conf.monitor
|
||||
%doc ../powerd-%{PDVER}/powerd.conf.peer
|
||||
%doc doc/powerd
|
||||
%endif
|
||||
# %doc contrib/bootlogd.README
|
||||
%dir /lib/mkinitrd
|
||||
%dir /lib/mkinitrd/scripts
|
||||
/lib/mkinitrd/scripts/boot-blogd.sh
|
||||
@ -269,8 +269,6 @@ rm -rf ${RPM_BUILD_ROOT}
|
||||
/usr/bin/last
|
||||
/usr/bin/lastb
|
||||
/usr/bin/utmpdump
|
||||
# /sbin/bootlogd
|
||||
# /sbin/intr
|
||||
/sbin/blogger
|
||||
/sbin/blogd
|
||||
/sbin/fstab-decode
|
||||
@ -301,7 +299,6 @@ rm -rf ${RPM_BUILD_ROOT}
|
||||
# /usr/lib/libblogger.a
|
||||
%doc %{_mandir}/man1/mountpoint.1.gz
|
||||
%doc %{_mandir}/man1/utmpdump.1.gz
|
||||
# %doc %{_mandir}/man8/bootlogd.8.gz
|
||||
%doc %{_mandir}/man8/blogger.8.gz
|
||||
%doc %{_mandir}/man8/blogd.8.gz
|
||||
%doc %{_mandir}/man8/fstab-decode.8.gz
|
||||
@ -310,7 +307,6 @@ rm -rf ${RPM_BUILD_ROOT}
|
||||
%doc %{_mandir}/man8/isserial.8.gz
|
||||
%doc %{_mandir}/man8/checkproc.8.gz
|
||||
%doc %{_mandir}/man8/pidofproc.8.gz
|
||||
#%doc %{_mandir}/man8/intr.8.gz
|
||||
%doc %{_mandir}/man8/killall5.8.gz
|
||||
%doc %{_mandir}/man8/killproc.8.gz
|
||||
%doc %{_mandir}/man8/pidof.8.gz
|
||||
@ -325,5 +321,12 @@ rm -rf ${RPM_BUILD_ROOT}
|
||||
%doc %{_mandir}/man8/rvmtab.8.gz
|
||||
%doc %{_mandir}/man8/vhangup.8.gz
|
||||
%doc %{_mandir}/man8/mkill.8.gz
|
||||
%if 0
|
||||
%doc contrib/bootlogd.README
|
||||
/sbin/bootlogd
|
||||
/sbin/intr
|
||||
%doc %{_mandir}/man8/bootlogd.8.gz
|
||||
%doc %{_mandir}/man8/intr.8.gz
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
Loading…
x
Reference in New Issue
Block a user