Compare commits

...

27 Commits

Author SHA1 Message Date
William Hubbs
6cd030e3f1 update changelog 2015-02-19 15:25:27 -06:00
William Hubbs
90ecf23310 checkpath: do not chown or chmod symbolic links
This is another security fix. If you use chown() or chmod() on a
symbolic link, it affects the referenced file, not the symbolic link
itself.

X-Gentoo-Bug: 540006
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=540006
2015-02-19 15:23:06 -06:00
William Hubbs
55a3746d80 increment version 2015-02-19 15:22:13 -06:00
William Hubbs
8f7351cf7f Update ChangeLog 2015-02-18 12:56:50 -06:00
William Hubbs
52220d5df1 ChangeLog: show authors and committers 2015-02-18 12:49:39 -06:00
William Hubbs
d5dfc6d529 local: fix redirections
The local service now redirects stdout and stderr for the scripts it
runs to /dev/null unless it is run in verbose mode.

X-Gentoo-Bug: 537444
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=537444
2015-02-18 10:41:27 -06:00
William Hubbs
7f33410e5d typo fix 2015-02-18 10:41:27 -06:00
William Hubbs
56993950f2 checkpath: security fix for -m and -o options
Do not change permissions on the target if it is a file and has multiple
hard links. This is necessary because a hard link can be an attack
vector to gain privilege escalation.

X-Gentoo-Bug: 540006
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=540006
2015-02-18 10:41:27 -06:00
William Hubbs
e3999c15ad bump version to 0.13.10 2015-02-18 10:37:38 -06:00
William Hubbs
4a9c450ec2 update change log 2015-02-04 22:03:26 -06:00
William Hubbs
bb4c14999c Add nfsclient to netmount use dependencies
X-Gentoo-Bug: 537996
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=537996
2015-02-04 21:59:50 -06:00
William Hubbs
252422dcf0 start openrc-0.13.9 2015-02-04 21:59:14 -06:00
William Hubbs
a3a64ac94e update ChangeLog 2015-01-18 09:45:32 -06:00
William Hubbs
1a2f45a4c5 tmpfiles.dev: pass --boot to tmpfiles.sh so kmod works properly 2015-01-18 09:32:49 -06:00
William Hubbs
34b55f31b3 start work on 0.13.8 2015-01-18 09:31:53 -06:00
William Hubbs
e0c746e938 Create ChangeLog 2015-01-15 09:51:12 -06:00
William Hubbs
50329eee7a Add description for cgroup_cleanup
X-Gentoo-Bug: 535184
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=535184
2015-01-13 01:07:02 -06:00
Doug Freed
fb81028121 fix double free of pidfile
This fixes a double free of the pidfile variable. For discussion of this
issue, see the bug.

X-Gentoo-Bug: 531600
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=531600
2015-01-13 01:07:02 -06:00
William Hubbs
50e99aa30a Do not call the shell to evaluate CHANGELOG_LIMIT
The git log command understands dates such as "1 year ago", so there is
no need to use the date command.
2015-01-13 01:07:02 -06:00
William Hubbs
b177b79242 Add target to create ChangeLog
This was added by request because some users are requesting a ChangeLog.

This fixes #29.
2015-01-13 01:07:02 -06:00
William Hubbs
7009f66872 start working on 0.13.7 2015-01-13 00:45:19 -06:00
William Hubbs
2eb0ea9afb Make sysfs behave like netmount and localmount
sysfs now mounts all related sysfs file systems and returns success,
like netmount and localmount.

Also, we now check to make sure the cgroups are not mounted before we
mount them.

X-Gentoo-Bug: 530138
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=530138
2014-11-23 21:59:01 -06:00
William Hubbs
534031fc7a Start work on 0.13.6 2014-11-23 21:57:44 -06:00
William Hubbs
6b85d4288c devfs: optionally add missing symbolic links
If symbolic links for /dev/{fd,stdin,stdout,stderr,core} do not exist
once /dev is mounted, we should create them.
2014-11-20 11:07:14 -06:00
William Hubbs
dec899b946 Start work on 0.13.5 2014-11-20 11:06:03 -06:00
William Hubbs
c9f6e2a6c8 netmount: unmount nfs file systems 2014-11-06 14:44:01 -06:00
William Hubbs
e1a4aef3e5 start work on 0.13.4 2014-11-06 14:43:02 -06:00
11 changed files with 1116 additions and 41 deletions

1064
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,3 @@
NAME= openrc
VERSION= 0.13.3
VERSION= 0.13.11
PKG= ${NAME}-${VERSION}

View File

@@ -69,7 +69,14 @@ seed_dev()
# so udev can add its start-message to dmesg
[ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
# Mount required stuff as user may not have then in /etc/fstab
# extra symbolic links not provided by default
[ -e /dev/fd ] || ln -snf /proc/self/fd /dev/fd
[ -e /dev/stdin ] || ln -snf /proc/self/fd/0 /dev/stdin
[ -e /dev/stdout ] || ln -snf /proc/self/fd/1 /dev/stdout
[ -e /dev/stderr ] || ln -snf /proc/self/fd/2 /dev/stderr
[ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
# Mount required directories as user may not have them in /etc/fstab
for x in \
"mqueue /dev/mqueue 1777 ,nodev mqueue" \
"devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \

View File

@@ -14,12 +14,13 @@ start()
{
ebegin "Starting local"
local file has_errors=0 retval
local file has_errors=0 redirect retval
yesno $rc_verbose || redirect='> /dev/null 2>&1'
eindent
for file in @SYSCONFDIR@/local.d/*.start; do
if [ -x "${file}" ]; then
vebegin "Executing \"${file}\""
"${file}" 2>&1 >/dev/null
"${file}" $redirect
retval=$?
if [ ${retval} -ne 0 ]; then
has_errors=1
@@ -52,12 +53,13 @@ stop()
{
ebegin "Stopping local"
local file has_errors=0 retval
local file has_errors=0 redirect retval
yesno $rc_verbose || redirect='> /dev/null 2>&1'
eindent
for file in @SYSCONFDIR@/local.d/*.stop; do
if [ -x "${file}" ]; then
vebegin "Executing \"${file}\""
"${file}" 2>&1 >/dev/null
"${file}" $redirect
retval=$?
if [ ${retval} -ne 0 ]; then
has_errors=1

View File

@@ -7,7 +7,7 @@ description="Mounts network shares according to /etc/fstab."
depend()
{
config /etc/fstab
use afc-client amd autofs openvpn
use afc-client amd nfsclient autofs openvpn
use dns
keyword -jail -prefix -vserver -lxc
}
@@ -47,14 +47,7 @@ stop()
eindent
fs=
for x in $net_fs_list $extra_net_fs_list; do
case "$x" in
nfs|nfs4)
continue
;;
*)
fs="$fs${fs:+|}$x"
;;
esac
fs="$fs${fs:+|}$x"
done
[ -n "$fs" ] && fs="^($fs)$"
do_unmount umount ${fs:+--fstype-regex} $fs --netdev

View File

@@ -113,7 +113,8 @@ mount_cgroups()
yesno ${rc_controller_cgroups:-YES} && [ -e /proc/cgroups ] || return 0
while read name hier groups enabled rest; do
case "${enabled}" in
1) mkdir /sys/fs/cgroup/${name}
1) mountinfo -q /sys/fs/cgroup/${name} && continue
mkdir /sys/fs/cgroup/${name}
mount -n -t cgroup -o ${sysfs_opts},${name} \
${name} /sys/fs/cgroup/${name}
;;
@@ -129,25 +130,13 @@ restorecon_sys()
restorecon -rF /sys/fs/cgroup >/dev/null 2>&1
eend $?
fi
return 0
}
start()
{
local retval
mount_sys
retval=$?
if [ $retval -eq 0 ]; then
mount_misc
retval=$?
fi
if [ $retval -eq 0 ]; then
mount_cgroups
retval=$?
fi
mount_misc
mount_cgroups
restorecon_sys
return $retval
return 0
}

View File

@@ -14,7 +14,7 @@ depend()
start()
{
ebegin "setting up tmpfiles.d entries for /dev"
@LIBEXECDIR@/sh/tmpfiles.sh --prefix=/dev --create ${tmpfiles_opts}
@LIBEXECDIR@/sh/tmpfiles.sh --prefix=/dev --create --boot ${tmpfiles_opts}
eend $?
return 0
}

View File

@@ -8,12 +8,17 @@ DISTFILE?= ${DISTPREFIX}.tar.bz2
CLEANFILES+= ${NAME}-*.tar.bz2
CHANGELOG_LIMIT?= --after="1 year ago"
_SNAP_SH= date -u +%Y%m%d%H%M
_SNAP:= $(shell ${_SNAP_SH})
SNAP= ${_SNAP}
SNAPDIR= ${DISTPREFIX}-${SNAP}
SNAPFILE= ${SNAPDIR}.tar.bz2
changelog:
git log ${CHANGELOG_LIMIT} --format=full > ChangeLog
dist:
git archive --prefix=${DISTPREFIX}/ ${GITREF} | bzip2 > ${DISTFILE}

View File

@@ -2,6 +2,7 @@
# Copyright (c) 2012 Alexander Vershilov <qnikst@gentoo.org>
# Released under the 2-clause BSD license.
extra_stopped_commands="${extra_stopped_commands} cgroup_cleanup"
description_cgroup_cleanup="Kill all processes in the cgroup"
cgroup_find_path()
{

View File

@@ -560,22 +560,20 @@ rc_service_daemons_crashed(const char *service)
spidfile = xmalloc(strlen(ch_root) + strlen(pidfile) + 1);
strcpy(spidfile, ch_root);
strcat(spidfile, pidfile);
free(pidfile);
pidfile = spidfile;
}
pid = 0;
if (spidfile) {
if (pidfile) {
retval = true;
if ((fp = fopen(spidfile, "r"))) {
if ((fp = fopen(pidfile, "r"))) {
if (fscanf(fp, "%d", &pid) == 1)
retval = false;
fclose(fp);
}
free(spidfile);
spidfile = NULL;
if (ch_root) {
free(pidfile);
pidfile = NULL;
}
free(pidfile);
pidfile = NULL;
/* We have the pid, so no need to match
on exec or name */

View File

@@ -68,7 +68,7 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
int u;
memset(&st, 0, sizeof(st));
if (stat(path, &st) || trunc) {
if (lstat(path, &st) || trunc) {
if (type == inode_file) {
einfo("%s: creating file", path);
if (!mode) /* 664 */
@@ -133,6 +133,14 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
}
if (mode && (st.st_mode & 0777) != mode) {
if ((type != inode_dir) && (st.st_nlink > 1)) {
eerror("%s: chmod: %s %s", applet, "Too many hard links to", path);
return -1;
}
if (S_ISLNK(st.st_mode)) {
eerror("%s: chmod: %s %s", applet, path, " is a symbolic link");
return -1;
}
einfo("%s: correcting mode", path);
if (chmod(path, mode)) {
eerror("%s: chmod: %s", applet, strerror(errno));
@@ -141,6 +149,14 @@ static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode,
}
if (chowner && (st.st_uid != uid || st.st_gid != gid)) {
if ((type != inode_dir) && (st.st_nlink > 1)) {
eerror("%s: chown: %s %s", applet, "Too many hard links to", path);
return -1;
}
if (S_ISLNK(st.st_mode)) {
eerror("%s: chown: %s %s", applet, path, " is a symbolic link");
return -1;
}
einfo("%s: correcting owner", path);
if (chown(path, uid, gid)) {
eerror("%s: chown: %s", applet, strerror(errno));