public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH 17/54] samba: Remove reset options
Date: Tue, 13 Oct 2020 16:07:35 +0000	[thread overview]
Message-ID: <20201013160812.27754-17-michael.tremer@ipfire.org> (raw)
In-Reply-To: <20201013160812.27754-1-michael.tremer@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 14439 bytes --]

This only requires that we have to change multiple files with
the same settings.

Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
---
 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 => global}     |  0
 config/samba/{default.pdc => pdc}           |  0
 config/samba/{default.printer => printer}   |  0
 config/samba/{default.settings => settings} |  0
 config/samba/{default.shares => 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 => global} (100%)
 rename config/samba/{default.pdc => pdc} (100%)
 rename config/samba/{default.printer => printer} (100%)
 rename config/samba/{default.settings => settings} (100%)
 rename config/samba/{default.shares => shares} (100%)

diff --git a/config/rootfiles/packages/aarch64/samba b/config/rootfiles/packages/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/packages/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/packages/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/sambactrl smbreload");refreshpage();}
-if ($sambasettings{'ACTION'} eq 'globalresetyes')
-	{
-	system("/usr/local/bin/sambactrl smbglobalreset");
-	$sambasettings{'WORKGRP'} = 'homeip.net';
-	$sambasettings{'INTERFACES'} = '';
-	$sambasettings{'SECURITY'} = 'user';
-	$sambasettings{'OSLEVEL'} = '65';
-	$sambasettings{'GREEN'} = 'on';
-	$sambasettings{'BLUE'} = 'off';
-	$sambasettings{'ORANGE'} = 'off';
-	$sambasettings{'VPN'} = 'off';
-	$sambasettings{'REMOTEANNOUNCE'} = '';
-	$sambasettings{'REMOTESYNC'} = '';
-	$sambasettings{'PASSWORDSYNC'} = 'off';
-	$sambasettings{'OTHERINTERFACES'} = '127.0.0.1';
-	$sambasettings{'GUESTACCOUNT'} = 'samba';
-	$sambasettings{'MAPTOGUEST'} = 'Bad User';
-### Samba CUPS Variablen
-	$sambasettings{'LOADPRINTERS'} = 'Yes';
-	$sambasettings{'PRINTING'} = 'cups';
-	$sambasettings{'PRINTCAPNAME'} = 'cups';
-	$sambasettings{'PRINTERNAME'} = 'Printer';
-### Values that have to be initialized
-	$sambasettings{'WIDELINKS'} = 'on';
-	$sambasettings{'UNIXEXTENSION'} = 'off';
-	$sambasettings{'ACTION'} = '';
-	$sambasettings{'LOCALMASTER'} = 'off';
-	$sambasettings{'DOMAINMASTER'} = 'off';
-	$sambasettings{'PREFERREDMASTER'} = 'off';
-	$sambasettings{'WIDELINKS'} = 'on';
-	$sambasettings{'UNIXEXTENSION'} = 'off';
-	$PDCOPTIONS = `cat ${General::swroot}/samba/pdc`;
-	system("/usr/local/bin/sambactrl smbreload");
-	refreshpage();
-	}
-
 if ($sambasettings{'ACTION'} eq 'join') {
 	$message .= &joindomain($sambasettings{'USERNAME'}, $sambasettings{'PASSWORD'});
 }
 
-############################################################################################################################
-################################################ Sicherheitsabfrage für den Reset ##########################################
-
-if ($sambasettings{'ACTION'} eq 'globalreset')
-	{
-	print <<END
-	<br />
-	<table width='95%' cellspacing='0'>
-	<tr><td bgcolor='$color{'color20'}' colspan='3' align='center'><b>$Lang::tr{'resetglobals'}</b>
-	<tr><td align='right' width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
-					 $Lang::tr{'yes'} <input type='image' alt='$Lang::tr{'yes'}' title='$Lang::tr{'yes'}' src='/images/edit-redo.png' />
-					<input type='hidden' name='ACTION' value='globalresetyes' /></form></td>
-			<td align='left'  width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
-					<input type='image' alt='$Lang::tr{'no'}' title='$Lang::tr{'no'}' src='/images/dialog-error.png' /> $Lang::tr{'no'} 
-					<input type='hidden' name='ACTION' value='cancel' /></form></td>
-	</tr>
-	</table>
-END
-;
-}
-
-if ($sambasettings{'ACTION'} eq 'sharesreset')
-	{
-	print <<END
-	<br />
-	<table width='95%' cellspacing='0'>
-	<tr><td bgcolor='$color{'color20'}' colspan='3' align='center'><b>$Lang::tr{'resetshares'}</b>
-	<tr><td align='right'  width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
-					 $Lang::tr{'yes'} <input type='image' alt='$Lang::tr{'yes'}' title='$Lang::tr{'yes'}' src='/images/edit-redo.png' />
-					<input type='hidden' name='ACTION' value='sharesresetyes' /></form></td>
-			<td align='left'  width='50%'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
-					<input type='image' alt='$Lang::tr{'no'}' title='$Lang::tr{'no'}' src='/images/dialog-error.png' /> $Lang::tr{'no'} 
-					<input type='hidden' name='ACTION' value='cancel' /></form></td>
-	</tr>
-	</table>
-END
-;
-	}
-
 ############################################################################################################################
 ########################################### Samba Benutzer oder PC l�chen #################################################
 
@@ -526,9 +451,6 @@ print <<END
 <tr><td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
 												<input type='hidden' name='ACTION' value=$Lang::tr{'save'} />
 												<input type='image' alt='$Lang::tr{'save'}' title='$Lang::tr{'save'}' src='/images/media-floppy.png' /></form></td>
-<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
-										<input type='hidden' name='ACTION' value='globalreset' />
-										<input type='image' alt='$Lang::tr{'reset'}' title='$Lang::tr{'reset'}' src='/images/reload.gif' /></form></td>
 <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'>
 										<input type='hidden' name='ACTION' value='globalcaption' />
 										<input type='image' alt='$Lang::tr{'caption'}' title='$Lang::tr{'caption'}' src='/images/help-browser.png' /></form></td></tr>
@@ -906,10 +828,6 @@ print <<END
 												<input type='hidden' name='ACTION' value='shareadd' />
 												<input type='image' alt='$Lang::tr{'add share'}' title='$Lang::tr{'add share'}' src='/images/list-add.png' />
 												</form></td>
-		<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}#$Lang::tr{'manage shares'}'>
-												<input type='hidden' name='ACTION' value='sharesreset' />
-												<input type='image' alt='$Lang::tr{'reset'}' title='$Lang::tr{'reset'}' src='/images/reload.gif' />
-												</form></td>
 		<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}#$Lang::tr{'manage shares'}'>
 												<input type='hidden' name='ACTION' value='sharecaption' />
 												<input type='image' alt='$Lang::tr{'caption'}' title='$Lang::tr{'caption'}' src='/images/help-browser.png' />
@@ -928,7 +846,6 @@ if ($sambasettings{'ACTION'} eq 'sharecaption')
 	<tr><td align='right' width='33%'><img src='/images/list-add.png' /></td><td align='left'>$Lang::tr{'add share'}</td></tr>
 	<tr><td align='right' width='33%'><img src='/images/edit.gif' /></td><td align='left'>$Lang::tr{'edit share'}</td></tr>
 	<tr><td align='right' width='33%'><img src='/images/media-floppy.png' /></td><td align='left'>$Lang::tr{'save config'}</td></tr>
-	<tr><td align='right' width='33%'><img src='/images/reload.gif' /></td><td align='left'>$Lang::tr{'reset shares'}</td></tr>
 	<tr><td align='right' width='33%'><img src='/images/user-trash.png' /></td><td align='left'>$Lang::tr{'delete share'}</td></tr>
 	</table>
 END
@@ -976,12 +893,6 @@ END
 ;
 	}
 
-if ($sambasettings{'ACTION'} eq 'sharesresetyes')
-	{
-	system('/usr/local/bin/sambactrl smbsharesreset');
-	my $shares = config("${General::swroot}/samba/shares");
-	system("/usr/local/bin/sambactrl smbreload");
-	}
 if ($sambasettings{'ACTION'} eq 'smbshareadd')
 	{
 	$shares{'xvx'}= "$sambasettings{'SHAREOPTION'}";
@@ -1047,10 +958,6 @@ print <<END
 												<input type='hidden' name='ACTION' value='printeradd' />
 												<input type='image' alt='$Lang::tr{'add printer'}' title='$Lang::tr{'add printer'}' src='/images/list-add.png' />
 												</form></td>
-		<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}#$Lang::tr{'manage printers'}'>
-												<input type='hidden' name='ACTION' value='printereset' />
-												<input type='image' alt='$Lang::tr{'reset'}' title='$Lang::tr{'reset'}' src='/images/reload.gif' />
-												</form></td>
 		<td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}#$Lang::tr{'manage printers'}'>
 												<input type='hidden' name='ACTION' value='printercaption' />
 												<input type='image' alt='$Lang::tr{'caption'}' title='$Lang::tr{'caption'}' src='/images/help-browser.png' />
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/smb.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") == 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");
 
-	} else if (strcmp(argv[1], "smbglobalreset") == 0) {
-		safe_system("/bin/cat /var/ipfire/samba/default.global /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf");
-		safe_system("/bin/cat /var/ipfire/samba/default.settings > /var/ipfire/samba/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/pdc");
-
-	} else if (strcmp(argv[1], "smbsharesreset") == 0) {
-		safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/default.shares > /var/ipfire/samba/smb.conf");
-		safe_system("/bin/cat /var/ipfire/samba/default.shares > /var/ipfire/samba/shares");
-
 	} else if (strcmp(argv[1], "smbstop") == 0) {
 		safe_system("/etc/rc.d/init.d/samba stop >/dev/null");
 		safe_system("/usr/local/bin/sambactrl disable");
-- 
2.20.1


  parent reply	other threads:[~2020-10-13 16:07 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 16:07 [PATCH 01/54] samba: Migrate configuration from Samba 3.6 to 4.x Michael Tremer
2020-10-13 16:07 ` [PATCH 02/54] samba: Migrate older backups too and use standard update mechasism Michael Tremer
2020-10-13 16:07 ` [PATCH 03/54] samba: Remove deprecated syslog options Michael Tremer
2020-10-13 16:07 ` [PATCH 04/54] samba: Remove socket options Michael Tremer
2020-10-13 16:07 ` [PATCH 05/54] samba: Show status output in monospace font Michael Tremer
2020-10-13 16:07 ` [PATCH 06/54] samba: Correctly escape status output Michael Tremer
2020-10-13 16:07 ` [PATCH 07/54] samba: Update SECURITY option in settings, too Michael Tremer
2020-10-13 16:07 ` [PATCH 08/54] samba: Remove deprecated encrypt/null passwords options Michael Tremer
2020-10-13 16:07 ` [PATCH 09/54] samba: Remove any options left to default value in global section Michael Tremer
2020-10-13 16:07 ` [PATCH 10/54] sambactrl: Remove unused reset command Michael Tremer
2020-10-13 16:07 ` [PATCH 11/54] samba: Drop outdated character set settings Michael Tremer
2020-10-13 16:07 ` [PATCH 12/54] samba: Hard-code server string Michael Tremer
2020-10-13 16:07 ` [PATCH 13/54] samba: Drop netbios name option Michael Tremer
2020-10-13 16:07 ` [PATCH 14/54] samba: Remove limitation that server only uses SMB2 Michael Tremer
2020-10-13 16:07 ` [PATCH 15/54] samba: Drop support for WINS Michael Tremer
2020-10-13 16:07 ` [PATCH 16/54] samba: Log to syslog Michael Tremer
2020-10-13 16:07 ` Michael Tremer [this message]
2020-10-13 16:07 ` [PATCH 18/54] samba: Remove help popup Michael Tremer
2020-10-13 16:07 ` [PATCH 19/54] samba: Always show printer options Michael Tremer
2020-10-13 16:07 ` [PATCH 20/54] samba: Remove printer management Michael Tremer
2020-10-13 16:07 ` [PATCH 21/54] samba: Export all printers from CUPS Michael Tremer
2020-10-13 16:07 ` [PATCH 22/54] samba: Add option to require clients to encrypt the connection Michael Tremer
2020-10-13 16:07 ` [PATCH 23/54] samba: Drop interfaces configuration Michael Tremer
2020-10-13 16:07 ` [PATCH 24/54] samba: Drop support for being PDC for Windows NT domains Michael Tremer
2020-10-13 16:07 ` [PATCH 25/54] samba: Remove local master option Michael Tremer
2020-10-13 16:07 ` [PATCH 26/54] samba: Remove preferred " Michael Tremer
2020-10-13 16:07 ` [PATCH 27/54] samba: Drop PDC default configuration Michael Tremer
2020-10-13 16:07 ` [PATCH 28/54] samba: Remove OS level Michael Tremer
2020-10-13 16:07 ` [PATCH 29/54] samba: Remove move unused network variables Michael Tremer
2020-10-13 16:07 ` [PATCH 30/54] samba: Remove un-exported password sync option Michael Tremer
2020-10-13 16:07 ` [PATCH 31/54] samba: Refactor service status Michael Tremer
2020-10-13 16:07 ` [PATCH 32/54] samba: Drop refresh page hack Michael Tremer
2020-10-13 16:07 ` [PATCH 33/54] samba: Add tbl class to all <table>s Michael Tremer
2020-10-13 16:07 ` [PATCH 34/54] samba: Replace icons on top of page with buttons Michael Tremer
2020-10-13 16:07 ` [PATCH 35/54] samba: Re-indent global settings table Michael Tremer
2020-10-13 16:07 ` [PATCH 36/54] samba: Replace save icon with a button and remove legend Michael Tremer
2020-10-13 16:07 ` [PATCH 37/54] samba: Remove more legends Michael Tremer
2020-10-13 16:07 ` [PATCH 38/54] samba: Remove unused anchors Michael Tremer
2020-10-13 16:07 ` [PATCH 39/54] samba: Refactor shares section Michael Tremer
2020-10-13 16:07 ` [PATCH 40/54] samba: Refactor status area Michael Tremer
2020-10-13 16:07 ` [PATCH 41/54] samba: Use full page width for all tables Michael Tremer
2020-10-13 16:08 ` [PATCH 42/54] samba: Enable support for Apple's OS X by default Michael Tremer
2020-10-13 16:08 ` [PATCH 43/54] samba: Drop choice to enable/disable wide links/UNIX extensions Michael Tremer
2020-10-13 16:08 ` [PATCH 44/54] samba: Add recycle extension, too Michael Tremer
2020-10-13 16:08 ` [PATCH 45/54] samba: Change share template to something more safe Michael Tremer
2020-10-13 16:08 ` [PATCH 46/54] samba: Replace security setting with server role Michael Tremer
2020-10-13 16:08 ` [PATCH 47/54] samba: Automatically migrate role setting Michael Tremer
2020-10-13 16:08 ` [PATCH 48/54] samba: Remove tbl class from join form Michael Tremer
2020-10-13 16:08 ` [PATCH 49/54] samba: Set a useful default workgroup Michael Tremer
2020-10-13 16:08 ` [PATCH 50/54] samba: Refactor user management Michael Tremer
2020-10-13 16:08 ` [PATCH 51/54] samba: Use the same delete icon as everywhere else Michael Tremer
2020-10-13 16:08 ` [PATCH 52/54] samba: Remove unused INTERFACES setting Michael Tremer
2020-10-13 16:08 ` [PATCH 53/54] samba: Allow rewriting configuration from CLI Michael Tremer
2020-10-13 16:08 ` [PATCH 54/54] samba: Bump package version Michael Tremer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201013160812.27754-17-michael.tremer@ipfire.org \
    --to=michael.tremer@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox