Changeset 1058
- Timestamp:
- Apr 24, 2019, 2:12:25 PM (2 years ago)
- Location:
- trunk/guitools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/guitools/shared/cltinit.vrs
r1055 r1058 196 196 ok = SysMkDir(etc'\samba') 197 197 ok = SysMkDir(etc'\samba\pid') 198 ok = SysMkDir(etc'\samba\private') 198 199 ok = SysMkDir(etc'\samba\lock') 199 200 /* This EA makes the testparm warning about browsing go away. */ -
trunk/guitools/smbmon/smbmon.vrx
r1054 r1058 1095 1095 end 1096 1096 end 1097 smbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", smbdhandle, , NLVGetMessage(130)' ' word(smbdpids,I)' ('d2x(word(smbdpids,I))'x)', "$48")1097 smbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", smbdhandle, , NLVGetMessage(130)' 'right("0000"||word(smbdpids,I),5)' ('right("0000"||d2x(word(smbdpids,I)),4)'x)', "$48") 1098 1098 /* we ping all smbd.exe except the first one */ 1099 1099 if DetectZombies = 1 & I > 1 then do … … 1136 1136 nmbdpidhandle.0 = words(nmbdpids) 1137 1137 do I = 1 to words(nmbdpids) 1138 nmbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", nmbdhandle, , NLVGetMessage(130)' ' word(nmbdpids,I)' ('d2x(word(nmbdpids,I))'x)', "$48")1138 nmbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", nmbdhandle, , NLVGetMessage(130)' 'right("0000"||word(nmbdpids,I),5)' ('right("0000"||d2x(word(nmbdpids,I)),4)'x)', "$48") 1139 1139 end 1140 1140 end … … 1149 1149 winbpidhandle.0 = words(winbpids) 1150 1150 do I = 1 to words(winbpids) 1151 winbpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", winbhandle, , NLVGetMessage(130)' ' word(winbpids,I)' ('d2x(word(winbpids,I))'x)', "$48")1151 winbpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", winbhandle, , NLVGetMessage(130)' 'right("0000"||word(winbpids,I),5)' ('right("0000"||d2x(word(winbpids,I)),4)'x)', "$48") 1152 1152 end 1153 1153 end -
trunk/guitools/smbusers/SMBUSERS.VRX
r1024 r1058 742 742 743 743 /* Lets see if the credentials are good */ 744 /* 3 possible results: 745 1. list of users, each user in one line 746 2. first line is "Anonymous login successful", list of users afterwards 747 3. Samba error NT_STATUS 748 4. Other error 749 */ 744 750 ok = VRSet("Main", 'Pointer', 'Wait' ) 745 751 say ' 'samba.!netexe' rpc user 'DebugLevel' 'UserCred' 1>'samba.!msg 746 752 address cmd samba.!netexe' rpc user 'DebugLevel' 'UserCred' 1>'samba.!msg 747 ok = VRSet("Main", 'Pointer', '<default>' ) 753 754 login_ok = 0 748 755 do while lines(samba.!msg) > 0 749 loginLine = linein(samba.!msg) 750 if words(loginline) <> 1 then do 751 if pos("NT_STATUS",loginline) > 0 then leave /* Bad login */ 752 end 753 else leave /* Good login */ 754 /* retry - we read garbage - probably debug data */ 756 loginLine = strip(linein(samba.!msg)) 757 select 758 when loginline = "Anonymous login successful" then do 759 login_ok = 0 760 leave 761 end 762 when pos("NT_STATUS",loginline) > 0 then do /* Bad login */ 763 Msg.Text = loginline 764 Msg.Type = "E" 765 call _ShowMsg 766 login_ok = 0 767 leave 768 end 769 when words(loginline) = 1 then do /* looks like an item from the list of users */ 770 if _UserIsValid(strip(loginLine)) then do 771 login_ok = 1 772 end 773 leave 774 end 775 otherwise nop /* we read garbage - probably debug data, let's retry */ 776 end 755 777 end 756 778 ok = stream(samba.!msg,'c','close') 757 779 ok = SysFileDelete(samba.!msg) 758 759 /* If did not get a valid user back i.e. the first entry of the list, login was not successful */ 760 if \_UserIsValid(strip(loginLine)) then do 780 ok = VRSet("Main", 'Pointer', '<default>' ) 781 if \login_ok then do 761 782 Msg.Title = NLVGetMessage(31)': 'Credentials.!username'@'copies('*',length(Credentials.!password)) 762 Msg.Text = substr(loginLine, pos("NT_STATUS",loginline)) 783 /* Make sure we do not crash in case there was no valid 784 Samba error, but the user is not valid either */ 785 Msg.Text = substr(loginLine, max(pos("NT_STATUS",loginline),1)) 763 786 Msg.Type = "E" 764 787 call _ShowMsg -
trunk/guitools/smbusers/smbusers.VRP
r990 r1058 8 8 VRXWindow: __VREMainWindow,1,2831,4577,1024,8000 9 9 VRXWindow: __VRESectionListWindow,1,518,14599,12587,4445 10 VRXWindow: __VREToolsWindow,1,3975,10744, 6986,166910 VRXWindow: __VREToolsWindow,1,3975,10744,5498,1661 11 11 VRXWindow: __VREWindListWindow,1,506,10744,5215,3150 12 12 UserFile: 1
Note: See TracChangeset
for help on using the changeset viewer.