source: packages/net/quagga-unstable/patches/150-no-cross-fs-link.patch @ 19137

Last change on this file since 19137 was 19137, checked in by jow, 7 years ago

[packages] quagga-unstable: fix mini_fo assertion triggered by cross-fs link() (#5960)

File size: 1.1 KB
  • lib/command.c

    a b  
    26012601                 VTY_NEWLINE); 
    26022602        goto finished; 
    26032603      } 
     2604 
     2605#if 0 
     2606  /* This code fails on UNION MOUNTs and similar filesystems if the 
     2607   * config file is still on the RO layer. Hardlinks across layers 
     2608   * will not work and cause quagga to fail saving the configuration... 
     2609   * should use rename() to move files around... 
     2610   */ 
    26042611  if (link (config_file, config_file_sav) != 0) 
    26052612    { 
    26062613      vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav, 
     
    26142621                VTY_NEWLINE); 
    26152622      goto finished; 
    26162623    } 
     2624#else 
     2625  /* And this is the code that hopefully does work */ 
     2626  if (rename (config_file, config_file_sav) != 0) 
     2627    { 
     2628      vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav, 
     2629                VTY_NEWLINE); 
     2630      goto finished; 
     2631    } 
     2632  sync (); 
     2633#endif 
     2634 
     2635#if 0 
     2636  /* same here. Please no cross-filesystem hardlinks... */ 
    26172637  if (link (config_file_tmp, config_file) != 0) 
     2638#else 
     2639  if (rename (config_file_tmp, config_file) != 0) 
     2640#endif 
    26182641    { 
    26192642      vty_out (vty, "Can't save configuration file %s.%s", config_file, 
    26202643               VTY_NEWLINE); 
Note: See TracBrowser for help on using the repository browser.