From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 19/54] samba: Always show printer options Date: Tue, 13 Oct 2020 16:07:37 +0000 Message-ID: <20201013160812.27754-19-michael.tremer@ipfire.org> In-Reply-To: <20201013160812.27754-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6902126808386425564==" List-Id: --===============6902126808386425564== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Samba is always linked against CUPS and therefore there is no way to disable printing anyways. Signed-off-by: Michael Tremer --- html/cgi-bin/samba.cgi | 53 ++------------------------------------ src/misc-progs/sambactrl.c | 6 ----- 2 files changed, 2 insertions(+), 57 deletions(-) diff --git a/html/cgi-bin/samba.cgi b/html/cgi-bin/samba.cgi index abf5e3295..cd0cc8ab8 100644 --- a/html/cgi-bin/samba.cgi +++ b/html/cgi-bin/samba.cgi @@ -89,10 +89,6 @@ $sambasettings{'WIDELINKS'} =3D 'on'; $sambasettings{'UNIXEXTENSION'} =3D 'off'; ### Values that have to be initialized $sambasettings{'ACTION'} =3D ''; -### Samba CUPS Variablen -$sambasettings{'LOADPRINTERS'} =3D 'Yes'; -$sambasettings{'PRINTING'} =3D 'cups'; -$sambasettings{'PRINTCAPNAME'} =3D 'cups'; my $LOGLINES =3D '50'; =20 ################################################## Samba PDC Variablen #####= ################################################ @@ -204,25 +200,11 @@ logging =3D syslog preferred master =3D $sambasettings{'PREFERREDMASTER'} domain master =3D $sambasettings{'DOMAINMASTER'} local master =3D $sambasettings{'LOCALMASTER'} - END ; close FILE; =20 - if (-e "${General::swroot}/cups/enable"){ - open (FILE, ">>${General::swroot}/samba/global") or die "Can't save the glo= bal cups settings: $!"; - flock (FILE, 2); - print FILE <${General::swroot}/samba/pdc") or die "Can't save the pdc set= tings: $!"; flock (FILE, 2); @@ -239,16 +221,8 @@ END close FILE; } =20 -if ( -e "/var/ipfire/cups/enable") - { - if ( $sambasettings{'SECURITY'} eq 'user' && $sambasettings{'DOMAINMASTER'}= eq 'true' ){system("/usr/local/bin/sambactrl smbsafeconfpdccups");refreshpag= e();} - else {system("/usr/local/bin/sambactrl smbsafeconfcups");} - } -else - { if ( $sambasettings{'SECURITY'} eq 'user' && $sambasettings{'DOMAINMASTER'}= eq 'true' ){system("/usr/local/bin/sambactrl smbsafeconfpdc");refreshpage();} else{system("/usr/local/bin/sambactrl smbsafeconf");} - } =20 system("/usr/local/bin/sambactrl smbreload");refreshpage(); } @@ -432,18 +406,6 @@ END ; } =09 - if ( -e "/var/ipfire/cups/enable") - { - print <
- $Lang= ::tr{'printing options'} - $Lang::tr{'load printer'} - $Lang::tr{'printing'} - $Lang::tr{'printcap name'} -END -; - } - print <
@@ -916,8 +878,6 @@ if ($sambasettings{'ACTION'} eq 'smbsharechange') =20 my %printer =3D config("${General::swroot}/samba/printer"); =20 -if ( -e "/var/ipfire/cups/enable") -{ &Header::openbox('100%', 'center', $Lang::tr{'printer'}); =20 my @Printers =3D keys(%printer); @@ -1026,7 +986,6 @@ if ($sambasettings{'ACTION'} eq 'smbprinterchange') } =20 &Header::closebox(); -} =20 ############################################################################= ################################################ ############################################### Anzeige des Sambastatus ####= ################################################ @@ -1098,16 +1057,8 @@ if ( $smb eq 'shares') =20 close FILE; =20 -if ( -e "/var/ipfire/cups/enable") - { - if ( $sambasettings{'SECURITY'} eq 'user' && $sambasettings{'DOMAINMASTER'}= eq 'true' ){system("/usr/local/bin/sambactrl smbsafeconfpdccups");} - else {system("/usr/local/bin/sambactrl smbsafeconfcups");} - } -else - { - if ( $sambasettings{'SECURITY'} eq 'user' && $sambasettings{'DOMAINMASTER'}= eq 'true' ){system("/usr/local/bin/sambactrl smbsafeconfpdc");} +if ( $sambasettings{'SECURITY'} eq 'user' && $sambasettings{'DOMAINMASTER'} = eq 'true' ){system("/usr/local/bin/sambactrl smbsafeconfpdc");} else{system("/usr/local/bin/sambactrl smbsafeconf");} - } =20 system("/usr/local/bin/sambactrl smbreload"); refreshpage(); diff --git a/src/misc-progs/sambactrl.c b/src/misc-progs/sambactrl.c index 2724bfc34..1dcc8ee61 100644 --- a/src/misc-progs/sambactrl.c +++ b/src/misc-progs/sambactrl.c @@ -37,15 +37,9 @@ int main(int argc, char *argv[]) { } else if (strcmp(argv[1], "smbsafeconf") =3D=3D 0) { safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/shares > = /var/ipfire/samba/smb.conf"); =20 - } else if (strcmp(argv[1], "smbsafeconfcups") =3D=3D 0) { - safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/shares /v= ar/ipfire/samba/printer > /var/ipfire/samba/smb.conf"); - } else if (strcmp(argv[1], "smbsafeconfpdc") =3D=3D 0) { safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/pdc /var/= ipfire/samba/shares > /var/ipfire/samba/smb.conf"); =20 - } 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"); - } 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 --===============6902126808386425564==--