-
Notifications
You must be signed in to change notification settings - Fork 4
Gendarme.Rules.Portability.FeatureRequiresRootPrivilegeOnUnixRule(2.10)
Sebastien Pouliot edited this page Feb 9, 2011
·
3 revisions
Assembly: Gendarme.Rules.Portability
Version: 2.10
This rule fires if a feature is used which is, by default, restricted under Unix.
- System.Net.NetworkInformation.Ping : This type can only be used by root on Unix systems. As an alternative you can execute the ping command and parse its result.
- System.Diagnostics.Process : The PriorityClass property can only be set to Normal by non-root users. To avoid this problem you can do a platform check before assigning a priority.
Bad example:
process.PriorityClass = ProcessPriorityClass.AboveNormal;
process.Start ();
Good example:
if (Environment.OSVersion.Platform != PlatformID.Unix) {
process.PriorityClass = ProcessPriorityClass.AboveNormal;
}
process.Start ();
Note that this page was autogenerated (3/17/2011 9:31:58 PM) based on the xmldoc comments inside the rules source code and cannot be edited from this wiki.
Please report any documentation errors, typos or suggestions to the
Gendarme Mailing List. Thanks!