Add NO_LOCALNAME
The pname to uid functionality at present assumes there is an implementation of getpwnam() and that the local user identifier is an integer. On Windows, the local user identifier is a SId. Add NO_LOCALNAME as a build option so that Windows (for now) can build without providing a getpwnam() implementation. Change-Id: I04cfd6d2cd52e6228733f1da1dab420b453e6566
This commit is contained in:
@@ -76,6 +76,7 @@ while(<>) {
|
|||||||
if ("$(HAVE_SCC)") { print "#define HAVE_SCC 1\n"; }
|
if ("$(HAVE_SCC)") { print "#define HAVE_SCC 1\n"; }
|
||||||
if ("$(DIR_hdbdir)") { print "#define HDB_DB_DIR \"".'$(DIR_hdbdir)'."\"\n"; }
|
if ("$(DIR_hdbdir)") { print "#define HDB_DB_DIR \"".'$(DIR_hdbdir)'."\"\n"; }
|
||||||
if ("$(HAVE_MSLSA_CACHE)") { print "#define HAVE_MSLSA_CACHE 1\n"; }
|
if ("$(HAVE_MSLSA_CACHE)") { print "#define HAVE_MSLSA_CACHE 1\n"; }
|
||||||
|
if ("$(NO_LOCALNAME)") { print "#define NO_LOCALNAME 1\n"; }
|
||||||
|
|
||||||
} elsif (m/\@VERSION_OPTDEFS\@/) {
|
} elsif (m/\@VERSION_OPTDEFS\@/) {
|
||||||
|
|
||||||
|
@@ -38,6 +38,10 @@ _gsskrb5_pname_to_uid(OM_uint32 *minor_status,
|
|||||||
const gss_OID mech_type,
|
const gss_OID mech_type,
|
||||||
uid_t *uidp)
|
uid_t *uidp)
|
||||||
{
|
{
|
||||||
|
#ifdef NO_LOCALNAME
|
||||||
|
*minor_status = KRB5_NO_LOCALNAME;
|
||||||
|
return GSS_S_FAILURE;
|
||||||
|
#else
|
||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
krb5_context context;
|
krb5_context context;
|
||||||
krb5_const_principal princ = (krb5_const_principal)pname;
|
krb5_const_principal princ = (krb5_const_principal)pname;
|
||||||
@@ -77,4 +81,5 @@ _gsskrb5_pname_to_uid(OM_uint32 *minor_status,
|
|||||||
*uidp = pwd->pw_uid;
|
*uidp = pwd->pw_uid;
|
||||||
|
|
||||||
return GSS_S_COMPLETE;
|
return GSS_S_COMPLETE;
|
||||||
|
#endif /* NO_LOCALNAME */
|
||||||
}
|
}
|
||||||
|
@@ -59,6 +59,9 @@ attr_pname_to_uid(OM_uint32 *minor_status,
|
|||||||
struct _gss_mechanism_name *mn,
|
struct _gss_mechanism_name *mn,
|
||||||
uid_t *uidp)
|
uid_t *uidp)
|
||||||
{
|
{
|
||||||
|
#ifdef NO_LOCALNAME
|
||||||
|
return GSS_S_UNAVAILABLE;
|
||||||
|
#else
|
||||||
OM_uint32 major_status = GSS_S_UNAVAILABLE;
|
OM_uint32 major_status = GSS_S_UNAVAILABLE;
|
||||||
OM_uint32 tmpMinor;
|
OM_uint32 tmpMinor;
|
||||||
int more = -1;
|
int more = -1;
|
||||||
@@ -124,6 +127,7 @@ attr_pname_to_uid(OM_uint32 *minor_status,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return major_status;
|
return major_status;
|
||||||
|
#endif /* NO_LOCALNAME */
|
||||||
}
|
}
|
||||||
|
|
||||||
OM_uint32
|
OM_uint32
|
||||||
|
@@ -100,6 +100,9 @@ DIR_hdbdir=%{COMMON_APPDATA}/heimdal/hdb
|
|||||||
# Enable weak crypto
|
# Enable weak crypto
|
||||||
WEAK_CRYPTO=1
|
WEAK_CRYPTO=1
|
||||||
|
|
||||||
|
# Disable use of GSS LOCALNAME support
|
||||||
|
NO_LOCALNAME=1
|
||||||
|
|
||||||
# Disable build of installers
|
# Disable build of installers
|
||||||
!ifndef NO_INSTALLERS
|
!ifndef NO_INSTALLERS
|
||||||
BUILD_INSTALLERS=1
|
BUILD_INSTALLERS=1
|
||||||
|
Reference in New Issue
Block a user