Changeset: 667c9bb0a81a for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=667c9bb0a81a Removed Files: buildtools/selinux/monetdb.fc buildtools/selinux/monetdb.if buildtools/selinux/monetdb.te Modified Files: sql/backends/monet5/sql_result.c Branch: monetdbe-proxy Log Message:
Merge with default. diffs (truncated from 5204 to 300 lines): diff --git a/ChangeLog.userstats b/ChangeLog.userstats new file mode 100644 --- /dev/null +++ b/ChangeLog.userstats @@ -0,0 +1,19 @@ +# ChangeLog file for userstats +# This file is updated with Maddlog + +* Mon Aug 10 2020 Ying Zhang <y.zh...@cwi.nl> +- Finished a first version of the new monitoring function + user_statistics(), which is only intended for the DBAs. + For each database user who has logged in during the current mserver5 + session, it returns + "username": login name of the database user, + "querycount": the number of queries this user has executed since his/her + first login, + "totalticks": the total execution time (in microsecond) of the queries ran + by this user, + "maxquery": the query with the longest execution time (if two queries have + the same execution time, the newer overwrites the older), + "maxticks": the execution time of the 'maxquery' (in microsecond), + "started": the start timestamp of the 'maxquery', + "finished": the finish timestamp of the 'maxquery'. + diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -753,7 +753,8 @@ fi %files selinux %defattr(-,root,root,0755) -%doc buildtools/selinux/* +%docdir %{_datadir}/doc/MonetDB-selinux +%{_datadir}/doc/MonetDB-selinux/* %{_datadir}/selinux/*/monetdb.pp %endif @@ -793,22 +794,6 @@ fi %cmake3_build -%if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7 -cd buildtools/selinux -%if 0%{?fedora} < 27 -# no `map' policy available before Fedora 27 -sed -i '/map/d' monetdb.te -%endif - -for selinuxvariant in %{selinux_variants} -do - make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile - mv monetdb.pp monetdb.pp.${selinuxvariant} - make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean -done -cd - -%endif - %install %cmake3_install @@ -836,12 +821,6 @@ rm -f %{buildroot}%{_bindir}/monetdb_mte rm -rf %{buildroot}%{_datadir}/monetdb # /cmake %if %{?rhel:0}%{!?rhel:1} || 0%{?rhel} >= 7 -for selinuxvariant in %{selinux_variants} -do - install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant} - install -p -m 644 buildtools/selinux/monetdb.pp.${selinuxvariant} \ - %{buildroot}%{_datadir}/selinux/${selinuxvariant}/monetdb.pp -done if [ -x /usr/sbin/hardlink ]; then /usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux else diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py --- a/NT/mkodbcwxs.py +++ b/NT/mkodbcwxs.py @@ -48,11 +48,11 @@ def main(): print(r' <Product Id="*" Language="1033" Manufacturer="MonetDB" Name="MonetDB ODBC Driver" UpgradeCode="{}" Version="{}">'.format(upgradecode[arch], sys.argv[1])) print(r' <Package Id="*" Comments="MonetDB ODBC Driver" Compressed="yes" InstallerVersion="301" Keywords="MonetDB SQL ODBC" Languages="1033" Manufacturer="MonetDB BV" Platform="{}"/>'.format(arch)) print(r' <MajorUpgrade AllowDowngrades="no" DowngradeErrorMessage="A later version of [ProductName] is already installed." AllowSameVersionUpgrades="no"/>') - print(r' <WixVariable Id="WixUILicenseRtf" Value="license.rtf"/>') - print(r' <WixVariable Id="WixUIBannerBmp" Value="banner.bmp"/>') + print(r' <WixVariable Id="WixUILicenseRtf" Value="share\license.rtf"/>') + print(r' <WixVariable Id="WixUIBannerBmp" Value="share\banner.bmp"/>') # print(r' <WixVariable Id="WixUIDialogBmp" Value="backgroundRipple.bmp"/>') print(r' <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>') - print(r' <Property Id="ARPPRODUCTICON" Value="monetdb.ico"/>') + print(r' <Property Id="ARPPRODUCTICON" Value="share\monetdb.ico"/>') print(r' <Media Id="1" Cabinet="monetdb.cab" EmbedCab="yes"/>') print(r' <CustomAction Id="driverinstall" FileKey="odbcinstall" ExeCommand="/Install" Execute="deferred" Impersonate="no"/>') print(r' <CustomAction Id="driveruninstall" FileKey="odbcinstall" ExeCommand="/Uninstall" Execute="deferred" Impersonate="no"/>') @@ -80,12 +80,12 @@ def main(): vcpkg.format(r'bin\zlib1.dll')]) print(r' </Directory>') id = comp(features, id, 12, - [r'license.rtf']) + [r'share\license.rtf']) id = comp(features, id, 12, [r'bin\odbcinstall.exe'], fid = 'odbcinstall') id = comp(features, id, 12, - [r'website.html'], + [r'share\website.html'], name = 'MonetDB Web Site', sid = 'website_html', vital = 'no') @@ -109,7 +109,7 @@ def main(): print(r' </Feature>') print(r' <UIRef Id="WixUI_InstallDir"/>') print(r' <UIRef Id="WixUI_ErrorProgressText"/>') - print(r' <Icon Id="monetdb.ico" SourceFile="monetdb.ico"/>') + print(r' <Icon Id="monetdb.ico" SourceFile="share\monetdb.ico"/>') print(r' <InstallExecuteSequence>') print(r' <Custom Action="driverinstall" Before="RegisterUser">') print(r' NOT Installed OR REINSTALL') diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py --- a/NT/mksqlwxs.py +++ b/NT/mksqlwxs.py @@ -65,8 +65,8 @@ def main(): print(r' <UpgradeVersion OnlyDetect="no" Minimum="11.29.3" IncludeMinimum="no" Maximum="{}" Property="GEOMINSTALLED"/>'.format(sys.argv[1])) print(r' </Upgrade>') print(r' <MajorUpgrade AllowDowngrades="no" DowngradeErrorMessage="A later version of [ProductName] is already installed." AllowSameVersionUpgrades="no"/>') - print(r' <WixVariable Id="WixUILicenseRtf" Value="license.rtf"/>') - print(r' <WixVariable Id="WixUIBannerBmp" Value="banner.bmp"/>') + print(r' <WixVariable Id="WixUILicenseRtf" Value="share\license.rtf"/>') + print(r' <WixVariable Id="WixUIBannerBmp" Value="share\banner.bmp"/>') # print(r' <WixVariable Id="WixUIDialogBmp" Value="backgroundRipple.bmp"/>') print(r' <Property Id="INSTALLDIR">') print(r' <RegistrySearch Id="MonetDBRegistry" Key="Software\[Manufacturer]\[ProductName]" Name="InstallPath" Root="HKLM" Type="raw"/>') @@ -99,7 +99,7 @@ def main(): print(r' <Property Id="ApplicationFolderName" Value="MonetDB"/>') print(r' <Property Id="WixAppFolder" Value="WixPerMachineFolder"/>') print(r' <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"/>') - print(r' <Property Id="ARPPRODUCTICON" Value="monetdb.ico"/>') + print(r' <Property Id="ARPPRODUCTICON" Value="share\monetdb.ico"/>') print(r' <Media Id="1" Cabinet="monetdb.cab" EmbedCab="yes"/>') print(r' <Directory Id="TARGETDIR" Name="SourceDir">') msvc = r'C:\Program Files (x86)\Microsoft Visual Studio\{}\Community\VC\Redist\MSVC'.format(vs) @@ -195,7 +195,7 @@ def main(): r'share\doc\MonetDB-SQL\dump-restore.txt'], vital = 'no') id = comp(features, id, 18, - [r'website.html'], + [r'share\website.html'], name = 'MonetDB Web Site', sid = 'website_html', vital = 'no') @@ -203,7 +203,7 @@ def main(): print(r' </Directory>') print(r' </Directory>') id = comp(features, id, 12, - [r'license.rtf', + [r'share\license.rtf', r'M5server.bat', r'msqldump.bat']) id = comp(pyapi3, id, 12, @@ -259,7 +259,7 @@ def main(): print(r' </Feature>') print(r' <UIRef Id="WixUI_Mondo"/>') print(r' <UIRef Id="WixUI_ErrorProgressText"/>') - print(r' <Icon Id="monetdb.ico" SourceFile="monetdb.ico"/>') + print(r' <Icon Id="monetdb.ico" SourceFile="share\monetdb.ico"/>') print(r' </Product>') print(r'</Wix>') diff --git a/buildtools/selinux/monetdb.fc b/buildtools/selinux/monetdb.fc deleted file mode 100644 --- a/buildtools/selinux/monetdb.fc +++ /dev/null @@ -1,15 +0,0 @@ -/usr/bin/monetdbd -- gen_context(system_u:object_r:monetdbd_exec_t,s0) -/usr/bin/mserver5 -- gen_context(system_u:object_r:mserver5_exec_t,s0) -/usr/lib/systemd/system/monetdbd.* gen_context(system_u:object_r:monetdbd_unit_file_t,s0) -/var/log/monetdb(/.*)? gen_context(system_u:object_r:monetdbd_log_t,s0) -# for some reason we cannot use /run/monetdb here, even though that is the real name -/var/run/monetdb(/.*)? gen_context(system_u:object_r:monetdbd_var_run_t,s0) -# database "farm" -/var/monetdb5/dbfarm(/.*)? gen_context(system_u:object_r:mserver5_db_t,s0) -/var/monetdb5/dbfarm/\.merovingian_properties -- gen_context(system_u:object_r:monetdbd_etc_t,s0) -/var/monetdb5/dbfarm/\.merovingian_lock -- gen_context(system_u:object_r:monetdbd_lock_t,s0) -/var/monetdb5/dbfarm/.*/\.gdk_lock -- gen_context(system_u:object_r:mserver5_lock_t,s0) -/var/lib/monetdb(/.*)? gen_context(system_u:object_r:mserver5_db_t,s0) -/var/lib/monetdb/\.merovingian_properties -- gen_context(system_u:object_r:monetdbd_etc_t,s0) -/var/lib/monetdb/\.merovingian_lock -- gen_context(system_u:object_r:monetdbd_lock_t,s0) -/var/lib/monetdb/.*/\.gdk_lock -- gen_context(system_u:object_r:mserver5_lock_t,s0) diff --git a/buildtools/selinux/monetdb.if b/buildtools/selinux/monetdb.if deleted file mode 100644 --- a/buildtools/selinux/monetdb.if +++ /dev/null @@ -1,1 +0,0 @@ -## <summary></summary> diff --git a/buildtools/selinux/monetdb.te b/buildtools/selinux/monetdb.te deleted file mode 100644 --- a/buildtools/selinux/monetdb.te +++ /dev/null @@ -1,150 +0,0 @@ -policy_module(monetdb, 1.0) -# The above line declares that this file is a SELinux policy file. Its -# name is monetdb, so the file should be saved as monetdb.te - -# Declare the system types and classes we're using. -require { - type proc_net_t; - type tmp_t; - type var_t; - type var_lib_t; - type user_home_t; - type user_home_dir_t; - type unconfined_service_t; # for EPEL 7 - type proc_t; # for EPEL 7 - type cgroup_t; - class dir { read }; - class fd { use }; - class fifo_file { getattr read write }; - class file { entrypoint execute getattr manage_file_perms map open read }; - class netlink_selinux_socket create_socket_perms; - class process { rlimitinh siginh signal sigchld sigkill transition }; - class tcp_socket create_stream_socket_perms; - class udp_socket create_stream_socket_perms; - class unix_dgram_socket create_socket_perms; - class unix_stream_socket { connectto create_stream_socket_perms getopt read shutdown write }; -} - -# First, we declare the monetdbd_t domain, used for the "monetdbd" -# process. Because it is launched by systemd, we tell the policy that -# monetdbd_exec_t (the context of monetdbd), when launched by systemd, -# should transition to monetdbd_t. -type monetdbd_t; # monetdbd when run by systemd -type monetdbd_exec_t; # /usr/bin/monetdbd -init_daemon_domain(monetdbd_t, monetdbd_exec_t) - -# monetdbd_t must be allowed to execute mserver5 which has context -# mserver5_exec_t which must then transition to the mserver5_t domain -type mserver5_t; # mserver5 when run by monetdbd (monetdbd_t) -type mserver5_exec_t; # /usr/bin/mserver5 -init_daemon_domain(mserver5_t, mserver5_exec_t) -# see https://selinuxproject.org/page/NB_Domain_and_Object_Transitions#Domain_Transition -allow monetdbd_t mserver5_t:process transition; -allow monetdbd_t mserver5_exec_t:file { execute open read getattr }; -allow mserver5_t mserver5_exec_t:file { entrypoint read execute }; -type_transition monetdbd_t mserver5_exec_t:process mserver5_t; - -# monetdbd must be allowed to kill the server it started -allow monetdbd_t mserver5_t:process sigkill; -# on EPEL 7 we need these as well -allow mserver5_t monetdbd_t:process sigchld; -allow monetdbd_t unconfined_service_t:process signal; -allow mserver5_t proc_t:file { open read getattr }; # read /proc/meminfo - -# declare a type for the systemd unit file (monetdbd.service) -type monetdbd_unit_file_t; -systemd_unit_file(monetdbd_unit_file_t) - -# declare a type for the log files -type monetdbd_log_t; -logging_log_file(monetdbd_log_t) -manage_dirs_pattern(monetdbd_t, monetdbd_log_t, monetdbd_log_t) -manage_files_pattern(monetdbd_t, monetdbd_log_t, monetdbd_log_t) -logging_log_filetrans(monetdbd_t, monetdbd_log_t, { file dir }) - -# the context used for the MonetDB database files -type mserver5_db_t; -files_type(mserver5_db_t) -manage_files_pattern(mserver5_t, mserver5_db_t, mserver5_db_t) -manage_dirs_pattern(mserver5_t, mserver5_db_t, mserver5_db_t) -manage_files_pattern(monetdbd_t, mserver5_db_t, mserver5_db_t) -manage_dirs_pattern(monetdbd_t, mserver5_db_t, mserver5_db_t) -allow mserver5_t mserver5_db_t:file { map }; - -# the context used for the configuration files -type monetdbd_etc_t; -files_config_file(monetdbd_etc_t) -read_files_pattern(monetdbd_t, monetdbd_etc_t, monetdbd_etc_t) -read_lnk_files_pattern(monetdbd_t, monetdbd_etc_t, monetdbd_etc_t) - -# the context used for the PID file -type monetdbd_var_run_t; -files_pid_file(monetdbd_var_run_t) -init_daemon_run_dir(monetdbd_var_run_t, "monetdb") -manage_dirs_pattern(monetdbd_t, monetdbd_var_run_t, monetdbd_var_run_t) -manage_files_pattern(monetdbd_t, monetdbd_var_run_t, monetdbd_var_run_t) - -# context for .merovingian_lock file -type monetdbd_lock_t; -files_lock_file(monetdbd_lock_t) -allow monetdbd_t monetdbd_lock_t:file manage_file_perms; -files_lock_filetrans(monetdbd_t, monetdbd_lock_t, file, ".merovingian_lock") - -# context for .gdk_lock file inside the database -# these files get locked by mserver5, but also by monetdbd -type mserver5_lock_t; -files_lock_file(mserver5_lock_t) -allow mserver5_t mserver5_lock_t:file manage_file_perms; -files_lock_filetrans(mserver5_t, mserver5_lock_t, file, ".gdk_lock") -allow monetdbd_t mserver5_lock_t:file manage_file_perms; -files_lock_filetrans(monetdbd_t, mserver5_lock_t, file, ".gdk_lock") - -# other required permissions -dev_read_rand(monetdbd_t) -sysnet_dns_name_resolve(monetdbd_t) _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list