Remove rc_service_plugable function and make it private as it needs to read from our config file.
This commit is contained in:
@@ -833,42 +833,3 @@ char **rc_services_scheduled (const char *service)
|
||||
return (list);
|
||||
}
|
||||
librc_hidden_def(rc_services_scheduled)
|
||||
|
||||
bool rc_service_plugable (const char *service)
|
||||
{
|
||||
char *list;
|
||||
char *p;
|
||||
char *star;
|
||||
char *token;
|
||||
bool allow = true;
|
||||
char *match = getenv ("RC_PLUG_SERVICES");
|
||||
if (! match)
|
||||
return true;
|
||||
|
||||
list = xstrdup (match);
|
||||
p = list;
|
||||
while ((token = strsep (&p, " "))) {
|
||||
bool truefalse = true;
|
||||
if (token[0] == '!') {
|
||||
truefalse = false;
|
||||
token++;
|
||||
}
|
||||
|
||||
star = strchr (token, '*');
|
||||
if (star) {
|
||||
if (strncmp (service, token, star - token) == 0) {
|
||||
allow = truefalse;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (strcmp (service, token) == 0) {
|
||||
allow = truefalse;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free (list);
|
||||
return (allow);
|
||||
}
|
||||
librc_hidden_def(rc_service_plugable)
|
||||
|
||||
@@ -99,7 +99,6 @@ librc_hidden_proto(rc_service_exists)
|
||||
librc_hidden_proto(rc_service_extra_commands)
|
||||
librc_hidden_proto(rc_service_in_runlevel)
|
||||
librc_hidden_proto(rc_service_mark)
|
||||
librc_hidden_proto(rc_service_plugable)
|
||||
librc_hidden_proto(rc_service_resolve)
|
||||
librc_hidden_proto(rc_service_schedule_clear)
|
||||
librc_hidden_proto(rc_service_schedule_start)
|
||||
|
||||
@@ -148,11 +148,6 @@ bool rc_service_mark (const char *service, rc_service_state_t state);
|
||||
* @return NULL terminated string list of commands */
|
||||
char **rc_service_extra_commands (const char *service);
|
||||
|
||||
/*! Check if the service is allowed to be hot/cold plugged
|
||||
* @param service to check
|
||||
* @return true if allowed, otherwise false */
|
||||
bool rc_service_plugable (const char *service);
|
||||
|
||||
/*! Resolves a service name to its full path.
|
||||
* @param service to check
|
||||
* @return pointer to full path of service */
|
||||
|
||||
@@ -28,7 +28,6 @@ global:
|
||||
rc_service_in_runlevel;
|
||||
rc_service_mark;
|
||||
rc_service_options;
|
||||
rc_service_plugable;
|
||||
rc_service_resolve;
|
||||
rc_service_schedule_clear;
|
||||
rc_service_schedule_start;
|
||||
|
||||
Reference in New Issue
Block a user