Changeset 1058


Ignore:
Timestamp:
Apr 24, 2019, 2:12:25 PM (2 years ago)
Author:
Herwig Bauernfeind
Message:

Fix Ticket #324 in cltinit.vrs

Location:
trunk/guitools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/guitools/shared/cltinit.vrs

    r1055 r1058  
    196196    ok = SysMkDir(etc'\samba')
    197197    ok = SysMkDir(etc'\samba\pid')
     198    ok = SysMkDir(etc'\samba\private')
    198199    ok = SysMkDir(etc'\samba\lock')
    199200    /* This EA makes the testparm warning about browsing go away. */
  • trunk/guitools/smbmon/smbmon.vrx

    r1054 r1058  
    10951095                end
    10961096            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")
    10981098            /* we ping all smbd.exe except the first one */
    10991099            if DetectZombies = 1 & I > 1 then do
     
    11361136        nmbdpidhandle.0 = words(nmbdpids)
    11371137        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")
    11391139        end
    11401140    end
     
    11491149        winbpidhandle.0 = words(winbpids)
    11501150        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")
    11521152        end
    11531153    end
  • trunk/guitools/smbusers/SMBUSERS.VRX

    r1024 r1058  
    742742
    743743    /* 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     */
    744750    ok = VRSet("Main", 'Pointer', 'Wait' )
    745751    say '  'samba.!netexe' rpc user 'DebugLevel' 'UserCred' 1>'samba.!msg
    746752    address cmd samba.!netexe' rpc user 'DebugLevel' 'UserCred' 1>'samba.!msg
    747     ok = VRSet("Main", 'Pointer', '<default>' )
     753
     754    login_ok = 0
    748755    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
    755777    end
    756778    ok = stream(samba.!msg,'c','close')
    757779    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
    761782        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))
    763786        Msg.Type = "E"
    764787        call _ShowMsg
  • trunk/guitools/smbusers/smbusers.VRP

    r990 r1058  
    88VRXWindow: __VREMainWindow,1,2831,4577,1024,8000
    99VRXWindow: __VRESectionListWindow,1,518,14599,12587,4445
    10 VRXWindow: __VREToolsWindow,1,3975,10744,6986,1669
     10VRXWindow: __VREToolsWindow,1,3975,10744,5498,1661
    1111VRXWindow: __VREWindListWindow,1,506,10744,5215,3150
    1212UserFile: 1
Note: See TracChangeset for help on using the changeset viewer.