[X2Go-Commits] [x2goserver] 01/01: debian/x2goserver-desktopsharing.<debconf>: Update templates after l10n-english review, simplify question pattern as suggested by Justin B Rye.

git-admin at x2go.org git-admin at x2go.org
Wed Nov 14 21:33:48 CET 2018


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2goserver.

commit d36448653222b697ee5d7f66b914689a411ed7e2
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Wed Nov 14 21:27:36 2018 +0100

    debian/x2goserver-desktopsharing.<debconf>: Update templates after l10n-english review, simplify question pattern as suggested by Justin B Rye.
---
 debian/x2goserver-desktopsharing.config    |  69 +++++++-------------
 debian/x2goserver-desktopsharing.postinst  |  43 ++++++-------
 debian/x2goserver-desktopsharing.templates | 100 ++++++++++++++---------------
 3 files changed, 92 insertions(+), 120 deletions(-)

diff --git a/debian/x2goserver-desktopsharing.config b/debian/x2goserver-desktopsharing.config
index 5708985..7cdaf70 100755
--- a/debian/x2goserver-desktopsharing.config
+++ b/debian/x2goserver-desktopsharing.config
@@ -5,63 +5,38 @@ set -e
 # Source debconf library.
 . /usr/share/debconf/confmodule
 
-# remember the formerly used (or default) group names, if any
-db_get x2goserver-desktopsharing/group-sharing && db_set x2goserver-desktopsharing/last-group-sharing $RET || true
-
-# set the confirmation questions for group deletions always to false before we begin...
-db_set x2goserver-desktopsharing/del-last-group-sharing false
-
-db_input high x2goserver-desktopsharing/create-group-for-sharing || true
-db_go
-db_get x2goserver-desktopsharing/create-group-for-sharing
-create_group=$RET
-
-# always allow usage of existing group (also when $create_group is set)
-db_set x2goserver-desktopsharing/use-existing-group-for-sharing true
-if [ "$create_group" = "false" ]; then
-
-	db_get x2goserver-desktopsharing/group-sharing
-	if [ -z "$RET" ] || ! getent group $RET 1>/dev/null; then
-		db_set x2goserver-desktopsharing/group-sharing "root"
-	fi
-
-	db_input high x2goserver-desktopsharing/use-existing-group-for-sharing || true
+create_group="false"
+if ! getent group "x2godesktopsharing" 1>/dev/null; then
+	db_input high x2goserver-desktopsharing/create-group-for-sharing || true
 	db_go
+	db_get x2goserver-desktopsharing/create-group-for-sharing
+	create_group=$RET
 fi
 
-db_get x2goserver-desktopsharing/use-existing-group-for-sharing
-use_existing_group=$RET
-
-if [ "$create_group" = "true" ] || [ "$use_existing_group" = "true" ]; then
-
-	loop=1
-	while [ $loop -eq 1 ]; do
-		db_input high x2goserver-desktopsharing/group-sharing || true
-		db_go
+if [ "$create_group" = "true" ]; then
+	db_set x2goserver-desktopsharing/group-sharing "x2godesktopsharing"
+else
+	db_input high x2goserver-desktopsharing/use-existing-group-for-sharing || true
+	db_go
+	db_get x2goserver-desktopsharing/use-existing-group-for-sharing
+	use_existing_group=$RET
 
-		db_get x2goserver-desktopsharing/group-sharing
-		group_sharing=$RET
-		if getent group $group_sharing 1>/dev/null; then
-			loop=0
-		else
-			if [ "$create_group" = "true" ]; then
+	if [ "$use_existing_group" = "true" ]; then
+		loop=1
+		while [ $loop -eq 1 ]; do
+			db_input high x2goserver-desktopsharing/group-sharing || true
+			db_go
+			db_get x2goserver-desktopsharing/group-sharing
+			group_sharing=$RET
+			if getent group $group_sharing 1>/dev/null; then
 				loop=0
 			else
 				db_input critical x2goserver-desktopsharing/no-such-group || true
 				db_go
 				continue
 			fi
-		fi
-
-		db_get x2goserver-desktopsharing/last-group-sharing
-		if [ -z "$RET" ] || ! getent group $RET 1>/dev/null; then
-			RET="root"
-		fi
-		if [ "$RET" != "$group_sharing" ] && [ $(getent group $RET | cut -d ":" -f 3) -ge 100 ]; then
-			db_input critical x2goserver-desktopsharing/del-last-group-sharing || true
-			db_go
-		fi
-	done
+		done
+	fi
 fi
 
 db_input high x2goserver-desktopsharing/auto-start-on-logon || true
diff --git a/debian/x2goserver-desktopsharing.postinst b/debian/x2goserver-desktopsharing.postinst
index e7aac11..94a4e89 100755
--- a/debian/x2goserver-desktopsharing.postinst
+++ b/debian/x2goserver-desktopsharing.postinst
@@ -29,30 +29,18 @@ case "$1" in
 	db_get x2goserver-desktopsharing/create-group-for-sharing && x2godesktopsharing_create_group_for_sharing=$RET
 	db_get x2goserver-desktopsharing/use-existing-group-for-sharing && x2godesktopsharing_use_existing_group_for_sharing=$RET
 
-	# remove previously used sharing group
-
-	db_get x2goserver-desktopsharing/del-last-group-sharing
-	del_last_group="$RET"
-
-	if [ "$del_last_group" = "true" ]; then
-		db_get x2goserver-desktopsharing/last-group-sharing
-		last_group=$(echo $RET | cut -d" " -f1)
-
-		# try to remove the formerly used sharing group; on failure, ignore it
-		getent group $last_group 1>/dev/null && delgroup "$last_group" || \
-			echo "Removing Posix previous X2Go Desktop Sharing group »$last_group« failed."
-	fi
-
 	# create debconf-configured sharing group
 
-	db_get x2goserver-desktopsharing/group-sharing
-	# for sanity: we take everything as a group name until we find a blank...
-	group=$(echo $RET | cut -d" " -f1)
+	group=""
+	if [ "$x2godesktopsharing_create_group_for_sharing" = "true" ] || [ "$x2godesktopsharing_use_existing_group_for_sharing" = "true" ]; then
+		db_get x2goserver-desktopsharing/group-sharing
+		# for sanity: we take everything as a group name until we find a blank...
+		group=$(echo $RET | cut -d" " -f1)
+	fi
 
 	if [ "$x2godesktopsharing_create_group_for_sharing" = "true" ] && [ "x$group" != "x" ]; then
-		if echo "$group" | egrep '^[[:digit:]]{1,5}$' 1>/dev/null; then
-			echo "Specified sharing group is a gidNumber, not creating any group." 1>&2
-		elif ! getent group $group >/dev/null; then
+		# this should create the hard-coded "x2godesktopsharing" group
+		if ! getent group $group >/dev/null; then
 			echo "Creating $group group." 1>&2
 			addgroup --system $group
 		else
@@ -60,11 +48,20 @@ case "$1" in
 		fi
 	fi
 
-	# finally tweak X2Go Desktop Sharing's configuration file and adapt the group parameter
-	if [ -n "$group" ]; then
-		sed -i /etc/x2go/desktopsharing/settings -e "s/group=.*/group=$group/"
+	if [ "$x2godesktopsharing_use_existing_group_for_sharing" = "true" ] && [ "x$group" != "x" ]; then
+		if echo "$group" | egrep '^[[:digit:]]{1,5}$' 1>/dev/null; then
+			echo "Specified sharing group is a gidNumber." 1>&2
+			group=$(getent group $group | cut -d":" -f1)
+		fi
 	fi
 
+	if [ -z "$group" ]; then
+		group="root"
+	fi
+
+	# finally tweak X2Go Desktop Sharing's configuration file and adapt the group parameter
+	sed -i /etc/x2go/desktopsharing/settings -e "s/group=.*/group=$group/"
+
 	db_get x2goserver-desktopsharing/auto-start-on-logon
 	if [ "$RET" = "true" ] && [ ! -e /etc/xdg/autostart/x2godesktopsharing.desktop ]; then
 		echo "Setting up system-wide XDG autostart for X2Go Desktop Sharing."
diff --git a/debian/x2goserver-desktopsharing.templates b/debian/x2goserver-desktopsharing.templates
index 820614c..2e6f193 100644
--- a/debian/x2goserver-desktopsharing.templates
+++ b/debian/x2goserver-desktopsharing.templates
@@ -6,78 +6,78 @@ Description: for internal use
 Template: x2goserver-desktopsharing/create-group-for-sharing
 Type: boolean
 Default: true
-_Description: Create group for X2Go Desktop Sharing now?
- In X2Go Desktop Sharing users gain the privilege to share one another's
- X2Go/X11 desktop session by being members of a common POSIX group. The
- POSIX group being used for this can be configured system-wide and on a
- per user basis.
- .
- In X2Go Desktop Sharing's user configuration you can adjust what group
- to use for this later on. Here, you are asked for the system-wide default.
- .
- If this group is not created now, you should assign this desktop sharing
- privilege to an already existing group on the next screen.
- .
- If this group is not created / not assigned, users will not be able to share
- X2Go/X11 desktop sessions with each other.
+_Description: Create x2godesktopsharing group?
+  X2Go Desktop Sharing grants users the privileges to share X2Go/X11
+  desktop session with one another via membership of a common POSIX
+  group. The group being used for this can be configured system-wide and
+  on a per-user basis (in X2Go Desktop Sharing's user configuration).
+  .
+  Please specify whether X2Go Desktop Sharing should set up the group
+  "x2godesktopsharing" as the system-wide default group used for this
+  purpose.
+  .
+  Alternatively, if you reject this option, you will be asked to assign
+  the role to some already existing group.
+  .
+  With no such group users will not be able to share X2Go/X11 desktop
+  sessions.
 
 Template: x2goserver-desktopsharing/use-existing-group-for-sharing
 Type: boolean
 Default: false
-_Description: Use already existing groups for X2Go Desktop Sharing?
- If a group appropriate for being assigned the desktop sharing privilege has
- already been created (e.g. in an LDAP user/group database) then you can
- specify this group name on the next screen.
+_Description: Use existing group for X2Go Desktop Sharing?
+  If X2Go Desktop Sharing can use an existing group (possibly from an LDAP
+  database) then you can specify this group name on the next screen.
 
 Template: x2goserver-desktopsharing/group-sharing
 Type: string
 Default: x2godesktopsharing
-_Description: Assign X2Go Desktop Sharing privilege to POSIX group:
- Please specify the name of the POSIX group that you want to assign the
- X2Go Desktop Sharing privilege to.
- .
- If you leave this empty, the "root" group will be used.
+_Description: Group to use for X2Go Desktop Sharing:
+  Please specify the name of the existing POSIX group that you want to
+  assign X2Go Desktop Sharing privileges to.
+  .
+  An empty string will be replaced by the "root" group.
 
 Template: x2goserver-desktopsharing/del-last-group-sharing
 Type: boolean
 Default: false
 _Description: Delete the group that was formerly used for this?
- The group for the X2Go Desktop Sharing privilege has been modified.
- .
- Please specify whether the old group should be deleted. If unsure,
- keep the formerly used group and manually investigate later.
+  The group used for X2Go Desktop Sharing has been changed.
+  .
+  Please specify whether the old group should be deleted. If unsure,
+  keep the formerly used group and manually investigate later.
 
 Template: x2goserver-desktopsharing/no-such-group
 Type: error
 _Description: Non-existing group
- The given group does not exist on this system. You should specify an
- already existing group.
+  The given group does not exist on this system. You should specify an
+  already existing group.
 
 Template: x2goserver-desktopsharing/auto-start-on-logon
 Type: boolean
 Default: false
-_Description: Auto-start X2Go Desktop Sharing applet on desktop session startup?
- For an X2Go/X11 desktop session to be accessible via X2Go Desktop
- Sharing, the X2Go Desktop Sharing applet needs to be running. It
- advertises the users X2Go/X11 session through an access controlled
- socket to X2Go client applications.
- .
- The applet can be configured to start automatically on desktop session
- startup, but for security reasons this is not the default.
+_Description: Auto-start X2Go Desktop Sharing applet?
+  For an X2Go/X11 desktop session to be accessible via X2Go Desktop
+  Sharing, the X2Go Desktop Sharing applet needs to be running. It
+  advertises the user's X2Go/X11 session through an access controlled
+  socket to X2Go client applications.
+  .
+  The applet can be configured to start automatically on desktop session
+  startup, but for security reasons this is not the default.
 
 Template: x2goserver-desktopsharing/auto-activate-on-logon
 Type: boolean
 Default: false
-_Description: Auto-activate X2Go Desktop Sharing on desktop session startup?
- The X2Go Desktop Sharing applet normally starts in non-sharing mode
- (users that request to share the running desktop session get
- auto-rejected). The user normally has to actively activate the sharing
- mode in the applet's GUI.
- .
- If you enabled the auto-start option in the previous screen, you can
- additionally choose here, if desktop sharing shall be activated when the
- X2Go Desktop Sharing applet is auto-started at session logon.
- .
- For security and data protection reasons, this is not the default. Use
- this auto-activation feature only in appropriate environments (e.g.
- on class room computers).
+_Description: Auto-activate X2Go Desktop Sharing?
+  The X2Go Desktop Sharing applet normally starts in non-sharing mode
+  (users that request to share the running desktop session get
+  auto-rejected). The user normally has to choose to activate the sharing
+  mode in the applet's GUI.
+  .
+  If the auto-start option is active, you can additionally choose here
+  whether desktop sharing should be activated when the X2Go Desktop
+  Sharing applet is auto-started at session logon.
+  .
+  For security and data protection reasons, this is not the default. Use
+  this auto-activation feature only in appropriate environments, such as
+  for classroom computers.

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goserver.git


More information about the x2go-commits mailing list