From patchwork Tue Oct 13 16:07:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 3545 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4C9gT13hNKz3x69 for ; Tue, 13 Oct 2020 16:08:37 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4C9gSp6qkvz1Hg; Tue, 13 Oct 2020 16:08:26 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4C9gSl5xVkz304J; Tue, 13 Oct 2020 16:08:23 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4C9gSk2mLmz2y3n for ; Tue, 13 Oct 2020 16:08:22 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4C9gSj1P3fz1G6; Tue, 13 Oct 2020 16:08:21 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1602605301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hY2pmnqk+3r1/0StmKxZNRowwL5QoPPQi6Evto3es/g=; b=uCFdHjA1KgjF/mOGVpi+HBeHYDSFVuVVLGBbrzK62vI1Z8BdiWMdFFYS0poXS1eZnL//G9 sTdZ4xY+fJ8pfKCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1602605301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hY2pmnqk+3r1/0StmKxZNRowwL5QoPPQi6Evto3es/g=; b=gIypoodhMCK2+1vuz8fEWx7Xs3oPvbwAjMPVaNYsRjf/v4SsPnkeKSUrN8StSwmTwpjDMS qcnk4OUjhNTLhekcSE0vTTSb+DcWcjNowP1+5cEplEkrd5of4FAdEeis7aI0DrRypVlSId ayLy0ItLSjJUppp1Nkj51nNwKnADG8scgd3KV1GpVkEYenoMFpgi7WizpwMoU85i+DbvvS LoPMX5NHJOyLy8W11sE9R2Omb/yaNbf0QaQlPonc8DJ1ZW5N95F4YvagGtAGA/8TPu+w76 EtpdJzovLkeTrpVgtdm4c7vI09imOLSIWYW10/PZBFtM075lZuYUnL4APIvung== 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> References: <20201013160812.27754-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" 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'} = 'on'; $sambasettings{'UNIXEXTENSION'} = 'off'; ### Values that have to be initialized $sambasettings{'ACTION'} = ''; -### Samba CUPS Variablen -$sambasettings{'LOADPRINTERS'} = 'Yes'; -$sambasettings{'PRINTING'} = 'cups'; -$sambasettings{'PRINTCAPNAME'} = 'cups'; my $LOGLINES = '50'; ################################################## Samba PDC Variablen ##################################################### @@ -204,25 +200,11 @@ logging = syslog preferred master = $sambasettings{'PREFERREDMASTER'} domain master = $sambasettings{'DOMAINMASTER'} local master = $sambasettings{'LOCALMASTER'} - END ; close FILE; - if (-e "${General::swroot}/cups/enable"){ - open (FILE, ">>${General::swroot}/samba/global") or die "Can't save the global cups settings: $!"; - flock (FILE, 2); - print FILE <${General::swroot}/samba/pdc") or die "Can't save the pdc settings: $!"; flock (FILE, 2); @@ -239,16 +221,8 @@ END close FILE; } -if ( -e "/var/ipfire/cups/enable") - { - if ( $sambasettings{'SECURITY'} eq 'user' && $sambasettings{'DOMAINMASTER'} eq 'true' ){system("/usr/local/bin/sambactrl smbsafeconfpdccups");refreshpage();} - 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");} - } system("/usr/local/bin/sambactrl smbreload");refreshpage(); } @@ -432,18 +406,6 @@ END ; } - 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') my %printer = config("${General::swroot}/samba/printer"); -if ( -e "/var/ipfire/cups/enable") -{ &Header::openbox('100%', 'center', $Lang::tr{'printer'}); my @Printers = keys(%printer); @@ -1026,7 +986,6 @@ if ($sambasettings{'ACTION'} eq 'smbprinterchange') } &Header::closebox(); -} ############################################################################################################################ ############################################### Anzeige des Sambastatus #################################################### @@ -1098,16 +1057,8 @@ if ( $smb eq 'shares') close FILE; -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");} - } 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") == 0) { safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf"); - } else if (strcmp(argv[1], "smbsafeconfcups") == 0) { - safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/shares /var/ipfire/samba/printer > /var/ipfire/samba/smb.conf"); - } else if (strcmp(argv[1], "smbsafeconfpdc") == 0) { safe_system("/bin/cat /var/ipfire/samba/global /var/ipfire/samba/pdc /var/ipfire/samba/shares > /var/ipfire/samba/smb.conf"); - } 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], "smbstop") == 0) { safe_system("/etc/rc.d/init.d/samba stop >/dev/null"); safe_system("/usr/local/bin/sambactrl disable");