summaryrefslogtreecommitdiff
path: root/source3/web
diff options
context:
space:
mode:
Diffstat (limited to 'source3/web')
-rw-r--r--source3/web/statuspage.c3
-rw-r--r--source3/web/swat.c14
-rw-r--r--source3/web/swat_proto.h70
3 files changed, 80 insertions, 7 deletions
diff --git a/source3/web/statuspage.c b/source3/web/statuspage.c
index eda53b66ab..ce24c7cddd 100644
--- a/source3/web/statuspage.c
+++ b/source3/web/statuspage.c
@@ -123,6 +123,7 @@ static void print_share_mode(const struct share_mode_entry *e,
{
char *utf8_fname;
int deny_mode;
+ size_t converted_size;
if (!is_valid_share_mode_entry(e)) {
return;
@@ -169,7 +170,7 @@ static void print_share_mode(const struct share_mode_entry *e,
printf("NONE ");
printf("</td>");
- push_utf8_allocate(&utf8_fname, fname);
+ push_utf8_allocate(&utf8_fname, fname, &converted_size);
printf("<td>%s</td><td>%s</td></tr>\n",
utf8_fname,tstring(talloc_tos(),e->time.tv_sec));
SAFE_FREE(utf8_fname);
diff --git a/source3/web/swat.c b/source3/web/swat.c
index 6d8f4cae06..3e14d2d098 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -228,6 +228,7 @@ static void show_parameter(int snum, struct parm_struct *parm)
int i;
void *ptr = parm->ptr;
char *utf8_s1, *utf8_s2;
+ size_t converted_size;
TALLOC_CTX *ctx = talloc_stackframe();
if (parm->p_class == P_LOCAL && snum >= 0) {
@@ -252,12 +253,12 @@ static void show_parameter(int snum, struct parm_struct *parm)
for (;*list;list++) {
/* enclose in HTML encoded quotes if the string contains a space */
if ( strchr_m(*list, ' ') ) {
- push_utf8_allocate(&utf8_s1, *list);
- push_utf8_allocate(&utf8_s2, ((*(list+1))?", ":""));
+ push_utf8_allocate(&utf8_s1, *list, &converted_size);
+ push_utf8_allocate(&utf8_s2, ((*(list+1))?", ":""), &converted_size);
printf("&quot;%s&quot;%s", utf8_s1, utf8_s2);
} else {
- push_utf8_allocate(&utf8_s1, *list);
- push_utf8_allocate(&utf8_s2, ((*(list+1))?", ":""));
+ push_utf8_allocate(&utf8_s1, *list, &converted_size);
+ push_utf8_allocate(&utf8_s2, ((*(list+1))?", ":""), &converted_size);
printf("%s%s", utf8_s1, utf8_s2);
}
SAFE_FREE(utf8_s1);
@@ -282,7 +283,7 @@ static void show_parameter(int snum, struct parm_struct *parm)
case P_STRING:
case P_USTRING:
- push_utf8_allocate(&utf8_s1, *(char **)ptr);
+ push_utf8_allocate(&utf8_s1, *(char **)ptr, &converted_size);
printf("<input type=text size=40 name=\"parm_%s\" value=\"%s\">",
make_parm_name(parm->label), fix_quotes(ctx, utf8_s1));
SAFE_FREE(utf8_s1);
@@ -897,6 +898,7 @@ static void shares_page(void)
int i;
int mode = 0;
unsigned int parm_filter = FLAG_BASIC;
+ size_t converted_size;
if (share)
snum = lp_servicenumber(share);
@@ -951,7 +953,7 @@ static void shares_page(void)
for (i=0;i<lp_numservices();i++) {
s = lp_servicename(i);
if (s && (*s) && strcmp(s,"IPC$") && !lp_print_ok(i)) {
- push_utf8_allocate(&utf8_s, s);
+ push_utf8_allocate(&utf8_s, s, &converted_size);
printf("<option %s value=\"%s\">%s\n",
(share && strcmp(share,s)==0)?"SELECTED":"",
utf8_s, utf8_s);
diff --git a/source3/web/swat_proto.h b/source3/web/swat_proto.h
new file mode 100644
index 0000000000..0f84e4f4ce
--- /dev/null
+++ b/source3/web/swat_proto.h
@@ -0,0 +1,70 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * collected prototypes header
+ *
+ * frozen from "make proto" in May 2008
+ *
+ * Copyright (C) Michael Adam 2008
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _SWAT_PROTO_H_
+#define _SWAT_PROTO_H_
+
+
+/* The following definitions come from web/cgi.c */
+
+void cgi_load_variables(void);
+const char *cgi_variable(const char *name);
+const char *cgi_variable_nonull(const char *name);
+bool am_root(void);
+char *cgi_user_name(void);
+void cgi_setup(const char *rootdir, int auth_required);
+const char *cgi_baseurl(void);
+const char *cgi_pathinfo(void);
+const char *cgi_remote_host(void);
+const char *cgi_remote_addr(void);
+bool cgi_waspost(void);
+
+/* The following definitions come from web/diagnose.c */
+
+bool winbindd_running(void);
+bool nmbd_running(void);
+bool smbd_running(void);
+
+/* The following definitions come from web/neg_lang.c */
+
+int web_open(const char *fname, int flags, mode_t mode);
+void web_set_lang(const char *lang_string);
+
+/* The following definitions come from web/startstop.c */
+
+void start_smbd(void);
+void start_nmbd(void);
+void start_winbindd(void);
+void stop_smbd(void);
+void stop_nmbd(void);
+void stop_winbindd(void);
+void kill_pid(struct server_id pid);
+
+/* The following definitions come from web/statuspage.c */
+
+void status_page(void);
+
+/* The following definitions come from web/swat.c */
+
+const char *lang_msg_rotate(TALLOC_CTX *ctx, const char *msgid);
+
+#endif /* _SWAT_PROTO_H_ */