Automatic import for version 0.7.3

This commit is contained in:
Rosa 2012-02-01 21:01:36 +04:00
commit 6b3c46d7e1
6 changed files with 2112 additions and 0 deletions

2
.abf.yml Normal file
View file

@ -0,0 +1,2 @@
sources:
"freenx-server-0.7.3.tar.gz": 888344f946cfb0802e2532e6b93601248c909eb8

View file

@ -0,0 +1,8 @@
/var/log/nxserver.log {
compress
create 600 nx root
notifempty
missingok
monthly
}

View file

@ -0,0 +1,29 @@
--- nxserver.bak 2011-02-13 16:37:48.284013842 -0500
+++ nxserver 2011-02-13 16:41:25.180489647 -0500
@@ -1447,7 +1447,7 @@
# Now check for the other enabled services
let SAMBA_DISPLAY=$SESS_DISPLAY+3000
- if [ "$(getparam 'samba')" = 1 ] && $COMMAND_NETCAT -z "$SERVER_HOST" $SAMBA_DISPLAY
+ if [ "$(getparam 'samba')" = 1 ] && $COMMAND_NETCAT -z "$SERVER_HOST" $SAMBA_DISPLAY 2>/dev/null
then
log 2 "Warning: Skipping $SERVER_HOST:$AGENT_DISPLAY as samba port is not free."
let SESS_DISPLAY=$SESS_DISPLAY+1
@@ -1455,7 +1455,7 @@
fi
let MEDIA_DISPLAY=$SESS_DISPLAY+7000
- if [ "$(getparam 'media')" = 1 ] && $COMMAND_NETCAT -z "$SERVER_HOST" $MEDIA_DISPLAY
+ if [ "$(getparam 'media')" = 1 ] && $COMMAND_NETCAT -z "$SERVER_HOST" $MEDIA_DISPLAY 2>/dev/null
then
log 2 "Warning: Skipping $SERVER_HOST:$AGENT_DISPLAY as media port is not free."
let SESS_DISPLAY=$SESS_DISPLAY+1
@@ -1464,7 +1464,7 @@
let CUPS_DISPLAY=$SESS_DISPLAY+9000
- if [ "$(getparam 'cups')" = 1 ] && $COMMAND_NETCAT -z "$SERVER_HOST" $CUPS_DISPLAY
+ if [ "$(getparam 'cups')" = 1 ] && $COMMAND_NETCAT -z "$SERVER_HOST" $CUPS_DISPLAY 2>/dev/null
then
log 2 "Warning: Skipping $SERVER_HOST:$AGENT_DISPLAY as cups port is not free."
let SESS_DISPLAY=$SESS_DISPLAY+1

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,494 @@
diff -rud -x .bzr freenx-server/init.d/freenx-server freenx-server.fixes/init.d/freenx-server
--- freenx-server/init.d/freenx-server 2009-11-23 10:16:13.100350348 +0100
+++ freenx-server.fixes/init.d/freenx-server 2009-11-23 11:18:49.590351559 +0100
@@ -1,43 +1,92 @@
#!/bin/bash
+#
+# Sample startup script for FreeNX server
+#
+# Coypright (c) 2007 by Fabian Franz <freenx@fabian-franz.de>.
+#
+# License: GNU GPL, version 2
+#
+# SVN: $Id: freenx-server 485 2008-03-02 10:29:52Z fabianx $
+#
+# Modified to be chkconfig compatible by Johnny Hughes <johnny@centos.org>
+#
+# chkconfig: 2345 91 35
+# description: Creates /tmp/.X11-unix/ if required and cleans up dead \
+# NX sessions.
-### BEGIN INIT INFO
-# Provides: freenx_server
-# Required-Start: sshd
-# Required-Stop: sshd
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: FreeNX Server
-# Description: Cleanup FreeNX Server session database at boot time
-### END INIT INFO
-PATH_BIN=/usr/lib/nx
+# Read the config file
+. /usr/bin/nxloadconfig --
+
+# Source function library.
+. /etc/init.d/functions
+prog="freenx-server"
+
+start() {
+ su -s /bin/bash - nx -c "$PATH_BIN/nxserver --cleanup" > /dev/null 2>&1 < /dev/null
+ if [ ! -d "/tmp/.X11-unix" ]; then
+ mkdir -m1777 /tmp/.X11-unix/
+ ret=$?
+ else
+ X11_owner=`/bin/ls -ald /tmp/.X11-unix | /bin/gawk {'print $3'}`
+ if [ "$X11_owner" != "root" ]; then
+ /bin/chown root /tmp/.X11-unix
+ fi
+ ret=0
+ fi
+ if [ $ret -eq 0 ]; then
+ touch /var/lock/subsys/freenx-server
+ action $"Starting $prog: " /bin/true
+ else
+ action $"Starting $prog: " /bin/false
+ fi
+ echo
+ return $ret
+}
+
+stop() {
+ su -s /bin/bash - nx -c "$PATH_BIN/nxserver --cleanup" > /dev/null 2>&1 < /dev/null
+ if [ -e "/var/lock/subsys/freenx-server" ]; then
+ rm -f /var/lock/subsys/freenx-server
+ ret=$?
+ else
+ ret=0
+ fi
+ if [ $ret -eq 0 ]; then
+ action $"Stopping $prog: " /bin/true
+ else
+ action $"Stopping $prog: " /bin/false
+ fi
+ echo
+ return $ret
+}
+
+restart() {
+ echo $"Restarting $prog:"
+ stop
+ start
+}
case "$1" in
- start)
- if [ ! -e "/var/run/freenx-server" ]; then
- [ ! -d "/tmp/.X11-unix" ] && mkdir -m1755 /tmp/.X11-unix/
- $PATH_BIN/nxserver --cleanup
- $PATH_BIN/nxserver --start
- touch "/var/run/freenx-server";
- else
- echo "Not starting freenx-server, it's already started."
- fi
- ;;
- restart|force-reload)
- $PATH_BIN/nxserver --cleanup
- $PATH_BIN/nxserver --start
- touch "/var/run/freenx-server";
- ;;
- stop)
- $PATH_BIN/nxserver --stop
- $PATH_BIN/nxserver --cleanup
- rm -f /var/run/freenx-server
- ;;
- status)
- [ ! -e "/var/run/freenx-server" ] || exit 3
- exit 0;
- ;;
- *)
- echo "Usage: $0 <start|restart|stop|force-reload|status>"
- ;;
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ restart
+ ;;
+ status)
+ if [ -e "/var/lock/subsys/freenx-server" ]; then
+ echo $"$prog is running"
+ else
+ echo $"$prog is stopped"
+ fi
+ ;;
+ *)
+ echo $"Usage: $prog {start|stop|restart|status}"
+ exit 1
esac
+
+exit $?
diff -rud -x .bzr freenx-server/nxloadconfig freenx-server.fixes/nxloadconfig
--- freenx-server/nxloadconfig 2009-11-23 10:16:13.103349734 +0100
+++ freenx-server.fixes/nxloadconfig 2009-11-23 12:54:19.852601780 +0100
@@ -112,11 +112,28 @@
# Restriction directives
-DISPLAY_BASE=1000
+#JJK: DISPLAY_BASE=1000
+#JJK: Change DISPLAY_BASE to 2000 to avoid conflict of DISPLAY_BASE+7000 with nasd
+DISPLAY_BASE=2000
SESSION_LIMIT=200
SESSION_USER_LIMIT="" #Calculated
DISPLAY_LIMIT=200
+#JJK: Added the following to allow printing when using cifs mount
+#JJK: Note the smb print port (#139) must then be tunnelled manually
+#JJK: from <DISPLAY+3000+SMBPORT_OFFSET> on the server to port 139 on the host
+#JJK: by running on the client:
+#JJK: ssh ... -R <DISPLAY+3000+SMBPORT_OFFSET>:<client name>:139
+#JJK: If SAMBA_MOUNT_SHARE_PROTOCOL="smbfs" (technically, if it doesn't equal
+#JJK 'cifs' or in most cases 'both') then the ssh tunnel is automatically
+#JJK: set up from port <DISPLAY+3000> on the server to port 139
+#JJK: on the remote client.
+#JJK: Note in *all* cases, the cups printer on the client is accessed from
+#JJK: the server via the command line, using the following -h flag:
+#JJK: -h localhost:<DISPLAY+9000> [-P <printer name>]
+#JJK: or via the CUPS web browser using:
+#JJK: http://localhost:<DISPLAY+9000>
+SMBPORT_OFFSET=8000
ENABLE_PERSISTENT_SESSION="all"
DISABLE_PERSISTENT_SESSION=""
@@ -174,7 +191,11 @@
ENABLE_CUPS_SEAMLESS="0"
CUPS_SEAMLESS_DELAY="10"
ENABLE_FOOMATIC="1"
-COMMAND_FOOMATIC="/usr/lib/cups/driver/foomatic-ppdfile"
+#JJK: COMMAND_FOOMATIC="/usr/lib/cups/driver/foomatic-ppdfile"
+COMMAND_FOOMATIC="/usr/bin/foomatic-ppdfile"
+
+#JJK: added the following path referenced in nxprint
+PPD_DIR="/usr/share/cups/model" #JJK: Note /usr/share/ppd on some systems
CUPS_BACKEND="/usr/lib/cups/backend"
CUPS_IPP_BACKEND="$CUPS_BACKEND/nxipp"
@@ -194,7 +215,8 @@
KILL_DEFAULT_X_WM="1"
BOOTSTRAP_X_SESSION="0"
USER_X_STARTUP_SCRIPT=.Xclients
-DEFAULT_X_SESSION=/etc/X11/xdm/Xsession
+#JJK: DEFAULT_X_SESSION=/etc/X11/xdm/Xsession
+DEFAULT_X_SESSION=/etc/X11/xinit/Xsession
COMMAND_GDM_X_SESSION="/etc/gdm/Xsession custom"
if [ ! -x "$COMMAND_GDM_X_SESSION" ]
then
@@ -213,7 +235,7 @@
COMMAND_SSH=ssh
COMMAND_SSH_KEYGEN=ssh-keygen
COMMAND_CUPSD=/usr/sbin/cupsd
-COMMAND_MD5SUM="openssl md5"
+COMMAND_MD5SUM="md5sum"
COMMAND_PERL=perl
COMMAND_RDESKTOP="rdesktop"
COMMAND_VNCVIEWER="vncviewer"
@@ -357,7 +379,7 @@
[ -z "$AGENT_LIBRARY_PATH" ] && AGENT_LIBRARY_PATH=$PATH_LIB
[ -z "$PROXY_LIBRARY_PATH" ] && PROXY_LIBRARY_PATH=$PATH_LIB
[ -z "$APPLICATION_LIBRARY_PATH" ] && APPLICATION_LIBRARY_PATH=$PATH_LIB
-[ -z "$APPLICATION_LIBRARY_PRELOAD" ] && APPLICATION_LIBRARY_PRELOAD="$APPLICATION_LIBRARY_PATH/libX11.so.6.2:$APPLICATION_LIBRARY_PATH/libXext.so.6.4:$APPLICATION_LIBRARY_PATH/libXcomp.so:$APPLICATION_LIBRARY_PATH/libXcompext.so:$APPLICATION_LIBRARY_PATH/libXrender.so.1.2"
+[ -z "$APPLICATION_LIBRARY_PRELOAD" ] && APPLICATION_LIBRARY_PRELOAD="$APPLICATION_LIBRARY_PATH/libX11.so.6:$APPLICATION_LIBRARY_PATH/libXext.so.6:$APPLICATION_LIBRARY_PATH/libXcomp.so.3:$APPLICATION_LIBRARY_PATH/libXcompext.so.3:$APPLICATION_LIBRARY_PATH/libXrender.so.1"
NX_BACKEND_VERSION=$(strings $COMMAND_NXAGENT 2>/dev/null | egrep 'NXAGENT - Version' | sed 's/.*Version //g')
diff -rud -x .bzr freenx-server/nxnode freenx-server.fixes/nxnode
--- freenx-server/nxnode 2009-11-23 10:16:13.104350274 +0100
+++ freenx-server.fixes/nxnode 2009-11-23 11:15:44.385476686 +0100
@@ -20,6 +20,20 @@
# Read the config file
. $(PATH=$(cd $(dirname $0) && pwd):$PATH which nxloadconfig) --userconf
+#JJK: Added following 'if' stanza as a kluge since the following variables
+#JJK: need to be set in cmd_node_smbmount node_umount_smb
+#JJK: but they are currently set only in startsession which is called
+#JJK: separately from nxserver via ssh so environment variables
+#JJK: aren't preserved.
+if [[ "$SAMBA_MOUNT_SHARE_PROTOCOL" = "cifs" || \
+ ( "$SAMBA_MOUNT_SHARE_PROTOCOL" = "both" && \
+ `which "$COMMAND_SMBMOUNT_CIFS"` && `which "$COMMAND_SMBUMOUNT_CIFS"` ) \
+ ]] > /dev/null 2>&1; then
+ COMMAND_SMBMOUNT=$COMMAND_SMBMOUNT_CIFS
+ COMMAND_SMBUMOUNT=$COMMAND_SMBUMOUNT_CIFS
+ SAMBA_MOUNT_SHARE_PROTOCOL="cifs"
+fi
+
#
# -----------------------------------------------------------------------------
# Startup of nxnode
@@ -659,11 +673,27 @@
touch "$USER_FAKE_HOME/.nx/C-$sess_id/pids/cupsd"
mkdir -p "$USER_FAKE_HOME/.nx/C-$sess_id/cups/spool/tmp" "$USER_FAKE_HOME/.nx/C-$sess_id/cups/spool/certs" "$USER_FAKE_HOME/.nx/C-$sess_id/cups/ppd" "$USER_FAKE_HOME/.nx/C-$sess_id/cups/cache"
+ mkdir -p "$USER_FAKE_HOME/.nx/C-$sess_id/cups/log" #JJK cups log file home
+
+#JJK: Modifications to cupsd.conf
+#JJK: - Added SystemGroup line in order to add $USER to SystemGroup
+#JJK: - Moved all the log files to log/<log>
+#JJK: - Set AccessLog to: log/access_log (was /dev/null)
+#JJK: - Added listening on $NODE_CUPSD_PORT
+#JJK: Listen localhost: $NODE_CUPSD_PORT
+#JJK: - Removed following line because directive is specific to Debian
+#JJK: PidFile $USER_FAKE_HOME/.nx/C-$sess_id/pids/cupsd
+#JJK: - Access restrictions borrowed from /etc/cups/cupsd.conf
+#JJK: - Default policy borrowed from /etc/cups/cupsd.conf but modified
+#JJK: to allow Add, Delete, and Default printer without (password)
+#JJK: authentication
+#JJK: - Note for more detailed logging set: LogLevel debug
cat <<EOF > $USER_FAKE_HOME/.nx/C-$sess_id/cups/cupsd.conf
-AccessLog /dev/null
-ErrorLog error_log
-PageLog page_log
+SystemGroup sys root $USER
+AccessLog log/access_log
+ErrorLog log/error_log
+PageLog log/page_log
LogLevel info
TempDir $USER_FAKE_HOME/.nx/C-$sess_id/cups/spool/tmp
RequestRoot $USER_FAKE_HOME/.nx/C-$sess_id/cups/spool
@@ -671,19 +701,60 @@
StateDir $USER_FAKE_HOME/.nx/C-$sess_id/cups/
CacheDir $USER_FAKE_HOME/.nx/C-$sess_id/cups/cache
+Listen localhost:$NODE_CUPSD_PORT
Listen $NODE_CUPSD_SOCKET
Browsing Off
ServerName localhost
-PidFile $USER_FAKE_HOME/.nx/C-$sess_id/pids/cupsd
+#JJK: Restrict access to the server...
<Location />
Order Deny,Allow
Deny From All
Allow from 127.0.0.1
</Location>
+#JJK: Restrict access to the admin pages...
+<Location /admin>
+ Encryption Required
+ Order allow,deny
+ Allow localhost
+</Location>
+
+#JJK: Restrict access to configuration files...
+<Location /admin/conf>
+ AuthType Basic
+ Require user @SYSTEM
+ Order allow,deny
+ Allow localhost
+</Location>
+
# Allow everything for anonymous, because we are protected through UNIX socket
+#JJK: Since allowing access via $NODE_CUPSD_PORT, need to add protection
<Policy default>
+ #JJK: Job-related operations must be done by the owner or an adminstrator...
+ <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>
+ Require user @OWNER @SYSTEM
+ Order deny,allow
+ </Limit>
+
+ #JJK:All administration operations require an adminstrator to authenticate...
+ <Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs>
+ AuthType Basic
+ Require user @SYSTEM
+ Order deny,allow
+ </Limit>
+
+ #JJK: Except need to allow these for nxnode to work
+ <Limit CUPS-Add-Printer CUPS-Delete-Printer CUPS-Set-Default>
+ Order deny,allow
+ </Limit>
+
+ # Only the owner or an administrator can cancel or authenticate a job...
+ <Limit Cancel-Job CUPS-Authenticate-Job>
+ Require user @OWNER @SYSTEM
+ Order deny,allow
+ </Limit>
+
<Limit All>
AuthType None
Order deny,allow
@@ -695,9 +766,17 @@
# copy mime.* files
cp -af "$CUPS_ETC"/mime.* "$USER_FAKE_HOME/.nx/C-$sess_id/cups/"
+ #JJK: Also copy over pstoraster.convs
+ cp -af "$CUPS_ETC"/mime.* "$CUPS_ETC"/pstoraster.convs "$USER_FAKE_HOME/.nx/C-$sess_id/cups/"
# start cupsd
- $COMMAND_CUPSD -c "$USER_FAKE_HOME/.nx/C-$sess_id/cups/cupsd.conf" &>/dev/null </dev/null
+#JJK: Note the directive PidFile in the original cupsd.conf intended for
+#JJK: recording the pid is a Debianism. Instead, we will use the non-daemon
+#JJK: form of cupsd and capture the pid directly
+#JJK: $COMMAND_CUPSD -c "$USER_FAKE_HOME/.nx/C-$sess_id/cups/cupsd.conf" &>/dev/null </dev/null
+ $COMMAND_CUPSD -F -c "$USER_FAKE_HOME/.nx/C-$sess_id/cups/cupsd.conf" &>/dev/null </dev/null &
+ NODE_CUPSD_PID=$!
+ echo $NODE_CUPSD_PID >"$USER_FAKE_HOME/.nx/C-$sess_id/pids/cupsd"
# setup KDE
if [ "$ENABLE_KDE_CUPS" = "1" -a -e "$KDE_PRINTRC" ]
@@ -747,6 +826,7 @@
fi
sleep 0.5s
done
+ rmdir "$mpoint" >/dev/null 2>/dev/null #JJK:Remove mount point if empty
done
}
@@ -1166,6 +1246,7 @@
COMMAND_SMBMOUNT=/bin/true
COMMAND_SMBUMOUNT=/bin/true
+ smbport=139 #JJK: still may want to do printer sharing...
else # smbfs
smbport=139
fi
@@ -1436,7 +1517,8 @@
password=$(getparam password)
share=$(getparam share)
computername=$(getparam computername)
- dir=$(getparam dir | sed 's|$(SHARES)|MyShares|g')
+#JJK: dir=$(getparam dir | sed 's|$(SHARES)|MyShares|g')
+ dir=$(getparam dir | sed 's/\(%24\|\$\)(SHARES)/MyShares/g')
# rdir=$(getparam dir | sed 's|$(SHARES)/||g')
display=$(cd $USER_FAKE_HOME/.nx/; echo C-$SERVER_NAME-*-$sessionid | awk 'BEGIN {FS="-"} {i=NF-1; print $i}')
mkdir -p "$HOME/$dir"
@@ -1456,6 +1538,7 @@
echo "$HOME/$dir" >> "$USER_FAKE_HOME/.nx/C-$SERVER_NAME-$display-$sessionid/scripts/mpoint"
else
$PATH_BIN/nxdialog -dialog ok -caption "NXServer Message" -message "Info: Share: '//$computername/$share' failed to mount: $error" -display :$display &
+ rmdir "$HOME/$dir" >/dev/null 2>/dev/null #JJK: Remove mount point if empty
fi
}
@@ -1478,6 +1561,12 @@
# this will also setup the userspace cupsd
export CUPS_SERVER=$(node_cupsd_get_socket)
+#JJK: The following if-stanza kludge added to enable printing when smbport=cifs
+#JJK: since smb printing won't work when forwarded over port 445
+ if [ "$SAMBA_MOUNT_SHARE_PROTOCOL" = "cifs" ] ; then
+ let port=$port+$SMBPORT_OFFSET
+ fi
+
if [ "$type" = "smb" ]
then
if [ -x "$CUPS_BACKEND/nxsmb" ]
@@ -1506,6 +1595,9 @@
if [ "$ENABLE_CUPS_SEAMLESS" != "1" ]
then
+ #JJK: Export the following variables for use by nxdialog/nxprint
+ #JJK: Note they are also exported in nxdialog but doesn't help there
+ export ENABLE_FOOMATIC COMMAND_FOOMATIC PPD_DIR
MODEL=$($PATH_BIN/nxdialog -printer "$NAME" -display :$display)
[ -z "$MODEL" -o "$MODEL" = "cancel: aborted" ] && return
else
@@ -1513,7 +1605,11 @@
MODEL="download_cached"
fi
- PUBLIC="-u allow:$USER"
+#JJK: I like to also allow 'guest' so you can do things like print
+#JJK: testpages from the CUPS web interface. Note this is required
+#JJK: even for the original user to print test pages
+#JJK: PUBLIC="-u allow:$USER"
+ PUBLIC="-u allow:$USER,guest"
[ "$public" == "1" ] && PUBLIC=""
if [ "$MODEL" = "download_new" -o "$MODEL" = "download_cached" ]
diff -rud -x .bzr freenx-server/nxprint freenx-server.fixes/nxprint
--- freenx-server/nxprint 2009-11-23 10:16:13.102350032 +0100
+++ freenx-server.fixes/nxprint 2009-11-23 10:52:01.353353153 +0100
@@ -51,7 +51,8 @@
if [ -z "$(find $UTILITY_DRIVERS_CACHE.all -mmin -60 2> /dev/null)" ]
then
{
- cd /usr/share/ppd/
+#JJK: cd /usr/share/ppd/
+ cd $PPD_DIR
awk -F '"' '/\*Manufacturer:/ { a[FILENAME]=$2 }
/\*NickName:/ { b[FILENAME]=$2 }
END {
diff -rud -x .bzr freenx-server/nxredir/Makefile freenx-server.fixes/nxredir/Makefile
--- freenx-server/nxredir/Makefile 2009-11-23 10:16:13.100350348 +0100
+++ freenx-server.fixes/nxredir/Makefile 2009-11-23 11:57:13.481350660 +0100
@@ -9,13 +9,12 @@
$(CC) -fPIC $(CFLAGS) -nostdlib -shared -Wl,-soname,$(LIBNAME).$(VERSION) -o $(LIBNAME).$(VERSION) nxredir.o -ldl -lc
clean:
- rm -f $(LIBNAME)
rm -f $(LIBNAME).$(VERSION)
rm -f *.o
ifneq ($(NX_VERSION),)
install: all
- install -m755 $(LIBNAME) $(DESTDIR)/$$PATH_LIB/
+ install -m755 $(LIBNAME).$(VERSION) $(DESTDIR)/$$PATH_LIB/
install -m755 nxredir $(DESTDIR)/$$PATH_BIN/
install -m755 nxsmb $(DESTDIR)/$$CUPS_BACKEND/
perl -pi -e "s,PATH_LIB=.*,PATH_LIB=\"$$PATH_LIB\",g" $(DESTDIR)/$$PATH_BIN/nxredir
diff -rud -x .bzr freenx-server/nxredir/nxsmb freenx-server.fixes/nxredir/nxsmb
--- freenx-server/nxredir/nxsmb 2009-11-23 10:16:13.098350105 +0100
+++ freenx-server.fixes/nxredir/nxsmb 2009-11-23 10:52:01.354352855 +0100
@@ -18,6 +18,11 @@
PROTOCOL=$(echo $DEVICE_URI | cut -d/ -f4)
PRINTER=$(echo $DEVICE_URI | cut -d/ -f5)
+if [ "$#" -eq 0 ]
+then
+ exit 0
+fi
+
if [ -z "$PRINTER" ] # old style setup
then
echo "Warning: Not using nxredir library. The DEVICE_URI is not in the right format."
diff -rud -x .bzr freenx-server/nxserver freenx-server.fixes/nxserver
--- freenx-server/nxserver 2009-11-23 10:16:13.100350348 +0100
+++ freenx-server.fixes/nxserver 2009-11-23 10:52:01.356476314 +0100
@@ -17,6 +17,22 @@
# Read the config file
. $(PATH=$(cd $(dirname $0) && pwd):$PATH which nxloadconfig) --
+if test ! -e $NX_ETC_DIR/users.id_dsa; then
+ $COMMAND_SSH_KEYGEN -q -t dsa -N "" -f $NX_ETC_DIR/users.id_dsa
+fi
+
+if test ! -e $NX_ETC_DIR/client.id_dsa.key -o ! -e $NX_ETC_DIR/server.id_dsa.pub.key; then
+ $COMMAND_SSH_KEYGEN -q -t dsa -N "" -f $NX_ETC_DIR/local.id_dsa
+ mv -f $NX_ETC_DIR/local.id_dsa $NX_ETC_DIR/client.id_dsa.key
+ mv -f $NX_ETC_DIR/local.id_dsa.pub $NX_ETC_DIR/server.id_dsa.pub.key
+ chmod 0600 $NX_ETC_DIR/client.id_dsa.key $NX_ETC_DIR/server.id_dsa.pub.key
+fi
+
+if test ! -s $NX_HOME_DIR/.ssh/known_hosts -a -e /etc/ssh/ssh_host_rsa_key.pub; then
+ echo -n "127.0.0.1 " > $NX_HOME_DIR/.ssh/known_hosts
+ cat /etc/ssh/ssh_host_rsa_key.pub >> $NX_HOME_DIR/.ssh/known_hosts 2>/dev/null
+fi
+
# following two functions are Copyright by Klaus Knopper
stringinstring(){
@@ -1466,7 +1482,7 @@
done
# Check if there is already an agent running on that display on that host
- let AGENT_DISPLAY=$SESS_DISPLAY+6000
+ let AGENT_DISPLAY=$SESS_DISPLAY-$DISPLAY_BASE+6000
if $COMMAND_NETCAT -z "$SERVER_HOST" $AGENT_DISPLAY 2>/dev/null
then
log 2 "Warning: Stray nxagent without .nX$SESS_DISPLAY-lock found on host:port $SERVER_HOST:$AGENT_DISPLAY."

386
freenx.spec Normal file
View file

@ -0,0 +1,386 @@
# --with NomachineKey
# Allow login with the key shipped with the NoMachine client.
# This can be a security risk, so it is disabled by default
# and an SSH key is generated at install time.
%bcond_with NomachineKey
Summary: Free NX implementation
Name: freenx
Version: 0.7.3
Release: %mkrel 10
License: GPLv2
Group: Networking/Remote access
URL: http://freenx.berlios.de/
Source0: http://download.berlios.de/freenx/freenx-server-%{version}.tar.gz
Source1: freenx-nxserver.logrotate
Patch0: freenx-server-0.7.3-lp-fixes.patch
Patch1: freenx-server-r104-fixes.patch
Patch2: freenx-server-0.7.3-connection-fix.patch
Requires: expect
Requires: netcat
Requires: nxagent
Requires: nxproxy
Requires: openssh-server
Requires: Xdialog
Requires: xmessage
Requires: xterm
Requires(pre): rpm-helper
Requires(post): expect
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
NoMachine NX is the next-generation X compression and roundtrip
suppression scheme. It can operate remote X11 sessions over 56k
modem dialup links or anything better.
This package contains a free (GPL) implementation of the nxserver
component.
%prep
%setup -q -n %{name}-server-%{version}
%patch0 -p1 -b .lp
%patch1 -p1 -b .fixes
%patch2 -p0 -b .connection-fix
%build
perl -pi -e "s|/var/lib/nxserver/home|%{_localstatedir}/lib/nxserver/nxhome|" nxloadconfig
pushd nxserver-helper
%make
popd
# README.install.urpmi doesn't work yet.
cat << EOF > README.urpmi
After installing this package, an nx user is created (this is a
system user, do not try to log in as him), with a home located
at %{_localstatedir}/lib/nxserver/nxhome. His password is a random
32-character password.
%if %with NomachineKey
Using Nomachine ssh key, warning, this is a potential security risk.
%else
Your user must install the key located at:
%{_localstatedir}/lib/nxserver/nxhome/.ssh/client.id_dsa.key
to log in.
For knx, put it in: %{_datadir}/knx/ with world-readable right.
For nomachine.com Nx client for windows put it in : C:\Program
Files\NX Client for Windows\share
You user will now be able to log in using their username
and password provided you have ssh logins enabled for them
%endif
EOF
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_sbindir}
install -m 755 {nxdialog,nxkeygen,nxloadconfig,nxnode,nxnode-login,nxserver,nxserver-helper/nxserver-helper} %{buildroot}%{_bindir}
install -m 755 nxsetup %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{_localstatedir}/lib/nxserver/nxhome/.ssh
mkdir -p %{buildroot}%{_localstatedir}/lib/nxserver/db/{closed,failed,running}
mkdir -p %{buildroot}%{_sysconfdir}/nxserver
mkdir -p %{buildroot}%{_logdir}
/bin/touch %{buildroot}%{_sysconfdir}/nxserver/{passwords,passwords.orig,users.id_dsa,users.id_dsa.pub}
/bin/touch %{buildroot}%{_localstatedir}/lib/nxserver/nxhome/.ssh/{server.id_dsa.pub.key,client.id_dsa.key,authorized_keys2,known_hosts}
/bin/touch %{buildroot}%{_logdir}/nxserver.log
install node.conf.sample %{buildroot}%{_sysconfdir}/nxserver/node.conf
#/bin/echo 'ENABLE_1_5_0_BACKEND="1"' >> %{buildroot}%{_sysconfdir}/nxserver/node.conf
/bin/echo 'ENABLE_2_0_0_BACKEND="1"' >> %{buildroot}%{_sysconfdir}/nxserver/node.conf
/bin/echo 'ENABLE_ROOTLESS_MODE="1"' >> %{buildroot}%{_sysconfdir}/nxserver/node.conf
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
cp -a %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
# install init script
install -D -m 755 init.d/freenx-server %{buildroot}%{_initrddir}/freenx-server
# tell spec-helper to not remove passwords.orig
export DONT_CLEANUP=1
%clean
rm -rf %{buildroot}
%pre
if [ $1 = 1 ]; then
%_pre_useradd nx %{_localstatedir}/lib/nxserver/nxhome %{_bindir}/nxserver
fi
%postun
if [ $1 = 0 ]; then
%_postun_userdel nx
fi
%post
%_post_service freenx-server
# make a link from %{_usr}/X11R6/lib/X11/fonts -> %{_datadir}/fonts if needed
[ ! -d %{_usr}/X11R6/lib/X11/fonts ] && %{__ln_s} %{_datadir}/fonts %{_usr}/X11R6/lib/X11/
if [ $1 = 1 ]; then
%{_bindir}/ssh-keygen -f %{_sysconfdir}/nxserver/users.id_dsa -t dsa -N "" 2>&1 > /dev/null
chown nx.root %{_sysconfdir}/nxserver/users.id_dsa
chmod 600 %{_sysconfdir}/nxserver/users.id_dsa
%if %with NomachineKey
cat << EOF > %{_localstatedir}/lib/nxserver/nxhome/.ssh/authorized_keys2
ssh-dss AAAAB3NzaC1kc3MAAACBAJe/0DNBePG9dYLWq7cJ0SqyRf1iiZN/IbzrmBvgPTZnBa5FT/0Lcj39sRYt1paAlhchwUmwwIiSZaON5JnJOZ6jKkjWIuJ9MdTGfdvtY1aLwDMpxUVoGwEaKWOyin02IPWYSkDQb6cceuG9NfPulS9iuytdx0zIzqvGqfvudtufAAAAFQCwosRXR2QA8OSgFWSO6+kGrRJKiwAAAIEAjgvVNAYWSrnFD+cghyJbyx60AAjKtxZ0r/Pn9k94Qt2rvQoMnGgt/zU0v/y4hzg+g3JNEmO1PdHh/wDPVOxlZ6Hb5F4IQnENaAZ9uTZiFGqhBO1c8Wwjiq/MFZy3jZaidarLJvVs8EeT4mZcWxwm7nIVD4lRU2wQ2lj4aTPcepMAAACANlgcCuA4wrC+3Cic9CFkqiwO/Rn1vk8dvGuEQqFJ6f6LVfPfRTfaQU7TGVLk2CzY4dasrwxJ1f6FsT8DHTNGnxELPKRuLstGrFY/PR7KeafeFZDf+fJ3mbX5nxrld3wi5titTnX+8s4IKv29HJguPvOK/SI7cjzA+SqNfD7qEo8= root@nettuno
EOF
%else
%{_bindir}/ssh-keygen -q -t dsa -N '' -f %{_localstatedir}/lib/nxserver/nxhome/.ssh/local.id_dsa 2>&1 > /dev/null
mv -f %{_localstatedir}/lib/nxserver/nxhome/.ssh/local.id_dsa %{_localstatedir}/lib/nxserver/nxhome/.ssh/client.id_dsa.key
mv -f %{_localstatedir}/lib/nxserver/nxhome/.ssh/local.id_dsa.pub %{_localstatedir}/lib/nxserver/nxhome/.ssh/server.id_dsa.pub.key
cat %{_localstatedir}/lib/nxserver/nxhome/.ssh/server.id_dsa.pub.key > %{_localstatedir}/lib/nxserver/nxhome/.ssh/authorized_keys2
%endif
/bin/echo -n "127.0.0.1 " > %{_localstatedir}/lib/nxserver/nxhome/.ssh/known_hosts
cat %{_sysconfdir}/ssh/ssh_host_rsa_key.pub >> %{_localstatedir}/lib/nxserver/nxhome/.ssh/known_hosts
chmod 600 %{_localstatedir}/lib/nxserver/nxhome/.ssh/*
chown nx.root %{_localstatedir}/lib/nxserver/nxhome/.ssh/*
%create_ghostfile %{_sysconfdir}/nxserver/users.id_dsa.pub root root 644
%create_ghostfile %{_sysconfdir}/nxserver/passwords.orig nx root 600
%create_ghostfile %{_sysconfdir}/nxserver/passwords nx root 600
%create_ghostfile %{_logdir}/nxserver.log nx root 600
%{_bindir}/mkpasswd -l 32 | %{_bindir}/passwd --stdin nx 2>&1 > /dev/null
fi
%preun
%_preun_service freenx-server
%files
%defattr(0644,root,root,0755)
%doc AUTHORS README.urpmi
%attr(0755,root,root) %{_bindir}/nxdialog
%attr(0755,root,root) %{_bindir}/nxkeygen
%attr(0755,root,root) %{_bindir}/nxloadconfig
%attr(0755,root,root) %{_bindir}/nxnode
%attr(0755,root,root) %{_bindir}/nxnode-login
%attr(0755,root,root) %{_bindir}/nxserver
%attr(0755,root,root) %{_bindir}/nxserver-helper
%attr(0755,root,root) %{_sbindir}/nxsetup
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%attr(0755,root,root) %{_initrddir}/freenx-server
%attr(755,nx,root) %dir %{_sysconfdir}/nxserver
%attr(755,nx,root) %dir %{_localstatedir}/lib/nxserver
%attr(755,nx,root) %dir %{_localstatedir}/lib/nxserver/db
%attr(700,nx,root) %dir %{_localstatedir}/lib/nxserver/db/closed
%attr(700,nx,root) %dir %{_localstatedir}/lib/nxserver/db/failed
%attr(700,nx,root) %dir %{_localstatedir}/lib/nxserver/db/running
%attr(755,nx,root) %dir %{_localstatedir}/lib/nxserver/nxhome
%attr(700,nx,root) %dir %{_localstatedir}/lib/nxserver/nxhome/.ssh
%attr(644,nx,root) %config(noreplace) %{_sysconfdir}/nxserver/node.conf
%attr(600,nx,root) %ghost %{_sysconfdir}/nxserver/passwords
%attr(600,nx,root) %ghost %{_sysconfdir}/nxserver/users.id_dsa
%attr(644,root,root) %ghost %{_sysconfdir}/nxserver/users.id_dsa.pub
%attr(600,nx,root) %ghost %{_sysconfdir}/nxserver/passwords.orig
%attr(600,nx,root) %ghost %{_localstatedir}/lib/nxserver/nxhome/.ssh/known_hosts
%attr(600,nx,root) %ghost %{_localstatedir}/lib/nxserver/nxhome/.ssh/authorized_keys2
%attr(600,nx,root) %ghost %{_localstatedir}/lib/nxserver/nxhome/.ssh/client.id_dsa.key
%attr(600,nx,root) %ghost %{_localstatedir}/lib/nxserver/nxhome/.ssh/server.id_dsa.pub.key
# E: freenx non-root-user-log-file /var/log/nxserver.log nx
%attr(600,nx,root) %ghost %{_logdir}/nxserver.log
%changelog
* Mon Feb 28 2011 Funda Wang <fwang@mandriva.org> 0.7.3-10mdv2011.0
+ Revision: 640868
- rebuild
* Mon Feb 14 2011 Lev Givon <lev@mandriva.org> 0.7.3-9
+ Revision: 637651
- Patch nxserver connection problem (#61008).
* Mon Feb 14 2011 Lev Givon <lev@mandriva.org> 0.7.3-8
+ Revision: 637644
- Correct path to nxloadconfig (#61530).
Use su instead of runuser in init script.
* Sun Dec 05 2010 Oden Eriksson <oeriksson@mandriva.com> 0.7.3-7mdv2011.0
+ Revision: 610766
- rebuild
* Tue Jun 01 2010 Ahmad Samir <ahmadsamir@mandriva.org> 0.7.3-6mdv2010.1
+ Revision: 546825
- drop patche0, it's old and doesn't apply anyway
- add two patches from Fedora, should fix (mdv#59579) and (mdv#59572)
- drop patches 2,3 as they're part of the Fedora patches now
- renumber the patches
* Sun Mar 28 2010 Ahmad Samir <ahmadsamir@mandriva.org> 0.7.3-5mdv2010.1
+ Revision: 528539
- really sync sources
- clean spec
- add patch from CentOS to use the init script to make sure /tmp/.X11-unix
exists otherwise freenx fails to work, also the init script cleans out dead
NX sessions (fixes mdv bug#51240)
* Mon Nov 30 2009 Ahmad Samir <ahmadsamir@mandriva.org> 0.7.3-4mdv2010.1
+ Revision: 471959
- Remove ENABLE_1_5_0_BACKEND="1" (fix bug #51242)
* Fri Sep 11 2009 Thierry Vignaud <tv@mandriva.org> 0.7.3-3mdv2010.0
+ Revision: 437593
- rebuild
* Tue Dec 16 2008 Adam Williamson <awilliamson@mandriva.org> 0.7.3-2mdv2009.1
+ Revision: 314711
- package is no longer noarch, nxserver-helper is a binary
- build and install nxserver-helper: needed for slave mode to work, which
seems to be upstream's preferred method now
* Tue Dec 09 2008 Adam Williamson <awilliamson@mandriva.org> 0.7.3-1mdv2009.1
+ Revision: 312057
- update nxagent version patch for 3.3.0
- drop removeunix-sockets.patch (merged upstream)
- drop 0.7.1-0.7.2-405-417.patch (superseded by 0.7.3)
- new license policy
- new release 0.7.3
* Thu Jul 24 2008 Thierry Vignaud <tv@mandriva.org> 0.7.1-7mdv2009.0
+ Revision: 245399
- rebuild
+ Pixel <pixel@mandriva.com>
- adapt to %%_localstatedir now being /var instead of /var/lib (#22312)
* Thu Jan 31 2008 Emmanuel Blindauer <blindauer@mandriva.org> 0.7.1-5mdv2008.1
+ Revision: 160624
- fixed typo
* Mon Jan 28 2008 Emmanuel Blindauer <blindauer@mandriva.org> 0.7.1-4mdv2008.1
+ Revision: 159077
- fix patch
- BS: fix the patch and make what I say!
- removed 0.7.0 source
- fix typo
- removed typo
- update patch for 3.1.0
- really patch for 3.1.0
* Sun Jan 27 2008 Emmanuel Blindauer <blindauer@mandriva.org> 0.7.1-2mdv2008.1
+ Revision: 158781
- readd patch
- remove patch ?!
- dont forget to bump release
- added patch for nx-3.1.0
added patch for testing unix sockets (Yves-Gael Cheny)
* Sun Jan 27 2008 Emmanuel Blindauer <blindauer@mandriva.org> 0.7.1-1mdv2008.1
+ Revision: 158691
- bumped to 0.7.2 (0.7.1 + svn upgrade)
removed patch0 (merged uptream)
+ Olivier Blin <oblin@mandriva.com>
- restore BuildRoot
+ Thierry Vignaud <tv@mandriva.org>
- kill re-definition of %%buildroot on Pixel's request
* Thu Sep 06 2007 Jérôme Soyer <saispo@mandriva.org> 0.7.0-1mdv2008.0
+ Revision: 80702
- New release 0.7.0
* Mon Aug 20 2007 Emmanuel Blindauer <blindauer@mandriva.org> 0.6.0-3mdv2008.0
+ Revision: 67230
+ rebuild (emptylog)
* Mon Aug 20 2007 Emmanuel Blindauer <blindauer@mandriva.org> 0.6.0-2mdv2008.0
+ Revision: 67215
- really fix the missing link. REALLY!
* Wed Mar 14 2007 Emmanuel Blindauer <blindauer@mandriva.org> 0.6.0-2mdv2007.1
+ Revision: 143892
- don't forget to increase release
- remove the link fonts from package
- Fixes creation of /usr/X11R6/lib/X11/fonts if not available
+ David Walluck <walluck@mandriva.org>
- update sources
- 0.6.0
macros
use macros for paths
create users.id_dsa.pub ghostfile
use %%bcond_with
some grammar fixes
bunzip2 souces and patches and use more consistent names
use more explicit file list
* Thu Jan 04 2007 Crispin Boylan <crisb@mandriva.org> 0.5.0-3.rev281.3mdv2007.1
+ Revision: 103936
- Fix typo in Requires
* Wed Jan 03 2007 Crispin Boylan <crisb@mandriva.org> 0.5.0-3.rev281.2mdv2007.1
+ Revision: 103901
- Actually bump revision
* Wed Jan 03 2007 Crispin Boylan <crisb@mandriva.org> 0.5.0-3.rev281.1mdv2007.1
+ Revision: 103891
- Fix Requires (#26321)
- Import freenx
* Thu Sep 21 2006 Emmanuel Blindauer <blindauer@mandriva.org> 0.5.0-3.rev281.1mdv2007.0
- upgrade to svn 281 to be compatible with nx-2.0.0 and nxclient v2
- enable NX 2.0.0 backend
- add link for fonts to support /usr/share/fonts
* Sun Jul 30 2006 Couriousous <couriousous@mandriva.org> 0.5.0-2mdv2007.0
- Add expect to requires(post)
* Thu Jul 13 2006 Couriousous <couriousous@mandriva.org> 0.5.0-1mdv2007.0
- 0.5.0
* Mon Aug 08 2005 Couriousous <couriousous@mandriva.org> 0.4.4-1mdk
- 0.4.4
* Sun Jul 31 2005 Couriousous <couriousous@mandriva.org> 0.4.3-2mdk
- Enable NX 1.5.0 backend
* Sat Jul 30 2005 Couriousous <couriousous@mandriva.org> 0.4.3-1mdk
- 0.4.3
* Sun Jul 24 2005 Couriousous <couriousous@mandriva.org> 0.4.2-1mdk
- 0.4.2 ( Bugfix )
* Wed Jun 29 2005 Couriousous <couriousous@mandriva.org> 0.4.1-1mdk
- 0.4.1 ( Bugfix )
* Fri May 13 2005 Emmanuel Blindauer <blindauer@mandriva.org> 0.4.0-2mdk
- Rebuild for the right /var/lib
* Thu May 12 2005 Emmanuel Blindauer <blindauer@mandriva.org> 0.4.0-1mdk
- 0.4 release
- Rediff P1
* Fri Apr 01 2005 Couriousous <couriousous@mandrake.org> 0.3.1-2mdk
- Package nxclient binary ( fix #15140 )
* Tue Mar 22 2005 Couriousous <couriousous@mandrake.org> 0.3.1-1mdk
- Final 0.3.1
* Sat Mar 12 2005 Couriousous <couriousous@mandrake.org> 0.3.1-0.pre1.1mdk
- Add bugfixes from upstream ( == 0.3.1-pre1 )
* Thu Mar 10 2005 Emmanuel Blindauer <mdk@agat.net> 0.3.0-3mdk
- Really fix permissions, only users in root group were able to log.
* Thu Mar 10 2005 Emmanuel Blindauer <mdk@agat.net> 0.3.0-2mdk
- Fix permissions on node.conf (or no-one can log in)
* Sun Mar 06 2005 Couriousous <couriousous@mandrake.org> 0.3.0-1mdk
- 0.3.0
- Some spec tweak
* Wed Feb 23 2005 Couriousous <couriousous@mandrake.org> 0.2.8-2mdk
- Try to fix bug #13670
* Fri Feb 11 2005 Couriousous <couriousous@mandrake.org> 0.2.8-1mdk
- 0.2.8
* Sat Dec 25 2004 Couriousous <couriousous@mandrake.org> 0.2.7-2mdk
- Better README.urpmi from Matthew Roller
* Fri Dec 03 2004 couriousous <couriousous@zarb.org> 0.2.7-1mdk
- First Mandrakelinux release
- Automatic setup
- Set nx home as /var/lib/nxserver/nxhome