[Samba] [patch] swat status page - add share path support

Marcin Gryszkalis mg at fork.pl
Sun Dec 20 15:51:34 MST 2009


Hi
I created little patch (against 3.3.9) to swat to support
showing share path for locked files (like smbstatus does).


--- source/web/statuspage.c.orig	2009-12-20 23:40:52.000000000 +0100
+++ source/web/statuspage.c	2009-12-20 23:43:19.000000000 +0100
@@ -123,6 +123,7 @@
 			     void *dummy)
 {
 	char           *utf8_fname;
+	char           *utf8_sharepath;
 	int deny_mode;
 	size_t converted_size;

@@ -172,8 +173,9 @@
 	printf("</td>");

 	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));
+	push_utf8_allocate(&utf8_sharepath, sharepath, &converted_size);
+	printf("<td>%s</td><td>%s</td><td>%s</td></tr>\n",
+	       utf8_sharepath,utf8_fname,tstring(talloc_tos(),e->time.tv_sec));
 	SAFE_FREE(utf8_fname);
 }

@@ -427,8 +429,8 @@

 	printf("<h3>%s</h3>\n", _("Open Files"));
 	printf("<table border=1>\n");
-	printf("<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>\n",
-		_("PID"), _("UID"), _("Sharing"), _("R/W"), _("Oplock"), _("File"), _("Date"));
+	printf("<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>\n",
+		_("PID"), _("UID"), _("Sharing"), _("R/W"), _("Oplock"), _("Share"), _("File"), _("Date"));

 	locking_init_readonly();
 	share_mode_forall(print_share_mode, NULL);


-- 
Marcin Gryszkalis, PGP 0x9F183FA3 
jabber jid:mg at fork.pl, gg:2532994
http://the.fork.pl


More information about the samba mailing list