Changeset 248 for trunk/src/sh_gpg.c


Ignore:
Timestamp:
Sep 21, 2009, 8:23:56 PM (15 years ago)
Author:
katerina
Message:

Code to track down originating site for ticket #163.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sh_gpg.c

    r247 r248  
    270270  char        pname[128];
    271271  int         pfd;
     272  int         val_return;
    272273#endif
    273274#endif
     
    534535       */
    535536#if defined(WITH_PGP)
    536       checkfd = sl_open_read(DEFAULT_PGP_PATH, SL_NOPRIV);
    537 #else
    538       checkfd = sl_open_read(DEFAULT_GPG_PATH, SL_NOPRIV);
     537      checkfd = sl_open_read(FIL__, __LINE__, DEFAULT_PGP_PATH, SL_NOPRIV);
     538#else
     539      checkfd = sl_open_read(FIL__, __LINE__, DEFAULT_GPG_PATH, SL_NOPRIV);
    539540#endif
    540541
    541542      if (0 != sh_gpg_checksum(checkfd, 0))
    542         aud__exit(FIL__, __LINE__, EXIT_FAILURE);
     543        {
     544          sl_close(checkfd);
     545          aud__exit(FIL__, __LINE__, EXIT_FAILURE);
     546        }
    543547
    544548      pfd = get_the_fd(checkfd);
     549      do {
     550        val_return = dup (pfd);
     551      } while (val_return < 0 && errno == EINTR);
     552      pfd = val_return;
     553      sl_close(checkfd);
     554      checkfd = -1;
     555
    545556      sl_snprintf(pname, sizeof(pname), _("/proc/self/fd/%d"), pfd);
    546557      if (0 == access(pname, R_OK|X_OK))               /* flawfinder: ignore */
     
    559570      /* procfs not working, go ahead
    560571       */
    561       sl_close(checkfd);
    562       checkfd = -1;
    563572#endif
    564573
     
    576585        {
    577586#if defined(WITH_PGP)
    578           checkfd = sl_open_fastread(DEFAULT_PGP_PATH, SL_NOPRIV);
    579 #else
    580           checkfd = sl_open_fastread(DEFAULT_GPG_PATH, SL_NOPRIV);
     587          checkfd = sl_open_fastread(FIL__, __LINE__, DEFAULT_PGP_PATH, SL_NOPRIV);
     588#else
     589          checkfd = sl_open_fastread(FIL__, __LINE__, DEFAULT_GPG_PATH, SL_NOPRIV);
    581590#endif
    582591          if (0 != sh_gpg_checksum(checkfd, 0)) {
     
    685694
    686695#ifdef HAVE_GPG_CHECKSUM
    687   checkfd = sl_open_read(DEFAULT_GPG_PATH, SL_YESPRIV);
     696  checkfd = sl_open_read(FIL__, __LINE__, DEFAULT_GPG_PATH, SL_YESPRIV);
    688697
    689698  if (0 != sh_gpg_checksum(checkfd, 1))
     
    716725
    717726#ifdef HAVE_GPG_CHECKSUM
    718   checkfd = sl_open_read(DEFAULT_PGP_PATH, SL_YESPRIV);
     727  checkfd = sl_open_read(FIL__, __LINE__, DEFAULT_PGP_PATH, SL_YESPRIV);
    719728
    720729  if (0 != sh_gpg_checksum(checkfd, 1))
Note: See TracChangeset for help on using the changeset viewer.