Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 118905
Collapse All | Expand All

(-)crontab.c.orig (-1 / +6 lines)
Lines 121-126 Link Here
121
static void
121
static void
122
parse_args(int argc, char *argv[]) {
122
parse_args(int argc, char *argv[]) {
123
	int argch;
123
	int argch;
124
	char resolved_path[PATH_MAX];
124
125
125
	if (!(pw = getpwuid(getuid()))) {
126
	if (!(pw = getpwuid(getuid()))) {
126
		fprintf(stderr, "%s: your UID isn't in the passwd file.\n",
127
		fprintf(stderr, "%s: your UID isn't in the passwd file.\n",
Lines 202-208 Link Here
202
		 */
203
		 */
203
		if (!strcmp(Filename, "-"))
204
		if (!strcmp(Filename, "-"))
204
			NewCrontab = stdin;
205
			NewCrontab = stdin;
205
		else {
206
		else if (realpath(Filename, resolved_path) != NULL &&
207
		    !strcmp(resolved_path, SYSCRONTAB)) {
208
			fprintf(stderr, SYSCRONTAB " must be edited manually\n");
209
			exit(ERROR_EXIT);
210
		} else {
206
			/* relinquish the setuid status of the binary during
211
			/* relinquish the setuid status of the binary during
207
			 * the open, lest nonroot users read files they should
212
			 * the open, lest nonroot users read files they should
208
			 * not be able to read.  we can't use access() here
213
			 * not be able to read.  we can't use access() here

Return to bug 118905