If someone have the same problem, is not related to Windows itself, it's
a bug in 1.2.8 version. I didn't see the problem on debian/ubuntu
because debian/ubuntu patch rdiff-backup to fix this bug.

https://bugs.launchpad.net/ubuntu/+source/rdiff-backup/+bug/349072

I rebuild rdiff-backup for windows with this patch and works now.

The bug is fixed in CVS apparently.

>Fixed in CVS. Will be included in next rdiff-backup releases, 1.2.9
>and 1.3.4.


Regards,
--
Davy STOFFEL
GPG Key ID/Fingerprint: 66A51FF7
Conostix S.A.
70, rue de Tétange
3672 Kayl, Luxembourg

Tel : +352 26 10 30 61
Fax : +352 26 10 30 62

On 08/01/2012 11:05 AM, Davy Stoffel wrote:
> Hi Guys,
> 
> I'm trying to test the --test-server switch with the Windows version
> (1.2.8).
> 
> On the server side, i defined (trough authorized keys) "--restrict backup/".
> 
> On the windows, if i try to backup something  :
> 
> rdiff-backup.exe --remote-schema """C:\cbackup_test\plink.exe"" -2
> -batch -P 22 -i ""C:\cbackup_test\private_key.ppk"" %s rdiff-backup
> --server" --include "C:\\/test" --exclude "C:\\/**" C:\/
> machine1@myhostname::backup/
> 
> It's working correctly.
> 
> If i try the --test-server :
> 
> rdiff-backup.exe --remote-schema """C:\cbackup_test\plink.exe"" -2
> -batch -P 22 -i ""C:\cbackup_test\private_key.ppk"" %s rdiff-backup
> --server" --test-server machine1@myhostname::backup/
> 
> Testing server started by:  "C:\cbackup_test\plink.exe" -2 -batch -P 22
> -i "C:\cbackup_test\private_key.ppk" machi...@obkp1.secure-pme.com
> rdiff-backup --server
> 
> Server tests failed
> Exception '
> Warning Security Violation!
> Request to handle path .
> which doesn't appear to be within restrict path backup.
> ' raised of class '<class 'rdiff_backup.Security.Violation'>':
>   File "rdiff_backup\Main.pyc", line 304, in error_check_Main
>   File "rdiff_backup\Main.pyc", line 324, in Main
>   File "rdiff_backup\Main.pyc", line 291, in take_action
>   File "rdiff_backup\SetConnections.pyc", line 248, in TestConnections
>   File "rdiff_backup\SetConnections.pyc", line 256, in test_connection
>   File "rdiff_backup\connection.pyc", line 450, in __call__
>   File "rdiff_backup\connection.pyc", line 370, in reval
> 
> Traceback (most recent call last):
>   File "rdiff-backup", line 30, in <module>
>   File "rdiff_backup\Main.pyc", line 304, in error_check_Main
>   File "rdiff_backup\Main.pyc", line 324, in Main
>   File "rdiff_backup\Main.pyc", line 291, in take_action
>   File "rdiff_backup\SetConnections.pyc", line 248, in TestConnections
>   File "rdiff_backup\SetConnections.pyc", line 256, in test_connection
>   File "rdiff_backup\connection.pyc", line 450, in __call__
>   File "rdiff_backup\connection.pyc", line 370, in reval
> rdiff_backup.Security.Violation:
> Warning Security Violation!
> Request to handle path .
> which doesn't appear to be within restrict path backup.
> 
> 
> If i remove the --restrict on the server side, the --test-server is
> running fine.
> 
> Is this a bug with the Windows version when --restrict is enabled or i
> miss something in my test ?
> 
> 
> Thank you,
> --
> Davy STOFFEL
> GPG Key ID/Fingerprint: 66A51FF7
> Conostix S.A.
> 70, rue de Tétange
> 3672 Kayl, Luxembourg
> 
> Tel : +352 26 10 30 61
> Fax : +352 26 10 30 62
+## 01_fix_restricted_test-server_option.dpatch by Carl Chenet 
<cha...@ohmytux.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Reimplemented from the Ubuntu patch by <andr...@arrakis.se>
+## DP: Original patch from : 
https://bugs.launchpad.net/ubuntu/+source/rdiff-backup/+bug/349072
+
+@DPATCH@
+diff -urNad rdiff-backup-1.2.8~/rdiff_backup/Main.py 
rdiff-backup-1.2.8/rdiff_backup/Main.py
+--- rdiff-backup-1.2.8~/rdiff_backup/Main.py   2009-03-16 15:36:21.000000000 
+0100
++++ rdiff-backup-1.2.8/rdiff_backup/Main.py    2010-02-20 11:26:27.000000000 
+0100
+@@ -288,7 +288,7 @@
+       elif action == "remove-older-than": RemoveOlderThan(rps[0])
+       elif action == "restore": Restore(*rps)
+       elif action == "restore-as-of": Restore(rps[0], rps[1], 1)
+-      elif action == "test-server": SetConnections.TestConnections()
++      elif action == "test-server": SetConnections.TestConnections(rps)
+       elif action == "verify": Verify(rps[0])
+       else: raise AssertionError("Unknown action " + action)
+ 
+diff -urNad rdiff-backup-1.2.8~/rdiff_backup/SetConnections.py 
rdiff-backup-1.2.8/rdiff_backup/SetConnections.py
+--- rdiff-backup-1.2.8~/rdiff_backup/SetConnections.py 2009-03-16 
15:36:21.000000000 +0100
++++ rdiff-backup-1.2.8/rdiff_backup/SetConnections.py  2010-02-20 
11:29:43.000000000 +0100
+@@ -241,20 +241,25 @@
+       Globals.backup_reader = Globals.isbackup_reader = \
+                 Globals.backup_writer = Globals.isbackup_writer = None
+ 
+-def TestConnections():
++def TestConnections(rpaths):
+       """Test connections, printing results"""
+       if len(Globals.connections) == 1: print "No remote connections 
specified"
+       else:
+-              for i in range(1, len(Globals.connections)): test_connection(i)
++              assert len(Globals.connections) == len(rpaths) + 1
++              for i in range(1, len(Globals.connections)):
++                      test_connection(i, rpaths[i-1])
+ 
+-def test_connection(conn_number):
++def test_connection(conn_number, rp):
+       """Test connection.  conn_number 0 is the local connection"""
+       print "Testing server started by: ", __conn_remote_cmds[conn_number]
+       conn = Globals.connections[conn_number]
+       try:
+               assert conn.Globals.get('current_time') is None
+-              assert type(conn.os.listdir('.')) is list
+               version = conn.Globals.get('version')
++              try:
++                      assert type(conn.os.getuid()) is int
++              except AttributeError: # Windows doesn't support os.getuid()
++                      assert type(conn.os.listdir(rp.path)) is list
+       except:
+               sys.stderr.write("Server tests failed\n")
+               raise

_______________________________________________
rdiff-backup-users mailing list at rdiff-backup-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

Reply via email to