ontodev / droid

DROID Reminds us that Ordinary Individuals can be Developers
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Allow CGI "scripts" to be binaries #132

Closed jamesaoverton closed 1 year ago

jamesaoverton commented 1 year ago

At https://github.com/ontodev/droid/blob/master/src/droid/html.clj#L1931 we look into the CGI script for a #! and refuse to execute if we don't find it. That was by design, but now I'm reconsidering. Now I'd like to run an executable binary, and drop that check.

@lmcmicu What do you think? Am I forgetting a reason for checking for the #!?

lmcmicu commented 1 year ago

I need some time to think about this. I seem to recall that we needed this to be able to distinguish executable "views" from the other types of view (directory and file views) that DROID needs to handle. DROID handles them all differently and needs to know which is which. There may be another reason but I'm not sure.

I think I would make this change very carefully as I worry it will break things.

lmcmicu commented 1 year ago

What I said in my last comment was incorrect. Actually it is the leading ./ that DROID uses to distinguish executable from other views

Regarding the #!, I am now a little less worried about removing the check, but I still would like to think about it.

jamesaoverton commented 1 year ago

The simple workaround is to create a trivial wrapper script that calls the binary, which is fine for now, but it would be better not to need a wrapper.

lmcmicu commented 1 year ago

As far as I can tell, there is no reason internal to DROID for requiring executables to be scripts beginning with #!. My guess is that the reason was just paranoia, though I'm not completely sure. There doesn't seem to be any reason in principle why we shouldn't allow it. On my own workstation I've commented out the block of code that begins at line 1932 of html.clj and everything is working fine.