Changeset 4966
- Timestamp:
- 04/10/11 03:00:41 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam-config.c
r4948 r4966 1741 1741 fprintf_conf(f, CONFVARWIDTH, "serverip", "%s\n", cs_inet_ntoa(cfg.srvip)); 1742 1742 if (cfg.usrfile != NULL || cfg.http_full_cfg) 1743 fprintf_conf(f, CONFVARWIDTH, "usrfile", "%s\n", cfg.usrfile );1743 fprintf_conf(f, CONFVARWIDTH, "usrfile", "%s\n", cfg.usrfile?cfg.usrfile:""); 1744 1744 if (cfg.logfile != NULL || cfg.logtostdout == 1 || cfg.logtosyslog == 1 || cfg.http_full_cfg){ 1745 1745 value = mk_t_logfile(); … … 1748 1748 } 1749 1749 if (cfg.cwlogdir != NULL || cfg.http_full_cfg) 1750 fprintf_conf(f, CONFVARWIDTH, "cwlogdir", "%s\n", cfg.cwlogdir );1750 fprintf_conf(f, CONFVARWIDTH, "cwlogdir", "%s\n", cfg.cwlogdir?cfg.cwlogdir:""); 1751 1751 #ifdef QBOXHD_LED 1752 1752 if (cfg.disableqboxhdled || cfg.http_full_cfg) … … 1832 1832 1833 1833 if (cfg.lb_savepath || cfg.http_full_cfg) 1834 fprintf_conf(f, CONFVARWIDTH, "lb_savepath", "%s\n", cfg.lb_savepath );1834 fprintf_conf(f, CONFVARWIDTH, "lb_savepath", "%s\n", cfg.lb_savepath?cfg.lb_savepath:""); 1835 1835 if (cfg.lb_stat_cleanup != DEFAULT_LB_STAT_CLEANUP || cfg.http_full_cfg) 1836 1836 fprintf_conf(f, CONFVARWIDTH, "lb_stat_cleanup", "%d\n", cfg.lb_stat_cleanup); … … 2319 2319 if (rdr->ncd_key[0] || rdr->ncd_key[13] || cfg.http_full_cfg) { 2320 2320 fprintf_conf(f, CONFVARWIDTH, "key", ""); 2321 for (j = 0; j < 14; j++) { 2322 fprintf(f, "%02X", rdr->ncd_key[j]); 2321 if(rdr->ncd_key[0] || rdr->ncd_key[13]){ 2322 for (j = 0; j < 14; j++) { 2323 fprintf(f, "%02X", rdr->ncd_key[j]); 2324 } 2323 2325 } 2324 2326 fprintf(f, "\n"); … … 2335 2337 2336 2338 if ((rdr->emmfile || cfg.http_full_cfg) && isphysical) 2337 fprintf_conf(f, CONFVARWIDTH, "readnano", "%s\n", rdr->emmfile );2339 fprintf_conf(f, CONFVARWIDTH, "readnano", "%s\n", rdr->emmfile?rdr->emmfile:""); 2338 2340 2339 2341 value = mk_t_service((uint64)rdr->sidtabok, (uint64)rdr->sidtabno); … … 2368 2370 free(value); 2369 2371 2370 if ( (rdr->boxid || cfg.http_full_cfg)&& isphysical)2372 if (rdr->boxid && isphysical) 2371 2373 fprintf_conf(f, CONFVARWIDTH, "boxid", "%08X\n", rdr->boxid); 2374 else if (cfg.http_full_cfg && isphysical) 2375 fprintf_conf(f, CONFVARWIDTH, "boxid", "\n"); 2372 2376 2373 2377 if((rdr->fix_9993 || cfg.http_full_cfg) && isphysical) … … 2376 2380 // rsakey 2377 2381 int len = check_filled(rdr->rsa_mod, 120); 2378 if ( (len > 0 || cfg.http_full_cfg)&& isphysical) {2382 if (len > 0 && isphysical) { 2379 2383 if(len > 64) len = 120; 2380 2384 else len = 64; 2381 2385 fprintf_conf(f, CONFVARWIDTH, "rsakey", "%s\n", cs_hexdump(0, rdr->rsa_mod, len)); 2382 } 2386 } else if(cfg.http_full_cfg && isphysical) 2387 fprintf_conf(f, CONFVARWIDTH, "rsakey", "\n"); 2383 2388 2384 2389 if ((rdr->force_irdeto || cfg.http_full_cfg) && isphysical) { 2385 2390 fprintf_conf(f, CONFVARWIDTH, "force_irdeto", "%d\n", rdr->force_irdeto); 2386 2391 } 2387 2388 if ((check_filled(rdr->nagra_boxkey, 8) > 0 || cfg.http_full_cfg) && isphysical) 2389 fprintf_conf(f, CONFVARWIDTH, "boxkey", "%s\n", cs_hexdump(0, rdr->nagra_boxkey, 8)); 2392 2393 len = check_filled(rdr->nagra_boxkey, 8); 2394 if ((len > 0 || cfg.http_full_cfg) && isphysical) 2395 fprintf_conf(f, CONFVARWIDTH, "boxkey", "%s\n", len>0?cs_hexdump(0, rdr->nagra_boxkey, 8):""); 2390 2396 2391 2397 if ((rdr->atr[0] || cfg.http_full_cfg) && isphysical) { 2392 2398 fprintf_conf(f, CONFVARWIDTH, "atr", ""); 2393 for (j=0; j < rdr->atrlen/2; j++) { 2394 fprintf(f, "%02X", rdr->atr[j]); 2399 if(rdr->atr[0]){ 2400 for (j=0; j < rdr->atrlen/2; j++) { 2401 fprintf(f, "%02X", rdr->atr[j]); 2402 } 2395 2403 } 2396 2404 fprintf(f, "\n"); … … 2494 2502 fprintf_conf(f, CONFVARWIDTH, "audisabled", "%d\n", rdr->audisabled); 2495 2503 2496 if (rdr->auprovid || cfg.http_full_cfg) 2497 fprintf_conf(f, CONFVARWIDTH, "auprovid", "%06lX", rdr->auprovid); 2504 if (rdr->auprovid) 2505 fprintf_conf(f, CONFVARWIDTH, "auprovid", "%06lX\n", rdr->auprovid); 2506 else if (cfg.http_full_cfg) 2507 fprintf_conf(f, CONFVARWIDTH, "auprovid", "\n"); 2498 2508 2499 2509 if ((rdr->ndsversion || cfg.http_full_cfg) && isphysical) … … 3191 3201 3192 3202 if (!strcmp(token, "key")) { 3193 if (key_atob_l(value, rdr->ncd_key, 28)) { 3203 if (strlen(value) == 0){ 3204 return; 3205 } else if (key_atob_l(value, rdr->ncd_key, 28)) { 3194 3206 fprintf(stderr, "Configuration newcamd: Error in Key\n"); 3195 exit(1);3196 3207 } 3197 3208 return; … … 3321 3332 3322 3333 if (!strcmp(token, "pincode")) { 3323 strncpy(rdr->pincode, value, sizeof(rdr->pincode) - 1);3334 cs_strncpy(rdr->pincode, value, sizeof(rdr->pincode)); 3324 3335 return; 3325 3336 }
Note:
See TracChangeset
for help on using the changeset viewer.