Changeset 277


Ignore:
Timestamp:
Jun 18, 2009, 10:45:43 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Updates in the shared code for the GUI tools

Location:
branches/guitools-1.0/shared
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/guitools-1.0/shared/sambainit.vrs

    r275 r277  
    1010
    1111    /* Error status and file variables */
    12     ErrorFile  = Tempdir'smbutil.error'
    1312    ErrorState = 0 /* _ErrorBinaryNotFound() changes this variable */
    1413    DataErrorState = 0 /* _ErrorDataFileNotFound() changes this variable */
     
    2726    IF options.!debug == 1 THEN say '  UnixRoot       = "'UnixRoot'"'
    2827
    29     /* if kLIBCPathrewriterInstalled() then do
    30         unixetc = kLIBCpathRewriter("/etc")
    31     end
    32     else */
    3328    unixetc = UnixRoot'\etc'
    3429    IF options.!debug == 1 THEN say '  Unixetc        = "'unixetc'"'
    3530
    36     /* Samba needs TMPDIR for several purposes - if it is absent Samba crashes */
    37     if translate(value('TMPDIR',,'OS2ENVIRONMENT'),'\','/') = '' then do
    38         Msg.Title = VRGet("Main", "Caption")
    39         Msg.Text  = "Environment variable TMPDIR is missing - expect to see Samba crashes!"
    40         Msg.Type  = "E"
    41         call _ShowMsg
    42     end
    43 
    44     /* find all executables */
    45 
    46     /* get the path to this file */
     31    /* Find all executables */
     32
     33    /* Get the path to this file */
    4734    samba.!tools = VRParseFilename(VRGet("Application", "Program"),'DP')
    4835    if samba.!tools = '' then do
     
    185172
    186173    /* find all datafiles - their locations are fixed */
     174   
    187175    /* the password files - we'll create them if they don't exist */
    188176    samba.!masterpasswd = unixetc'\master.passwd'
     
    225213    samba.!error = SysTempFileName(TempDir'smb_err.???')
    226214    samba.!msg   = SysTempFileName(TempDir'smb_msg.???')
     215    /* Use of this file is deprecated */
     216    ErrorFile  = Tempdir'smbutil.error'
    227217
    228218    IF options.!debug == 1 then do
     
    260250
    261251/*:VRX */
    262 _SambaRunning: procedure expose running. pids. TempDir HaveWinbindd
     252_SambaExtendSearchPath:
     253    IF options.!debug == 1 THEN say '_SambaExtendSearchPath() started'
     254    /* Add binary and tools path to the PATH variable */
     255    old_path = value('PATH',, 'OS2ENVIRONMENT')
     256    if pos(translate(samba.!bin';'),translate(old_path)) = 0 then do
     257        if samba.!bin = samba.!tools then new_path = samba.!bin';'
     258        else new_path = samba.!bin';'samba.!tools';'
     259        ok = value('PATH', new_path || old_path, 'OS2ENVIRONMENT')
     260        drop new_path
     261    end
     262    drop old_path
     263   
     264    /* Add binary and tools path to the BEGINLIBPATH variable */
     265    old_beginlibpath = SysQueryExtLibPath("B")
     266    if pos(translate(samba.!bin';'),translate(old_beginlibpath)) = 0 then do
     267        if samba.!bin = samba.!tools then new_beginlibpath = samba.!bin';'old_beginlibpath
     268        else new_beginlibpath = samba.!bin';'samba.!tools';'old_beginlibpath
     269        ok = SysSetExtLibPath( new_beginlibpath, "B")
     270        drop new_beginlibpath
     271    end
     272    drop old_beginlibpath
     273    IF options.!debug == 1 THEN say '_SambaExtendSearchPath() done'
     274return
     275
     276/*:VRX */
     277_SambaRunning: procedure expose running. pids. TempDir HaveWinbindd options.
     278    IF options.!debug == 1 THEN say '_SambaRunning() started'
     279
    263280    /* Checks whether any Samba daemon is currently running */
    264281       
     
    301318        runres = (running.!smbd | running.!nmbd |running.!winb)
    302319    end
     320    IF options.!debug == 1 THEN say '_SambaRunning() done'
    303321return runres
     322
     323/*:VRX */
     324_PasswordDbRewrite:
     325    IF options.!debug == 1 THEN say "_PasswordDBRewrite() started"
     326
     327    /* Reset any old rc from pwd_mkdb.exe */
     328    pwd_mkdbrc = 0
     329
     330    /* delete old .db.tmp files */
     331    ok = SysFileDelete(UnixETC'\pwd.db.tmp')
     332    ok = SysFileDelete(UnixETC'\spwd.db.tmp')
     333
     334    /* create backups of old .db files */
     335    ok = VRCopyFile( UnixETC'\pwd.db',  UnixETC'\pwd.db.bak'  )
     336    ok = VRCopyFile( UnixETC'\spwd.db', UnixETC'\spwd.db.bak' )
     337
     338    /* delete old .db files */
     339    ok = SysFileDelete(UnixETC'\pwd.db')
     340    ok = SysFileDelete(UnixETC'\spwd.db')
     341
     342    /* Create new password db */
     343    address cmd samba.!pwd_mkdb' -d 'unixetc' 'samba.!masterpasswd' 2>'samba.!error
     344    pwd_mkdbrc = rc
     345    if \VRFileExists(samba.!pwddb) | pwd_mkdbrc <> 0 then do
     346        call _SambaShowError
     347    end
     348    IF options.!debug == 1 THEN say "_PasswordDBRewrite() done ("pwd_mkdbrc")"
     349return
  • branches/guitools-1.0/shared/swat.vrs

    r269 r277  
    22*/
    33_FindHtpasswd:
     4    IF options.!debug == 1 THEN say '_FindHtpasswd() started'
    45    /* htpasswd.exe - required for SWAT but not really part of Samba */
    56    samba.!htpasswdexe = ""
     
    5960        swatusers = ETC'\samba\private\swatusers'
    6061    end
     62    IF options.!debug == 1 THEN say '_FindHtpasswd() done'
    6163return
Note: See TracChangeset for help on using the changeset viewer.