Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Blinken on March 17, 2017, 02:48:22 PM



Title: Why is secp256k1.c executable?
Post by: Blinken on March 17, 2017, 02:48:22 PM
In the bitcoin core, the critical secp256k1.c file is marked as executable (see https://github.com/bitcoin-core/secp256k1/blob/master/src/secp256k1.c)

Is this just a screw up or is there a valid reason for this?

The change appears to have been made by Peter Dettman. (see https://github.com/peterdettman/secp256k1/commit/0f9e69db555ea35b90f49fa48925c366261452ec)


Title: Re: Why is secp256k1.c executable?
Post by: achow101 on March 17, 2017, 03:19:33 PM
What do you mean "marked as executable"? What is marking it as an executable? What is telling you that? The file is a text file, it can't be executable.


Title: Re: Why is secp256k1.c executable?
Post by: Blinken on March 17, 2017, 03:43:34 PM
In the unix operating system, there is a "file permission" system that allows files to be marked as "executable" by either the file owner, the owner's group or everyone.

The git version control system supports preservation and propagation of that system and stores changes and state of each files unix-like permissions.

The current revision of secp256k1.c is marked as having executable permissions on the owner, group and everyone levels. This can be clearly seen in the system header of the originally linked github page. The commit where this change was made to the file was also linked.


Title: Re: Why is secp256k1.c executable?
Post by: achow101 on March 17, 2017, 03:51:26 PM
The current revision of secp256k1.c is marked as having executable permissions on the owner, group and everyone levels. This can be clearly seen in the system header of the originally linked github page. The commit where this change was made to the file was also linked.
Ah. I see it now. It's probably just a mistake/oversight from one of the contributors. There isn't anything in the file that can be executed as is.


Title: Re: Why is secp256k1.c executable?
Post by: peterdettman on March 18, 2017, 06:35:53 AM
Quote
The change appears to have been made by Peter Dettman.

Please note that I was not the commit author, I merely pulled it into my fork, as should have been clear from the github link. In any case, it appears there is now a PR to fix it: https://github.com/bitcoin-core/secp256k1/pull/449 (https://github.com/bitcoin-core/secp256k1/pull/449) .