From mboxrd@z Thu Jan 1 00:00:00 1970 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> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5127495587127152545==" List-Id: --===============5127495587127152545== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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/cor= e/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/packa= ges/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/pack= ages/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/packag= es/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 =3D ( 'openvpn' =3D> '(openvpnserver\[.*\]: |.*n2n\[.*\]: )', 'pakfire' =3D> '(pakfire:)', 'red' =3D> '(red:|pppd\[.*\]: |chat\[.*\]|pppoe\[.*\]|pptp\[.*\]|ppp= oa\[.*\]|pppoa3\[.*\]|pppoeci\[.*\]|ipppd|ipppd\[.*\]|kernel: ippp\d|kernel: = isdn.*|ibod\[.*\]|dhcpcd\[.*\]|modem_run\[.*\])', + 'samba' =3D> '(nmbd|smbd|winbind)\[\d+\]:', 'suricata' =3D> '(suricata: )', 'squid' =3D> '(squid\[.*\]: |squid: )', 'ssh' =3D> '(sshd(?:\(.*\))?\[.*\]: )', @@ -95,6 +96,7 @@ my %trsections =3D ( 'openvpn' =3D> 'OpenVPN', 'pakfire' =3D> 'Pakfire', 'red' =3D> 'RED', + 'samba' =3D> $Lang::tr{'samba'}, 'suricata' =3D> "$Lang::tr{'intrusion detection'}", 'squid' =3D> "$Lang::tr{'web proxy'}", 'ssh' =3D> '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 =3D (); my $message =3D ""; my $errormessage =3D ""; =20 -my @Logs =3D qx(ls /var/log/samba/); -my $Log =3D$Lang::tr{'no log selected'}; - my $Status =3D qx(/usr/local/bin/sambactrl smbstatus); $Status =3D &Header::cleanhtml($Status); =20 @@ -88,7 +85,6 @@ $sambasettings{'PASSWORDSYNC'} =3D 'off'; $sambasettings{'OTHERINTERFACES'} =3D '127.0.0.1'; $sambasettings{'GUESTACCOUNT'} =3D 'samba'; $sambasettings{'MAPTOGUEST'} =3D 'Bad User'; -$sambasettings{'LOGLEVEL'} =3D '3 passdb:5 auth:5 winbind:2'; $sambasettings{'WIDELINKS'} =3D 'on'; $sambasettings{'UNIXEXTENSION'} =3D 'off'; ### Values that have to be initialized @@ -149,7 +145,6 @@ if ($sambasettings{'ACTION'} eq 'globalresetyes') $sambasettings{'OTHERINTERFACES'} =3D '127.0.0.1'; $sambasettings{'GUESTACCOUNT'} =3D 'samba'; $sambasettings{'MAPTOGUEST'} =3D 'Bad User'; - $sambasettings{'LOGLEVEL'} =3D '3 passdb:5 auth:5 winbind:2'; ### Samba CUPS Variablen $sambasettings{'LOADPRINTERS'} =3D 'Yes'; $sambasettings{'PRINTING'} =3D 'cups'; @@ -278,8 +273,8 @@ winbind uid =3D 10000-20000 winbind gid =3D 10000-20000 winbind use default domain =3D yes =20 -log file =3D /var/log/samba/samba-log.%m -log level =3D $sambasettings{'LOGLEVEL'} +# Log to syslog +logging =3D syslog =20 preferred master =3D $sambasettings{'PREFERREDMASTER'} domain master =3D $sambasettings{'DOMAINMASTER'} @@ -427,7 +422,6 @@ print < $Lang:= :tr{'basic options'} $Lang::tr{'workgroup'} -$Lang::tr{'log level'} $Lang::tr{'interfaces'}on / off | O= penVpn - $ovpnip[0].$ovpnip[1].$ovpnip[2].$ovpnip[3]/$ovpnnetwork[1] @@ -1147,42 +1141,6 @@ END ; &Header::closebox(); =20 -############################################################################= ################################################ -############################################### Anzeige der Sambalogs ######= ################################################ - - -if ($sambasettings{'ACTION'} eq 'showlog') -{ -$Log =3D qx(tail -n $sambasettings{'LOGLINES'} /var/log/samba/$sambasettings= {'LOG'}); -$Log=3D~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(); =20 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/s= mb.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/backu= p/addons/includes/samba =20 -mkdir -p /var/lib/samba/winbindd_privileged --=20 2.20.1 --===============5127495587127152545==--