From b0c1b75553fda0a315887a87f1be0b772d144047 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 6 Apr 2012 18:32:10 +0200 Subject: [PATCH] templates for TightVNC reg files --- createlinks | 3 +- ipasserelle-gp.spec | 6 +-- .../db/configuration/migrate/WpkgVNCPassword | 10 ++++ .../files/settings/tightvnc/tightvnc_x64.reg/10All | 53 +++++++++++++++++++++ .../tightvnc/tightvnc_x64.reg/template-begin | 0 .../files/settings/tightvnc/tightvnc_x86.reg/10All | 53 +++++++++++++++++++++ .../tightvnc/tightvnc_x86.reg/template-begin | 0 .../wpkg/files/settings/tightvnc/tightvnc_x64.reg | Bin 2470 -> 0 bytes .../wpkg/files/settings/tightvnc/tightvnc_x86.reg | Bin 2446 -> 0 bytes 9 files changed, 120 insertions(+), 5 deletions(-) create mode 100644 root/etc/e-smith/db/configuration/migrate/WpkgVNCPassword create mode 100644 root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg/10All create mode 100644 root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg/template-begin create mode 100644 root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg/10All create mode 100644 root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg/template-begin delete mode 100644 root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg delete mode 100644 root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg diff --git a/createlinks b/createlinks index e5d3ffc..7b334cf 100644 --- a/createlinks +++ b/createlinks @@ -12,4 +12,5 @@ templates2events("/home/e-smith/files/shares/tools/files/scripts/conf.bat", qw(w templates2events("/home/e-smith/files/shares/wpkg/files/config.xml", qw(wpkg-update bootstrap-console-save)); templates2events("/home/e-smith/files/shares/wpkg/files/settings/fusioninventory/fusioninventory_x86.reg", qw(wpkg-update bootstrap-console-save)); templates2events("/home/e-smith/files/shares/wpkg/files/settings/fusioninventory/fusioninventory_x64.reg", qw(wpkg-update bootstrap-console-save)); - +templates2events("/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg", qw(wpkg-update bootstrap-console-save)); +templates2events("/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg", qw(wpkg-update bootstrap-console-save)); diff --git a/ipasserelle-gp.spec b/ipasserelle-gp.spec index c8b924c..06a10ee 100644 --- a/ipasserelle-gp.spec +++ b/ipasserelle-gp.spec @@ -1,5 +1,5 @@ %define version 0.0.1 -%define release 1.beta14 +%define release 1.beta16 %define name ipasserelle-gp @@ -32,7 +32,7 @@ Basé sur WPKG et d'autres outils %build perl createlinks -%{__mkdir_p} root/home/e-smith/files/shares/wpkg/files/settings/{fusioninventory,wpkg-gp} +%{__mkdir_p} root/home/e-smith/files/shares/wpkg/files/settings/{fusioninventory,wpkg-gp,tightvnc} %{__mkdir_p} root/home/e-smith/files/shares/wpkg/files/{packages,softwares} %install @@ -43,8 +43,6 @@ perl createlinks --file /home/e-smith/files/shares/wpkg/files/profiles.xml 'attr(0770,root,admin) %config(noreplace)' \ --file /home/e-smith/files/shares/wpkg/files/hosts.xml 'attr(0770,root,admin) %config(noreplace)' \ --file /home/e-smith/files/shares/wpkg/files/packages.xml 'attr(0770,root,admin) %config(noreplace)' \ - --file /home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg 'attr(0660,root,admin) %config(noreplace)' \ - --file /home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg 'attr(0660,root,admin) %config(noreplace)' \ > %{name}-%{version}-filelist %files -f %{name}-%{version}-filelist diff --git a/root/etc/e-smith/db/configuration/migrate/WpkgVNCPassword b/root/etc/e-smith/db/configuration/migrate/WpkgVNCPassword new file mode 100644 index 0000000..41eb7d0 --- /dev/null +++ b/root/etc/e-smith/db/configuration/migrate/WpkgVNCPassword @@ -0,0 +1,10 @@ +{ +my $rec = $DB->get('wpkg') || $DB->new_record('wpkg', { type => 'service' }); +my $pw = $rec->prop('VNCPassword'); + +if (not $pw){ + $pw = `/usr/bin/openssl rand -base64 6`; + chomp($pw); + $rec->set_prop('VNCPassword', $pw); +} +} diff --git a/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg/10All b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg/10All new file mode 100644 index 0000000..b019a6d --- /dev/null +++ b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg/10All @@ -0,0 +1,53 @@ +Windows Registry Editor Version 5.00 + +{ + +use Crypt::DES; +my $clear = $wpkg{'VNCPassword'} || 'secret'; +my $key = pack ('H16', "E84AD660C4721AE0"); +my $des = Crypt::DES->new($key); +my $crypt = $des->encrypt($clear); +my $pass = join(',', map {unpack('H2', $_)} split //, $cryptpass); + +my $out =<<"EOF"; + +[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\TightVNC\\Server] +"ExtraPorts"="" +"QueryTimeout"=dword:0000001e +"QueryAcceptOnTimeout"=dword:00000000 +"LocalInputPriorityTimeout"=dword:00000003 +"LocalInputPriority"=dword:00000000 +"BlockRemoteInput"=dword:00000000 +"BlockLocalInput"=dword:00000000 +"IpAccessControl"="" +"RfbPort"=dword:0000170c +"HttpPort"=dword:000016a8 +"DisconnectAction"=dword:00000000 +"AcceptRfbConnections"=dword:00000001 +"UseVncAuthentication"=dword:00000001 +"UseControlAuthentication"=dword:00000001 +"LoopbackOnly"=dword:00000000 +"AcceptHttpConnections"=dword:00000000 +"LogLevel"=dword:00000000 +"EnableFileTransfers"=dword:00000001 +"BlankScreen"=dword:00000000 +"RemoveWallpaper"=dword:00000001 +"EnableUrlParams"=dword:00000001 +"Password"=hex:$pass +"AlwaysShared"=dword:00000000 +"NeverShared"=dword:00000000 +"DisconnectClients"=dword:00000001 +"PollingInterval"=dword:000003e8 +"AllowLoopback"=dword:00000000 +"VideoRecognitionInterval"=dword:00000bb8 +"GrabTransparentWindows"=dword:00000001 +"SaveLogToAllUsersPath"=dword:00000000 +"RunControlInterface"=dword:00000001 +"VideoClasses"="" +"ControlPassword"=hex:$pass + +EOF + +$out =~ s/\n/\r\n/g; +$OUT = $out; +} diff --git a/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg/template-begin b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg/template-begin new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg/10All b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg/10All new file mode 100644 index 0000000..f600259 --- /dev/null +++ b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg/10All @@ -0,0 +1,53 @@ +Windows Registry Editor Version 5.00 + +{ + +use Crypt::DES; +my $clear = $wpkg{'VNCPassword'} || 'secret'; +my $key = pack ('H16', "E84AD660C4721AE0"); +my $des = Crypt::DES->new($key); +my $crypt = $des->encrypt($clear); +my $pass = join(',', map {unpack('H2', $_)} split //, $cryptpass); + +my $out =<<"EOF"; + +[HKEY_LOCAL_MACHINE\\SOFTWARE\\TightVNC\\Server] +"ExtraPorts"="" +"QueryTimeout"=dword:0000001e +"QueryAcceptOnTimeout"=dword:00000000 +"LocalInputPriorityTimeout"=dword:00000003 +"LocalInputPriority"=dword:00000000 +"BlockRemoteInput"=dword:00000000 +"BlockLocalInput"=dword:00000000 +"IpAccessControl"="" +"RfbPort"=dword:0000170c +"HttpPort"=dword:000016a8 +"DisconnectAction"=dword:00000000 +"AcceptRfbConnections"=dword:00000001 +"UseVncAuthentication"=dword:00000001 +"UseControlAuthentication"=dword:00000001 +"LoopbackOnly"=dword:00000000 +"AcceptHttpConnections"=dword:00000000 +"LogLevel"=dword:00000000 +"EnableFileTransfers"=dword:00000001 +"BlankScreen"=dword:00000000 +"RemoveWallpaper"=dword:00000001 +"EnableUrlParams"=dword:00000001 +"Password"=hex:$pass +"AlwaysShared"=dword:00000000 +"NeverShared"=dword:00000000 +"DisconnectClients"=dword:00000001 +"PollingInterval"=dword:000003e8 +"AllowLoopback"=dword:00000000 +"VideoRecognitionInterval"=dword:00000bb8 +"GrabTransparentWindows"=dword:00000001 +"SaveLogToAllUsersPath"=dword:00000000 +"RunControlInterface"=dword:00000001 +"VideoClasses"="" +"ControlPassword"=hex:$pass + +EOF + +$out =~ s/\n/\r\n/g; +$OUT = $out; +} diff --git a/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg/template-begin b/root/etc/e-smith/templates/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg/template-begin new file mode 100644 index 0000000..e69de29 diff --git a/root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg b/root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x64.reg deleted file mode 100644 index cb65feae6129a0954241e00814d1e0bc16a74c25..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2470 zcmb`JTW=Ck6ovP*iT|PDnHUkNm&6Ce);4NefkKR$W`HRrg&6{)ls~V2>kP+%hQUG2 zWG?5j_gQ=Geb$+uKe{%u$OabM!sd2hO$%*E-`o2JE8uETI>PpxWC zm=&{b$jmlt4ebU59eNwiRv5lJBwyXCB|O|Y#DQHnqzM>H_KLf-n(@)TIg6$9IN>{{ zCvmd|M6dV;_R>Y8h;&t$rN~N_S=X)471|Wrb2t#bV%|JYB^ZhE5!e_$B0LGl1?!7d zJrkJU$8U9ovWQ=?k{54=@HN11u3}X1vEP zds&W~c5S`i6_Dq@V$aBJf5q7ez7p2(b(3#(NXDM8tlp5NIX;9Xf|))(gfekCjCNL4 z#aM14Xp5^6JwZWio8C6r{&%mcgBZ4Z z;8AsH2aT!rJl4h4cD{Vx{)VwsuhM-uWH*LRP10)0=h<5wfjJ<8F?Pprt9P4v4CtRz zfvH07j>xmDeI~nG6tRzwkgI6*NUOCorG#C)jJc+~r?h8(VAQX_9?K+?lt<|S0 zMEQ}o&C`E3PG2!C?3FL=Z5-HRZv15?DpsL-$bdRd#awrdW|ogw!3|K zY#E2Df&eU1#QT2&!lw~`=F7K~@{ZHLhuV})e<5YEq3?jdkusw_o;7$abJuvj;1o&! N4K_9M|9aO7zX0pVfa3rF diff --git a/root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg b/root/home/e-smith/files/shares/wpkg/files/settings/tightvnc/tightvnc_x86.reg deleted file mode 100644 index 412d0c1322dc643de0413044d19853db8b9d0df3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2446 zcmb`JZEq4m6ov0+6aPcQXJW)^ttNgzY;B{q6)420X%^VhO<|Y7D&^0s&zWUhXjoj- zY+!a??wNC6=FI;5(Y4588(3ma{;TWZGsn{!imF0?$_RU!=K#y$9d%{TSRt@k{ehloTV=d-- zYOIn670a#b*5?Urg6%oJmPhmPsNi`5MqnfSjzJQS3-(v^^q&&pU2yl8EX&|3DnB5?BzLb+O_q5S3nVd&7PCn z{xW7KV5RKg>!#T1fQ%h3t=^EO85rUc6PZ33Vwt)e##^f@kFxhmwUlwsyz_|JY04_O zIA^sbr%M=xoRSzGbyrh2^cAa!k)R~Eb+q+p|2wMcAR*d4_^7&cf<{z(QPdTy&GGVi z`oYL3+cixx^P`w)%U zZtbIa#@bBFcemYi3LCJAz*OCr^+0D|(bJtbbSfvc(;cIz7W=W!Dz6BNf;4mP)P1$a zi|toyyTk4S@DiuEQkEfXbQfeQAnh&3sz+^lR&QM{dn@&+3Q>N9wtmZR=jkh^g}w5n zlRN}BL2KlBrat-xPz9yb!FD{K|0YTm-&6J6*K4qJ+iu75-0~Qz3Ie!D5$}Hqh@WQs yoiA)D