Bug 4346 - SHARE_INFO1 's share-type of hidden share "foo$" is *NOT* STYPE_HIDDEN
SHARE_INFO1 's share-type of hidden share "foo$" is *NOT* STYPE_HIDDEN
Product: Samba 3.0
Classification: Unclassified
Component: File Services
x86 Windows XP
: P3 minor
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2007-01-18 03:30 UTC by YAMASAKI Hiroyuki
Modified: 2007-01-18 05:32 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description YAMASAKI Hiroyuki 2007-01-18 03:30:17 UTC
Sorry for my poor english.

I found a difference between Windows-server and Samba-server.
When execute "net view \\server" on WinXP client, server send
 back SHARE_INFO1. 

If server is Windows, SHARE_INFO1 of "foo$" is STYPE_HIDDEN. 
But server is samba, SHARE_INFO1 of "foo$" is *NOT* STYPE_HIDDEN.

I think below patch fix wrong condition check for STYPE_HIDDEN.

--- srv_srvsvc_nt.c.org 2006-08-31 03:08:38.000000000 +0900
+++ srv_srvsvc_nt.c     2007-01-10 23:31:34.000000000 +0900
@@ -32,31 +32,31 @@ extern struct generic_mapping file_gener
  Utility function to get the 'type' of a share from an snum.
 static uint32 get_share_type(int snum)
        char *net_name = lp_servicename(snum);
        int len_net_name = strlen(net_name);

        /* work out the share type */
        uint32 type = STYPE_DISKTREE;

        if (lp_print_ok(snum))
                type = STYPE_PRINTQ;
        if (strequal(lp_fstype(snum), "IPC"))
                type = STYPE_IPC;
-       if (net_name[len_net_name] == '$')
+       if (net_name[len_net_name - 1] == '$')
                type |= STYPE_HIDDEN;

        return type;
Comment 1 Volker Lendecke 2007-01-18 05:32:11 UTC
Fixed with r20876 -- thanks!