8000 KEYCLOAK-4563: Large user account ID and group ID may break distribut… by glavoie · Pull Request #3936 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

KEYCLOAK-4563: Large user account ID and group ID may break distribut… #3936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 7, 2017
Merged

KEYCLOAK-4563: Large user account ID and group ID may break distribut… #3936

merged 2 commits into from
Apr 7, 2017

Conversation

glavoie
Copy link
Contributor
@glavoie glavoie commented Mar 10, 2017
  • Maven documentation recommends using POSIX tar format.

In my case, this is an environmental issue caused by macOS computer being connected to an Active Directory domain. I don't have the control on the UID/GID used for my user account.

@mstruk
Copy link
Contributor
mstruk commented Mar 13, 2017

I'd suggest that a better way to do this would be to not set tarLongFileMode on every occurrence of assembly plugin, but rather remove it from those where it's already present, and add the following into plug 8000 inManagement section of parent pom (the pom.xml in project root):

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
            <tarLongFileMode>posix</tarLongFileMode>
        </configuration>
    </plugin>

@glavoie
Copy link
Contributor Author
glavoie commented Mar 13, 2017

Sure! I wasn't sure of how to do it globally. I'll submit a new version shortly.

…ion builds.

- Maven documentation recommends using POSIX tar format.
@glavoie
Copy link
Contributor Author
glavoie commented Mar 13, 2017

Just updated the PR with the suggested change.

@stianst
Copy link
Contributor
stianst commented Mar 14, 2017

I'm not convinced about this. The general recommendations seems to be to use the gnu format and I'm concerned this will fix your issue, but break for others.

Sorry, something went wrong.

@mstruk
Copy link
Contributor
mstruk commented Mar 14, 2017

To better inform any decision ... I also looked at it a bit ... Here is the section 8.3.7 from GNU tar manual.

I understand this to mean that from version 1.14 the gnu tar will unpack tar files in posix format without any need for any extra options. I'd expect any system with java on it to have a version of tar newer than that (version 1.14 was released in 2004).

@mstruk
Copy link
Contributor
mstruk commented Mar 14, 2017

Additionally, it seems that LONGFILE_GNU option in apache commons tar package is less portable than posix option according to 'Long File Names' section here.

@stianst
Copy link
Contributor
stianst commented Mar 14, 2017

How about other archive tools? I did a little browse on Github to see what others use and WildFly, Infinispan as well as a few Apache projects seems to be using GNU and not POSIX.

@stianst stianst self-assigned this Mar 14, 2017
@glavoie
Copy link
Contributor Author
glavoie commented Mar 14, 2017

Googling the error message always seem to point to MacOS users, potentially linked to ActiveDirectory. I'm sure the error could also occur on Linux if UID/GID were to be too large.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.5.5:single (assemble) on project keycloak-as7-adapter-dist: Execution assemble of goal org.apache.maven.plugins:maven-assembly-plugin:2.5.5:single failed: group id '1316617920' is too big ( > 2097151 ). Use STAR or POSIX extensions to overcome this limit -> [Help 1]

My guess is that a correct solution would be to force the UID/GID in the generated archive (to 0/0), rather than use the ones from the filesystem. While the "tar" command supports that, unfortunately the Maven archive plugin doesn't have any option for it.

In all cases I've found, they point to the tarLongFileMode=posix. Any reason to stick to GNU format? POSIX format has been there since 2001 and should likely be handled by most if not all archive tools outside of the Linux world: https://en.wikipedia.org/wiki/Tar_(computing)#POSIX.1-2001.2Fpax

Again, I'm not sure why the Maven project only added a FAQ and don't change the default format... Most tickets to the project get closed with a reference to that flag and the FAQ: https://issues.apache.org/jira/browse/MASSEMBLY-728

@glavoie
Copy link
Contributor Author
glavoie commented Mar 14, 2017

I tried unpacking the server distribution generated with the POSIX file format using 7-zip on Windows and I do encounter issues I don't see with the official distribution TGZ file. A long path doesn't get unpacked correctly (missing and renamed folder/files).

From experience, 7-zip doesn't have a very good track record with TAR files and I would guess that the official archive to use for Windows would be the ZIP archive?

Using GNU tar on Cygwin works flawlessly with the POSIX file.

@stianst
Copy link
Contributor
stianst commented Apr 7, 2017

I'm going to merge this, but if we get issues reported we may change it back to gnu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0