author | duke |
Wed, 05 Jul 2017 21:06:18 +0200 | |
changeset 34465 | 41a1258588da |
parent 30044 | bab15bbe2ca3 |
child 34894 | 3248b89d1921 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
23010
6dadb192ad81
8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents:
20742
diff
changeset
|
2 |
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package com.sun.security.auth.module; |
|
27 |
||
28 |
/** |
|
30044
bab15bbe2ca3
8078528: clean out tidy warnings from security.auth
avstepan
parents:
25859
diff
changeset
|
29 |
* This class implementation retrieves and makes available Solaris |
2 | 30 |
* UID/GID/groups information for the current user. |
31 |
* |
|
24270
12b6bc57472d
8040068: SolarisSystem should be @Deprecated and @jdk.Exported(false)
weijun
parents:
23010
diff
changeset
|
32 |
* @deprecated replaced by {@link UnixSystem}. |
2 | 33 |
*/ |
24270
12b6bc57472d
8040068: SolarisSystem should be @Deprecated and @jdk.Exported(false)
weijun
parents:
23010
diff
changeset
|
34 |
@jdk.Exported(false) |
12b6bc57472d
8040068: SolarisSystem should be @Deprecated and @jdk.Exported(false)
weijun
parents:
23010
diff
changeset
|
35 |
@Deprecated |
2 | 36 |
public class SolarisSystem { |
37 |
||
38 |
private native void getSolarisInfo(); |
|
39 |
||
40 |
protected String username; |
|
41 |
protected long uid; |
|
42 |
protected long gid; |
|
43 |
protected long[] groups; |
|
44 |
||
45 |
/** |
|
30044
bab15bbe2ca3
8078528: clean out tidy warnings from security.auth
avstepan
parents:
25859
diff
changeset
|
46 |
* Instantiate a {@code SolarisSystem} and load |
2 | 47 |
* the native library to access the underlying system information. |
48 |
*/ |
|
49 |
public SolarisSystem() { |
|
50 |
System.loadLibrary("jaas_unix"); |
|
51 |
getSolarisInfo(); |
|
52 |
} |
|
53 |
||
54 |
/** |
|
55 |
* Get the username for the current Solaris user. |
|
56 |
* |
|
57 |
* @return the username for the current Solaris user. |
|
58 |
*/ |
|
59 |
public String getUsername() { |
|
60 |
return username; |
|
61 |
} |
|
62 |
||
63 |
/** |
|
64 |
* Get the UID for the current Solaris user. |
|
65 |
* |
|
66 |
* @return the UID for the current Solaris user. |
|
67 |
*/ |
|
68 |
public long getUid() { |
|
69 |
return uid; |
|
70 |
} |
|
71 |
||
72 |
/** |
|
73 |
* Get the GID for the current Solaris user. |
|
74 |
* |
|
75 |
* @return the GID for the current Solaris user. |
|
76 |
*/ |
|
77 |
public long getGid() { |
|
78 |
return gid; |
|
79 |
} |
|
80 |
||
81 |
/** |
|
82 |
* Get the supplementary groups for the current Solaris user. |
|
83 |
* |
|
84 |
* @return the supplementary groups for the current Solaris user. |
|
85 |
*/ |
|
86 |
public long[] getGroups() { |
|
7528
aae1ca8d088f
6992964: FindBugs warnings in com.sun.security.auth.module.UnixSystem.java
weijun
parents:
5506
diff
changeset
|
87 |
return groups == null ? null : groups.clone(); |
2 | 88 |
} |
89 |
} |