]> WPIA git - gigi.git/blob - src/org/cacert/gigi/natives/SetUID.java
fix: ResultSet.getDate is often wrong as it fetches day-precision times
[gigi.git] / src / org / cacert / gigi / natives / SetUID.java
1 package org.cacert.gigi.natives;
2
3 import java.io.File;
4
5 /**
6  * Native to use privileged ports on unix-like hosts.
7  * 
8  * @author janis
9  */
10 public class SetUID {
11
12     static {
13         System.load(new File("natives/libsetuid.so").getAbsolutePath());
14     }
15
16     public native Status setUid(int uid, int gid);
17
18     public static class Status {
19
20         private boolean success;
21
22         private String message;
23
24         public Status(boolean success, String message) {
25             this.success = success;
26             this.message = message;
27         }
28
29         public boolean getSuccess() {
30             return success;
31         }
32
33         public String getMessage() {
34             return message;
35         }
36     }
37 }