History

Updates to Unix based UserInfo implementation.

ritchiecarroll committed 12 years ago

Commit bf22ae21 parent 2ab4c339 files · +284 −43Browse files

Showing the changes to Source/Tools/UnixTools/GSF.POSIX.h (1 of 9 files). Show all

Unified · Split

Source/Tools/UnixTools/GSF.POSIX.h+73−0
@@ -0,0 +1,73 @@
1//******************************************************************************************************
2// GSF.POSIX.h - Gbtc
3//
4// Copyright � 2014, Grid Protection Alliance. All Rights Reserved.
5//
6// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
7// the NOTICE file distributed with this work for additional information regarding copyright ownership.
8// The GPA licenses this file to you under the Eclipse Public License -v 1.0 (the "License"); you may
9// not use this file except in compliance with the License. You may obtain a copy of the License at:
10//
11// http://www.opensource.org/licenses/eclipse-1.0.php
12//
13// Unless agreed to in writing, the subject software distributed under the License is distributed on an
14// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
15// License for the specific language governing permissions and limitations.
16//
17// Code Modification History:
18// ----------------------------------------------------------------------------------------------------
19// 09/14/2014 - J. Ritchie Carroll
20// Generated original version of source code.
21//
22//******************************************************************************************************
23
24// Structure used to return key spwd information
25struct UserPasswordInformation
26{
27 // Do not include any pointer types in this structure
28 // to keep marshaling into .NET simple
29 long lastChangeDate;
30 long minDaysForChange;
31 long maxDaysForChange;
32 long warningDays;
33 long inactivityDays;
34 long accountExpirationDate;
35};
36
37int AuthenticateUser(const char* userName, const char* password);
38
39int ChangeUserPassword(const char* userName, const char* oldPassword, const char* newPassword);
40
41int GetLocalUserID(const char* userName, /*out*/ unsigned int* uid);
42
43// Preallocate outbound userName to 256 characters
44int GetLocalUserName(unsigned int uid, /*out*/ char* userName);
45
46char* GetLocalUserHomeDirectory(const char* userName);
47
48char* GetLocalUserGecos(const char* userName);
49
50// Values for status parameter:
51// 1 -- "*" Account is disabled
52// 2 -- "!<...>" The account locked out (e.g., with passwd -l <username>)
53// 2 -- "!" The password expired / never set - effectively locked out
54// 2 -- "!!" The password expired / never set - effectively locked out
55// 3 -- "" No password defined
56// 0 -- "<else>" Account assumed normal (encrypted password)
57int GetLocalUserPasswordInformation(const char* userName, struct UserPasswordInformation* userPasswordInfo, /*out*/ int* status);
58
59int SetLocalUserPassword(const char* userName, const char* password, const char* salt);
60
61char* GetPasswordHash(const char* password, const char* salt);
62
63int GetLocalUserGroupCount(const char* userName);
64
65// Preallocate outbound groupIDs as an unsigned integer array sized from GetLocalUserGroupCount
66int GetLocalUserGroupIDs(const char* userName, int groupCount, /*out*/ gid_t** groupIDs);
67
68int GetLocalGroupID(const char* groupName, /*out*/ unsigned int* gid);
69
70// Preallocate outbound groupName to 256 characters
71int GetLocalGroupName(unsigned int gid, /*out*/ char* groupName);
72
73char** GetLocalGroupMembers(const char* groupName);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t