#2426 closed defect (fixed)

Magic Folder on Windows: admin privileges needed to run tests on Windows 7+

Reported by: daira Owned by: daira
Priority: normal Milestone: 1.12.0
Component: unknown Version: unknown
Keywords: windows tests security magic-folder Cc:
Launchpad Bug:

Description

Running the drop-upload tests without admin privileges on Windows 7 gives these errors when run from a normal (non-admin) command prompt:

[ERROR]
Traceback (most recent call last):
  File "c:\tahoe\git\tahoe-magic\src\allmydata\test\test_drop_upload.py", line 247, in <lambda>
    d.addCallback(lambda ign: self._check_file(u"short", "test"))
  File "c:\tahoe\git\tahoe-magic\src\allmydata\test\test_drop_upload.py", line 298, in _check_file
    fileutil.flush_volume(path_u)
  File "c:\tahoe\git\tahoe-magic\src\allmydata\util\fileutil.py", line 599, in flush_volume
    raise WinError(get_last_error())
exceptions.WindowsError: [Error 6] The handle is invalid.

allmydata.test.test_drop_upload.MockTest.test_drop_upload
allmydata.test.test_drop_upload.RealTest.test_drop_upload

(probably also on Windows Vista, but no-one will ever make me care about Vista any more).

FlushFileBuffers on a drive is indeed documented to require admin privs:

To flush all open files on a volume, call FlushFileBuffers with a handle to the volume. The caller must have administrative privileges.

I'm not actually sure that flushing buffers is still necessary; for the time being I'll keep it in until the tests are fully debugged, and then try removing it.

Change History (8)

comment:1 Changed at 2015-05-18T22:46:41Z by daira

It probably also required admin privs on XP, but that was hidden because there was no need to elevate to get those privs from the account I was using.

comment:2 Changed at 2015-05-18T23:07:50Z by daira

Notice the terrible error reporting -- pretty typical for Win32 APIs.

comment:3 Changed at 2015-06-01T16:11:09Z by daira

  • Keywords magic-folder added

Add magic-folder keyword to all drop-upload tickets.

comment:4 Changed at 2015-10-29T02:23:30Z by daira

  • Keywords drop-upload removed
  • Status changed from new to assigned
  • Summary changed from drop-upload on Windows: admin privileges needed to run tests on Windows 7+ to Magic Folder on Windows: admin privileges needed to run tests on Windows 7+

comment:5 Changed at 2015-12-03T19:19:57Z by daira

This is not a blocker for merging Magic Folder to trunk.

comment:6 Changed at 2015-12-03T19:21:55Z by daira

However, the tests should be skipped if they can't be run for this reason. (I don't know whether the tests will end up needing flush_volume; if possible we should remove that.)

comment:7 Changed at 2016-03-22T05:02:52Z by warner

  • Milestone changed from 1.11.0 to 1.12.0

Milestone renamed

comment:8 Changed at 2016-03-29T14:25:12Z by daira

  • Resolution set to fixed
  • Status changed from assigned to closed

We removed the calls to flush_volume.

Note: See TracTickets for help on using tickets.