ignore non-readable or non-writeable block devices

added sources for help_browser_disable icon
This commit is contained in:
lars 2007-02-02 08:57:46 +00:00
parent b6cbdfac3c
commit 2cac563bea
2 changed files with 266 additions and 1 deletions

View File

@ -0,0 +1,253 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="744.09448819"
height="1052.3622047"
id="svg2224"
sodipodi:version="0.32"
inkscape:version="0.44.1"
sodipodi:docbase="/home/lars/subversion/cryptobox/trunk/design/icons"
sodipodi:docname="help_browser_disable.svg">
<defs
id="defs2226">
<linearGradient
inkscape:collect="always"
id="linearGradient3190">
<stop
style="stop-color:#516ce1;stop-opacity:1;"
offset="0"
id="stop3192" />
<stop
style="stop-color:#516ce1;stop-opacity:0;"
offset="1"
id="stop3194" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient3155">
<stop
style="stop-color:#1a77c7;stop-opacity:1;"
offset="0"
id="stop3157" />
<stop
style="stop-color:#1a77c7;stop-opacity:0;"
offset="1"
id="stop3159" />
</linearGradient>
<linearGradient
id="linearGradient2431">
<stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="0"
id="stop2433" />
<stop
style="stop-color:#b8b8b8;stop-opacity:1;"
offset="1"
id="stop2435" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2431"
id="radialGradient2222"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(4.445991,0,0,6.8665,-126.7211,-297.6152)"
cx="-19.515638"
cy="16.855663"
fx="-19.515638"
fy="16.855663"
r="8.7536434" />
<linearGradient
id="linearGradient2933">
<stop
id="stop2935"
offset="0"
style="stop-color:#9cbcde;stop-opacity:1" />
<stop
id="stop2937"
offset="1"
style="stop-color:#204a87" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2933"
id="radialGradient2220"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.238342,5.954846e-3,-6.507762e-3,1.351272,-182.6622,-181.4226)"
cx="26.544321"
cy="28.458725"
fx="26.544321"
fy="28.458725"
r="22.376116" />
<linearGradient
inkscape:collect="always"
id="linearGradient21644">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop21646" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop21648" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient21644"
id="radialGradient2218"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.595238,-140.446,-253.7092)"
cx="25.125"
cy="36.75"
fx="25.125"
fy="36.75"
r="15.75" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient21644"
id="radialGradient2262"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1,0,0,0.595238,-82.2408,-250.1376)"
cx="25.125"
cy="36.75"
fx="25.125"
fy="36.75"
r="15.75" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2933"
id="radialGradient2264"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.238342,5.954846e-3,-6.507762e-3,1.351272,-109.8592,-179.1397)"
cx="26.544321"
cy="28.458725"
fx="26.544321"
fy="28.458725"
r="22.376116" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2431"
id="radialGradient2266"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(4.445991,0,0,6.8665,-46.333,-295.0494)"
cx="-19.515638"
cy="16.855663"
fx="-19.515638"
fy="16.855663"
r="8.7536434" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3155"
id="linearGradient3161"
x1="0.5175451"
y1="23.825787"
x2="47.300551"
y2="23.825787"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(1.044152,18.1659)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3190"
id="linearGradient3196"
x1="0.5175451"
y1="23.825787"
x2="47.300551"
y2="23.825787"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.945826,0,0,0.95445,-1.470008,53.10059)" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
gridtolerance="10000"
guidetolerance="10"
objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.47134939"
inkscape:cx="120.40831"
inkscape:cy="867.85711"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:window-width="1014"
inkscape:window-height="688"
inkscape:window-x="0"
inkscape:window-y="26" />
<metadata
id="metadata2229">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
transform="matrix(1.173803,0,0,0.6,91.52996,179.3327)"
d="M 40.875 36.75 A 15.75 9.375 0 1 1 9.375,36.75 A 15.75 9.375 0 1 1 40.875 36.75 z"
sodipodi:ry="9.375"
sodipodi:rx="15.75"
sodipodi:cy="36.75"
sodipodi:cx="25.125"
id="path2250"
style="opacity:0.63068183;color:black;fill:url(#radialGradient2262);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible"
sodipodi:type="arc" />
<path
transform="matrix(0.938442,0,0,0.93868,98.09846,160.6416)"
d="M 45.785164 23.825787 A 21.876116 21.876116 0 1 1 2.0329323,23.825787 A 21.876116 21.876116 0 1 1 45.785164 23.825787 z"
sodipodi:ry="21.876116"
sodipodi:rx="21.876116"
sodipodi:cy="23.825787"
sodipodi:cx="23.909048"
id="path2252"
style="fill:url(#radialGradient2264);fill-opacity:1;stroke:#204a87;stroke-width:1"
sodipodi:type="arc" />
<path
sodipodi:type="arc"
style="opacity:0.96022728;fill:url(#linearGradient3196);fill-opacity:1;stroke:#fa1010;stroke-width:2.87962484;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path2254"
sodipodi:cx="23.909048"
sodipodi:cy="23.825787"
sodipodi:rx="21.876116"
sodipodi:ry="21.876116"
d="M 45.785164 23.825787 A 21.876116 21.876116 0 1 1 2.0329323,23.825787 A 21.876116 21.876116 0 1 1 45.785164 23.825787 z"
transform="matrix(0.904081,0,0,0.896028,98.74012,161.6603)" />
<path
transform="matrix(0.849895,0,0,0.835205,138.2642,167.556)"
d="M -20.25,5.875 C -21.309019,5.8750263 -22.397637,5.9982356 -23.53125,6.21875 C -24.664175,6.4391783 -25.911412,6.7562625 -27.28125,7.21875 C -27.291632,7.21754 -27.302118,7.21754 -27.3125,7.21875 C -27.324563,7.2273788 -27.335121,7.237937 -27.34375,7.25 C -27.355813,7.2586288 -27.366371,7.269187 -27.375,7.28125 C -27.37621,7.2916315 -27.37621,7.3021185 -27.375,7.3125 C -27.37621,7.3228815 -27.37621,7.3333685 -27.375,7.34375 L -27.375,12.5 C -27.37621,12.510382 -27.37621,12.520868 -27.375,12.53125 C -27.37621,12.541632 -27.37621,12.552118 -27.375,12.5625 C -27.366371,12.574563 -27.355813,12.585121 -27.34375,12.59375 C -27.335121,12.605813 -27.324563,12.616371 -27.3125,12.625 C -27.302118,12.62621 -27.291632,12.62621 -27.28125,12.625 C -27.270868,12.62621 -27.260382,12.62621 -27.25,12.625 C -27.239618,12.62621 -27.229132,12.62621 -27.21875,12.625 C -27.208368,12.62621 -27.197882,12.62621 -27.1875,12.625 C -26.045062,11.905957 -24.954148,11.357862 -23.90625,11 C -22.858109,10.631244 -21.863134,10.437521 -20.96875,10.4375 C -20.019532,10.437521 -19.323825,10.648045 -18.8125,11.0625 C -18.303777,11.46459 -18.031262,12.04554 -18.03125,12.78125 C -18.03126,13.261907 -18.175438,13.73266 -18.46875,14.21875 C -18.751741,14.705766 -19.209015,15.249245 -19.84375,15.8125 L -20.9375,16.75 C -22.138959,17.83049 -22.926743,18.741022 -23.3125,19.46875 C -23.695613,20.180196 -23.875005,20.988074 -23.875,21.90625 L -23.875,22.71875 C -23.87621,22.729132 -23.87621,22.739618 -23.875,22.75 C -23.87621,22.760382 -23.87621,22.770868 -23.875,22.78125 C -23.866371,22.793313 -23.855813,22.803871 -23.84375,22.8125 C -23.835121,22.824563 -23.824563,22.835121 -23.8125,22.84375 C -23.802118,22.84496 -23.791632,22.84496 -23.78125,22.84375 C -23.770868,22.84496 -23.760382,22.84496 -23.75,22.84375 L -17.65625,22.84375 C -17.645868,22.84496 -17.635382,22.84496 -17.625,22.84375 C -17.614618,22.84496 -17.604132,22.84496 -17.59375,22.84375 C -17.581687,22.835121 -17.571129,22.824563 -17.5625,22.8125 C -17.550437,22.803871 -17.539879,22.793313 -17.53125,22.78125 C -17.53004,22.770868 -17.53004,22.760382 -17.53125,22.75 C -17.53004,22.739618 -17.53004,22.729132 -17.53125,22.71875 L -17.53125,21.96875 C -17.531261,21.500554 -17.38288,21.075901 -17.15625,20.6875 C -16.933955,20.296216 -16.448177,19.737141 -15.6875,19.0625 L -14.625,18.125 C -13.558412,17.14269 -12.794341,16.240346 -12.34375,15.375 C -11.894481,14.500954 -11.656268,13.50158 -11.65625,12.40625 C -11.656268,10.279985 -12.400019,8.6722224 -13.875,7.5625 C -15.350197,6.4414748 -17.48124,5.8750263 -20.25,5.875 z M -23.8125,25.03125 C -23.824563,25.039879 -23.835121,25.050437 -23.84375,25.0625 C -23.855813,25.071129 -23.866371,25.081687 -23.875,25.09375 C -23.87621,25.104132 -23.87621,25.114618 -23.875,25.125 C -23.87621,25.135382 -23.87621,25.145868 -23.875,25.15625 L -23.875,31 C -23.87621,31.010382 -23.87621,31.020868 -23.875,31.03125 C -23.87621,31.041632 -23.87621,31.052118 -23.875,31.0625 C -23.866371,31.074563 -23.855813,31.085121 -23.84375,31.09375 C -23.835121,31.105813 -23.824563,31.116371 -23.8125,31.125 C -23.802118,31.12621 -23.791632,31.12621 -23.78125,31.125 C -23.770868,31.12621 -23.760382,31.12621 -23.75,31.125 L -17.65625,31.125 C -17.645868,31.12621 -17.635382,31.12621 -17.625,31.125 C -17.614618,31.12621 -17.604132,31.12621 -17.59375,31.125 C -17.581687,31.116371 -17.571129,31.105813 -17.5625,31.09375 C -17.550437,31.085121 -17.539879,31.074563 -17.53125,31.0625 C -17.53004,31.052118 -17.53004,31.041632 -17.53125,31.03125 C -17.53004,31.020868 -17.53004,31.010382 -17.53125,31 L -17.53125,25.15625 C -17.53004,25.145868 -17.53004,25.135382 -17.53125,25.125 C -17.53004,25.114618 -17.53004,25.104132 -17.53125,25.09375 C -17.539879,25.081687 -17.550437,25.071129 -17.5625,25.0625 C -17.571129,25.050437 -17.581687,25.039879 -17.59375,25.03125 C -17.604132,25.03004 -17.614618,25.03004 -17.625,25.03125 C -17.635382,25.03004 -17.645868,25.03004 -17.65625,25.03125 L -23.75,25.03125 C -23.760382,25.03004 -23.770868,25.03004 -23.78125,25.03125 C -23.791632,25.03004 -23.802118,25.03004 -23.8125,25.03125 z "
id="path2256"
style="font-size:34.15322876px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:url(#radialGradient2266);fill-opacity:1;stroke:white;stroke-width:1.09947276px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.78612713;font-family:Bitstream Vera Sans"
xlink:href="#text2215"
inkscape:original="M -20.25 6 C -21.298341 6.000026 -22.372769 6.1244771 -23.5 6.34375 C -24.627244 6.563073 -25.886043 6.8832479 -27.25 7.34375 L -27.25 12.5 C -26.100219 11.776335 -24.997109 11.236862 -23.9375 10.875 C -22.877902 10.502213 -21.881822 10.312521 -20.96875 10.3125 C -19.999334 10.312521 -19.259834 10.530174 -18.71875 10.96875 C -18.177686 11.396402 -17.906262 12.013726 -17.90625 12.78125 C -17.906261 13.285654 -18.039408 13.776881 -18.34375 14.28125 C -18.636843 14.785651 -19.107484 15.33609 -19.75 15.90625 L -20.84375 16.84375 C -22.038631 17.918325 -22.815518 18.829509 -23.1875 19.53125 C -23.559495 20.22205 -23.750005 21.007137 -23.75 21.90625 L -23.75 22.71875 L -17.65625 22.71875 L -17.65625 21.96875 C -17.656262 21.475338 -17.517981 21.030712 -17.28125 20.625 C -17.044542 20.208345 -16.547785 19.648586 -15.78125 18.96875 L -14.71875 18.03125 C -13.659161 17.055386 -12.908389 16.156813 -12.46875 15.3125 C -12.029144 14.457253 -11.781268 13.480828 -11.78125 12.40625 C -11.781268 10.311973 -12.525902 8.7417969 -13.96875 7.65625 C -15.41163 6.559783 -17.499549 6.0000261 -20.25 6 z M -23.75 25.15625 L -23.75 31 L -17.65625 31 L -17.65625 25.15625 L -23.75 25.15625 z "
inkscape:radius="0.13495015"
sodipodi:type="inkscape:offset"
inkscape:href="#text2215" />
<path
id="path2258"
d="M 124.96339,187.32226 L 124.96339,187.32226 z "
style="fill:none;fill-rule:evenodd;stroke:black;stroke-width:0.27757019px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<rect
transform="matrix(0.755258,0.655428,-0.632078,0.774905,0,0)"
y="58.321785"
x="188.26982"
height="2.396728"
width="41.862988"
id="rect2260"
style="fill:#de2735;fill-opacity:1;stroke:#5c5f7d;stroke-width:0.27763376;stroke-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -219,9 +219,18 @@ class CryptoBox:
def is_device_allowed(self, devicename):
"check if a device is white-listed for being used as cryptobox containers"
"""check if a device is white-listed for being used as cryptobox containers
also check, if the device is readable and writeable for the current user
"""
import types
devicename = os.path.abspath(devicename)
if not os.access(devicename, os.R_OK):
self.log.debug("Skipping device without read permissions: %s" % devicename)
return False
if not os.access(devicename, os.W_OK):
self.log.debug("Skipping device without write permissions: %s" % devicename)
return False
allowed = self.prefs["Main"]["AllowedDevices"]
if type(allowed) == types.StringType:
allowed = [allowed]
@ -234,7 +243,10 @@ class CryptoBox:
## it is not possible to check for 'realpath' - that does not work
## for the cryptobox as /dev/ is bind-mounted (real hda-name is /opt/...)
if re.search('^%s' % a_dev, devicename):
self.log.debug("Adding valid device: %s" % devicename)
return True
self.log.debug("Skipping device not listed in Main->AllowedDevices: %s" \
% devicename)
return False