In the standard library for ecliptic curve cryptography one of the C source files has the executable bit set, qv:

enter image description here

As you can see there are multiple C files, but only the secp2561k1.c file is executable. This is just as I downloaded it. Why would just this one source code file have its execute bits set?

  • 1
    Just a guess, I’d say it’s accidental. – Stephen Kitt Mar 17 '17 at 14:12
  • @StephenKitt If this was an obscure piece of code from somebody's personal project I would buy that, but this is a major library used by a lot of people for mission-critical purposes. – Tyler Durden Mar 17 '17 at 14:26
  • 1
    Even for a major library, the release process in many, many cases is just tar czf in the developer's directory (perhaps codified as make dist). – Stephen Kitt Mar 17 '17 at 14:29
  • @StephenKitt Yes, that seems logical, also see Chazelas' comment to the answer below. – Tyler Durden Mar 17 '17 at 15:15

There is no reason for a C source file to be executable. This may sometimes happen if the file has been transferred from or through a non-Unix operating system.

You may safely remove the execute bit if you wish:

$ chmod a-x secp256k1.c
  • There are two other C files in the same directory. Why would just this one particular file have the execute bit set? The file is marked as executable in the repository. – Tyler Durden Mar 17 '17 at 14:19
  • 1
    @TylerDurden It's most likely just by accident. If you really want to go to the bottom with it, then contact the original authors. – Kusalananda Mar 17 '17 at 14:26
  • 3
    The x bit was added (for that file and another one) in that commit. Most probably an accident like the working copy was on a NTFS file system mounted on a Unix-like system... – Stéphane Chazelas Mar 17 '17 at 14:40
  • 1
    The 2 only commits by that user do add x bits, so it's just a case of that user having an issue with their working copy. It's not a big issue. Just looks untidy – Stéphane Chazelas Mar 17 '17 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.