iad_user.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Licensed Materials - Property of IBM and/or HCL
  3. *
  4. * IBM Informix
  5. * Copyright IBM Corporation 2013
  6. * (c) Copyright HCL Technologies Ltd. 2017. All Rights Reserved.
  7. */
  8. #include "API.h"
  9. #ifndef IADUSER_HEADER_INCLUDED
  10. #define IADUSER_HEADER_INCLUDED
  11. /* Installation properties */
  12. #define IAD_P_RUNAS_INFORMIX 0 /* used for server owner */
  13. #define IAD_P_CHANGE_USER_CRED 1 /* Changes are required for user */
  14. #define IAD_P_RUNAS_LOCAL 2 /* local or remote informix account */
  15. #define IAD_P_ENABLE_ROLESEP 3
  16. #define IAD_P_USER_IS_ADMIN 4
  17. #define IAD_P_USER_IS_DOMAIN_ADMIN 5
  18. #define IAD_P_COMPUTER_IS_DOMAIN 6
  19. #define IAD_P_COMPUTER_ON_DOMAIN 7 /* TRUE when computer is connected to domain
  20. * and user has rights to query users on
  21. * DOMAIN */
  22. #define IAD_P_FIRST IAD_P_RUNAS_INFORMIX
  23. #define IAD_P_LAST_SETABLE IAD_P_ENABLE_ROLESEP
  24. #define IAD_P_LAST IAD_P_COMPUTER_ON_DOMAIN
  25. #define IAD_P_GROUP_EXISTS 0 /* group there */
  26. #define IAD_P_USER_EXISTS 1 /* user there */
  27. #define IAD_P_DOMAIN_GROUP_EXISTS 2 /* True when the loged in user detects that
  28. * the DOMAIN group is there */
  29. #define IAD_P_DOMAIN_USER_EXISTS 3
  30. #define IAD_USERTYPE_DBSA 0
  31. #define IAD_USERTYPE_DBSO 1
  32. #define IAD_USERTYPE_AAOG 2
  33. #define IAD_USERTYPE_USER 3
  34. #define IAD_USERTYPE_JSON 4
  35. #define IAD_USERTYPE_LAST IAD_USERTYPE_JSON
  36. #define FALSE 0
  37. #define TRUE 1
  38. /* function prototypes */
  39. /* Called by init_API */
  40. /* detects the current state of the informix required users and groups */
  41. EXPORT int STDCALL initIadUser(install_t *is);
  42. /* Called by deployInstallation */
  43. /* Applies informix required users and groups */
  44. EXPORT int STDCALL iadDeployIfmxCredentials(install_t *is);
  45. /* Not implemented yet, need to confirm what it needs to do */
  46. EXPORT int STDCALL iadValidateUser(install_t *is);
  47. /* iadSetInstallationProperty,
  48. * property must be a valid properties, between IAD_P_FIRST and IAD_P_LAST_SETABLE
  49. * setting must be TRUE or FALSE
  50. */
  51. EXPORT int STDCALL iadSetInstallationProperty(install_t *is, int property, int setting);
  52. /* iadGetUserProperty, property must be a valid enum user_properties, returns TRUE or FALSE */
  53. EXPORT int STDCALL iadGetUserProperty(install_t *is, int type, int property);
  54. EXPORT int STDCALL iadGetInstallationProperty(install_t *is, int property);
  55. /* When modifying user info use this home dir for informix account */
  56. EXPORT int STDCALL iadSetHomePath(install_t *is, const char *homedir);
  57. /* When modifying user info use this password for informix account */
  58. /* When not modifying user info validate that this is the password for informix account */
  59. EXPORT int STDCALL iadSetPasswd(install_t *is, int type, const char *passwd);
  60. EXPORT char *STDCALL iadGetAccountName(install_t *is);
  61. EXPORT char *STDCALL iadGetAccountName_a(install_t *is, int type);
  62. EXPORT char *STDCALL iadGetUserName(install_t * is, int type);
  63. EXPORT char *STDCALL iadGetGroupName(install_t * is, int type);
  64. EXPORT char *STDCALL iadGetDoaminControler(install_t * is);
  65. EXPORT char *STDCALL iadGetDoaminName(install_t * is);
  66. EXPORT int STDCALL iadChangeGroupRequired(install_t * is, int type, const char *group);
  67. EXPORT int STDCALL iadAddUserGroupRequired(install_t * is, int type, const char *group, const char *user, const char * passwd);
  68. /* Cleanup All user related memory */
  69. EXPORT void STDCALL iadFreeUser(install_t * is);
  70. #endif /* IADUSER_HEADER_INCLUDED */