Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

Commit

Permalink
Merged PR 6158: Add ifdef guards for nss shadow function #147438
Browse files Browse the repository at this point in the history
Add ifdef guards for nss shadow function #147438

Aix doesn't support shadow database

Related work items: #147438
  • Loading branch information
dmorash-BT committed May 28, 2018
1 parent 042f0d1 commit 443d3e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
20 changes: 12 additions & 8 deletions lsass/interop/nsswitch/common/nss-user.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ LsaNssClearEnumUsersState(
);
pState->ppUserInfoList = (HANDLE)NULL;
}

if (hLsaConnection && pState->hResume != (HANDLE)NULL)
{
LsaEndEnumUsers(hLsaConnection, pState->hResume);
Expand Down Expand Up @@ -267,6 +267,7 @@ LsaNssWriteUserInfo(
goto cleanup;
}

#ifdef HAVE_SHADOW_H
DWORD
LsaNssWriteShadowInfo(
DWORD dwUserInfoLevel,
Expand Down Expand Up @@ -360,6 +361,7 @@ LsaNssWriteShadowInfo(

goto cleanup;
}
#endif

NSS_STATUS
LsaNssCommonPasswdSetpwent(
Expand All @@ -374,7 +376,7 @@ LsaNssCommonPasswdSetpwent(
LsaNssCommonEnsureConnected(pConnection));
BAIL_ON_NSS_ERROR(ret);
hLsaConnection = pConnection->hLsaConnection;

LsaNssClearEnumUsersState(hLsaConnection, pEnumUsersState);

ret = MAP_LSA_ERROR(NULL,
Expand Down Expand Up @@ -465,7 +467,7 @@ LsaNssCommonPasswdGetpwent(
{
bIgnoreEntry = TRUE;
}
else
else
{
ret = MAP_LSA_ERROR(pErrorNumber,
LsaNssWriteUserInfo(
Expand All @@ -475,7 +477,7 @@ LsaNssCommonPasswdGetpwent(
&pszBuf,
bufLen));
BAIL_ON_NSS_ERROR(ret);

ret = NSS_STATUS_SUCCESS;
}

Expand Down Expand Up @@ -506,7 +508,7 @@ LsaNssCommonPasswdGetpwent(
else
{
LsaNssClearEnumUsersState(hLsaConnection, pEnumUsersState);

if ( hLsaConnection != (HANDLE)NULL)
{
if (ret != NSS_STATUS_TRYAGAIN && ret != NSS_STATUS_NOTFOUND)
Expand Down Expand Up @@ -663,6 +665,7 @@ LsaNssCommonPasswdGetpwuid(
goto cleanup;
}

#ifdef HAVE_SHADOW_H
NSS_STATUS
LsaNssCommonShadowGetspent(
PLSA_NSS_CACHED_HANDLE pConnection,
Expand Down Expand Up @@ -726,7 +729,7 @@ LsaNssCommonShadowGetspent(
{
bIgnoreEntry = TRUE;
}
else
else
{
ret = MAP_LSA_ERROR(pErrorNumber,
LsaNssWriteShadowInfo(
Expand All @@ -736,7 +739,7 @@ LsaNssCommonShadowGetspent(
&pszBuf,
bufLen));
BAIL_ON_NSS_ERROR(ret);

ret = NSS_STATUS_SUCCESS;
}

Expand Down Expand Up @@ -767,7 +770,7 @@ LsaNssCommonShadowGetspent(
else
{
LsaNssClearEnumUsersState(hLsaConnection, pEnumUsersState);

if ( hLsaConnection != (HANDLE)NULL)
{
if (ret != NSS_STATUS_TRYAGAIN && ret != NSS_STATUS_NOTFOUND)
Expand Down Expand Up @@ -849,3 +852,4 @@ LsaNssCommonShadowGetspnam(

goto cleanup;
}
#endif
5 changes: 5 additions & 0 deletions lsass/interop/nsswitch/include/lsanss.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ LsaNssWriteUserInfo(
int bufLen
);

#ifdef HAVE_SHADOW_H
DWORD
LsaNssWriteShadowInfo(
DWORD dwUserInfoLevel,
Expand All @@ -181,6 +182,7 @@ LsaNssWriteShadowInfo(
char** ppszBuf,
int bufLen
);
#endif

VOID
LsaNssClearEnumGroupsState(
Expand Down Expand Up @@ -257,6 +259,7 @@ LsaNssCommonPasswdGetpwuid(
int * pErrorNumber
);

#ifdef HAVE_SHADOW_H
NSS_STATUS
LsaNssCommonShadowGetspent(
PLSA_NSS_CACHED_HANDLE pConnection,
Expand All @@ -276,6 +279,8 @@ LsaNssCommonShadowGetspnam(
size_t bufLen,
int * pErrorNumber
);
#endif


NSS_STATUS
LsaNssCommonGroupSetgrent(
Expand Down

0 comments on commit 443d3e4

Please sign in to comment.