You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/11/20 19:20:15 UTC

[GitHub] [lucene] rmuir opened a new issue, #11957: false warning around 'gitStatus' on newish macos X

rmuir opened a new issue, #11957:
URL: https://github.com/apache/lucene/issues/11957

   ### Description
   
   When I run builds on mac, I see:
   ```
   > Task :gitStatus
   Cannot run program "/usr/bin/git" (in directory "/usr/bin"): error=2, No such file or directory
   ```
   
   But the error is actually harmless. `checkWorkingCopy` etc work as you expect. It just confuses me...
   
   The jgit does pretty crazy stuff on macos hosts, and I think the issues are there? On my mac `/usr/bin/git` is indeed git and not some xcode wrapper.
   
   See logic in https://git.eclipse.org/c/jgit/jgit.git/tree/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java#n145
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss closed issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
dweiss closed issue #11957: false warning around 'gitStatus' on newish macos X
URL: https://github.com/apache/lucene/issues/11957


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
rmuir commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1322092882

   i'll help dawid and fix the unix side by setting the env var. we can clear it up right now, we don't need to push this to our downstream users. 
   
   as far as upstream, no need to waste time arguing with them / waiting on new release. we can fix it now. you can report it if you like... i'm not really sure it is a security issue vs just a case of stupidity, but i'm not gonna wait on resolution of that. we don't need special git functionality impacted by config files.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] uschindler commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
uschindler commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1322106594

   > It is different if there is a real risk to some user.
   
   Let me try to trick jenkins to print /etc/passwd when checking out something with jgit.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
dweiss commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1321715665

   Windows part at: #11959


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
rmuir commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1321256630

   i tried it out, `GIT_CONFIG_NOSYSTEM=1 ./gradlew gitStatus` no longer prints the confusing error.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] uschindler commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
uschindler commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1322084003

   But without that export and the env var, this oculd still be a security issue, as Dawid showed. I just think this should be fixed downstream and it should not fork processes by default.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
rmuir commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1321248831

   good find, thank you


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
rmuir commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1322079238

   well for us there is no concern of anything, we don't need to suck in any fancy git configuration for the minimal way we use this jgit (simply checking the status)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
dweiss commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1322354312

   Sorry for the delay - thanks for testing, Robert. The reason jgit does this is, I believe, to extract user-specific git options so that jgit and git behave the same (for example per-user settings for eols, etc.). At least that was my impression from looking at method names in FS class that does it. 
   
   I don't think this matters to us at all.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
dweiss commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1321223132

   Perhaps we should upgrade jgit first? scriptDepVersions.gradle, the latest one is 6.3.0.202209071007, https://repo1.maven.org/maven2/org/eclipse/jgit/org.eclipse.jgit/6.3.0.202209071007-r/
   
   I'm surprised it searches for native git... wasn't it supposed to be pure java?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] uschindler commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
uschindler commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1322097248

   I was not against fixing it here. But as a good open source citizen we should at least report this. If we declare it as security issue (e.g., it could affect Jenkin's git plugin executing code), I have more pressure at hand.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
rmuir commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1322043978

   we should `export` on its own line, if thats how other env vars are working?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
dweiss commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1321226220

   I looked at the source and the only reason it tries to locate system git is to find out where its config files are. It's actually configurable via:
   ```
   	/**
   	 * The environment variable that blocks use of the system config file
   	 *
   	 * @since 3.3
   	 */
   	public static final String GIT_CONFIG_NOSYSTEM_KEY = "GIT_CONFIG_NOSYSTEM";
    ```
   
   So maybe we can just switch it off this way? I don't think it'll make a difference for us.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
dweiss commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1321712405

   Should we do:
   ```
   GIT_CONFIG_NOSYSTEM=1 exec "$JAVACMD" "$@"
   ```
   or a separate set/export above?
   
   I am a bit concerned by the amount of customizations that go into those gradlew scripts, eh.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] dweiss commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
dweiss commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1321229903

   Yeah... it's absolutely terrible that jgit blindly forks jgit off the path. I just made the Lucene build open a file editor by renaming it to git.exe...
   
   I think we should just set the GIT_CONFIG_NOSYSTEM env. variable in gradlew launch scripts. Dumb.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] uschindler commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
uschindler commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1322059176

   Hi,
   
   > Yeah... it's absolutely terrible that jgit blindly forks git off the path. I just made the Lucene build open a file editor by renaming it to git.exe...
   
   I think this is a security issue in jgit? It should not do this. I thinkw e should open an issue. I have the feeling the whole issue is around atomic file modifications (according to their code comments). The code in JGit still uses old `java.io.File`, so I have the feeling when they update to `java.nio.files` (Java 7), all should be fine and native Git access is not needed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene] rmuir commented on issue #11957: false warning around 'gitStatus' on newish macos X

Posted by GitBox <gi...@apache.org>.
rmuir commented on issue #11957:
URL: https://github.com/apache/lucene/issues/11957#issuecomment-1322103222

   i know, but i hate how "security" gets abused for purposes like that.
   
   It is different if there is a real risk to some user.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org