Changeset 859
- Timestamp:
- Apr 18, 2014, 9:26:53 AM (11 years ago)
- Location:
- branches/guitools-1.0/install
- Files:
-
- 1 added
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/guitools-1.0/install/readme.sscc
r577 r859 1 SSCC Simple Samba Configuration Center Version 1.0. 11 SSCC Simple Samba Configuration Center Version 1.0.2 2 2 ==================================================== 3 3 … … 44 44 loss of all comments (and all errors in smb.conf, which is not that bad 45 45 after all) 46 47 NOTE: Versions prior to 1.0.2 trash the smb.conf of a Samba Server 3.3.x! 46 48 47 49 Author: -
branches/guitools-1.0/install/sscc.RC
r333 r859 6 6 bitmap 7 up.bmp 7 7 bitmap 8 down.bmp 8 bitmap 9 netlabs.bmp8 bitmap 9 bww.bmp -
branches/guitools-1.0/install/sscc.vrp
r580 r859 1 1 VX-REXX OS/2 V2.14 Build B3 2 2 VRX: sscc.VRX 3 VXOFile: VROBJEX 3 4 MacroPath: VRM:U:\Develop\Samba\guitools-1.0\install 4 5 EXEPath: 5 RunParameters: / Install6 RunDirectory: E:\Dev\REXX\VXREXX\Projects\Samba\install7 VRXWindow: __VREMainWindow,1, 1987,5059,891,72638 VRXWindow: __VRESectionListWindow,1,3 071,10551,8974,48909 VRXWindow: __VREToolsWindow,1, 1590,337,6489,165910 VRXWindow: __VREWindListWindow,1, 458,12190,2650,31506 RunParameters: /install 7 RunDirectory: D:\samba 8 VRXWindow: __VREMainWindow,1,2180,3710,903,8000 9 VRXWindow: __VRESectionListWindow,1,3481,15080,8648,7299 10 VRXWindow: __VREToolsWindow,1,3324,9877,5477,1659 11 VRXWindow: __VREWindListWindow,1,927,11997,3577,3336 11 12 UserFile: 1 12 13 UserWindow: Main,1 -
branches/guitools-1.0/install/sscc.vrx
r580 r859 475 475 */ 476 476 _LoadOtherFuncs: 477 if options.!Debug then ok = VRREdirectStdIO("ON") 478 else ok = VRREdirectStdIO("OFF") 477 if options.!Debug = 1 478 then ok = VRREdirectStdIO("ON") 479 else ok = VRREdirectStdIO("OFF") 479 480 480 481 call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' … … 499 500 */ 500 501 _MasterPasswdCreate: 501 call lineout samba.!masterpasswd, '# Created by SSCC ver. 'word(VRGet("Main","Hinttext"),2)502 call lineout samba.!masterpasswd, '# Created by 'VRParseFileName(OurINI,'N')' Ver. 'word(VRGet("Main","Hinttext"),2) 502 503 call lineout samba.!masterpasswd, '# syntax:' 503 504 call lineout samba.!masterpasswd, '# username:passwd:UID:GID:login-class:chg pw x sec:deact x sec:GECOS:home:shell' 504 call lineout samba.!masterpasswd, 'root:*:0:51 3::0:0:root:/nonexistent:/usr/sbin/nologin'505 call lineout samba.!masterpasswd, 'root:*:0:512::0:0:root:/nonexistent:/usr/sbin/nologin' 505 506 call lineout samba.!masterpasswd, 'guest:*:65534:65534::0:0:guest:/nonexistent:/usr/sbin/nologin' 506 507 ok = stream(samba.!masterpasswd,'c','close') 508 return 509 510 /*:VRX _MasterPasswdFindUser 511 */ 512 _MasterPasswdFindUser: procedure expose username. 513 IF options.!debug == 1 THEN say '_MasterpasswdFindUser("'arg(1)'") started' 514 FindUser = arg(1) 515 Idx = 0 516 do I = 1 to username.0 517 if translate(username.I) = translate(FindUser) then do 518 Idx = I 519 leave 520 end 521 end 522 IF options.!debug == 1 THEN say '_MasterpasswdFindUser("'FindUser'") done, returning 'Idx 523 return idx 524 /*:VRX _MasterPasswdRead 525 */ 526 _MasterPasswdRead: 527 IF options.!debug == 1 THEN say '_MasterpasswdRead() started' 528 /* Read complete master.passwd */ 529 I = 0 530 531 do until lines(samba.!masterpasswd) = 0 532 userline = strip(linein(samba.!masterpasswd)) 533 534 /* Skip comments */ 535 if left(userline,1) = "#" then iterate 536 if left(userline,1) = ";" then iterate 537 538 /* parse fields into stem variables */ 539 I = I + 1 540 parse var userline username.I':'password.I':'uid.I':'gid.I':'LoginClass.I':'pwchange.I':'deact.I':'gecos.I':'home.I':'shell.I 541 542 Status.I ="" 543 do J = 1 to I - 1 544 if translate(Username.J) = translate(Username.I) then do 545 status.I = "DUPLICATE" 546 leave 547 end 548 end 549 end 550 ok = stream(samba.!masterpasswd,'c','close') 551 drop userline 552 553 /* set "stem roots" properly */ 554 username.0 = I 555 password.0 = I 556 uid.0 = I 557 gid.0 = I 558 loginclass.0= I 559 pwchange.0 = I 560 deact.0 = I 561 gecos.0 = I 562 home.0 = I 563 shell.0 = I 564 565 /* also smbpasswd stems */ 566 lmhash. = '' 567 nthash. = '' 568 flags. = '' 569 lct. = '' 570 lmhash.0 = I 571 nthash.0 = I 572 flags.0 = I 573 lct.0 = I 574 575 /* smbusermap stem */ 576 MapTo. = '' 577 MapTo.0 = I 578 579 /* our private stem */ 580 status.0 = I 581 IF options.!debug == 1 THEN say '_MasterpasswdRead() done, read 'username.0' users' 582 return 583 584 /*:VRX _MasterPasswdWrite 585 */ 586 _MasterpasswdWrite: 587 IF options.!debug == 1 THEN say "_MasterpasswdWrite() started" 588 newmasterpasswd = TempDir'master.passwd' 589 590 ok = SysFileDelete(newmasterpasswd) 591 592 call lineout newmasterpasswd, '# Created by 'VRParseFileName(OurINI,'N')' Ver. 'word(VRGet("Main","Hinttext"),2) 593 call lineout newmasterpasswd, '# syntax:' 594 call lineout newmasterpasswd, '# username:passwd:UID:GID:login-class:chg pw x sec:deact x sec:GECOS:home:shell' 595 596 do I = 1 to username.0 597 select 598 when Status.I = "DUPLICATE" & settings.!FixErrors = 1 then iterate 599 when Status.I = "UID MISMATCH" then do 600 call lineout newmasterpasswd, username.I':'password.I':'word(uid.I,1)':'gid.I':'loginclass.I':'pwchange.I':'deact.I':'gecos.I':'home.I':'shell.I 601 end 602 when Status.I = "UNIX MISSING" & settings.!FixErrors then do 603 call lineout newmasterpasswd, username.I':'password.I':'uid.I':'gid.I':'loginclass.I':'pwchange.I':'deact.I':'gecos.I':'home.I':'shell.I 604 end 605 otherwise call lineout newmasterpasswd, username.I':'password.I':'uid.I':'gid.I':'loginclass.I':'pwchange.I':'deact.I':'gecos.I':'home.I':'shell.I 606 end 607 end 608 ok = stream(newmasterpasswd,'c','close') 609 ok = VRCopyFile( samba.!masterpasswd, samba.!masterpasswd'.bak' ) 610 ok = VRCopyFile( newmasterpasswd, samba.!masterpasswd ) 611 ok = SysFileDelete(newmasterpasswd) 612 IF options.!debug == 1 THEN say "_MasterpasswdWrite() done" 507 613 return 508 614 … … 750 856 */ 751 857 _SambaGuestCreate: 752 say samba.!smbpasswdexe' -a guest -n' 753 address cmd samba.!smbpasswdexe' -a guest -n -D 0 2>'samba.!error' 1>'samba.!message 754 smbpasswdrc = rc 755 if RC = 0 then call _SambaShowMsg 858 IF options.!debug == 1 THEN say "_SambaGuestCreate() started" 859 IF options.!debug == 1 THEN say ' 'samba.!smbpasswdexe' -a guest -n' 860 samba.!smbpasswdexe' -a guest -n -D 0 2>'samba.!error' 1>'samba.!message 861 862 if rc = 0 then call _SambaShowMsg 756 863 else call _SambaShowError 864 865 IF options.!debug == 1 THEN say "_SambaGuestCreate() done" 757 866 return 758 867 … … 784 893 */ 785 894 _SambaRootPWSet: 786 /* ok VRREdirectStdIO("ON") */ 895 IF options.!debug == 1 THEN say "_SambaRootPWSet() started" 896 897 /* Write root password to a temp file */ 787 898 pwdfile = TempDir'newpwd' 788 899 call lineout pwdfile, VRGet("EF_RootPassword","value") 789 900 call lineout pwdfile, VRGet("EF_RootPassword","value") 790 901 ok = stream(pwdfile,"c","close") 791 say samba.!smbpasswdexe' -a root -s <'pwdfile 792 address cmd samba.!smbpasswdexe' -a root -s -D 0 <'pwdfile' 2>'samba.!error' 1>'samba.!message 793 smbpasswdrc = rc 794 if RC = 0 then call _SambaShowMsg 902 903 /* update Master.passwd and (s)pwd.db */ 904 call _MasterPasswdRead 905 nx = _MasterPasswdFindUser("root") 906 907 call rxFuncAdd "Crypt", "RxCrypt", "RxCrypt" 908 909 itoa64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 910 salt = "" 911 do i = 1 to 8 912 salt = salt || substr( itoa64, random( 0, 63 ) + 1, 1 ) 913 end 914 password.nx = Crypt(VRGet("EF_RootPassword","Value"), salt ) 915 916 /* we need this otherwise _MasterPasswdWrite does not work */ 917 settings.!FixErrors = 1 918 call _MasterPasswdWrite 919 call _PasswordDbRewrite 920 921 /* Create the root account */ 922 IF options.!debug == 1 THEN say ' 'samba.!smbpasswdexe' -a root -s <'pwdfile 923 samba.!smbpasswdexe' -a root -s -D 0 <'pwdfile' 2>'samba.!error' 1>'samba.!message 924 925 if rc = 0 then call _SambaShowMsg 795 926 else call _SambaShowError 796 927 928 /* Remove the temp password file */ 797 929 ok = SysFileDelete(pwdfile) 930 931 932 933 /* Deal with swat */ 934 /* We could use rxcrypt.dll however htpasswd.exe (at least in theory) is more flexible regarding encryption */ 798 935 if swatauth then do 799 936 /* we always remove the old swat */ 800 say ' 'samba.!htpasswdexe' -D "'swatusers'" 'Username.CurUserNr937 say ' 'samba.!htpasswdexe' -D "'swatusers'" root' 801 938 address cmd samba.!htpasswdexe' -D "'swatusers'" root' /* ' 2>'samba.!error' 1>'samba.!msg 802 939 if rc <> 0 then call _SambaShowError; else call _SambaShowMsg */ … … 808 945 else call _SambaShowMsg */ 809 946 end 810 return 811 947 IF options.!debug == 1 THEN say "_SambaRootPWSet() done" 948 return 812 949 /*:VRX _SambaShowError 813 950 */ … … 817 954 I = I + 1 818 955 smberr.I = linein(samba.!error) 956 say I':err:'smberr.I 819 957 end 820 958 ok = stream(Samba.!error,"c","close") … … 835 973 I = I + 1 836 974 smbmsg.I = linein(samba.!message) 975 say I':msg:'smbmsg.I 837 976 end 838 977 ok = stream(Samba.!message,"c","close") … … 970 1109 return 971 1110 1111 /*:VRX _Smb35Init 1112 */ 1113 _Smb35Init: 1114 IF options.!debug == 1 THEN say '_Smb35Init() started' 1115 say '1 -> 'samba.!smbpasswdexe' -a dummyuser -n -D 10' 1116 address cmd samba.!smbpasswdexe' -a dummyuser -n -D 10' 1117 say '2 -> 'samba.!smbpasswdexe' -x dummyuser -D 10' 1118 address cmd samba.!smbpasswdexe' -x dummyuser -D 10' 1119 say '3 -> 'samba.!pdbeditexe' --policies-reset -d=3' 1120 address cmd samba.!pdbeditexe' --policies-reset -d=3' 1121 say 'X -> ----------------------' 1122 IF options.!debug == 1 THEN say '_Smb35Init() done' 1123 return 1124 972 1125 /*:VRX _SmbConfBackup 973 1126 */ … … 985 1138 ok = VRCopyFile(smbconf,src) 986 1139 end 987 'pause'988 say src' 'stream(src,'c','query size')989 'pause'990 1140 trg = smbconf 991 say trg992 1141 ok = SysFileDelete(smbconf) 993 1142 call lineout trg, '# Samba config file created using SSCC ver. 'word(VRGet("Main","Hinttext"),2) … … 1098 1247 end 1099 1248 1100 call lineout smbconf, Indent||'dos charset = IBM-850' 1101 call lineout smbconf, Indent||'display charset = IBM-850' 1102 call lineout smbconf, Indent||'unix charset = IBM-850' 1249 if SysQueryProcessCodePage() = "850" then do 1250 call lineout smbconf, Indent||'dos charset = IBM-850' 1251 call lineout smbconf, Indent||'display charset = IBM-850' 1252 call lineout smbconf, Indent||'unix charset = IBM-850' 1253 end 1254 else do 1255 call lineout smbconf, Indent||'dos charset = IBM-850' 1256 call lineout smbconf, Indent||'display charset = SYSTEM' 1257 call lineout smbconf, Indent||'unix charset = SYSTEM' 1258 end 1103 1259 1104 1260 CurCP = SysQueryProcessCodePage() … … 1111 1267 call lineout smbconf, Indent||'passdb backend = tdbsam' 1112 1268 end 1269 call lineout smbconf, Indent||'log level = 2' 1270 call lineout smbconf, Indent||'log file = '||ETC||'\samba\log\log.smbd.%U.%M' 1113 1271 call lineout smbconf, Indent||'null passwords = Yes' 1114 1272 call lineout smbconf, Indent||'guest account = guest' 1115 1273 call lineout smbconf, Indent||'security = user' 1116 call lineout smbconf, Indent||'log level = 2'1117 call lineout smbconf, Indent||'log file = '||ETC||'\samba\log\log.smbd.%U.%M'1118 1274 call lineout smbconf, Indent||'load printers = No' 1119 1275 call lineout smbconf, Indent||'time server = Yes' … … 1674 1830 ok = VRSet("About","Caption", NLVGetMessage(31)) 1675 1831 ok = VRSet("PB_AboutOK","Caption", NLVGetMessage(2)) 1676 SambaTeam.0 = 8 1677 SambaTeam.1 = 'Paul Smedley' 1678 SambaTeam.2 = 'Yuri Dario' 1679 SambaTeam.3 = 'Herwig Bauernfeind' 1680 SambaTeam.4 = 'Silvan Scherrer' 1681 SambaTeam.5 = 'Alex Taylor' 1682 SambaTeam.6 = 'Nikolay Kolosov' 1683 SambaTeam.7 = 'All the Samba people' 1684 SambaTeam.8 = 'All the netlabs people' 1832 SambaTeam.0 = 9 1833 SambaTeam.1 = 'Silvan Scherrer' 1834 SambaTeam.2 = 'Herwig Bauernfeind' 1835 SambaTeam.3 = 'Vitali Pelenyov' 1836 SambaTeam.4 = 'Paul Smedley' 1837 SambaTeam.5 = 'Yuri Dario' 1838 SambaTeam.6 = 'Alex Taylor' 1839 SambaTeam.7 = 'Nikolay Kolosov' 1840 SambaTeam.8 = 'All the Samba people' 1841 SambaTeam.9 = 'All the netlabs people' 1685 1842 ok = VRSet("About","Font", VRGet("GB_Help2","Font")) 1686 1843 ok = VRMethod("LB_SambaTeam","AddStringList", "SambaTeam." ) … … 2105 2262 */ 2106 2263 GB_Global_1_Create: 2107 call GB_Global_1_Init 2264 call GB_Global_1_Init 2265 SysCP = SysQueryProcessCodePage() 2266 ok = VRMethod( "EF_unix_charset", "AddString", "IBM-"SysCP, 2) 2267 ok = VRMethod( "EF_display_charset", "AddString", "IBM-"SysCP, 2) 2268 if pos("IBM-"SysCP, VRGet( "EF_dos_charset","InitialList")) = 0 then do 2269 ok = VRMethod( "EF_dos_charset", "AddString", "IBM-"SysCP, 2) 2270 end 2108 2271 return 2109 2272 … … 2257 2420 */ 2258 2421 Main_Create: 2259 options.!debug = 0 2422 ok = VRREdirectStdIO("ON") 2423 options.!debug = 1 2260 2424 2261 2425 call _LoadOtherFuncs … … 2288 2452 ok = VRSet("GB_SmbConfTree","Top", FWidth) 2289 2453 ok = VRSet("GB_SmbConfTree","Left", FWidth-24) 2290 ok = VRSet("GB_SmbConfTree","Height", VRGet("Main", "Height") -1 350)2454 ok = VRSet("GB_SmbConfTree","Height", VRGet("Main", "Height") -1400) 2291 2455 2292 2456 ok = VRset("GB_SmbConfTree3","Top", FWidth) … … 2358 2522 2359 2523 if MButton.bTop < 1300 & MButton.bLeft < 1300 then do 2360 MButton.bTop = 48 422524 MButton.bTop = 4802 2361 2525 MButton.bLeft = 3758 2362 2526 MButton.bWidth = 1241 … … 2368 2532 ok = VRSet("PB_Reload", "Width", MButton.bWidth) 2369 2533 2370 ok = VRSet("PB_Save", "Top", MButton.bTop)2371 ok = VRSet("PB_Save", "Left", MButton.bLeft+1*FWidth+MButton.bWidth)2534 ok = VRSet("PB_Save", "Top", MButton.bTop) 2535 ok = VRSet("PB_Save", "Left", MButton.bLeft+1*FWidth+MButton.bWidth) 2372 2536 ok = VRSet("PB_Reload", "Width", MButton.bWidth) 2373 2537 … … 2697 2861 return 2698 2862 2863 /*:VRX PB_1_Click 2864 */ 2865 PB_1_Click: 2866 ok = VRREdirectStdIO("ON") 2867 Buttons.1 = NLVGetMessage(2) 2868 Buttons.2 = NLVGetMessage(3) 2869 Buttons.0 = 2 2870 command = 'd:\samba\smbpasswd.exe' 2871 id = VRPrompt( VRWindow(), "Console", "command", "Console", "Buttons.", buttons.1, buttons.2 ) 2872 if id = 2 then return 2873 say command 2874 address cmd command 2875 /* samba.!netexe' rpc 'command' 'DebugLevel' 'UserCred' 2>'samba.!error' 1>'samba.!msg */ 2876 /* if RC <> 0 then call _SambaShowError; else call _SambaShowMsg */ 2877 return 2878 2699 2879 /*:VRX PB_AboutOK_Click 2700 2880 */ … … 2758 2938 2759 2939 call _SmbConfCreateDefault 2940 /* call _Smb35Init */ 2760 2941 ok = SysFileTree(smbconf,exist.,'FO') 2761 2942 SmbConfExists = exist.0 2762 2943 call _SmbConfBackup 2763 2944 call _SmbConfTreeReset 2945 2764 2946 if \VRGet("CB_NoRoot","Set") then do 2765 2947 call _SambaRootPWSet
Note:
See TracChangeset
for help on using the changeset viewer.