MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / GetMachineNameFullyQualified

Method GetMachineNameFullyQualified

src/core/unixfsservices.cpp:426–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424}
425
426void cUnixFSServices::GetMachineNameFullyQualified(TSTRING& strName) const
427{
428#if HAVE_SYS_UTSNAME_H
429 char buf[256];
430 if (gethostname(buf, 256) != 0)
431 {
432# if defined(SOLARIS_NO_GETHOSTBYNAME) || !SUPPORTS_NETWORKING
433 strName = buf;
434 return;
435# else
436 struct hostent* ret;
437 ret = gethostbyname(buf);
438
439 if (ret != NULL)
440 {
441 strName = ret->h_name;
442 return;
443 }
444# endif
445 }
446#endif
447 try
448 {
449 cUnixFSServices::GetMachineName(strName);
450 }
451 catch (eFSServices&)
452 {
453 strName = TSS_GetString(cCore, core::STR_UNKNOWN);
454 }
455}
456
457bool cUnixFSServices::FileDelete(const TSTRING& strName) const
458{

Callers 2

EmailReportToFunction · 0.80
SendEmailTestMessageMethod · 0.80

Calls 1

gethostnameFunction · 0.85

Tested by

no test coverage detected