Ticket #725: 725.2.2.patch

File 725.2.2.patch, 1.1 KB (added by mcoppola, at 2011-05-05T18:57:20Z)

Updated patch, considers Windows users

Line 
1*** allmydata-tahoe-1.8.2-orig/src/allmydata/scripts/runner.py  2011-01-30 18:39:34.000000000 -0600
2--- allmydata-tahoe-1.8.2/src/allmydata/scripts/runner.py       2011-05-05 14:38:46.568230462 -0500
3***************
4*** 1,5 ****
5--- 1,6 ----
6 
7  import sys
8+ import os
9  from cStringIO import StringIO
10 
11  from twisted.python import usage
12***************
13*** 89,94 ****
14--- 90,102 ----
15      so.stderr = stderr
16      so.stdin = stdin
17 
18+     # This check is not triggered on Windows systems, which is okay for a few reasons (#725)
19+     if hasattr(os, 'geteuid') and os.geteuid() == 0:
20+         print >>stdout, "\n###############################################################"
21+         print >>stdout, "WARNING: You should not be running Tahoe-LAFS as root!"
22+         print >>stdout, "This poses an unnecessary security risk and is NOT recommended."
23+         print >>stdout, "###############################################################\n"
24+
25      if command in create_dispatch:
26          rc = create_dispatch[command](so, stdout, stderr)
27      elif command in startstop_node.dispatch: