Commit Graph

2678 Commits

Author SHA1 Message Date
William Hubbs
d38cc8f221 checkpath: fix warning about selinux_on being unused 2015-03-24 23:18:15 -05:00
Doug Freed
f085ae400c Fix some compiler warnings
librc: Fix C90 warning (mixed declaration and code)
rc: Fix warning about discarding const qualifier

Fixes #45.
2015-03-24 19:08:29 -05:00
Will Miles
c1faafcad8 start-stop-daemon: Fix regression for --test
The previous fix to --test (PR #34) prevented reading one too many
arguments when --exec -or --name was not specified, but created a
regression where the last argument would not print if either of those
arguments was specified. This corrects the issue.

Fixes #41.
2015-03-24 15:52:19 -05:00
William Hubbs
de93587aff Silence warning about _DEFAULT_SOURCE for Linux/glibc
In >=glibc-2.20, the _BSD_SOURCE macro is deprecated in favor of
_DEFAULT_SOURCE. This adds -D_DEFAULT_SOURCE to CPPFLAGS on Linux.

Fixes #44
2015-03-24 17:46:30 +00:00
Anthony Donnelly
be497229b6 Fix savecore service on FreeBSD
savecore -C only needs the dumpdevice otherwise it causes an error on startup.

This fixes #40.
2015-03-23 14:06:52 -05:00
William Hubbs
e16b7183e9 mk/os-GNU.mk: fix typo
MAX_PATH should have been PATH_MAX
2015-03-21 22:49:56 -05:00
Will Miles
ccd83a5e9c savecache: Make sure cache directory exists before running checkpath
checkpath -W can fail if the specified path doesn't actually exist yet.
In this case savecache script should attempt to create the path if it is
missing, however it is pre-empted by the checkpath call.  This patch adds
an explicit existence test before executing checkpath.

This fixes #36.
2015-03-20 17:21:57 -05:00
Robin H. Johnson
7bbb73574b bootmisc: clean_run safety improvements.
If /tmp or / are read-only, the clean_run function can fail in some very
bad ways.

1. dir=$(mktemp -d) returns an EMPTY string on error.
2. "mount -o bind / $dir", and don't check the result of that,
3. "rm -rf $dir/run/*", which removes the REAL /run contents
4. box gets very weird from this point forward

Signed-Off-By: Robin H. Johnson <robbat2@gentoo.org>
Signed-Off-By: Chip Parker <infowolfe@gmail.com>
Reported-by: Chip Parker <infowolfe@gmail.com>
Tested-by: Chip Parker <infowolfe@gmail.com>
2015-02-27 10:14:44 -06:00
William Hubbs
a0378f3871 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 14:39:04 -06:00
William Hubbs
423f82bae9 ChangeLog: show authors and committers 2015-02-18 12:47:19 -06:00
William Hubbs
9dfb85d5d2 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 09:58:54 -06:00
William Hubbs
6781667641 typo fix 2015-02-15 16:15:18 -06:00
William Hubbs
b17af3c85f 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-15 16:04:43 -06:00
William Hubbs
3100114bc1 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-03 10:54:57 -06:00
Will Miles
3f80f22e22 Prioritize local includes and libraries
This fixes #35.
2015-01-24 13:48:53 -06:00
Consus
8250ac94df tmpfiles.*: Follow OpenRC's message style
Just to be consistent.
2015-01-24 13:36:48 -06:00
William Hubbs
fbdd669ba7 Makefile: add variable for path to source tree
Add a new variable, ${TOP}, to the top level makefile, which points to
the path of the source tree.
2015-01-23 12:52:31 -06:00
Will Miles
cddb4aad08 Fix off-by-one error in --test argument printout in start-stop-daemon.
Fixes #34.
2015-01-22 12:53:41 -06:00
William Hubbs
3c5dc0ec77 tmpfiles.dev: pass --boot to tmpfiles.sh so kmod works properly 2015-01-18 09:13:43 -06:00
William Hubbs
7e3a33c8f5 Add description for cgroup_cleanup
X-Gentoo-Bug: 535184
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=535184
2015-01-12 14:45:06 -06:00
Doug Freed
74478830a8 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-12 10:30:36 -06:00
William Hubbs
6a9679377f 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.
2014-12-08 09:47:42 -06:00
William Hubbs
72186ea3bb etc/rc and etc/rc.shutdown: change references from rc to openrc 2014-12-07 19:07:11 -06:00
William Hubbs
3647db7a27 Add target to create ChangeLog
This was added by request because some users are requesting a ChangeLog.

This fixes #29.
2014-12-07 17:16:48 -06:00
William Hubbs
7a92eb8887 rename git.mk to gitver.mk
This is a more descriptive name since this file only sets the gitver
variable.
2014-12-05 11:55:45 -06:00
William Hubbs
30cc3cdb76 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:39:20 -06:00
S. Gilles
dff6e4a004 Fix mdoc warning for empty line in rc-update man page.
X-Gentoo-Bug: 529374
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=529374
2014-11-22 11:49:46 -06:00
William Hubbs
3fad31a994 init.d: add osclock to ignore patterns 2014-11-20 11:25:48 -06:00
William Hubbs
8d0ca13fbd 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 10:55:53 -06:00
William Hubbs
93ba67eff9 netmount: unmount nfs file systems 2014-11-06 14:38:17 -06:00
Jason Zaman
1932360adc Integrate the functionality from runscript_selinux.so
runscript used to dlopen() runscript_selinux.so. This adds equivalent
functionality directly in to runscript instead. It authenticates with
either PAM or shadow and optionally has a dep on audit.

X-Gentoo-Bug: 517450
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=517450
2014-11-03 09:31:25 -06:00
Alexander Vershilov
be952bebb3 Fix incorrect handling of chroot option.
Fixes #28.

X-Gentoo-Bug: #527370
X-Gentoo-Bug-Url: https://bugs.gentoo.org/show_bug.cgi?id=527370
2014-11-01 16:44:30 -05:00
Ralph Sennhauser
0bfde472d0 Add osclock service
This scripts sole purpose is to "provide clock" on OSs that already
take care of the clock being properly set.
2014-10-27 18:13:22 -05:00
Johan Bergström
ba0a11fc94 Pass ncurses cflags to build
Fixes #25
Note from William Hubbs:
The original patch overwrote CFLAGS. I modified this patch to add the
ncurses cflags to CPPFLAGS instead of overwriting CFLAGS.
2014-10-26 13:04:20 -05:00
William Hubbs
7700e6fe79 Fix compile errors created by bundling queue.h 2014-10-24 10:44:14 -05:00
Anthony G. Basile
6ca79042b9 helpers.h, start-stop-daemon.c: remove uneeded macros
TAILQ_CONCAT, TAILQ_FOREACH_SAFE and LIST_FOREACH_SAFE are defined
in our bundled queue.h and are no longer required.
2014-10-23 19:14:06 -05:00
Anthony G. Basile
1e0a4bebde Bundle <sys/queue.h> from NetBSD
We are bundling this to allow building on musl-based systems since musl
does not include <sys/queue.h>.
2014-10-23 19:14:06 -05:00
William Hubbs
ca6b86be44 Fix all tests for GNU/kFreeBSD
It is necessary to check for both the kernel and c library because
__FreeBSD_kernel is also defined on native FreeBSD [1].

[1] http://sourceforge.net/p/predef/wiki/OperatingSystems/
2014-10-23 18:47:24 -05:00
Gabriele Giacone
4ac289b539 Fix rc_svcdir for GNU/Hurd 2014-10-23 13:05:08 -05:00
Svante Signell
875f03e27c fix defines for GNU/Hurd 2014-10-23 13:00:24 -05:00
Svante Signell
203b754f84 add missing files for GNU/Hurd 2014-10-23 13:00:24 -05:00
Gabriele Giacone
89c8a62a10 Fix rc_svcdir for GNU/kFreeBSD 2014-10-22 13:27:37 -05:00
Gabriele Giacone
d8e1d9a6ed Add missing files for GNU/kFreeBSD 2014-10-22 11:09:58 -05:00
Svante Signell
3f82edbeb9 Fix GNU/kFreeBSD port
Check for __FreeBSD_kernel instead of __GLIBC__ in source files.

note from William Hubbs:
I was told this is a better check for GNU/kFreeBSD than checking the
C  library the source is being compiled against.
GNU/kFreeBSD than checking which library we are using.
2014-10-22 11:05:07 -05:00
Anthony G. Basile
86e9aa0d36 einfo.h, rc.h.in: simplify __BEGIN_DECLS logic
There is no need to redefine __BEGIN_DECLS and __END_DECLS.
We simplify the logic here and avoid undefining these macros.
2014-10-22 07:46:49 -04:00
Anthony G. Basile
4a08517cac einfo.h, rc.h.in: ensure __BEGIN_DECLS is defined
Some Standard C Libraries, like musl, don't define __BEGIN_DECLS
or __END_DECLS.  We add some ifdef magic to ensure these are
available.
2014-10-21 09:39:34 -04:00
William Hubbs
9bf789f788 Update news file wrt chroot variable 2014-10-20 15:52:11 -05:00
Alexander Vershilov
f9acd65497 librc:look for the pid file in a chroot if defined
X-Gentoo-Bug: 524388
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=524388
2014-10-20 15:44:19 -05:00
William Hubbs
8c7ea4e9e8 runscript.sh: add chroot support
This adds support for a chroot variable which will be passed to the
start-stop-daemon --chroot switch to runscript.sh when starting a
daemon. This also needs to be saved so it can be used in locating the
pid file when stopping the daemon.

X-Gentoo-Bug: 524388
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=524388
2014-10-20 15:44:19 -05:00
William Hubbs
5f1439f1aa Add NEWS file 2014-10-20 15:38:51 -05:00