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

kerberos_server: allow choosing MIT or Heimdal #31832

Merged
merged 10 commits into from Dec 11, 2018
Merged

Conversation

kwohlfahrt
Copy link
Contributor

@kwohlfahrt kwohlfahrt commented Nov 19, 2017

Motivation for this change

Allow using MIT Kerberos as a kerberos server, and add some initial configuration. Related to #29623.

This is my first PR, let me know if anything is not suitable.

As far as I can tell the upstream kerberos_server service was broken, as it expected binaries to be in sbin while they were in bin (see ab6c57e). There were previously no tests, this adds some basic smoke tests.

I'm happy to add more configurable options, I've so far just configured what I'm familiar with. In theory it should be possible to serve multiple realms from one server, but I don't need this and haven't been able to get it to work easily so it's not part of this PR.

Adding the usual set of plain-text configuration is difficult, as MIT and Heimdal take slightly different formats of options.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@joachifm
Copy link
Contributor

@GrahamcOfBorg test kerberos.mit kerberos.heimdal

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Partial log (click to expand)

�[31;1merror:�[0m attribute 'kerberos' in selection path 'tests.kerberos.mit' not found

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Partial log (click to expand)

error: attribute 'kerberos' in selection path 'tests.kerberos.mit' not found

@kwohlfahrt
Copy link
Contributor Author

@joachifm are there any specific changes you'd like me to make? Tests pass for me locally, and CI seems happy now.

As of 13e6a5c all user binaries (kinit, kadmin, etc) are installed with krb5Full.dev. This is a little counter-intuitive to me, especially since the commit only mentions moving headers. @vcunat as you are the author of that commit, should these binaries be moved to the default output?

@vcunat
Copy link
Member

vcunat commented Feb 26, 2018

I think the point here was krb5-config, as that needs to keep reference to the headers. I was focused on the case of type == "lib".

@kwohlfahrt
Copy link
Contributor Author

That makes sense - I will move the other programs back to the default output then unless there is an objection? Should there be separate 'bin' and 'lib' or 'out' and 'lib' outputs or should these go together?

@vcunat
Copy link
Member

vcunat commented Feb 28, 2018

The type == "lib" has almost nothing there, and for the other cases it's probably not important whether they're together or not.

@eqyiel
Copy link
Contributor

eqyiel commented Feb 28, 2018

@kwohlfahrt thanks for making an effort to fix this.

I had some similar changes in mind that I never got around to finishing: eqyiel@4114381

I'll probably try to apply it on top of your changes at some point 😸

@matthewbauer
Copy link
Member

Looks okay to me. Any objections to merging?

@matthewbauer
Copy link
Member

matthewbauer commented Apr 21, 2018

@GrahamcOfBorg test kerberos

@NixOS NixOS deleted a comment from GrahamcOfBorg Apr 21, 2018
@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: tests.kerberos

Partial log (click to expand)

Cannot nix-instantiate `tests.kerberos' because:
�[31;1merror:�[0m attribute 'kerberos' in selection path 'tests.kerberos' not found

Copy link
Member

@matthewbauer matthewbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but we cannot test it until tests.kerberos is in release.nix

@kwohlfahrt
Copy link
Contributor Author

kwohlfahrt commented Jul 18, 2018

@peterhoeg this is building locally now, but Graham has an error that "target branch staging doesn't evaluate" - should I be targeting a different branch?

EDIT: All I did was rebase onto the latest staging. That fixed the libdrm issue in a local build.

@peterhoeg
Copy link
Member

Thanks for doing all this hard work!

The staging part is probably due to the change to pkgs/development/libraries/kerberos/krb5.nix as I am assuming this will cause a significant amount of rebuilding.

I will not be able to review this in detail in the near future - the arrival of our twins is imminent now so I'm hoping @vcunat or @FRidh (or others) will be able to dedicate the time this PR deserves.

@kwohlfahrt
Copy link
Contributor Author

This is now rebased, and tests pass locally.

@peterhoeg congratulations!

Kai Wohlfahrt and others added 10 commits December 11, 2018 13:33
tcpd doesn't have sbin anymore (so it was broken), and heimdal just symlinks to
bin.
Don't use socket activation, as inetd is discouraged by heimdal documentation.
General cleanup before adding more options.
script causes problems for forking services like MIT Kerberos.
Allow switching out kerberos server implementation.

Sharing config is probably sensible, but implementation is different enough to
be worth splitting into two files. Not sure this is the correct way to split an
implementation, but it works for now.

Uses the switch from config.krb5 to select implementation.
Could also move kdc.conf, but this makes it inconvenient to use command line
utilities with heimdal, as it would require specifying --config-file with every
command.
Leave options for multiple realms for similarity to krb5, and future
expansion. Currently not tested because I can't make it work and don't need
it.
This contains all of the user binaries as of 13e6a5c.
The intention of the previous change was to move krb5-config to .dev (it
gives the locations of headers), but it grabbed all of the user-facing
binaries too. This puts them back.
@Mic92
Copy link
Member

Mic92 commented Dec 11, 2018

This was open for too long.

@kwohlfahrt
Copy link
Contributor Author

I think this closes #39424 as well.

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

Successfully merging this pull request may close these issues.

None yet

9 participants