We should check we resolved a service before stating it's existance.
This commit is contained in:
		| @@ -283,6 +283,7 @@ static char **get_provided (const rc_depinfo_t *deptree, | ||||
|  | ||||
| 	if (! deptree || ! depinfo) | ||||
| 		return (NULL); | ||||
| 	 | ||||
| 	if (rc_service_exists (depinfo->service)) | ||||
| 		return (NULL); | ||||
|  | ||||
|   | ||||
| @@ -289,7 +289,9 @@ bool rc_service_exists (const char *service) | ||||
| 		service[len - 1] == 'h') | ||||
| 		return (false); | ||||
|  | ||||
| 	file = rc_service_resolve (service); | ||||
| 	if (! (file = rc_service_resolve (service))) | ||||
| 		return (false); | ||||
|  | ||||
| 	if (stat (file, &buf) == 0 && buf.st_mode & S_IXUGO) | ||||
| 		retval = true; | ||||
| 	free (file); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user