Changeset 212 for trunk/src/sh_hash.c


Ignore:
Timestamp:
Feb 17, 2009, 10:37:42 PM (16 years ago)
Author:
katerina
Message:

Lock baseline database (ticket #139) and allow list as input for PortCheckInterface (ticket #140).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_hash.c

    r210 r212  
    15521552              sh_error_handle((-1), FIL__, __LINE__, pushdata_fd, MSG_E_ACCESS,
    15531553                              geteuid(), file_path('D', 'W'));
    1554               SL_RET0(_("sh_hash_pushdata_int"));
     1554              aud_exit(FIL__, __LINE__, EXIT_FAILURE);
    15551555            }
     1556
     1557          if (SL_ISERROR(status = sl_lock (pushdata_fd)))
     1558            {
     1559              SH_FREE(fullpath);
     1560              SH_FREE(linkpath);
     1561              sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGPATH,
     1562                              _("Failed to lock baseline database"), _("sh_hash_pushdata_int"),
     1563                              file_path('D', 'W'));
     1564              aud_exit(FIL__, __LINE__, EXIT_FAILURE);
     1565            }
     1566
    15561567          if ( SL_ISERROR(status = sl_forward(pushdata_fd)))
    15571568            {
     
    15591570              SH_FREE(linkpath);
    15601571              sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGPATH,
    1561                               _("Fast forward failed"), _("sh_hash_pushdata_int"),
     1572                              _("Failed to seek to end of baseline database"), _("sh_hash_pushdata_int"),
    15621573                              file_path('D', 'W'));
    1563               SL_RET0(_("sh_hash_pushdata_int"));
     1574              aud_exit(FIL__, __LINE__, EXIT_FAILURE);
    15641575            }
    15651576        }
     
    15701581        {
    15711582          TPT((0, FIL__, __LINE__, _("msg=<Update.>\n")))
    1572           if ( SL_ISERROR(pushdata_fd = sl_open_rdwr(file_path('D', 'W'), SL_YESPRIV))){
    1573             SH_FREE(fullpath);
    1574             SH_FREE(linkpath);
    1575             sh_error_handle((-1), FIL__, __LINE__, pushdata_fd, MSG_E_ACCESS,
    1576                             geteuid(), file_path('D', 'W'));
    1577             SL_RET0(_("sh_hash_pushdata_int"));
    1578           }
     1583            if ( SL_ISERROR(pushdata_fd = sl_open_rdwr(file_path('D', 'W'), SL_YESPRIV))){
     1584              SH_FREE(fullpath);
     1585              SH_FREE(linkpath);
     1586              sh_error_handle((-1), FIL__, __LINE__, pushdata_fd, MSG_E_ACCESS,
     1587                              geteuid(), file_path('D', 'W'));
     1588              aud_exit(FIL__, __LINE__, EXIT_FAILURE);
     1589            }
     1590
     1591          if (SL_ISERROR(status = sl_lock (pushdata_fd)))
     1592            {
     1593              SH_FREE(fullpath);
     1594              SH_FREE(linkpath);
     1595              sh_error_handle((-1), FIL__, __LINE__, status, MSG_E_SUBGPATH,
     1596                              _("Failed to lock baseline database"), _("sh_hash_pushdata_int"),
     1597                              file_path('D', 'W'));
     1598              aud_exit(FIL__, __LINE__, EXIT_FAILURE);
     1599            }
     1600
    15791601          line = SH_ALLOC(MAX_PATH_STORE+1);
    15801602          if (SL_ISERROR(sh_hash_setdataent_old (pushdata_fd, line,
     
    15851607              SH_FREE(linkpath);
    15861608              SH_FREE(line);
    1587               SL_RET0(_("sh_hash_pushdata_int"));
     1609              aud_exit(FIL__, __LINE__, EXIT_FAILURE);
    15881610            }
    15891611          SH_FREE(line);
Note: See TracChangeset for help on using the changeset viewer.