Changeset 1020 for trunk/guitools/sscc
- Timestamp:
- May 12, 2017, 4:03:38 PM (8 years ago)
- Location:
- trunk/guitools/sscc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/guitools/sscc/sscc.vrp
r1019 r1020 4 4 MacroPath: VRM:U:\Develop\Samba\trunk\guitools\sscc 5 5 EXEPath: 6 RunParameters: 6 RunParameters: /install 7 7 RunDirectory: U:\Develop\Samba\trunk\guitools\sscc 8 8 VRXWindow: __VREMainWindow,1,2867,4577,5767,8000 9 VRXWindow: __VRESectionListWindow,1, 3156,14791,10431,46869 VRXWindow: __VRESectionListWindow,1,1482,13924,10431,4686 10 10 VRXWindow: __VREToolsWindow,0,4011,10744,6992,1669 11 11 VRXWindow: __VREWindListWindow,1,2072,13539,4710,3150 -
trunk/guitools/sscc/sscc.vrx
r1019 r1020 95 95 #append ..\shared\inittempdir.vrs 96 96 #append ..\shared\sambainit.vrs 97 #append ..\shared\masterpasswd.vrs 97 98 */ 98 99 return … … 525 526 return 526 527 527 /*:VRX _MasterPasswdCreate528 */529 _MasterPasswdCreate:530 call lineout samba.!masterpasswd, '# Created by 'VRParseFileName(OurINI,'N')' Ver. 'word(VRGet("Main","Hinttext"),2)531 call lineout samba.!masterpasswd, '# syntax:'532 call lineout samba.!masterpasswd, '# username:passwd:UID:GID:login-class:chg pw x sec:deact x sec:GECOS:home:shell'533 call lineout samba.!masterpasswd, 'root:*:0:512::0:0:root:/nonexistent:/usr/sbin/nologin'534 call lineout samba.!masterpasswd, 'guest:*:65534:65534::0:0:guest:/nonexistent:/usr/sbin/nologin'535 ok = stream(samba.!masterpasswd,'c','close')536 return537 538 /*:VRX _MasterPasswdFindUser539 */540 _MasterPasswdFindUser: procedure expose username.541 IF options.!debug == 1 THEN say '_MasterpasswdFindUser("'arg(1)'") started'542 FindUser = arg(1)543 Idx = 0544 do I = 1 to username.0545 if translate(username.I) = translate(FindUser) then do546 Idx = I547 leave548 end549 end550 IF options.!debug == 1 THEN say '_MasterpasswdFindUser("'FindUser'") done, returning 'Idx551 return idx552 /*:VRX _MasterPasswdRead553 */554 _MasterPasswdRead:555 IF options.!debug == 1 THEN say '_MasterpasswdRead() started'556 /* Read complete master.passwd */557 I = 0558 559 do until lines(samba.!masterpasswd) = 0560 userline = strip(linein(samba.!masterpasswd))561 562 /* Skip comments */563 if left(userline,1) = "#" then iterate564 if left(userline,1) = ";" then iterate565 566 /* parse fields into stem variables */567 I = I + 1568 parse var userline username.I':'password.I':'uid.I':'gid.I':'LoginClass.I':'pwchange.I':'deact.I':'gecos.I':'home.I':'shell.I569 570 Status.I =""571 do J = 1 to I - 1572 if translate(Username.J) = translate(Username.I) then do573 status.I = "DUPLICATE"574 leave575 end576 end577 end578 ok = stream(samba.!masterpasswd,'c','close')579 drop userline580 581 /* set "stem roots" properly */582 username.0 = I583 password.0 = I584 uid.0 = I585 gid.0 = I586 loginclass.0= I587 pwchange.0 = I588 deact.0 = I589 gecos.0 = I590 home.0 = I591 shell.0 = I592 593 /* also smbpasswd stems */594 lmhash. = ''595 nthash. = ''596 flags. = ''597 lct. = ''598 lmhash.0 = I599 nthash.0 = I600 flags.0 = I601 lct.0 = I602 603 /* smbusermap stem */604 MapTo. = ''605 MapTo.0 = I606 607 /* our private stem */608 status.0 = I609 IF options.!debug == 1 THEN say '_MasterpasswdRead() done, read 'username.0' users'610 return611 612 /*:VRX _MasterPasswdWrite613 */614 _MasterpasswdWrite:615 IF options.!debug == 1 THEN say "_MasterpasswdWrite() started"616 newmasterpasswd = TempDir'master.passwd'617 618 ok = SysFileDelete(newmasterpasswd)619 620 call lineout newmasterpasswd, '# Created by 'VRParseFileName(OurINI,'N')' Ver. 'word(VRGet("Main","Hinttext"),2)621 call lineout newmasterpasswd, '# syntax:'622 call lineout newmasterpasswd, '# username:passwd:UID:GID:login-class:chg pw x sec:deact x sec:GECOS:home:shell'623 624 do I = 1 to username.0625 select626 when Status.I = "DUPLICATE" & settings.!FixErrors = 1 then iterate627 when Status.I = "UID MISMATCH" then do628 call lineout newmasterpasswd, username.I':'password.I':'word(uid.I,1)':'gid.I':'loginclass.I':'pwchange.I':'deact.I':'gecos.I':'home.I':'shell.I629 end630 when Status.I = "UNIX MISSING" & settings.!FixErrors then do631 call lineout newmasterpasswd, username.I':'password.I':'uid.I':'gid.I':'loginclass.I':'pwchange.I':'deact.I':'gecos.I':'home.I':'shell.I632 end633 otherwise call lineout newmasterpasswd, username.I':'password.I':'uid.I':'gid.I':'loginclass.I':'pwchange.I':'deact.I':'gecos.I':'home.I':'shell.I634 end635 end636 ok = stream(newmasterpasswd,'c','close')637 ok = VRCopyFile( samba.!masterpasswd, samba.!masterpasswd'.bak' )638 ok = VRCopyFile( newmasterpasswd, samba.!masterpasswd )639 ok = SysFileDelete(newmasterpasswd)640 IF options.!debug == 1 THEN say "_MasterpasswdWrite() done"641 return642 643 528 /*:VRX _MsgYesNo 644 529 */ … … 660 545 /*:VRX _MyIniEnum 661 546 */ 662 _MyIniEnum: procedure expose sections. Voc. Val. 547 _MyIniEnum: procedure expose sections. Voc. Val. options. 548 call _debugLog "_MyIniEnum() started." 663 549 CurSection = arg(1) 664 550 do I = 1 to sections.0 … … 676 562 end 677 563 end 564 call _debugLog "_MyIniEnum() done." 678 565 return 679 566 680 567 /*:VRX _MyIniEnumSections 681 568 */ 682 _MyIniEnumSections: procedure expose sections. 683 say'_MyIniEnumSections() started'569 _MyIniEnumSections: procedure expose sections. options. 570 call _DebugLog '_MyIniEnumSections() started' 684 571 smbconf = arg(1) 685 572 sections. = "" … … 714 601 sections.I.0 = J 715 602 ok = stream(smbconf,'c','close') 716 say'_MyIniEnumSections() done.'603 call _DebugLog '_MyIniEnumSections() done.' 717 604 return 718 605 … … 896 783 /*:VRX _SambaRootPWCheck 897 784 */ 898 _SambaRootPWCheck: 785 _SambaRootPWCheck: 786 call _debugLog "_SambaRootPWCheck() started " 899 787 if VRGet("EF_RootPassword","Value") ="" then do 900 788 Msg.type = "E" 901 789 Msg.Text = NLVGetMessage(57, "root") 902 790 call _ShowMsg 791 call _debugLog "_SambaRootPWCheck() done, RC = 0 " 903 792 return 0 904 793 end … … 907 796 Msg.Text = NLVGetMessage(58,"root") 908 797 call _ShowMsg 798 call _debugLog "_SambaRootPWCheck() done, RC = 0 " 909 799 return 0 910 800 end … … 914 804 Msg.Text = NLVGetMessage(59, "root") 915 805 call _ShowMsg 806 call _debugLog "_SambaRootPWCheck() done, RC = 0 " 916 807 return 0 917 808 end 809 call _debugLog "_SambaRootPWCheck() done, RC = 1 " 918 810 return 1 919 811 … … 921 813 */ 922 814 _SambaRootPWSet: 923 IF options.!debug == 1 THEN say "_SambaRootPWSet() started" 924 815 call _DebugLog "_SambaRootPWSet() started" 925 816 /* Write root password to a temp file */ 926 817 pwdfile = TempDir'newpwd' … … 928 819 call lineout pwdfile, VRGet("EF_RootPassword","value") 929 820 ok = stream(pwdfile,"c","close") 930 931 821 /* update Master.passwd and (s)pwd.db */ 932 822 call _MasterPasswdRead 933 823 nx = _MasterPasswdFindUser("root") 934 935 824 call rxFuncAdd "Crypt", "RxCrypt", "RxCrypt" 936 937 825 itoa64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" 938 826 salt = "" … … 956 844 /* Remove the temp password file */ 957 845 ok = SysFileDelete(pwdfile) 958 959 960 846 961 847 /* Deal with swat */ … … 973 859 else call _SambaShowMsg */ 974 860 end 975 IF options.!debug == 1THEN say "_SambaRootPWSet() done"861 call _DebugLog THEN say "_SambaRootPWSet() done" 976 862 return 977 863 /*:VRX _SambaShowError … … 1442 1328 */ 1443 1329 _SmbConfDefault_ShareDrives: 1330 call _debugLog "_SmbConfDefault_ShareDrives() started." 1444 1331 DriveList = SysDriveMap('C:','Local') 1445 1332 1446 1333 do I = 1 to words(DriveList) 1447 1334 CurDrive = word(DriveList,I) 1448 say CurDrive1335 say " CurDrive="Curdrive 1449 1336 Filesys = SysFilesystemType(Curdrive) 1450 1337 DriveInfo=SysDriveInfo(CurDrive) … … 1474 1361 end 1475 1362 ok = stream(smbconf, 'c','close') 1363 call _debugLog "_SmbConfDefault_ShareDrives() done." 1476 1364 return 1477 1365 … … 3031 2919 */ 3032 2920 PB_Install_Default_Click: 2921 ok = VRREdirectStdIO("ON") 3033 2922 if VRGet("EF_Workgroup_Initial","Value") = "" then return 3034 2923 … … 3048 2937 call _SambaRootPWSet 3049 2938 end 2939 3050 2940 call _SambaGuestCreate 3051 2941
Note:
See TracChangeset
for help on using the changeset viewer.