···6262 description = "Whether to enable authentication against an LDAP server.";
6363 };
64646565+ loginPam = mkOption {
6666+ type = types.bool;
6767+ default = true;
6868+ description = "Whether to include authentication against LDAP in login PAM";
6969+ };
7070+7171+ nsswitch = mkOption {
7272+ type = types.bool;
7373+ default = true;
7474+ description = "Whether to include lookup against LDAP in NSS";
7575+ };
7676+6577 server = mkOption {
6678 example = "ldap://ldap.example.org/";
6779 description = "The URL of the LDAP server.";
···44hardeningLDFlags=()
55hardeningDisable=${hardeningDisable:-""}
6677-if [[ -z "@ld_supports_bindnow@" ]]; then
88- hardeningDisable+=" bindnow"
99-fi
1010-1111-if [[ -z "@ld_supports_relro@" ]]; then
1212- hardeningDisable+=" relro"
1313-fi
77+hardeningDisable+=" @hardening_unsupported_flags@"
148159if [[ -n "$NIX_DEBUG" ]]; then echo HARDENING: Value of '$hardeningDisable': $hardeningDisable >&2; fi
16101717-if [[ ! $hardeningDisable == "all" ]]; then
1111+if [[ ! $hardeningDisable =~ "all" ]]; then
1812 if [[ -n "$NIX_DEBUG" ]]; then echo 'HARDENING: Is active (not completely disabled with "all" flag)' >&2; fi
1913 for flag in "${hardeningFlags[@]}"
2014 do
+8-3
pkgs/build-support/cc-wrapper/default.nix
···237237 cat $out/nix-support/setup-hook.tmp >> $out/nix-support/setup-hook
238238 rm $out/nix-support/setup-hook.tmp
239239240240- # some linkers on some platforms don't support -z
241241- export ld_supports_bindnow=$([[ "$($ldPath/ld -z now 2>&1 || true)" =~ "un(known|recognized) option" ]])
242242- export ld_supports_relro=$([[ "$($ldPath/ld -z relro 2>&1 || true)" =~ "un(known|recognized) option" ]])
240240+ # some linkers on some platforms don't support specific -z flags
241241+ hardening_unsupported_flags=""
242242+ if [[ "$($ldPath/ld -z now 2>&1 || true)" =~ "unknown option" ]]; then
243243+ hardening_unsupported_flags+=" bindnow"
244244+ fi
245245+ if [[ "$($ldPath/ld -z relro 2>&1 || true)" =~ "unknown option" ]]; then
246246+ hardening_unsupported_flags+=" relro"
247247+ fi
243248244249 substituteAll ${./add-flags.sh} $out/nix-support/add-flags.sh
245250 substituteAll ${./add-hardening.sh} $out/nix-support/add-hardening.sh