Showing the changes to Source/Tools/UnixTools/GSF.POSIX.h (1 of 9 files). Show all
Unified · Split
| @@ -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 | |
| 25 | +struct 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 | + | |
| 37 | +int AuthenticateUser(const char* userName, const char* password); | |
| 38 | + | |
| 39 | +int ChangeUserPassword(const char* userName, const char* oldPassword, const char* newPassword); | |
| 40 | + | |
| 41 | +int GetLocalUserID(const char* userName, /*out*/ unsigned int* uid); | |
| 42 | + | |
| 43 | +// Preallocate outbound userName to 256 characters | |
| 44 | +int GetLocalUserName(unsigned int uid, /*out*/ char* userName); | |
| 45 | + | |
| 46 | +char* GetLocalUserHomeDirectory(const char* userName); | |
| 47 | + | |
| 48 | +char* 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) | |
| 57 | +int GetLocalUserPasswordInformation(const char* userName, struct UserPasswordInformation* userPasswordInfo, /*out*/ int* status); | |
| 58 | + | |
| 59 | +int SetLocalUserPassword(const char* userName, const char* password, const char* salt); | |
| 60 | + | |
| 61 | +char* GetPasswordHash(const char* password, const char* salt); | |
| 62 | + | |
| 63 | +int GetLocalUserGroupCount(const char* userName); | |
| 64 | + | |
| 65 | +// Preallocate outbound groupIDs as an unsigned integer array sized from GetLocalUserGroupCount | |
| 66 | +int GetLocalUserGroupIDs(const char* userName, int groupCount, /*out*/ gid_t** groupIDs); | |
| 67 | + | |
| 68 | +int GetLocalGroupID(const char* groupName, /*out*/ unsigned int* gid); | |
| 69 | + | |
| 70 | +// Preallocate outbound groupName to 256 characters | |
| 71 | +int GetLocalGroupName(unsigned int gid, /*out*/ char* groupName); | |
| 72 | + | |
| 73 | +char** GetLocalGroupMembers(const char* groupName); | |