From: Jeffrey Altman Date: Sun, 22 Jul 2012 05:19:57 +0000 (-0400) Subject: Windows: get rid of _strdup and use rk_strdup X-Git-Tag: openafs-stable-1_8_0pre1~2171 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=736e0dbeec54e19801e96ba93d471bd5a995f4f3 Windows: get rid of _strdup and use rk_strdup Do not use the _strdup() C RTL function. Use strdup() so that rk_strdup() roken replacement can be used. Change-Id: Ifd2808a078b514468aee52ef76a9b51e606a2c88 Reviewed-on: http://gerrit.openafs.org/7848 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- diff --git a/src/WINNT/afs_setup_utils/sutil.c b/src/WINNT/afs_setup_utils/sutil.c index d56069d..9440434 100644 --- a/src/WINNT/afs_setup_utils/sutil.c +++ b/src/WINNT/afs_setup_utils/sutil.c @@ -434,7 +434,7 @@ static BOOL ReadAutoExec(char **ppszEnvValue, char *pszEnvName) if (_strnicmp(szSetCmd, szLine, strlen(szSetCmd)) == 0) { char *value = strchr(szLine, '='); if (value) - *ppszEnvValue = _strdup(++value); + *ppszEnvValue = strdup(++value); break; } } @@ -512,11 +512,11 @@ static BOOL FindSubString(const char *s1, const char *s2) char *ls1, *ls2; BOOL bFound = FALSE; - ls1 = _strdup(s1); + ls1 = strdup(s1); if (!ls1) return FALSE; - ls2 = _strdup(s2); + ls2 = strdup(s2); if (!ls2) { free(ls1); return FALSE; diff --git a/src/WINNT/afsd/afskfw.c b/src/WINNT/afsd/afskfw.c index 425c567..c37804a 100644 --- a/src/WINNT/afsd/afskfw.c +++ b/src/WINNT/afsd/afskfw.c @@ -61,6 +61,7 @@ #include #include +#include #include #include @@ -377,7 +378,7 @@ KFW_AFS_update_princ_ccache_data(krb5_context context, krb5_ccache cc, int lsa) next = (struct principal_ccache_data *) malloc(sizeof(struct principal_ccache_data)); next->next = princ_cc_data; princ_cc_data = next; - next->principal = _strdup(pname); + next->principal = strdup(pname); next->ccache_name = ccfullname; ccfullname = NULL; next->from_lsa = lsa; @@ -465,7 +466,7 @@ KFW_AFS_find_ccache_for_principal(krb5_context context, char * principal, if ( next->from_lsa || !strcmp(next->ccache_name, principal) ) free(response); } - response = _strdup(next->ccache_name); + response = strdup(next->ccache_name); // MS Kerberos LSA is our best option so use it and quit if ( next->from_lsa ) break; @@ -529,8 +530,8 @@ KFW_AFS_update_cell_princ_map(krb5_context context, char * cell, char *pname, in next = (struct cell_principal_map *) malloc(sizeof(struct cell_principal_map)); next->next = cell_princ_map; cell_princ_map = next; - next->principal = _strdup(pname); - next->cell = _strdup(cell); + next->principal = strdup(pname); + next->cell = strdup(cell); next->active = active; } } @@ -585,7 +586,7 @@ KFW_AFS_find_principals_for_cell(krb5_context context, char * cell, char **princ for ( next_map = cell_princ_map, i=0 ; next_map && inext ) { if ( (!active_only || next_map->active) && !strcmp(next_map->cell,cell) ) { - (*principals)[i++] = _strdup(next_map->principal); + (*principals)[i++] = strdup(next_map->principal); } } return count; @@ -615,7 +616,7 @@ KFW_AFS_find_cells_for_princ(krb5_context context, char * pname, char **cells[], for ( next_map = cell_princ_map, i=0 ; next_map && inext ) { if ( (!active_only || next_map->active) && !strcmp(next_map->principal,pname) ) { - (*cells)[i++] = _strdup(next_map->cell); + (*cells)[i++] = strdup(next_map->cell); } } return count; diff --git a/src/WINNT/afsreg/afsreg.c b/src/WINNT/afsreg/afsreg.c index 4bab463..f6c92c9 100644 --- a/src/WINNT/afsreg/afsreg.c +++ b/src/WINNT/afsreg/afsreg.c @@ -302,7 +302,7 @@ long RegDeleteEntryAlt(const char *entryName, regentry_t entryType) { long status = ERROR_SUCCESS; - char *entryBuf = _strdup(entryName); + char *entryBuf = strdup(entryName); if (entryBuf == NULL) { status = ERROR_NOT_ENOUGH_MEMORY; diff --git a/src/WINNT/client_creds/credstab.cpp b/src/WINNT/client_creds/credstab.cpp index 0b6b716..cd4ea5c 100644 --- a/src/WINNT/client_creds/credstab.cpp +++ b/src/WINNT/client_creds/credstab.cpp @@ -231,7 +231,7 @@ void ShowObtainCreds (BOOL fExpiring, LPTSTR pszCell) return; oc->parent = (IsWindowVisible (g.hMain)) ? g.hMain : NULL; oc->type = fExpiring ? IDD_NEWCREDS_EXPIRE : IDD_NEWCREDS; - oc->cell = _strdup(pszCell); + oc->cell = strdup(pszCell); HANDLE thread = 0; ULONG threadID = 123; diff --git a/src/WINNT/netidmgr_plugin/afsfuncs.c b/src/WINNT/netidmgr_plugin/afsfuncs.c index 3da709f..5dc0991 100644 --- a/src/WINNT/netidmgr_plugin/afsfuncs.c +++ b/src/WINNT/netidmgr_plugin/afsfuncs.c @@ -1443,7 +1443,7 @@ afs_get_cellconfig(char *cell, afs_conf_cell *cellconfig, char *local_cell) (void*) cellconfig); if (linkedCell[0]) - cellconfig->linkedCell = _strdup(linkedCell); + cellconfig->linkedCell = strdup(linkedCell); return rc; }