Uploaded image for project: 'SWORD'
  1. SWORD
  2. API-87

Compilation fails with latest glibc

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.90
    • Fix Version/s: None
    • Component/s: Make build system
    • Labels:
      None
    • Environment:

      Linux (Fedora -devel)

      Description

      Latest glibc (as packaged for upcoming Fedora 8) now performs a sanity check on open syscalls; codes that use 'open' without properly specifying the mode now fails at compile time. sword (1.5.9) fails in 2 separate places because of this, the attached patch fixes the issue.

      — utilities/cipherraw.cpp 2005-05-02 23:49:04.000000000 -0400
      +++ utilities/cipherraw.cpp.new 2007-09-25 18:14:16.000000000 -0400
      @@ -45,13 +45,13 @@

      tmpbuf = new char [ strlen(argv[1]) + 11 ];
      sprintf(tmpbuf, "%sot.zzz", argv[1]);

      • ofd[0] = open(tmpbuf, O_WRONLY|O_BINARY|O_CREAT);
        + ofd[0] = open(tmpbuf, O_WRONLY|O_BINARY|O_CREAT, 0600);
        sprintf(tmpbuf, "%sot.zzz.vss", argv[1]);
      • oxfd[0] = open(tmpbuf, O_WRONLY|O_BINARY|O_CREAT);
        + oxfd[0] = open(tmpbuf, O_WRONLY|O_BINARY|O_CREAT, 0600);
        sprintf(tmpbuf, "%snt.zzz", argv[1]);
      • ofd[1] = open(tmpbuf, O_WRONLY|O_BINARY|O_CREAT);
        + ofd[1] = open(tmpbuf, O_WRONLY|O_BINARY|O_CREAT, 0600);
        sprintf(tmpbuf, "%snt.zzz.vss", argv[1]);
      • oxfd[1] = open(tmpbuf, O_WRONLY|O_BINARY|O_CREAT);
        + oxfd[1] = open(tmpbuf, O_WRONLY|O_BINARY|O_CREAT, 0600);

      delete [] tmpbuf;

      — utilities/gbfidx.cpp 2007-09-25 18:12:44.000000000 -0400
      +++ utilities/gbfidx.cpp.new 2007-09-25 18:13:04.000000000 -0400
      @@ -258,25 +258,25 @@
      #endif // don't need it.
      char buf[255];

      • if ((fp = open(fname, O_RDONLY|O_BINARY)) == -1) {
        + if ((fp = open(fname, O_RDONLY|O_BINARY, 0600)) == -1) { fprintf(stderr, "Couldn't open file: %s\n", fname); exit(1); }

      sprintf(buf, "%s.vss", fname);

      • if ((vfp = open(buf, O_CREAT|O_WRONLY|O_BINARY)) == -1) {
        + if ((vfp = open(buf, O_CREAT|O_WRONLY|O_BINARY, 0600)) == -1) { fprintf(stderr, "Couldn't open file: %s\n", buf); exit(1); }

      sprintf(buf, "%s.cps", fname);

      • if ((cfp = open(buf, O_CREAT|O_WRONLY|O_BINARY)) == -1) {
        + if ((cfp = open(buf, O_CREAT|O_WRONLY|O_BINARY, 0600)) == -1) { fprintf(stderr, "Couldn't open file: %s\n", buf); exit(1); }

      sprintf(buf, "%s.bks", fname);

      • if ((bfp = open(buf, O_CREAT|O_WRONLY|O_BINARY)) == -1) {
        + if ((bfp = open(buf, O_CREAT|O_WRONLY|O_BINARY, 0600)) == -1) { fprintf(stderr, "Couldn't open file: %s\n", buf); exit(1); }

        Attachments

          Activity

            People

            • Assignee:
              scribe Troy A Griffitts
              Reporter:
              deji Deji Akingunola
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: