Skip to content
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

Update Jetty lib-setuid for Jetty 12 #10279

Closed
joakime opened this issue Aug 9, 2023 · 12 comments · Fixed by #10406
Closed

Update Jetty lib-setuid for Jetty 12 #10279

joakime opened this issue Aug 9, 2023 · 12 comments · Fixed by #10406
Assignees
Labels
Bug For general bugs on Jetty side
Milestone

Comments

@joakime
Copy link
Contributor

joakime commented Aug 9, 2023

Jetty version(s)
12.0.0

Java version/vendor (use: java -version)
17

OS type/version
Linux

Description
The lib-setuid 1.0.4 is incompatible with Jetty 12.

We need to update lib-setuid to support Jetty 12.

@joakime joakime added the Bug For general bugs on Jetty side label Aug 9, 2023
@joakime joakime added this to the 12.0.x milestone Aug 9, 2023
@joakime joakime self-assigned this Aug 9, 2023
@joakime
Copy link
Contributor Author

joakime commented Aug 9, 2023

A new Jetty lib-setuid 2.0.0-SNAPSHOT has been released, so a PR on this project can begin.

@scantor
Copy link

scantor commented Aug 9, 2023

If I have a chance to, I might take a stab and will submit a PR if I do.

@joakime
Copy link
Contributor Author

joakime commented Aug 9, 2023

PR is incoming already, stand by.

@joakime
Copy link
Contributor Author

joakime commented Aug 9, 2023

Opened PR #10280

@joakime joakime linked a pull request Aug 9, 2023 that will close this issue
@jmcc0nn3ll
Copy link
Contributor

@scantor Since you are bundling this, which environments do you support for setuid? We have historically provided a linux(x86) and osx library, we had sunos and some windows ones in the past as well. At this point we are just resurrecting the linux one for Jetty 12 but open to feedback on others.

@scantor
Copy link

scantor commented Aug 9, 2023

Mostly it's a "me" thing, on Linux, though we do mention it in our examples for using Jetty to run Shibboleth and I have always noted that I thought it was the simplest option overall. Most people these days do the proxying thing so they don't care much about it, either through a load balancer or Apache. I just have an allergy to layer 7 proxying and haven't needed to go that route.

In an official capacity, we don't really support MacOS and definitely not any other Unix, and we only bundle on Windows, not Linux. We document Linux heavily and recommend Jetty there, but that's all to this point.

Windows doesn't have the port restriction, though I wasn't aware there was really anything like this for Windows at all. We have continually struggled with procrun to service-ize the Jetty process and haven't found any better options, I'd be curious to know what you meant exactly by "some windows ones".

@joakime
Copy link
Contributor Author

joakime commented Aug 9, 2023

I'd be curious to know what you meant exactly by "some windows ones".

Back in the days of Jetty 6 we had some builds for dos & windows & windows-95
https://github.com/jetty-project/codehaus-jetty6/tree/master/extras/setuid (see pom)

@lorban
Copy link
Contributor

lorban commented Aug 25, 2023

Reminder: we need to consider jetty/jetty-toolchain#278 as an alternative.

@joakime
Copy link
Contributor Author

joakime commented Aug 28, 2023

PR #10406 merged.

@joakime joakime closed this as completed Aug 28, 2023
@joakime joakime linked a pull request Aug 28, 2023 that will close this issue
@scantor
Copy link

scantor commented Mar 26, 2024

I noted this is closed, but so far as I can tell, it's not bundled with Jetty 12. Is it dead after all, or published separately, or just available as source for those who want it?

@joakime
Copy link
Contributor Author

joakime commented Mar 26, 2024

There are no longer libs for setuid, it's all JNA based now..

But if you install the setuid module or use start.jar --create-files you'll get the most recent version of the JNA module from maven central (or your local repository)

[bases]$ mkdir setuid-example
[bases]$ cd setuid-example/
[setuid-example]$ java -jar ../../jetty-home-12.0.7/start.jar --add-module=setuid
INFO  : mkdir ${jetty.base}/start.d
INFO  : server          transitively enabled, ini template available with --add-modules=server
INFO  : logging-jetty   transitively enabled
INFO  : resources       transitively enabled
INFO  : setuid          initialized in ${jetty.base}/start.d/setuid.ini
INFO  : threadpool      transitively enabled, ini template available with --add-modules=threadpool
INFO  : logging/slf4j   dynamic dependency of logging-jetty
INFO  : bytebufferpool  transitively enabled, ini template available with --add-modules=bytebufferpool
INFO  : mkdir ${jetty.base}/resources
INFO  : copy ${jetty.home}/modules/logging/jetty/resources/jetty-logging.properties to ${jetty.base}/resources/jetty-logging.properties
INFO  : mkdir ${jetty.base}/lib/setuid
INFO  : copy /home/joakim/.m2/repository/org/eclipse/jetty/toolchain/setuid/jetty-setuid-jna/2.0.2/jetty-setuid-jna-2.0.2.jar to ${jetty.base}/lib/setuid/jetty-setuid-jna-2.0.2.jar
INFO  : copy /home/joakim/.m2/repository/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar to ${jetty.base}/lib/setuid/jna-5.13.0.jar
INFO  : Base directory was modified
[setuid-example]$ tree -F
./
├── lib/
│   └── setuid/
│       ├── jetty-setuid-jna-2.0.2.jar
│       └── jna-5.13.0.jar
├── resources/
│   └── jetty-logging.properties
└── start.d/
    └── setuid.ini

4 directories, 4 files

Example (with --create-files)

[setuid-example]$ rm -rf lib
[setuid-example]$ tree -F
./
├── resources/
│   └── jetty-logging.properties
└── start.d/
    └── setuid.ini

2 directories, 2 files
[setuid-example]$ java -jar ../../jetty-home-12.0.7/start.jar --create-files
INFO  : mkdir ${jetty.base}/lib/setuid
INFO  : copy /home/joakim/.m2/repository/org/eclipse/jetty/toolchain/setuid/jetty-setuid-jna/2.0.2/jetty-setuid-jna-2.0.2.jar to ${jetty.base}/lib/setuid/jetty-setuid-jna-2.0.2.jar
INFO  : copy /home/joakim/.m2/repository/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar to ${jetty.base}/lib/setuid/jna-5.13.0.jar
INFO  : Base directory was modified
[setuid-example]$ tree -F
./
├── lib/
│   └── setuid/
│       ├── jetty-setuid-jna-2.0.2.jar
│       └── jna-5.13.0.jar
├── resources/
│   └── jetty-logging.properties
└── start.d/
    └── setuid.ini

4 directories, 4 files

@sbordet
Copy link
Contributor

sbordet commented Mar 28, 2024

@joakime is this documented? If not, please open an issue about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
5 participants