use utname() to find the local hostname
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17796 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -570,13 +570,27 @@ static int
|
|||||||
HandleOP(GetVersionAndCapabilities)
|
HandleOP(GetVersionAndCapabilities)
|
||||||
{
|
{
|
||||||
int32_t cap = 0x10; /* has moniker */
|
int32_t cap = 0x10; /* has moniker */
|
||||||
|
char name[256] = "unknown", *str;
|
||||||
|
|
||||||
if (targetname)
|
if (targetname)
|
||||||
cap |= 0x1; /* is server */
|
cap |= 0x1; /* is server */
|
||||||
|
|
||||||
|
#ifdef HAVE_UNAME
|
||||||
|
{
|
||||||
|
struct utsname ut;
|
||||||
|
if (uname(&ut) == 0) {
|
||||||
|
snprintf(name, sizeof(name), "%s-%s-%s",
|
||||||
|
ut.sysname, ut.version, ut.machine);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
asprintf(&str, "gssmask %s %s", PACKAGE_STRING, name);
|
||||||
|
|
||||||
put32(c, GSSMAGGOTPROTOCOL);
|
put32(c, GSSMAGGOTPROTOCOL);
|
||||||
put32(c, cap);
|
put32(c, cap);
|
||||||
putstring(c, "gssmask");
|
putstring(c, str);
|
||||||
|
free(str);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user