Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 925085 Details for
Bug 1121496
Inadyn-mt 2.24.40-1.fc20 segfaults on start
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
decouple cache file writes/reads from cache data structure update
inadyn-mt-cache-02-02.24.40.patch (text/plain), 7.96 KB, created by
Bryan Hoover
on 2014-08-08 06:04:34 UTC
(
hide
)
Description:
decouple cache file writes/reads from cache data structure update
Filename:
MIME Type:
Creator:
Bryan Hoover
Created:
2014-08-08 06:04:34 UTC
Size:
7.96 KB
patch
obsolete
>diff -ur inadyn-mt.v.02.24.40/src/dyndns.c inadyn-mt.v.02.24.40_new/src/dyndns.c >--- inadyn-mt.v.02.24.40/src/dyndns.c 2014-06-03 11:41:51.000000000 -0400 >+++ inadyn-mt.v.02.24.40_new/src/dyndns.c 2014-08-08 01:07:39.000000000 -0400 >@@ -1360,6 +1360,33 @@ > free(alias_in); > } > >+static void ip_cache_list_add(DYN_DNS_CLIENT *p_dyndns,char *ip,char *alias,char *ip_type) >+{ >+ int cache_index; >+ char *ip_alias_type; >+ >+ >+ ip_alias_type=safe_malloc(strlen(ip)+strlen(alias)+strlen(ip_type)+3); >+ sprintf(ip_alias_type,"%s %s:%s",ip,alias,ip_type); >+ >+ cache_index=p_dyndns->ip_cache_list.count; >+ p_dyndns->ip_cache_list.count+=1; >+ >+ p_dyndns->ip_cache_list.saved_ip_cache=safe_realloc(p_dyndns->ip_cache_list.saved_ip_cache,sizeof(IP_CACHE)*p_dyndns->ip_cache_list.count); >+ >+ p_dyndns->ip_cache_list.saved_ip_cache[cache_index].ip=safe_malloc(strlen(ip)+1); >+ p_dyndns->ip_cache_list.saved_ip_cache[cache_index].alias=safe_malloc(strlen(alias)+1); >+ p_dyndns->ip_cache_list.saved_ip_cache[cache_index].type=safe_malloc(strlen(ip_type)+1); >+ p_dyndns->ip_cache_list.saved_ip_cache[cache_index].ip_alias_type=safe_malloc(strlen(ip_alias_type)+1); >+ >+ strcpy(p_dyndns->ip_cache_list.saved_ip_cache[cache_index].ip,ip); >+ strcpy(p_dyndns->ip_cache_list.saved_ip_cache[cache_index].alias,alias); >+ strcpy(p_dyndns->ip_cache_list.saved_ip_cache[cache_index].type,ip_type); >+ strcpy(p_dyndns->ip_cache_list.saved_ip_cache[cache_index].ip_alias_type,ip_alias_type); >+ >+ free(ip_alias_type); >+} >+ > /* Record the last ip as per that in ip cache file. Report it via log output. > > Set update need for each space separated ip, alias pair line read. >@@ -1369,6 +1396,8 @@ > 5/25/2014 > Very ugly parsing. Will move ip cache function to own module, and write a proper parser. Really. I will. > Stop looking at me like that. >+ 8/6/2014 >+ Fix so pivots on whether cache entries contain DDNS as per v.02.24.40 - that is, backward ip cache compat. > */ > > static RC_TYPE read_ip_cache(DYN_DNS_CLIENT *p_dyndns) >@@ -1386,7 +1415,8 @@ > char *in_str; > char *ip; > char server[256]; >- char *alias,ip_type[8],*ip_alias_type; >+ char *alias; >+ char ip_type[8]; //dangerous - ip_type len could increase (but, not likely) - should be a constant in dyndns.h > > int i=0; > int alias_count=0; >@@ -1427,15 +1457,20 @@ > } > else { > >+//space or carriage return >+ > if (ch==' ' && !is_got_space) { /*ip address*/ > >+//first space > is_got_space=1; > > strcpy(ip,in_str); > } > else { > >- if (is_got_space && ch=='\n') { /*server*/ >+//second space and \n >+ >+ if (is_got_space && ch=='\n' && is_got_alias) { /*server*/ > > is_got_space=0; > is_got_alias=0; >@@ -1443,10 +1478,12 @@ > DBG_PRINTF((LOG_WARNING, "W:" MODULE_TAG "%s %s:%s %s...\n",ip,alias,ip_type,server)); > > memset(server,0,256); >- free(alias); free(ip_alias_type); >+ free(alias); > } > else { /*alias*/ > >+//second space or \n >+ > int cache_count; > > /* >@@ -1455,8 +1492,6 @@ > others will be false, and need is_update_pending true accordingly > */ > >- is_got_alias=1; >- > set_update_state(p_dyndns,in_str,true); > > alias_count++; >@@ -1478,27 +1513,22 @@ > > strcpy(ip_type,(strchr(in_str,':')+1)); > >- cache_count=p_dyndns->ip_cache_list.count; >- p_dyndns->ip_cache_list.count+=1; >+ /*save each element of ip cache string (ip, alias, and type) and full string as appears in cache file*/ >+ ip_cache_list_add(p_dyndns,ip,alias,ip_type); > >- >- p_dyndns->ip_cache_list.saved_ip_cache=safe_realloc(p_dyndns->ip_cache_list.saved_ip_cache,sizeof(IP_CACHE)*p_dyndns->ip_cache_list.count); >+ /*pre v.02.24.40 - no DDNS server listed in cache entry*/ >+ if (!(ch=='\n')) { > >- ip_alias_type=safe_malloc(strlen(ip)+strlen(alias)+strlen(ip_type)+3); >+ is_got_alias=1; >+ } >+ else { > >- sprintf(ip_alias_type,"%s %s:%s",ip,alias,ip_type); >+ DBG_PRINTF((LOG_WARNING, "W:" MODULE_TAG "%s %s:%s...\n",ip,alias,ip_type)); > >- /*save each element of ip cache string (ip, alias, and type) and full string as appears in cache file*/ >+ is_got_space=0; > >- p_dyndns->ip_cache_list.saved_ip_cache[cache_count].ip=safe_malloc(strlen(ip)+1); >- p_dyndns->ip_cache_list.saved_ip_cache[cache_count].alias=safe_malloc(strlen(alias)+1); >- p_dyndns->ip_cache_list.saved_ip_cache[cache_count].type=safe_malloc(strlen(ip_type)+1); >- p_dyndns->ip_cache_list.saved_ip_cache[cache_count].ip_alias_type=safe_malloc(strlen(ip_alias_type)+1); >- >- strcpy(p_dyndns->ip_cache_list.saved_ip_cache[cache_count].ip,ip); >- strcpy(p_dyndns->ip_cache_list.saved_ip_cache[cache_count].alias,alias); >- strcpy(p_dyndns->ip_cache_list.saved_ip_cache[cache_count].type,ip_type); >- strcpy(p_dyndns->ip_cache_list.saved_ip_cache[cache_count].ip_alias_type,ip_alias_type); >+ free(alias); >+ } > } > > } >@@ -1581,6 +1611,9 @@ > > if (success_updates) { > >+ /*rebuilding the list*/ >+ ip_cache_list_destruct(&p_self->ip_cache_list); >+ > /*reset forced update period*/ > p_self->forced_update_counter=p_self->forced_update_period_sec_orig/p_self->cmd_check_period; > p_self->forced_update_period_sec=p_self->forced_update_period_sec_orig; >@@ -1592,9 +1625,10 @@ > fclose(fp); > } > >- if ((fp=utf_fopen(p_self->ip_cache, "w"))) { >+ fp=utf_fopen(p_self->ip_cache, "w"); > >- int i; >+ { >+ int i; > DYNDNS_IPV ip_enum; > BOOL is_dyndns_dual; > >@@ -1606,25 +1640,38 @@ > > if (p_self->alias_info.update_succeeded[i]) { > >- if (!(is_dyndns_dual)) >+ /*update saved ip cache list structure, and write it to cache file*/ > >- fprintf(fp,"%s %s:%s %s\n",p_self->info.my_ip_address.name[ip_enum], >- p_self->alias_info.names[i].name,p_self->alias_info.names[i].ip_v,p_self->info.dyndns_server_name.name[ip_store]); >+ if (!(is_dyndns_dual)) { > >+ ip_cache_list_add(p_self,p_self->info.my_ip_address.name[ip_enum], >+ p_self->alias_info.names[i].name,p_self->alias_info.names[i].ip_v); >+ >+ if (fp) >+ fprintf(fp,"%s %s:%s %s\n",p_self->info.my_ip_address.name[ip_enum], >+ p_self->alias_info.names[i].name,p_self->alias_info.names[i].ip_v,p_self->info.dyndns_server_name.name[ip_store]); >+ } > else { >+ ip_cache_list_add(p_self,p_self->info.my_ip_address.name[ip_4], >+ p_self->alias_info.names[i].name,"ip4"); >+ >+ ip_cache_list_add(p_self,p_self->info.my_ip_address.name[ip_6], >+ p_self->alias_info.names[i].name,"ip6"); >+ >+ if (fp) { > >- fprintf(fp,"%s %s:ip4 %s\n",p_self->info.my_ip_address.name[ip_4], >- p_self->alias_info.names[i].name,p_self->info.dyndns_server_name.name[ip_store]); >+ fprintf(fp,"%s %s:ip4 %s\n",p_self->info.my_ip_address.name[ip_4], >+ p_self->alias_info.names[i].name,p_self->info.dyndns_server_name.name[ip_store]); > >- fprintf(fp,"%s %s:ip6 %s\n",p_self->info.my_ip_address.name[ip_6], >- p_self->alias_info.names[i].name,p_self->info.dyndns_server_name.name[ip_store]); >+ fprintf(fp,"%s %s:ip6 %s\n",p_self->info.my_ip_address.name[ip_6], >+ p_self->alias_info.names[i].name,p_self->info.dyndns_server_name.name[ip_store]); >+ } > } > } > } > >- fclose(fp); >- >- ip_cache_list_update(p_self); >+ if (fp) >+ fclose(fp); > } > } > >diff -ur inadyn-mt.v.02.24.40/src/dyndns.h inadyn-mt.v.02.24.40_new/src/dyndns.h >--- inadyn-mt.v.02.24.40/src/dyndns.h 2014-06-01 11:01:18.000000000 -0400 >+++ inadyn-mt.v.02.24.40_new/src/dyndns.h 2014-08-08 01:07:47.000000000 -0400 >@@ -75,7 +75,7 @@ > > #endif > >-#define DYNDNS_EXTRA_VERSION >+#define DYNDNS_EXTRA_VERSION "-cache_patch_02" > > #define DYNDNS_VERSION_STRING "02.24.40" DYNDNS_VERSION_SND DYNDNS_VERSION_THD DYNDNS_EXTRA_VERSION > #define DYNDNS_AGENT_NAME "inadyn-mt/" DYNDNS_VERSION_STRING
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1121496
:
924363
|
925011
| 925085