Compare commits
	
		
			9 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | ee8c0c1cc1 | ||
|   | f61e44d110 | ||
|   | 55ceac775c | ||
|   | 7b07c55c86 | ||
|   | 793673df3c | ||
|   | 6219d87071 | ||
|   | 72b5c74290 | ||
|   | aad77d0267 | ||
|   | 99565e359f | 
							
								
								
									
										191
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										191
									
								
								ChangeLog
									
									
									
									
									
								
							| @@ -1,3 +1,66 @@ | |||||||
|  | commit 55ceac775c388191090fe37aef489d721ee9299d | ||||||
|  | Author: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  | Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  |  | ||||||
|  |     checkpath: fix code to walk the directory path | ||||||
|  |      | ||||||
|  |     X-Gentoo-Bug: 782808 | ||||||
|  |     X-Gentoo-Bug-URL: https://bugs.gentoo.org/782808 | ||||||
|  |  | ||||||
|  | commit 7b07c55c86cf356a832fe2975c9f8e164bcb2b7b | ||||||
|  | Author: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  | Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  |  | ||||||
|  |     version 0.43.2 | ||||||
|  |  | ||||||
|  | commit 793673df3ca3ad8692e135bd5c77b21bae3ebbe2 | ||||||
|  | Author: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  | Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  |  | ||||||
|  |     update ChangeLog | ||||||
|  |  | ||||||
|  | commit 6219d87071d07acf4d6b3e99ec58134acf129d8e | ||||||
|  | Author: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  | Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  |  | ||||||
|  |     checkpath: remove extra slashes from paths | ||||||
|  |      | ||||||
|  |     This fixes #418. | ||||||
|  |  | ||||||
|  | commit 72b5c7429011e0d20c450fe06dc4b645e36eecb0 | ||||||
|  | Author: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  | Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  |  | ||||||
|  |     version 0.43.1 | ||||||
|  |  | ||||||
|  | commit aad77d0267426edef6a568e26c9bae11c2367db4 | ||||||
|  | Author: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  | Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  |  | ||||||
|  |     update ChangeLog | ||||||
|  |  | ||||||
|  | commit 99565e359f3081e053573d10756e1a756c56342b | ||||||
|  | Author: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  | Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  |  | ||||||
|  |     cgroup2_set_limits: fix harmless error message | ||||||
|  |      | ||||||
|  |     In legacy cgroups mode, we were running `mountinfo -q ""` which was | ||||||
|  |     generating an error message. If we return immediately when | ||||||
|  |     cgroup2_find_path returns an empty value, we avoid this message. | ||||||
|  |  | ||||||
|  | commit ee05403c501b5f0c0a955b1f8d67b2d88f0ede7a | ||||||
|  | Author: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  | Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  |  | ||||||
|  |     version 0.43 | ||||||
|  |  | ||||||
|  | commit c1558abb0f1e0fe2d1a2c42a536de335a1cd8de9 | ||||||
|  | Author: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  | Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||||
|  |  | ||||||
|  |     update ChangeLog | ||||||
|  |  | ||||||
| commit 901b752463eb37784fcebe5a3b5648b4bfbd9371 | commit 901b752463eb37784fcebe5a3b5648b4bfbd9371 | ||||||
| Author: William Hubbs <w.d.hubbs@gmail.com> | Author: William Hubbs <w.d.hubbs@gmail.com> | ||||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> | Commit: William Hubbs <w.d.hubbs@gmail.com> | ||||||
| @@ -409,131 +472,3 @@ Commit: Manuel Rüger <manuel@rueg.eu> | |||||||
|     .cirrus.yml: Update FreeBSD releases |     .cirrus.yml: Update FreeBSD releases | ||||||
|      |      | ||||||
|     Signed-off-by: Manuel Rüger <manuel@rueg.eu> |     Signed-off-by: Manuel Rüger <manuel@rueg.eu> | ||||||
|  |  | ||||||
| commit 229692cc3424e95d8185e6c681b76c0dc88899f9 |  | ||||||
| Author: Austin English <austinenglish@gmail.com> |  | ||||||
| Commit: Mike Frysinger <vapier@gmail.com> |  | ||||||
|  |  | ||||||
|     man/openrc-run.8: fix a typo |  | ||||||
|  |  | ||||||
| commit 375ef42393f3dc6edbaa2cb70c79b2366072db38 |  | ||||||
| Author: Sergei Trofimovich <slyfox@gentoo.org> |  | ||||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> |  | ||||||
|  |  | ||||||
|     src/rc/rc-logger.h: fix build failure against gcc-10 |  | ||||||
|      |  | ||||||
|     On gcc-10 (and gcc-9 -fno-common) build fails as: |  | ||||||
|      |  | ||||||
|     ``` |  | ||||||
|     cc  -L../librc -L../libeinfo -O2 -g -std=c99 -Wall -Wextra -Wimplicit -Wshadow \ |  | ||||||
|       -Wformat=2 -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn \ |  | ||||||
|       -Wmissing-format-attribute -Wnested-externs -Winline -Wwrite-strings \ |  | ||||||
|       -Wcast-align -Wcast-qual -Wpointer-arith -Wdeclaration-after-statement \ |  | ||||||
|       -Wsequence-point -Werror=implicit-function-declaration    \ |  | ||||||
|       -Wl,-rpath=/lib   -o openrc rc.o rc-logger.o rc-misc.o rc-plugin.o _usage.o -lutil -lrc -leinfo -Wl,-Bdynamic -ldl |  | ||||||
|     ld: rc-logger.o:/home/slyfox/dev/git/openrc/src/rc/rc-logger.h:16: |  | ||||||
|       multiple definition of `rc_logger_pid'; rc.o:openrc/src/rc/rc-logger.h:16: first defined here |  | ||||||
|     ld: rc-logger.o:/home/slyfox/dev/git/openrc/src/rc/rc-logger.h:17: |  | ||||||
|       multiple definition of `rc_logger_tty'; rc.o:openrc/src/rc/rc-logger.h:17: first defined here |  | ||||||
|     ``` |  | ||||||
|      |  | ||||||
|     gcc-10 will change the default from -fcommon to fno-common: |  | ||||||
|     https://gcc.gnu.org/PR85678. |  | ||||||
|      |  | ||||||
|     The error also happens if CFLAGS=-fno-common passed explicitly. |  | ||||||
|      |  | ||||||
|     This fixes #348. |  | ||||||
|  |  | ||||||
| commit 6deda13754f1b60245945e953cce8d97e40e86fc |  | ||||||
| Author: Wolf <wolf@wolfsden.cz> |  | ||||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> |  | ||||||
|  |  | ||||||
|     supervise-daemon: Fix segfault when executable does not exist |  | ||||||
|      |  | ||||||
|     When executable is provided just by name (and therefore searched in a |  | ||||||
|     path), exec_file is reset to NULL every time. exists() handles it being |  | ||||||
|     NULL just fine, but dereferencing it in eerror does not work. |  | ||||||
|      |  | ||||||
|     Fixes #326 |  | ||||||
|     Fixes #327 |  | ||||||
|  |  | ||||||
| commit eb610859519292c6164c4ba601d22e642c306beb |  | ||||||
| Author: artoo <artoo@artixlinux.org> |  | ||||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> |  | ||||||
|  |  | ||||||
|     binfmt: ensure a file is ungegistered before registering |  | ||||||
|      |  | ||||||
|     This fixes #328 |  | ||||||
|  |  | ||||||
| commit 039845b742e40752b05ef9393d5a6959d55fe0b6 |  | ||||||
| Author: Andrew Scheller <github@loowis.durge.org> |  | ||||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> |  | ||||||
|  |  | ||||||
|     Fix typo in README |  | ||||||
|      |  | ||||||
|     This fixes #338 |  | ||||||
|  |  | ||||||
| commit a7e7fd2b37a7666f26c2d4de9386b2d04f583b41 |  | ||||||
| Author: Ethan Sommer <e5ten.arch@gmail.com> |  | ||||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> |  | ||||||
|  |  | ||||||
|     make grep usage POSIX compliant |  | ||||||
|      |  | ||||||
|     use grep -E instead of egrep |  | ||||||
|     check for space or end of line instead of GNU-specific word boundary |  | ||||||
|      |  | ||||||
|     This fixes #345 |  | ||||||
|  |  | ||||||
| commit 12e147a107c6e27172734c660624343a3c092437 |  | ||||||
| Author: Jason Bowen <jbowen@infinitecactus.com> |  | ||||||
| Commit: William Hubbs <w.d.hubbs@gmail.com> |  | ||||||
|  |  | ||||||
|     Delete stray text. |  | ||||||
|      |  | ||||||
|     It looks like some stray text was left at the bottom of the file: |  | ||||||
|     ``` |  | ||||||
|     package. |  | ||||||
|     migrating your system to openrc-init. |  | ||||||
|     ``` |  | ||||||
|     There's a subsection on migrating a system to `openrc-ini`; perhaps this was |  | ||||||
|     an embryonic section title? |  | ||||||
|      |  | ||||||
|     This fixes #347. |  | ||||||
|  |  | ||||||
| commit fd852865e06a74ecf8b77ff534fa8053e020160f |  | ||||||
| Author: William Hubbs <william.hubbs@sony.com> |  | ||||||
| Commit: William Hubbs <william.hubbs@sony.com> |  | ||||||
|  |  | ||||||
|     openrc-shutdown.c: typo fix |  | ||||||
|  |  | ||||||
| commit 35ec935741ffb571cacf763dcca98661c0cfb296 |  | ||||||
| Author: William Hubbs <w.d.hubbs@gmail.com> |  | ||||||
| Commit: William Hubbs <william.hubbs@sony.com> |  | ||||||
|  |  | ||||||
|     ci/travis.sh: run shellcheck on shell scripts |  | ||||||
|  |  | ||||||
| commit 19cfd82dadf2e52299cf3752deb04562be52145c |  | ||||||
| Author: Austin English <austinenglish@gmail.com> |  | ||||||
| Commit: William Hubbs <william.hubbs@sony.com> |  | ||||||
|  |  | ||||||
|     .travis.yml: install shellcheck |  | ||||||
|  |  | ||||||
| commit 87cfad3d6cd619c6090e8209092448ae68279b0c |  | ||||||
| Author: E5ten <ethancsommer@gmail.com> |  | ||||||
| Commit: William Hubbs <william.hubbs@sony.com> |  | ||||||
|  |  | ||||||
|     cgroup2_set_limits: verify that the cgroup2 path is a mount point |  | ||||||
|      |  | ||||||
|     prior to cgroups getting mounted, /sys/fs/cgroup will still exist, |  | ||||||
|     but attempts to make directories in it will fail, change cgroup2_set_limits() to |  | ||||||
|     verify that cgroups are mounted instead of just checking that /sys/fs/cgroup |  | ||||||
|     exists. |  | ||||||
|      |  | ||||||
|     This fixes #307. |  | ||||||
|     This fixes #321. |  | ||||||
|  |  | ||||||
| commit 8e31614c4b6679fc1bc1f1d1e0779dcedd066a5a |  | ||||||
| Author: William Hubbs <william.hubbs@sony.com> |  | ||||||
| Commit: William Hubbs <william.hubbs@sony.com> |  | ||||||
|  |  | ||||||
|     fix clang build |  | ||||||
|   | |||||||
| @@ -1,3 +1,3 @@ | |||||||
| NAME=		openrc | NAME=		openrc | ||||||
| VERSION=	0.43 | VERSION=	0.43.3 | ||||||
| PKG=		${NAME}-${VERSION} | PKG=		${NAME}-${VERSION} | ||||||
|   | |||||||
| @@ -189,6 +189,7 @@ cgroup2_set_limits() | |||||||
| { | { | ||||||
| 	local cgroup_path | 	local cgroup_path | ||||||
| 	cgroup_path="$(cgroup2_find_path)" | 	cgroup_path="$(cgroup2_find_path)" | ||||||
|  | 	[ -z "${cgroup_path}" ] && return 0 | ||||||
| 	mountinfo -q "${cgroup_path}"|| return 0 | 	mountinfo -q "${cgroup_path}"|| return 0 | ||||||
| 	rc_cgroup_path="${cgroup_path}/${RC_SVCNAME}" | 	rc_cgroup_path="${cgroup_path}/${RC_SVCNAME}" | ||||||
| 	[ ! -d "${rc_cgroup_path}" ] && mkdir "${rc_cgroup_path}" | 	[ ! -d "${rc_cgroup_path}" ] && mkdir "${rc_cgroup_path}" | ||||||
|   | |||||||
| @@ -92,13 +92,13 @@ static int get_dirfd(char *path, bool symlinks) { | |||||||
| 	if (dirfd == -1) | 	if (dirfd == -1) | ||||||
| 		eerrorx("%s: unable to open the root directory: %s", | 		eerrorx("%s: unable to open the root directory: %s", | ||||||
| 				applet, strerror(errno)); | 				applet, strerror(errno)); | ||||||
| 	path_dupe = xstrdup(path); | 	ch = path; | ||||||
| 	ch = path_dupe; |  | ||||||
| 	while (*ch) { | 	while (*ch) { | ||||||
| 		if (*ch == '/') | 		if (*ch == '/') | ||||||
| 			components++; | 			components++; | ||||||
| 		ch++; | 		ch++; | ||||||
| 	} | 	} | ||||||
|  | 	path_dupe = xstrdup(path); | ||||||
| 	item = strtok(path_dupe, "/"); | 	item = strtok(path_dupe, "/"); | ||||||
| #ifdef O_PATH | #ifdef O_PATH | ||||||
| 	flags |= O_PATH; | 	flags |= O_PATH; | ||||||
| @@ -131,6 +131,7 @@ static int get_dirfd(char *path, bool symlinks) { | |||||||
| 			 */ | 			 */ | ||||||
| 			close(new_dirfd); | 			close(new_dirfd); | ||||||
| 		} else { | 		} else { | ||||||
|  | 			/* now walk down the directory path */ | ||||||
| 			close(dirfd); | 			close(dirfd); | ||||||
| 			dirfd = new_dirfd; | 			dirfd = new_dirfd; | ||||||
| 			free(linkpath); | 			free(linkpath); | ||||||
| @@ -140,13 +141,39 @@ static int get_dirfd(char *path, bool symlinks) { | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 	free(path_dupe); | 	free(path_dupe); | ||||||
| 	if (linkpath) { |  | ||||||
| 	free(linkpath); | 	free(linkpath); | ||||||
| 		linkpath = NULL; |  | ||||||
| 	} |  | ||||||
| 	return dirfd; | 	return dirfd; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | static char *clean_path(char *path) | ||||||
|  | { | ||||||
|  | 	char *ch; | ||||||
|  | 	char *ch2; | ||||||
|  | 	char *str; | ||||||
|  | 	str = xmalloc(strlen(path)); | ||||||
|  | 	ch = path; | ||||||
|  | 	ch2 = str; | ||||||
|  | 	while (true) { | ||||||
|  | 		*ch2 = *ch; | ||||||
|  | 		ch++; | ||||||
|  | 		ch2++; | ||||||
|  | 		if (!*(ch-1)) | ||||||
|  | 			break; | ||||||
|  | 		while (*(ch - 1) == '/' && *ch == '/') | ||||||
|  | 			ch++; | ||||||
|  | 	} | ||||||
|  | 	/* get rid of trailing / characters */ | ||||||
|  | 	while ((ch = strrchr(str, '/'))) { | ||||||
|  | 		if (ch == str) | ||||||
|  | 			break; | ||||||
|  | 		if (!*(ch+1)) | ||||||
|  | 			*ch = 0; | ||||||
|  | 		else | ||||||
|  | 			break; | ||||||
|  | 	} | ||||||
|  | 	return str; | ||||||
|  | } | ||||||
|  |  | ||||||
| static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode, | static int do_check(char *path, uid_t uid, gid_t gid, mode_t mode, | ||||||
| 	inode_t type, bool trunc, bool chowner, bool symlinks, bool selinux_on) | 	inode_t type, bool trunc, bool chowner, bool symlinks, bool selinux_on) | ||||||
| { | { | ||||||
| @@ -344,6 +371,7 @@ int main(int argc, char **argv) | |||||||
| 	bool symlinks = false; | 	bool symlinks = false; | ||||||
| 	bool writable = false; | 	bool writable = false; | ||||||
| 	bool selinux_on = false; | 	bool selinux_on = false; | ||||||
|  | 	char *path = NULL; | ||||||
|  |  | ||||||
| 	applet = basename_c(argv[0]); | 	applet = basename_c(argv[0]); | ||||||
| 	while ((opt = getopt_long(argc, argv, getoptstring, | 	while ((opt = getopt_long(argc, argv, getoptstring, | ||||||
| @@ -406,12 +434,14 @@ int main(int argc, char **argv) | |||||||
| 		selinux_on = true; | 		selinux_on = true; | ||||||
|  |  | ||||||
| 	while (optind < argc) { | 	while (optind < argc) { | ||||||
|  | 		path = clean_path(argv[optind]); | ||||||
| 		if (writable) | 		if (writable) | ||||||
| 			exit(!is_writable(argv[optind])); | 			exit(!is_writable(path)); | ||||||
| 		if (do_check(argv[optind], uid, gid, mode, type, trunc, chowner, | 		if (do_check(path, uid, gid, mode, type, trunc, chowner, | ||||||
| 					symlinks, selinux_on)) | 					symlinks, selinux_on)) | ||||||
| 			retval = EXIT_FAILURE; | 			retval = EXIT_FAILURE; | ||||||
| 		optind++; | 		optind++; | ||||||
|  | 		free(path); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	if (selinux_on) | 	if (selinux_on) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user