From 73a06f2bbed64586c7e790495503fa5bcd2a76b6 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 27 Mar 2020 07:25:49 +0100 Subject: [PATCH] daily autocommit --- .etckeeper | 17 ++ NX/nxnode | 108 ++++++++++++ NX/nxserver | 159 ++++++++++++++++++ NX/server/localhost/client.cfg | 14 ++ NX/server/localhost/node.cfg | 14 ++ NX/server/localhost/player.cfg | 14 ++ NX/server/localhost/server.cfg | 14 ++ gnome/defaults.list | 2 + group | 1 + group- | 1 + gshadow | 1 + gshadow- | 1 + pam.d/nx | 8 + pam.d/nxlimits | 4 + passwd | 1 + passwd- | 1 + .../10-org.nomachine.allow.colord.pkla | 6 + ...omachine.allow.system-sources-refresh.pkla | 6 + shadow | 1 + shadow- | 1 + .../multi-user.target.wants/nxserver.service | 1 + .../applications-merged/NoMachine-dir.menu | 19 +++ xdg/menus/gnome-applications-merged | 1 + 23 files changed, 395 insertions(+) create mode 100755 NX/nxnode create mode 100755 NX/nxserver create mode 100644 NX/server/localhost/client.cfg create mode 100644 NX/server/localhost/node.cfg create mode 100644 NX/server/localhost/player.cfg create mode 100644 NX/server/localhost/server.cfg create mode 100644 pam.d/nx create mode 100644 pam.d/nxlimits create mode 100644 polkit-1/localauthority/55-org.nomachine.d/10-org.nomachine.allow.colord.pkla create mode 100644 polkit-1/localauthority/55-org.nomachine.d/10-org.nomachine.allow.system-sources-refresh.pkla create mode 120000 systemd/system/multi-user.target.wants/nxserver.service create mode 100644 xdg/menus/applications-merged/NoMachine-dir.menu create mode 120000 xdg/menus/gnome-applications-merged diff --git a/.etckeeper b/.etckeeper index 58db51a..d4fd4c0 100755 --- a/.etckeeper +++ b/.etckeeper @@ -129,6 +129,17 @@ maybe chmod 0644 'ImageMagick-6/type-ghostscript.xml' maybe chmod 0644 'ImageMagick-6/type-urw-base35.xml' maybe chmod 0644 'ImageMagick-6/type-windows.xml' maybe chmod 0644 'ImageMagick-6/type.xml' +maybe chmod 0755 'NX' +maybe chmod 0755 'NX/nxnode' +maybe chown 'nx' 'NX/nxserver' +maybe chgrp 'nx' 'NX/nxserver' +maybe chmod 6555 'NX/nxserver' +maybe chmod 0755 'NX/server' +maybe chmod 0755 'NX/server/localhost' +maybe chmod 0644 'NX/server/localhost/client.cfg' +maybe chmod 0644 'NX/server/localhost/node.cfg' +maybe chmod 0644 'NX/server/localhost/player.cfg' +maybe chmod 0644 'NX/server/localhost/server.cfg' maybe chmod 0755 'NetworkManager' maybe chmod 0644 'NetworkManager/NetworkManager.conf' maybe chmod 0755 'NetworkManager/VPN' @@ -2587,6 +2598,8 @@ maybe chmod 0644 'pam.d/lightdm-autologin' maybe chmod 0644 'pam.d/lightdm-greeter' maybe chmod 0644 'pam.d/login' maybe chmod 0644 'pam.d/newusers' +maybe chmod 0644 'pam.d/nx' +maybe chmod 0644 'pam.d/nxlimits' maybe chmod 0644 'pam.d/other' maybe chmod 0644 'pam.d/passwd' maybe chmod 0644 'pam.d/polkit-1' @@ -2727,6 +2740,9 @@ maybe chmod 0755 'polkit-1/localauthority/10-vendor.d' maybe chmod 0755 'polkit-1/localauthority/20-org.d' maybe chmod 0755 'polkit-1/localauthority/30-site.d' maybe chmod 0755 'polkit-1/localauthority/50-local.d' +maybe chmod 0755 'polkit-1/localauthority/55-org.nomachine.d' +maybe chmod 0644 'polkit-1/localauthority/55-org.nomachine.d/10-org.nomachine.allow.colord.pkla' +maybe chmod 0644 'polkit-1/localauthority/55-org.nomachine.d/10-org.nomachine.allow.system-sources-refresh.pkla' maybe chmod 0755 'polkit-1/localauthority/90-mandatory.d' maybe chmod 0664 'popularity-contest.conf' maybe chmod 0755 'postfix' @@ -3338,6 +3354,7 @@ maybe chmod 0644 'xdg/autostart/xdg-user-dirs.desktop' maybe chmod 0644 'xdg/autostart/zeitgeist-datahub.desktop' maybe chmod 0755 'xdg/menus' maybe chmod 0755 'xdg/menus/applications-merged' +maybe chmod 0644 'xdg/menus/applications-merged/NoMachine-dir.menu' maybe chmod 0644 'xdg/menus/gnome-applications.menu' maybe chmod 0644 'xdg/menus/unity-lens-applications.menu' maybe chmod 0644 'xdg/menus/unitycc.menu' diff --git a/NX/nxnode b/NX/nxnode new file mode 100755 index 0000000..02041a5 --- /dev/null +++ b/NX/nxnode @@ -0,0 +1,108 @@ +#!/bin/bash +###################################################################### +# # +# Copyright (c) 2001, 2018 NoMachine, http://www.nomachine.com. # +# # +# All rights reserved. # +# # +###################################################################### + +RunDir=${0%nxnode} +EtcDir=$(cd "$RunDir" && pwd) + +if [ -x /usr/bin/nawk ] +then + COMMAND_AWK="/usr/bin/nawk" +elif [ -x /usr/xpg4/bin/awk ] +then + COMMAND_AWK="/usr/xpg4/bin/awk" +elif [ -x /usr/bin/awk ] +then + COMMAND_AWK="/usr/bin/awk" +else + COMMAND_AWK="awk" +fi + +if [ -e "/usr/xpg4/bin/id" ]; +then + COMMAND_ID="/usr/xpg4/bin/id" +elif [ -e "/bin/id" ]; +then + COMMAND_ID="/bin/id" +elif [ -e "/usr/bin/id" ]; +then + COMMAND_ID="/usr/bin/id" +else + echo "ERROR: id command not found" + exit 1 +fi + +if [ -x "/bin/head" ]; +then + COMMAND_HEAD="/bin/head" +elif [ -x "/usr/bin/head" ]; +then + COMMAND_HEAD="/usr/bin/head" +else + COMMAND_HEAD="head" +fi + +ROOTDIR=`$COMMAND_AWK -F'"' '/^NodeRoot/ {print $2}' ${EtcDir}/server/localhost/node.cfg` + +if [ "x$ROOTDIR" = "x" ]; +then + echo "Cannot find NodeRoot in ${EtcDir}/server/localhost/node.cfg configuration file" + exit +fi + +USERID=`$COMMAND_ID -ru` +if test $? != 0; +then + echo "Error: Cannot check user id." + exit 1; +fi + +if test "x$USERID" = "x"; +then + echo "Error: Cannot check user id." + exit 1; +fi + +USERNAME=`$COMMAND_ID -run` +if test -f "${ROOTDIR}/etc/${USERNAME}.node.cfg"; +then + CONFIG_FILE="${ROOTDIR}/etc/${USERNAME}.node.cfg" +else + CONFIG_FILE="${ROOTDIR}/etc/node.cfg" +fi + +ENABLED_DEBUG=`$COMMAND_AWK -F "EnableDebug " '/^ *EnableDebug/ {gsub (/\"/,"",$2); gsub (/^ */,"",$2); print $2}' "${CONFIG_FILE}" | $COMMAND_HEAD -n 1` + +if test -z $ENABLED_DEBUG; +then + ENABLED_DEBUG=0 +elif test $ENABLED_DEBUG != 0; +then + ENABLED_DEBUG=1 + + COMMAND_DEBUG=`$COMMAND_AWK -F "CommandDebug " '/^ *CommandDebug/ {gsub (/\"/,"",$2); gsub (/^ */,"",$2); print $2}' "${CONFIG_FILE}" | $COMMAND_HEAD -n 1` + if test -z $COMMAND_DEBUG; + then + ENABLED_DEBUG=0 + else + PARAMS_DEBUG=`$COMMAND_AWK -F "DebugOptions " '/^ *DebugOptions/ {gsub (/\"/,"",$2); print $2}' "${CONFIG_FILE}" | $COMMAND_HEAD -n 1` + fi +fi + +export LD_LIBRARY_PATH="$ROOTDIR/lib:$ROOTDIR/lib/perl:$ROOTDIR/lib/perl/include:$ROOTDIR/lib/perl/nxnode:$ROOTDIR/lib/perl/libperl" +export PATH="$ROOTDIR/lib:$ROOTDIR/lib/perl:$ROOTDIR/lib/perl/include:$ROOTDIR/lib/perl/nxnode:$PATH" +export PERL5LIB="$ROOTDIR/lib:$ROOTDIR/lib/perl:$ROOTDIR/lib/perl/include:$ROOTDIR/lib/perl/nxnode:$ROOTDIR/lib/perl/libperl" +export PERL5INCLUDE="$ROOTDIR/lib/perl/nxnode" +export NX_SYSTEM="$ROOTDIR" + +if test $ENABLED_DEBUG = 0; +then + exec "$ROOTDIR/bin/nxnode.bin" "$@" +else + exec $COMMAND_DEBUG ${PARAMS_DEBUG} "$ROOTDIR/bin/nxnode.bin" "$@" +fi diff --git a/NX/nxserver b/NX/nxserver new file mode 100755 index 0000000..5523792 --- /dev/null +++ b/NX/nxserver @@ -0,0 +1,159 @@ +#!/bin/bash +###################################################################### +# # +# Copyright (c) 2001, 2019 NoMachine, http://www.nomachine.com. # +# # +# All rights reserved. # +# # +###################################################################### + +RunDir=${0%nxserver} +EtcDir=$(cd "$RunDir" && pwd) + +if [ -x /usr/bin/nawk ] +then + COMMAND_AWK="/usr/bin/nawk" +elif [ -x /usr/xpg4/bin/awk ] +then + COMMAND_AWK="/usr/xpg4/bin/awk" +elif [ -x /usr/bin/awk ] +then + COMMAND_AWK="/usr/bin/awk" +elif [ -x /bin/awk ] +then + COMMAND_AWK="/bin/awk" +else + COMMAND_AWK="awk" +fi + +if [ -e "/usr/xpg4/bin/id" ]; +then + COMMAND_ID="/usr/xpg4/bin/id" +elif [ -e "/bin/id" ]; +then + COMMAND_ID="/bin/id" +elif [ -e "/usr/bin/id" ]; +then + COMMAND_ID="/usr/bin/id" +else + echo "ERROR: id command not found" + exit 1 +fi + +if [ -x "/bin/head" ]; +then + COMMAND_HEAD="/bin/head" +elif [ -x "/usr/bin/head" ]; +then + COMMAND_HEAD="/usr/bin/head" +else + COMMAND_HEAD="head" +fi + +ROOTDIR=`$COMMAND_AWK -F'"' '/^ServerRoot/ {print $2}' ${EtcDir}/server/localhost/server.cfg` + +if [ "x$ROOTDIR" = "x" ]; +then + echo "Cannot found ServerRoot in ${EtcDir}/server/localhost/server.cfg configuration file"; + exit +fi + +USERID=`$COMMAND_ID -ru` +if test $? != 0; +then + echo "Error: Cannot check user id." + exit 1; +fi + +if test "x$USERID" = "x"; +then + echo "Error: Cannot check user id." + exit 1; +fi + +if test "$1" = "--login" || test "$2" = "/etc/NX/nxserver --login"; then + + if test "x$SSH_CONNECTION" != "x"; then + + NX_SSH_STATUS_FILE="$ROOTDIR/etc/sshstatus" + + if test -f "$NX_SSH_STATUS_FILE"; then + + cat "$NX_SSH_STATUS_FILE" + + exit 1 + fi + fi +fi + +if test $USERID != 0; +then + id_nx=`$COMMAND_ID -u nx 2>/dev/null` + + if test "x$id_nx" = "x"; + then + echo "Error: User nx not found." + exit 1; + fi + + if test $id_nx -ne $USERID; then + if test "$1" = "noloop"; then + echo "Error: Exit for avoid infinity loop." + exit 1; + elif test "$1" = "--login"; then + exec "$ROOTDIR/bin/nxexec" /etc/NX/nxserver noloop + elif test "$1" = "--status"; then + exec "$ROOTDIR/bin/nxexec" /etc/NX/nxserver noloop status + elif test "$1" = "--upnpstatus"; then + exec "$ROOTDIR/bin/nxexec" /etc/NX/nxserver noloop upnpstatus + elif test "$1" = "--startsession"; then + exec "$ROOTDIR/bin/nxexec" /etc/NX/nxserver noloop --startsession --display=${DISPLAY} $@ + elif test "$1" = "--userauth"; then + exec "$ROOTDIR/bin/nxexec" /etc/NX/nxserver noloop --userauth $2 + fi + + fi + +elif test "$1" = "--login"; then + exec "$ROOTDIR/bin/nxexec" /etc/NX/nxserver noloop +fi + +CONFIG_FILE="${ROOTDIR}/etc/server.cfg" + +ENABLED_DEBUG=`$COMMAND_AWK -F "EnableDebug " '/^ *EnableDebug/ {gsub (/"/,"",$2); gsub (/^ */,"",$2); print $2}' "${CONFIG_FILE}" | $COMMAND_HEAD -n 1` + +if test -z $ENABLED_DEBUG; +then + ENABLED_DEBUG=0 +elif test $ENABLED_DEBUG != 0; +then + ENABLED_DEBUG=1 + + COMMAND_DEBUG=`$COMMAND_AWK -F "CommandDebug " '/^ *CommandDebug/ {gsub (/"/,"",$2); gsub (/^ */,"",$2); print $2}' "${CONFIG_FILE}" | $COMMAND_HEAD -n 1` + if test -z $COMMAND_DEBUG; + then + ENABLED_DEBUG=0 + else + PARAMS_DEBUG=`$COMMAND_AWK -F "DebugOptions " '/^ *DebugOptions/ {gsub (/"/,"",$2); print $2}' "${CONFIG_FILE}" | $COMMAND_HEAD -n 1` + fi +fi + +if test "x$PATH" = "x"; +then + export PATH="/bin:/usr/bin" +fi + +export LD_LIBRARY_PATH="$ROOTDIR/lib:$ROOTDIR/lib/perl:$ROOTDIR/lib/perl/include:$ROOTDIR/lib/perl/nxserver:$ROOTDIR/lib/perl/libperl" +export PATH="$ROOTDIR/lib:$ROOTDIR/lib/perl:$ROOTDIR/lib/perl/include:$ROOTDIR/lib/perl/nxserver:$PATH" +export PERL5LIB="$ROOTDIR/lib:$ROOTDIR/lib/perl:$ROOTDIR/lib/perl/include:$ROOTDIR/lib/perl/nxserver:$ROOTDIR/lib/perl/libperl" +export PERL5INCLUDE="$ROOTDIR/lib/perl/nxserver" +export NX_SYSTEM="$ROOTDIR" + +if test $ENABLED_DEBUG = 0; +then + exec "$ROOTDIR/bin/nxserver.bin" "$@" +else + export NX_FREEPERL="no" + + exec $COMMAND_DEBUG ${PARAMS_DEBUG} "$ROOTDIR/bin/nxserver.bin" "$@" +fi diff --git a/NX/server/localhost/client.cfg b/NX/server/localhost/client.cfg new file mode 100644 index 0000000..98ef962 --- /dev/null +++ b/NX/server/localhost/client.cfg @@ -0,0 +1,14 @@ +###################################################################### +# # +# Copyright (c) 2002, 2019 NoMachine, http://www.nomachine.com. # +# # +# All rights reserved. # +# # +###################################################################### + +# +# Specify the path of base directory where the NX software has been +# installed. +# + +ClientRoot = "/usr/NX" diff --git a/NX/server/localhost/node.cfg b/NX/server/localhost/node.cfg new file mode 100644 index 0000000..79883d8 --- /dev/null +++ b/NX/server/localhost/node.cfg @@ -0,0 +1,14 @@ +###################################################################### +# # +# Copyright (c) 2001, 2019 NoMachine, http://www.nomachine.com. # +# # +# All rights reserved. # +# # +###################################################################### + +# +# Specify the path of base directory where the NX software has been +# installed. +# + +NodeRoot = "/usr/NX" diff --git a/NX/server/localhost/player.cfg b/NX/server/localhost/player.cfg new file mode 100644 index 0000000..85b33a8 --- /dev/null +++ b/NX/server/localhost/player.cfg @@ -0,0 +1,14 @@ +###################################################################### +# # +# Copyright (c) 2010, 2019 NoMachine, http://www.nomachine.com. # +# # +# All rights reserved. # +# # +###################################################################### + +# +# Specify the path of base directory where the NX software has been +# installed. +# + +PlayerRoot = "/usr/NX" diff --git a/NX/server/localhost/server.cfg b/NX/server/localhost/server.cfg new file mode 100644 index 0000000..f88c976 --- /dev/null +++ b/NX/server/localhost/server.cfg @@ -0,0 +1,14 @@ +###################################################################### +# # +# Copyright (c) 2001, 2019 NoMachine, http://www.nomachine.com. # +# # +# All rights reserved. # +# # +###################################################################### + +# +# Specify the path of base directory where the NX software has been +# installed. +# + +ServerRoot = "/usr/NX" diff --git a/gnome/defaults.list b/gnome/defaults.list index ba34a1f..92fd1e9 100644 --- a/gnome/defaults.list +++ b/gnome/defaults.list @@ -267,3 +267,5 @@ x-scheme-handler/http=firefox.desktop x-scheme-handler/https=firefox.desktop x-scheme-handler/mailto=thunderbird.desktop x-scheme-handler/snap=org.gnome.Software.desktop +application/nx-session=NoMachine-nxs.desktop +application/nx-recording=NoMachine-nxv.desktop diff --git a/group b/group index ac3baca..b35ec9e 100644 --- a/group +++ b/group @@ -90,3 +90,4 @@ systemd-coredump:x:997: render:x:131: tcpdump:x:145: nvidia-persistenced:x:146: +nx:x:1015: diff --git a/group- b/group- index a97f1ad..ac3baca 100644 --- a/group- +++ b/group- @@ -89,3 +89,4 @@ gdm:x:129: systemd-coredump:x:997: render:x:131: tcpdump:x:145: +nvidia-persistenced:x:146: diff --git a/gshadow b/gshadow index 9d54c77..8987b5b 100644 --- a/gshadow +++ b/gshadow @@ -90,3 +90,4 @@ systemd-coredump:!!:: render:!:: tcpdump:!:: nvidia-persistenced:!:: +nx:!:: diff --git a/gshadow- b/gshadow- index da5f65d..9d54c77 100644 --- a/gshadow- +++ b/gshadow- @@ -89,3 +89,4 @@ gdm:!:: systemd-coredump:!!:: render:!:: tcpdump:!:: +nvidia-persistenced:!:: diff --git a/pam.d/nx b/pam.d/nx new file mode 100644 index 0000000..b2e8376 --- /dev/null +++ b/pam.d/nx @@ -0,0 +1,8 @@ +# This is a default PAM configuration for NoMachine. It is based on +# system's 'su' configuration and can be adjusted freely according +# to administrative needs on the system. + +auth include su +account include su +password include su +session include su diff --git a/pam.d/nxlimits b/pam.d/nxlimits new file mode 100644 index 0000000..e8e6e63 --- /dev/null +++ b/pam.d/nxlimits @@ -0,0 +1,4 @@ +# This is a default PAM configuration for NoMachine. +# Used to obtain nx user and nxhtd user limits. + +session optional pam_limits.so diff --git a/passwd b/passwd index a2eadfa..4d34b7f 100644 --- a/passwd +++ b/passwd @@ -57,3 +57,4 @@ systemd-coredump:x:997:997:systemd Core Dumper:/:/sbin/nologin tcpdump:x:132:145::/nonexistent:/usr/sbin/nologin nvidia-persistenced:x:133:146:NVIDIA Persistence Daemon,,,:/nonexistent:/sbin/nologin dump1090:x:134:65534::/usr/share/dump1090-mutability:/usr/sbin/nologin +nx:x:135:1015::/var/NX/nx:/etc/NX/nxserver diff --git a/passwd- b/passwd- index a2eadfa..c797ef9 100644 --- a/passwd- +++ b/passwd- @@ -57,3 +57,4 @@ systemd-coredump:x:997:997:systemd Core Dumper:/:/sbin/nologin tcpdump:x:132:145::/nonexistent:/usr/sbin/nologin nvidia-persistenced:x:133:146:NVIDIA Persistence Daemon,,,:/nonexistent:/sbin/nologin dump1090:x:134:65534::/usr/share/dump1090-mutability:/usr/sbin/nologin +nx:x:135:1015::/var/NX/nx:/bin/false diff --git a/polkit-1/localauthority/55-org.nomachine.d/10-org.nomachine.allow.colord.pkla b/polkit-1/localauthority/55-org.nomachine.d/10-org.nomachine.allow.colord.pkla new file mode 100644 index 0000000..6112ad4 --- /dev/null +++ b/polkit-1/localauthority/55-org.nomachine.d/10-org.nomachine.allow.colord.pkla @@ -0,0 +1,6 @@ +[Allow System Color Manager] +Identity=unix-user:* +Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile +ResultAny=no +ResultInactive=no +ResultActive=yes diff --git a/polkit-1/localauthority/55-org.nomachine.d/10-org.nomachine.allow.system-sources-refresh.pkla b/polkit-1/localauthority/55-org.nomachine.d/10-org.nomachine.allow.system-sources-refresh.pkla new file mode 100644 index 0000000..14a7d27 --- /dev/null +++ b/polkit-1/localauthority/55-org.nomachine.d/10-org.nomachine.allow.system-sources-refresh.pkla @@ -0,0 +1,6 @@ +[Allow System Color Manager] +Identity=unix-user:* +Action=org.freedesktop.packagekit.system-sources-refresh +ResultAny=no +ResultInactive=no +ResultActive=yes diff --git a/shadow b/shadow index 78b181d..af8e5be 100644 --- a/shadow +++ b/shadow @@ -57,3 +57,4 @@ systemd-coredump:!!:18107:::::: tcpdump:*:18219:0:99999:7::: nvidia-persistenced:*:18219:0:99999:7::: dump1090:*:18302:0:99999:7::: +nx:*:18347:0:99999:7::: diff --git a/shadow- b/shadow- index 78b181d..af8e5be 100644 --- a/shadow- +++ b/shadow- @@ -57,3 +57,4 @@ systemd-coredump:!!:18107:::::: tcpdump:*:18219:0:99999:7::: nvidia-persistenced:*:18219:0:99999:7::: dump1090:*:18302:0:99999:7::: +nx:*:18347:0:99999:7::: diff --git a/systemd/system/multi-user.target.wants/nxserver.service b/systemd/system/multi-user.target.wants/nxserver.service new file mode 120000 index 0000000..bbc82cb --- /dev/null +++ b/systemd/system/multi-user.target.wants/nxserver.service @@ -0,0 +1 @@ +/lib/systemd/system/nxserver.service \ No newline at end of file diff --git a/xdg/menus/applications-merged/NoMachine-dir.menu b/xdg/menus/applications-merged/NoMachine-dir.menu new file mode 100644 index 0000000..b71a77c --- /dev/null +++ b/xdg/menus/applications-merged/NoMachine-dir.menu @@ -0,0 +1,19 @@ + + + + Applications + + Internet + + NoMachine-dir + NoMachine-dir.directory + + NoMachine-base.desktop + NoMachine-base-unity.desktop + NoMachine-status.desktop + NoMachine-status-unity.desktop + + + + diff --git a/xdg/menus/gnome-applications-merged b/xdg/menus/gnome-applications-merged new file mode 120000 index 0000000..778eb50 --- /dev/null +++ b/xdg/menus/gnome-applications-merged @@ -0,0 +1 @@ +applications-merged \ No newline at end of file -- 2.43.0