--- heartbeat-1.2.3/heartbeat/hb_resource.c 2004-09-11 22:52:33.000000000 +0200 +++ softs/heartbeat-1/heartbeat/hb_resource.c 2007-11-29 15:45:09.000000000 +0100 @@ -1864,6 +1864,7 @@ struct ha_msg * m; static int resource_shutdown_in_progress = FALSE; +#if 0 /* Arkoon: this seems to be buggy, shutdown_if_needed never gets called. */ if (!hb_rsc_isstable()) { /* Try again later... */ /* (through shutdown_if_needed()) */ @@ -1875,6 +1876,7 @@ } return; } +#endif rsc_needs_shutdown = FALSE; shutdown_in_progress = TRUE; diff -r --exclude=.svn -u -N heartbeat-1.2.3/heartbeat/heartbeat.c softs/heartbeat-1/heartbeat/heartbeat.c --- heartbeat-1.2.3/heartbeat/heartbeat.c 2004-09-17 07:39:55.000000000 +0200 +++ softs/heartbeat-1/heartbeat/heartbeat.c 2007-11-29 15:45:09.000000000 +0100 @@ -283,6 +283,7 @@ static char hbname []= "heartbeat"; const char * cmdname = hbname; char * localnodename = NULL; +char * localmachinename = NULL; static int Argc = -1; extern int optind; void (*localdie)(void); @@ -396,6 +397,7 @@ static void start_a_child_client(gpointer childentry, gpointer pidtable); static void LookForClockJumps(void); static void get_localnodeinfo(void); +static void get_localshortname(void); static gboolean EmergencyShutdown(gpointer p); static gboolean hb_reregister_with_apphbd(gpointer dummy); @@ -471,7 +473,7 @@ int ipcid; struct pstat_shm * shm; - if ((ipcid = shmget(IPC_PRIVATE, sizeof(*procinfo), 0666)) < 0) { + if ((ipcid = shmget(IPC_PRIVATE, sizeof(*procinfo), 0600)) < 0) { cl_perror("Cannot shmget for process status"); return; } @@ -1275,8 +1277,10 @@ /* Dump out memory stats periodically... */ memstatsinterval = (debug ? 10*60*1000 : ONEDAY*1000); +#if 0 /* ARKOON: stats disabled */ Gmain_timeout_add_full(PRI_DUMPSTATS, memstatsinterval , hb_dump_all_proc_stats, NULL, NULL); +#endif /* Audit clients for liveness periodically */ Gmain_timeout_add_full(PRI_AUDITCLIENT, 9*1000 @@ -2973,6 +2977,12 @@ } get_localnodeinfo(); + get_localshortname(); + /** + * Set localnodename for logs file + */ + cl_log_set_entity(localmachinename); + SetParameterValue(KEY_HBVERSION, VERSION); /* Default message handling... */ @@ -4432,6 +4442,23 @@ g_strdown(localnodename); } +static void get_localshortname() +{ + static struct utsname u; + + if (!(uname(&u))) { + char *crt = NULL; + localmachinename = u.nodename; + /* remove domain name */ + crt = strchr(localmachinename, '.'); + if (crt) *crt = 0; + } + else { + localmachinename = localnodename; + } +} + + /* * $Log: heartbeat.c,v $ * Revision 1.291.2.15 2004/09/17 05:39:55 alan --- heartbeat-1.2.3/lib/clplumbing/cl_netstring.c 2004-08-27 23:04:27.000000000 +0200 +++ softs/heartbeat-1/lib/clplumbing/cl_netstring.c 2007-11-29 15:45:08.000000000 +0100 @@ -257,5 +257,10 @@ *data = sp; sp += (*len); + + if (sp >= smax) { + return(HA_FAIL); + } + if (*sp != ','){ return(HA_FAIL);