- remove redundent strstr()
authorAndrew Tridgell <tridge@samba.org>
Sun, 8 Mar 1998 14:52:45 +0000 (14:52 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 8 Mar 1998 14:52:45 +0000 (14:52 +0000)
- don't show printers in shares page
(This used to be commit 2b4204a7769a974a74a7658e787274f6251b1d69)

source3/cgi.c
source3/swat.c
source3/web/cgi.c
source3/web/swat.c

index 83158fc1a544d2889da16cac3eadb74baa7f8f7b..9ce8c4d91ed7c7bec73871a614d666d6a1a092d1 100644 (file)
@@ -513,11 +513,6 @@ static void cgi_download(char *file)
                }
        }
 
-       if (strstr(file,"..")) {
-               cgi_setup_error("404 File Not Found","",
-                               "Relative paths not allowed");
-       }
-
        if (!file_exist(file, &st)) {
                cgi_setup_error("404 File Not Found","",
                                "The requested file was not found");
index 6a5b4f51f14f264d8bf9a689954d72405ed381e6..508c8944b4000595f7ff540b8db57fe3e98c9d43 100644 (file)
@@ -308,7 +308,7 @@ static void shares_page(void)
                printf("<option value=\" \"> \n");
        for (i=0;i<lp_numservices();i++) {
                s = lp_servicename(i);
-               if (s && (*s) && strcmp(s,"IPC$")) {
+               if (s && (*s) && strcmp(s,"IPC$") && !lp_print_ok(i)) {
                        printf("<option %s value=\"%s\">%s\n", 
                               (share && strcmp(share,s)==0)?"SELECTED":"",
                               s, s);
index 83158fc1a544d2889da16cac3eadb74baa7f8f7b..9ce8c4d91ed7c7bec73871a614d666d6a1a092d1 100644 (file)
@@ -513,11 +513,6 @@ static void cgi_download(char *file)
                }
        }
 
-       if (strstr(file,"..")) {
-               cgi_setup_error("404 File Not Found","",
-                               "Relative paths not allowed");
-       }
-
        if (!file_exist(file, &st)) {
                cgi_setup_error("404 File Not Found","",
                                "The requested file was not found");
index 6a5b4f51f14f264d8bf9a689954d72405ed381e6..508c8944b4000595f7ff540b8db57fe3e98c9d43 100644 (file)
@@ -308,7 +308,7 @@ static void shares_page(void)
                printf("<option value=\" \"> \n");
        for (i=0;i<lp_numservices();i++) {
                s = lp_servicename(i);
-               if (s && (*s) && strcmp(s,"IPC$")) {
+               if (s && (*s) && strcmp(s,"IPC$") && !lp_print_ok(i)) {
                        printf("<option %s value=\"%s\">%s\n", 
                               (share && strcmp(share,s)==0)?"SELECTED":"",
                               s, s);