--- source3/utils/smbtree.c     2011-08-09 19:17:47.000000000 +0800
+++ source3/utils/smbtree.c     2011-09-30 15:54:54.000000000 +0800
@@ -30,7 +30,7 @@

 /* How low can we go? */

-enum tree_level {LEV_WORKGROUP, LEV_SERVER, LEV_SHARE};
+enum tree_level {LEV_WORKGROUP, LEV_SERVER, LEV_SHARE, LEV_LISTSHARE};
 static enum tree_level level = LEV_SHARE;

 /* Holds a list of workgroups or servers */
@@ -239,7 +239,10 @@

         for (wg = workgroups; wg; wg = wg->next) {

-                printf("%s\n", wg->name);
+                if (level == LEV_LISTSHARE)
+                    printf("/%s", wg->name);
+                else
+                    printf("%s\n", wg->name);

                 /* List servers */

@@ -252,8 +255,11 @@

                 for (sv = servers; sv; sv = sv->next) {

-                        printf("\t\\\\%-15s\t\t%s\n",
-                              sv->name, sv->comment);
+                        if (level == LEV_LISTSHARE)
+                            printf("/%s", sv->name);
+                        else
+                            printf("\t\\\\%-15s\t\t%s\n",
+                                  sv->name, sv->comment);

                         /* List shares */

@@ -265,6 +271,9 @@
                                 continue;

                         for (sh = shares; sh; sh = sh->next) {
+                            if (level == LEV_LISTSHARE)
+                                printf("/%s", sh->name);
+                            else
                                 printf("\t\t\\\\%s\\%-15s\t%s\n",
                                       sv->name, sh->name, sh->comment);
                         }
@@ -286,6 +295,7 @@
                { "broadcast", 'b', POPT_ARG_VAL, &use_bcast, True, "Use broadcast instead of using the master browser" },
                { "domains", 'D', POPT_ARG_VAL, &level, LEV_WORKGROUP, "List only domains (workgroups) of tree" },
                { "servers", 'S', POPT_ARG_VAL, &level, LEV_SERVER, "List domains(workgroups) and servers of tree" },
+               { "fusesmb", 'F', POPT_ARG_VAL, &level, LEV_LISTSHARE, "List /(domains|workgroups)/server/share {for fusesmb}" },
                POPT_COMMON_SAMBA
                POPT_COMMON_CREDENTIALS
                POPT_TABLEEND