From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 17/54] samba: Remove reset options Date: Tue, 13 Oct 2020 16:07:35 +0000 Message-ID: <20201013160812.27754-17-michael.tremer@ipfire.org> In-Reply-To: <20201013160812.27754-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7583873247416507300==" List-Id: --===============7583873247416507300== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This only requires that we have to change multiple files with the same settings. Signed-off-by: Michael Tremer --- config/rootfiles/packages/aarch64/samba | 5 -- config/rootfiles/packages/armv5tel/samba | 5 -- config/rootfiles/packages/i586/samba | 5 -- config/rootfiles/packages/x86_64/samba | 5 -- config/samba/{default.global =3D> global} | 0 config/samba/{default.pdc =3D> pdc} | 0 config/samba/{default.printer =3D> printer} | 0 config/samba/{default.settings =3D> settings} | 0 config/samba/{default.shares =3D> shares} | 0 html/cgi-bin/samba.cgi | 93 --------------------- lfs/samba | 5 -- src/misc-progs/sambactrl.c | 10 --- 12 files changed, 128 deletions(-) rename config/samba/{default.global =3D> global} (100%) rename config/samba/{default.pdc =3D> pdc} (100%) rename config/samba/{default.printer =3D> printer} (100%) rename config/samba/{default.settings =3D> settings} (100%) rename config/samba/{default.shares =3D> shares} (100%) diff --git a/config/rootfiles/packages/aarch64/samba b/config/rootfiles/packa= ges/aarch64/samba index a707895d9..3bef0733e 100644 --- a/config/rootfiles/packages/aarch64/samba +++ b/config/rootfiles/packages/aarch64/samba @@ -793,11 +793,6 @@ usr/sbin/smbd usr/sbin/winbindd var/ipfire/backup/addons/includes/samba #var/ipfire/samba -var/ipfire/samba/default.global -var/ipfire/samba/default.pdc -var/ipfire/samba/default.printer -var/ipfire/samba/default.settings -var/ipfire/samba/default.shares var/ipfire/samba/global var/ipfire/samba/pdc var/ipfire/samba/printer diff --git a/config/rootfiles/packages/armv5tel/samba b/config/rootfiles/pack= ages/armv5tel/samba index 885d9e154..f58d4fc2f 100644 --- a/config/rootfiles/packages/armv5tel/samba +++ b/config/rootfiles/packages/armv5tel/samba @@ -793,11 +793,6 @@ usr/sbin/smbd usr/sbin/winbindd var/ipfire/backup/addons/includes/samba #var/ipfire/samba -var/ipfire/samba/default.global -var/ipfire/samba/default.pdc -var/ipfire/samba/default.printer -var/ipfire/samba/default.settings -var/ipfire/samba/default.shares var/ipfire/samba/global var/ipfire/samba/pdc var/ipfire/samba/printer diff --git a/config/rootfiles/packages/i586/samba b/config/rootfiles/packages= /i586/samba index e942471e2..e74caeea0 100644 --- a/config/rootfiles/packages/i586/samba +++ b/config/rootfiles/packages/i586/samba @@ -793,11 +793,6 @@ usr/sbin/smbd usr/sbin/winbindd var/ipfire/backup/addons/includes/samba #var/ipfire/samba -var/ipfire/samba/default.global -var/ipfire/samba/default.pdc -var/ipfire/samba/default.printer -var/ipfire/samba/default.settings -var/ipfire/samba/default.shares var/ipfire/samba/global var/ipfire/samba/pdc var/ipfire/samba/printer diff --git a/config/rootfiles/packages/x86_64/samba b/config/rootfiles/packag= es/x86_64/samba index 1c31256db..c91252a30 100644 --- a/config/rootfiles/packages/x86_64/samba +++ b/config/rootfiles/packages/x86_64/samba @@ -793,11 +793,6 @@ usr/sbin/smbd usr/sbin/winbindd var/ipfire/backup/addons/includes/samba #var/ipfire/samba -var/ipfire/samba/default.global -var/ipfire/samba/default.pdc -var/ipfire/samba/default.printer -var/ipfire/samba/default.settings -var/ipfire/samba/default.shares var/ipfire/samba/global var/ipfire/samba/pdc var/ipfire/samba/printer diff --git a/config/samba/default.global b/config/samba/global similarity index 100% rename from config/samba/default.global rename to config/samba/global diff --git a/config/samba/default.pdc b/config/samba/pdc similarity index 100% rename from config/samba/default.pdc rename to config/samba/pdc diff --git a/config/samba/default.printer b/config/samba/printer similarity index 100% rename from config/samba/default.printer rename to config/samba/printer diff --git a/config/samba/default.settings b/config/samba/settings similarity index 100% rename from config/samba/default.settings rename to config/samba/settings diff --git a/config/samba/default.shares b/config/samba/shares similarity index 100% rename from config/samba/default.shares rename to config/samba/shares diff --git a/html/cgi-bin/samba.cgi b/html/cgi-bin/samba.cgi index 0510f0f24..31751ff4c 100644 --- a/html/cgi-bin/samba.cgi +++ b/html/cgi-bin/samba.cgi @@ -128,85 +128,10 @@ if ($sambasettings{'ACTION'} eq 'smbrestart'){system("/= usr/local/bin/sambactrl s if ($sambasettings{'ACTION'} eq 'smbstart'){system("/usr/local/bin/sambactrl= smbstart");refreshpage();} if ($sambasettings{'ACTION'} eq 'smbstop'){system("/usr/local/bin/sambactrl = smbstop");refreshpage();} if ($sambasettings{'ACTION'} eq 'smbreload'){system("/usr/local/bin/sambactr= l smbreload");refreshpage();} -if ($sambasettings{'ACTION'} eq 'globalresetyes') - { - system("/usr/local/bin/sambactrl smbglobalreset"); - $sambasettings{'WORKGRP'} =3D 'homeip.net'; - $sambasettings{'INTERFACES'} =3D ''; - $sambasettings{'SECURITY'} =3D 'user'; - $sambasettings{'OSLEVEL'} =3D '65'; - $sambasettings{'GREEN'} =3D 'on'; - $sambasettings{'BLUE'} =3D 'off'; - $sambasettings{'ORANGE'} =3D 'off'; - $sambasettings{'VPN'} =3D 'off'; - $sambasettings{'REMOTEANNOUNCE'} =3D ''; - $sambasettings{'REMOTESYNC'} =3D ''; - $sambasettings{'PASSWORDSYNC'} =3D 'off'; - $sambasettings{'OTHERINTERFACES'} =3D '127.0.0.1'; - $sambasettings{'GUESTACCOUNT'} =3D 'samba'; - $sambasettings{'MAPTOGUEST'} =3D 'Bad User'; -### Samba CUPS Variablen - $sambasettings{'LOADPRINTERS'} =3D 'Yes'; - $sambasettings{'PRINTING'} =3D 'cups'; - $sambasettings{'PRINTCAPNAME'} =3D 'cups'; - $sambasettings{'PRINTERNAME'} =3D 'Printer'; -### Values that have to be initialized - $sambasettings{'WIDELINKS'} =3D 'on'; - $sambasettings{'UNIXEXTENSION'} =3D 'off'; - $sambasettings{'ACTION'} =3D ''; - $sambasettings{'LOCALMASTER'} =3D 'off'; - $sambasettings{'DOMAINMASTER'} =3D 'off'; - $sambasettings{'PREFERREDMASTER'} =3D 'off'; - $sambasettings{'WIDELINKS'} =3D 'on'; - $sambasettings{'UNIXEXTENSION'} =3D 'off'; - $PDCOPTIONS =3D `cat ${General::swroot}/samba/pdc`; - system("/usr/local/bin/sambactrl smbreload"); - refreshpage(); - } - if ($sambasettings{'ACTION'} eq 'join') { $message .=3D &joindomain($sambasettings{'USERNAME'}, $sambasettings{'PASSW= ORD'}); } =20 -############################################################################= ################################################ -################################################ Sicherheitsabfrage f=C3=BCr= den Reset ########################################## - -if ($sambasettings{'ACTION'} eq 'globalreset') - { - print < - - - - -
$La= ng::tr{'resetglobals'} -
- $Lang::tr{'yes'} -
- $Lang::tr{'no'}=20 -
-END -; -} - -if ($sambasettings{'ACTION'} eq 'sharesreset') - { - print < - - - - -
$La= ng::tr{'resetshares'} -
- $Lang::tr{'yes'} -
- $Lang::tr{'no'}=20 -
-END -; - } - ############################################################################= ################################################ ########################################### Samba Benutzer oder PC l=EF=BF= =BDchen ################################################# =20 @@ -526,9 +451,6 @@ print <
-
- -
@@ -906,10 +828,6 @@ print < -
- - -
@@ -928,7 +846,6 @@ if ($sambasettings{'ACTION'} eq 'sharecaption') <= /td>$Lang::tr{'add share'} = $Lang::tr{'edit share'} $Lang::tr{'save config'} - $Lang::tr{'reset shares'} $Lang::tr{'delete share'} END @@ -976,12 +893,6 @@ END ; } =20 -if ($sambasettings{'ACTION'} eq 'sharesresetyes') - { - system('/usr/local/bin/sambactrl smbsharesreset'); - my $shares =3D config("${General::swroot}/samba/shares"); - system("/usr/local/bin/sambactrl smbreload"); - } if ($sambasettings{'ACTION'} eq 'smbshareadd') { $shares{'xvx'}=3D "$sambasettings{'SHAREOPTION'}"; @@ -1047,10 +958,6 @@ print < -
- - -
diff --git a/lfs/samba b/lfs/samba index cd20baffc..5c527b257 100644 --- a/lfs/samba +++ b/lfs/samba @@ -101,11 +101,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP)/source3 && install -v -m644 ../examples/smb.conf.default /var= /ipfire/samba cp -vrf $(DIR_SRC)/config/samba/* /var/ipfire/samba/ chown nobody:nobody -R /var/ipfire/samba/ - cp -vfp /var/ipfire/samba/default.global /var/ipfire/samba/global - cp -vfp /var/ipfire/samba/default.pdc /var/ipfire/samba/pdc - cp -vfp /var/ipfire/samba/default.settings /var/ipfire/samba/settings - cp -vfp /var/ipfire/samba/default.shares /var/ipfire/samba/shares - cp -vfp /var/ipfire/samba/default.printer /var/ipfire/samba/printer cat /var/ipfire/samba/global /var/ipfire/samba/shares > /var/ipfire/samba/s= mb.conf rm -rf /var/lib/samba/private ln -s /var/ipfire/samba/private /var/lib/samba/private diff --git a/src/misc-progs/sambactrl.c b/src/misc-progs/sambactrl.c index 138a0b84f..2724bfc34 100644 --- a/src/misc-progs/sambactrl.c +++ b/src/misc-progs/sambactrl.c @@ -46,16 +46,6 @@ int main(int argc, char *argv[]) { } else if (strcmp(argv[1], "smbsafeconfpdccups") =3D=3D 0) { safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/pdc /var/= ipfire/samba/shares /var/ipfire/samba/printer > /var/ipfire/samba/smb.conf"); =20 - } else if (strcmp(argv[1], "smbglobalreset") =3D=3D 0) { - safe_system("/bin/cat /var/ipfire/samba/default.global /var/ipfire/samba/s= hares > /var/ipfire/samba/smb.conf"); - safe_system("/bin/cat /var/ipfire/samba/default.settings > /var/ipfire/sam= ba/settings"); - safe_system("/bin/cat /var/ipfire/samba/default.global > /var/ipfire/samba= /global"); - safe_system("/bin/cat /var/ipfire/samba/default.pdc > /var/ipfire/samba/pd= c"); - - } else if (strcmp(argv[1], "smbsharesreset") =3D=3D 0) { - safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/default.s= hares > /var/ipfire/samba/smb.conf"); - safe_system("/bin/cat /var/ipfire/samba/default.shares > /var/ipfire/samba= /shares"); - } else if (strcmp(argv[1], "smbstop") =3D=3D 0) { safe_system("/etc/rc.d/init.d/samba stop >/dev/null"); safe_system("/usr/local/bin/sambactrl disable"); --=20 2.20.1 --===============7583873247416507300==--