2

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?

4
  • 1
    Just a guess, I’d say it’s accidental. Mar 17, 2017 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. Mar 17, 2017 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). Mar 17, 2017 at 14:29
  • @StephenKitt Yes, that seems logical, also see Chazelas' comment to the answer below. Mar 17, 2017 at 15:15

1 Answer 1

6

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
4
  • 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. Mar 17, 2017 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, 2017 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... Mar 17, 2017 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 Mar 17, 2017 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .