Index: /trunk/guitools/shared/cltinit.vrs
===================================================================
--- /trunk/guitools/shared/cltinit.vrs	(revision 1057)
+++ /trunk/guitools/shared/cltinit.vrs	(revision 1058)
@@ -196,4 +196,5 @@
     ok = SysMkDir(etc'\samba')
     ok = SysMkDir(etc'\samba\pid')
+    ok = SysMkDir(etc'\samba\private')
     ok = SysMkDir(etc'\samba\lock')
     /* This EA makes the testparm warning about browsing go away. */
Index: /trunk/guitools/smbmon/smbmon.vrx
===================================================================
--- /trunk/guitools/smbmon/smbmon.vrx	(revision 1057)
+++ /trunk/guitools/smbmon/smbmon.vrx	(revision 1058)
@@ -1095,5 +1095,5 @@
                 end
             end
-            smbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", smbdhandle, , NLVGetMessage(130)' 'word(smbdpids,I)' ('d2x(word(smbdpids,I))'x)', "$48")
+            smbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", smbdhandle, , NLVGetMessage(130)' 'right("0000"||word(smbdpids,I),5)' ('right("0000"||d2x(word(smbdpids,I)),4)'x)', "$48")
             /* we ping all smbd.exe except the first one */
             if DetectZombies = 1 & I > 1 then do
@@ -1136,5 +1136,5 @@
         nmbdpidhandle.0 = words(nmbdpids)
         do I = 1 to words(nmbdpids)
-            nmbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", nmbdhandle, , NLVGetMessage(130)' 'word(nmbdpids,I)' ('d2x(word(nmbdpids,I))'x)', "$48")
+            nmbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", nmbdhandle, , NLVGetMessage(130)' 'right("0000"||word(nmbdpids,I),5)' ('right("0000"||d2x(word(nmbdpids,I)),4)'x)', "$48")
         end
     end
@@ -1149,5 +1149,5 @@
         winbpidhandle.0 = words(winbpids)
         do I = 1 to words(winbpids)
-            winbpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", winbhandle, , NLVGetMessage(130)' 'word(winbpids,I)' ('d2x(word(winbpids,I))'x)', "$48")
+            winbpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", winbhandle, , NLVGetMessage(130)' 'right("0000"||word(winbpids,I),5)' ('right("0000"||d2x(word(winbpids,I)),4)'x)', "$48")
         end
     end
Index: /trunk/guitools/smbusers/SMBUSERS.VRX
===================================================================
--- /trunk/guitools/smbusers/SMBUSERS.VRX	(revision 1057)
+++ /trunk/guitools/smbusers/SMBUSERS.VRX	(revision 1058)
@@ -742,23 +742,46 @@
 
     /* Lets see if the credentials are good */
+    /* 3 possible results:
+       1. list of users, each user in one line
+       2. first line is "Anonymous login successful", list of users afterwards
+       3. Samba error NT_STATUS
+       4. Other error
+     */
     ok = VRSet("Main", 'Pointer', 'Wait' )
     say '  'samba.!netexe' rpc user 'DebugLevel' 'UserCred' 1>'samba.!msg
     address cmd samba.!netexe' rpc user 'DebugLevel' 'UserCred' 1>'samba.!msg
-    ok = VRSet("Main", 'Pointer', '<default>' )
+
+    login_ok = 0
     do while lines(samba.!msg) > 0
-        loginLine = linein(samba.!msg)
-        if words(loginline) <> 1 then do
-            if pos("NT_STATUS",loginline) > 0 then leave /* Bad login */
-        end
-        else leave /* Good login */
-        /* retry - we read garbage - probably debug data */
+        loginLine = strip(linein(samba.!msg))
+        select 
+            when loginline = "Anonymous login successful" then do
+                login_ok = 0
+                leave
+            end
+            when pos("NT_STATUS",loginline) > 0 then do /* Bad login */
+                Msg.Text = loginline
+                Msg.Type = "E"
+                call _ShowMsg
+                login_ok = 0
+                leave
+            end
+            when words(loginline) = 1 then do /* looks like an item from the list of users */
+                if _UserIsValid(strip(loginLine)) then do
+                    login_ok = 1
+                end
+                leave
+            end
+            otherwise nop /* we read garbage - probably debug data, let's retry */
+        end
     end
     ok = stream(samba.!msg,'c','close')
     ok = SysFileDelete(samba.!msg)
-
-    /* If did not get a valid user back i.e. the first entry of the list, login was not successful */
-    if \_UserIsValid(strip(loginLine)) then do
+    ok = VRSet("Main", 'Pointer', '<default>' )
+    if \login_ok then do
         Msg.Title = NLVGetMessage(31)': 'Credentials.!username'@'copies('*',length(Credentials.!password))
-        Msg.Text = substr(loginLine, pos("NT_STATUS",loginline))
+        /* Make sure we do not crash in case there was no valid 
+           Samba error, but the user is not valid either */
+        Msg.Text = substr(loginLine, max(pos("NT_STATUS",loginline),1))
         Msg.Type = "E"
         call _ShowMsg
Index: /trunk/guitools/smbusers/smbusers.VRP
===================================================================
--- /trunk/guitools/smbusers/smbusers.VRP	(revision 1057)
+++ /trunk/guitools/smbusers/smbusers.VRP	(revision 1058)
@@ -8,5 +8,5 @@
 VRXWindow: __VREMainWindow,1,2831,4577,1024,8000
 VRXWindow: __VRESectionListWindow,1,518,14599,12587,4445
-VRXWindow: __VREToolsWindow,1,3975,10744,6986,1669
+VRXWindow: __VREToolsWindow,1,3975,10744,5498,1661
 VRXWindow: __VREWindListWindow,1,506,10744,5215,3150
 UserFile: 1
