From patchwork Tue Oct 13 16:07:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 3542 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 4C9gSy5Nmfz3x6D for ; Tue, 13 Oct 2020 16:08:34 +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 4C9gSm5rnXz1Hf; Tue, 13 Oct 2020 16:08:24 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4C9gSj4BDzz304t; Tue, 13 Oct 2020 16:08:21 +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 4C9gSg6Y4tz2xBf for ; Tue, 13 Oct 2020 16:08:19 +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 4C9gSg4ctKzlb; Tue, 13 Oct 2020 16:08:19 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1602605299; 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=FZexVCd0VCVFhTzZsQ377XmzmMv/QqZEMM2dvenYZvM=; b=Pvj0lm/7Q/6SoqFdFooySG7POTfgKsesbs11F40fB2h//5OIxbI68gQ/oenx0PUPwhWj8C eAOYifcstBmLNmBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1602605299; 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=FZexVCd0VCVFhTzZsQ377XmzmMv/QqZEMM2dvenYZvM=; b=cM0pF2IRRBC+6xeR3ULGYWveeODIwlurS3GO9aNBrFDHkTKleyQRQgH9pw1DTtQ9n4Gm6O lGFdJZBa2XR9JpysVLu1djkC/U5B4fhnxzxJg6y0Sg65jP/8xSjz2SniZ9yWYKTYRMx/XJ FD/aM5CJCuqmlw1DJ1WX5VCYw7MFZ+OeAbowhXhJkfC7GN+Oyy2UwO5IleyFHXTFpp1WCO /fg5Z/RA+fUDhDLjVLLOgqdKn7UEPuAsBiPNZG2PUlLQKaLzBUbe3ofQqhIl/ZQU9rqyhg zxEfoMFcVqsPlD/5eY9n/P4tRdTpH6cffAYfp0tt1LcPRzplQUkTePZ1/rFTQw== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 16/54] samba: Log to syslog Date: Tue, 13 Oct 2020 16:07:34 +0000 Message-Id: <20201013160812.27754-16-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" Signed-off-by: Michael Tremer --- config/rootfiles/core/152/filelists/files | 1 + config/rootfiles/packages/aarch64/samba | 1 - config/rootfiles/packages/armv5tel/samba | 1 - config/rootfiles/packages/i586/samba | 1 - config/rootfiles/packages/x86_64/samba | 1 - html/cgi-bin/logs.cgi/log.dat | 2 + html/cgi-bin/samba.cgi | 46 +---------------------- lfs/samba | 1 - 8 files changed, 5 insertions(+), 49 deletions(-) diff --git a/config/rootfiles/core/152/filelists/files b/config/rootfiles/core/152/filelists/files index ceb904c64..aaf469bce 100644 --- a/config/rootfiles/core/152/filelists/files +++ b/config/rootfiles/core/152/filelists/files @@ -9,5 +9,6 @@ etc/rc.d/helper/oci-setup etc/rc.d/init.d/networking/any etc/rc.d/init.d/networking/red srv/web/ipfire/cgi-bin/credits.cgi +srv/web/ipfire/cgi-bin/logs.cgi/log.dat usr/local/bin/setaliases var/ipfire/graphs.pl diff --git a/config/rootfiles/packages/aarch64/samba b/config/rootfiles/packages/aarch64/samba index 630ec9da8..a707895d9 100644 --- a/config/rootfiles/packages/aarch64/samba +++ b/config/rootfiles/packages/aarch64/samba @@ -812,7 +812,6 @@ var/lib/samba var/lib/samba/bind-dns var/lib/samba/private var/lib/samba/winbindd_privileged -var/log/samba var/nmbd srv/web/ipfire/cgi-bin/samba.cgi srv/web/ipfire/cgi-bin/sambahlp.cgi diff --git a/config/rootfiles/packages/armv5tel/samba b/config/rootfiles/packages/armv5tel/samba index 51349093b..885d9e154 100644 --- a/config/rootfiles/packages/armv5tel/samba +++ b/config/rootfiles/packages/armv5tel/samba @@ -812,7 +812,6 @@ var/lib/samba var/lib/samba/bind-dns var/lib/samba/private var/lib/samba/winbindd_privileged -var/log/samba var/nmbd srv/web/ipfire/cgi-bin/samba.cgi srv/web/ipfire/cgi-bin/sambahlp.cgi diff --git a/config/rootfiles/packages/i586/samba b/config/rootfiles/packages/i586/samba index 089f6981d..e942471e2 100644 --- a/config/rootfiles/packages/i586/samba +++ b/config/rootfiles/packages/i586/samba @@ -812,7 +812,6 @@ var/lib/samba var/lib/samba/bind-dns var/lib/samba/private var/lib/samba/winbindd_privileged -var/log/samba var/nmbd srv/web/ipfire/cgi-bin/samba.cgi srv/web/ipfire/cgi-bin/sambahlp.cgi diff --git a/config/rootfiles/packages/x86_64/samba b/config/rootfiles/packages/x86_64/samba index ff2b7d5c3..1c31256db 100644 --- a/config/rootfiles/packages/x86_64/samba +++ b/config/rootfiles/packages/x86_64/samba @@ -812,7 +812,6 @@ var/lib/samba var/lib/samba/bind-dns var/lib/samba/private var/lib/samba/winbindd_privileged -var/log/samba var/nmbd srv/web/ipfire/cgi-bin/samba.cgi srv/web/ipfire/cgi-bin/sambahlp.cgi diff --git a/html/cgi-bin/logs.cgi/log.dat b/html/cgi-bin/logs.cgi/log.dat index 8ca32d675..1fec05c35 100644 --- a/html/cgi-bin/logs.cgi/log.dat +++ b/html/cgi-bin/logs.cgi/log.dat @@ -67,6 +67,7 @@ my %sections = ( 'openvpn' => '(openvpnserver\[.*\]: |.*n2n\[.*\]: )', 'pakfire' => '(pakfire:)', 'red' => '(red:|pppd\[.*\]: |chat\[.*\]|pppoe\[.*\]|pptp\[.*\]|pppoa\[.*\]|pppoa3\[.*\]|pppoeci\[.*\]|ipppd|ipppd\[.*\]|kernel: ippp\d|kernel: isdn.*|ibod\[.*\]|dhcpcd\[.*\]|modem_run\[.*\])', + 'samba' => '(nmbd|smbd|winbind)\[\d+\]:', 'suricata' => '(suricata: )', 'squid' => '(squid\[.*\]: |squid: )', 'ssh' => '(sshd(?:\(.*\))?\[.*\]: )', @@ -95,6 +96,7 @@ my %trsections = ( 'openvpn' => 'OpenVPN', 'pakfire' => 'Pakfire', 'red' => 'RED', + 'samba' => $Lang::tr{'samba'}, 'suricata' => "$Lang::tr{'intrusion detection'}", 'squid' => "$Lang::tr{'web proxy'}", 'ssh' => 'SSH', diff --git a/html/cgi-bin/samba.cgi b/html/cgi-bin/samba.cgi index 4668cd253..0510f0f24 100644 --- a/html/cgi-bin/samba.cgi +++ b/html/cgi-bin/samba.cgi @@ -38,9 +38,6 @@ my %mainsettings = (); my $message = ""; my $errormessage = ""; -my @Logs = qx(ls /var/log/samba/); -my $Log =$Lang::tr{'no log selected'}; - my $Status = qx(/usr/local/bin/sambactrl smbstatus); $Status = &Header::cleanhtml($Status); @@ -88,7 +85,6 @@ $sambasettings{'PASSWORDSYNC'} = 'off'; $sambasettings{'OTHERINTERFACES'} = '127.0.0.1'; $sambasettings{'GUESTACCOUNT'} = 'samba'; $sambasettings{'MAPTOGUEST'} = 'Bad User'; -$sambasettings{'LOGLEVEL'} = '3 passdb:5 auth:5 winbind:2'; $sambasettings{'WIDELINKS'} = 'on'; $sambasettings{'UNIXEXTENSION'} = 'off'; ### Values that have to be initialized @@ -149,7 +145,6 @@ if ($sambasettings{'ACTION'} eq 'globalresetyes') $sambasettings{'OTHERINTERFACES'} = '127.0.0.1'; $sambasettings{'GUESTACCOUNT'} = 'samba'; $sambasettings{'MAPTOGUEST'} = 'Bad User'; - $sambasettings{'LOGLEVEL'} = '3 passdb:5 auth:5 winbind:2'; ### Samba CUPS Variablen $sambasettings{'LOADPRINTERS'} = 'Yes'; $sambasettings{'PRINTING'} = 'cups'; @@ -278,8 +273,8 @@ winbind uid = 10000-20000 winbind gid = 10000-20000 winbind use default domain = yes -log file = /var/log/samba/samba-log.%m -log level = $sambasettings{'LOGLEVEL'} +# Log to syslog +logging = syslog preferred master = $sambasettings{'PREFERREDMASTER'} domain master = $sambasettings{'DOMAINMASTER'} @@ -427,7 +422,6 @@ print < $Lang::tr{'basic options'} $Lang::tr{'workgroup'} -$Lang::tr{'log level'} $Lang::tr{'interfaces'}on / off | OpenVpn - $ovpnip[0].$ovpnip[1].$ovpnip[2].$ovpnip[3]/$ovpnnetwork[1] @@ -1147,42 +1141,6 @@ END ; &Header::closebox(); -############################################################################################################################ -############################################### Anzeige der Sambalogs ###################################################### - - -if ($sambasettings{'ACTION'} eq 'showlog') -{ -$Log = qx(tail -n $sambasettings{'LOGLINES'} /var/log/samba/$sambasettings{'LOG'}); -$Log=~s/\n/
/g; -} - -&Header::openbox('100%', 'center', $Lang::tr{'log'}); - -print < -
-
- - - - - - - - - -
$Lang::tr{'log view'}

$Lang::tr{'show last x lines'}

$Log

$sambasettings{'LOG'}
-
-END -; -&Header::closebox(); &Header::closebigbox(); &Header::closepage(); diff --git a/lfs/samba b/lfs/samba index 874166d2e..cd20baffc 100644 --- a/lfs/samba +++ b/lfs/samba @@ -109,7 +109,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) 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 - -mkdir -p /var/log/samba install -v -m 644 $(DIR_SRC)/config/backup/includes/samba /var/ipfire/backup/addons/includes/samba -mkdir -p /var/lib/samba/winbindd_privileged