Correct "incluing" typos.
[nivanova/samba-autobuild/.git] / source3 / rpc_server / svcctl / srv_svcctl_reg.c
index c3ce43f305ebe7e958d6060b3a0c54481cbd856d..f8d04d41dab0b8f3366575868287978274a00d28 100644 (file)
@@ -101,7 +101,7 @@ static struct service_display_info common_unix_svcs[] = {
   { "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 },
@@ -187,7 +187,7 @@ static bool read_init_file(TALLOC_CTX *mem_ctx,
        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);
@@ -205,13 +205,13 @@ static bool read_init_file(TALLOC_CTX *mem_ctx,
        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 '#' */
 
@@ -224,20 +224,20 @@ static bool read_init_file(TALLOC_CTX *mem_ctx,
                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,
@@ -392,10 +392,6 @@ static bool svcctl_add_service(TALLOC_CTX *mem_ctx,
                }
        }
 
-       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;
@@ -491,7 +487,7 @@ static bool svcctl_add_service(TALLOC_CTX *mem_ctx,
        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;
        }