{ "bind", NULL, "Domain Name Service", NULL },
{ "httpd", NULL, "HTTP Server", NULL },
{ "apache", NULL, "HTTP Server", "Provides s highly scalable and flexible web server "
- "capable of implementing various protocols incluing "
+ "capable of implementing various protocols including "
"but not limited to HTTP" },
{ "autofs", NULL, "Automounter", NULL },
{ "squid", NULL, "Web Cache Proxy ", NULL },
struct rcinit_file_information *info = NULL;
char *filepath = NULL;
char str[1024];
- XFILE *f = NULL;
+ FILE *f = NULL;
char *p = NULL;
info = talloc_zero(mem_ctx, struct rcinit_file_information);
if (filepath == NULL) {
return false;
}
- f = x_fopen( filepath, O_RDONLY, 0 );
+ f = fopen( filepath, "r" );
if (f == NULL) {
DEBUG(0,("read_init_file: failed to open [%s]\n", filepath));
return false;
}
- while ((x_fgets(str, sizeof(str) - 1, f)) != NULL) {
+ while ((fgets(str, sizeof(str) - 1, f)) != NULL) {
/* ignore everything that is not a full line
comment starting with a '#' */
p = strstr(str, "Description:");
if (p != NULL) {
char *desc;
+ size_t len = strlen(p);
- p += strlen( "Description:" ) + 1;
- if (p == NULL) {
+ if (len <= 12) {
break;
}
- desc = svcctl_cleanup_string(mem_ctx, p);
+ desc = svcctl_cleanup_string(mem_ctx, p + 12);
if (desc != NULL) {
info->description = talloc_strdup(info, desc);
}
}
}
- x_fclose(f);
+ fclose(f);
if (info->description == NULL) {
info->description = talloc_strdup(info,
}
}
- if (ipath == NULL || dname == NULL || description == NULL) {
- goto done;
- }
-
/* Default to an external service if we haven't found a match */
if (builtin_svcs[i].servicename == NULL) {
struct rcinit_file_information *init_info = NULL;
ZERO_STRUCT(wkey);
wkey.name = talloc_asprintf(mem_ctx, "%s\\%s\\Security", key, name);
if (wkey.name == NULL) {
- result = WERR_NOMEM;
+ result = WERR_NOT_ENOUGH_MEMORY;
goto done;
}