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

freeradius service handling fixes (Bug #6404), fix chown handling and various bugs #267

Merged
merged 14 commits into from
Jan 26, 2017

Conversation

doktornotor
Copy link
Contributor

@doktornotor doktornotor commented Jan 25, 2017

Service handling fixes:

  • Remove unwanted freeradius restart on install/upgrade
    This breaks things due to restarting the service multiple times - once here and more times when custom_php_resync_config_command is run on install, which in turn runs freeradius_settings_resync() which restarts the service, and then freeradius_users_resync() runs which restarts the service yet again.
  • Add an argument to skip service restart to freeradius_settings_resync() function
  • Do not restart service twice on resync
  • Do not restart on boot
  • Attempt to fix XMLRPC sync which was restarting the service four times for a good measure, WTF.

Other fixes:

  • Remove an evil recursive chown call on /var/log screwing up logdir permissions for things like squid, clamav, redis... Same unwanted recursive chown would be run on entire /usr/local/lib if $frlib was empty for some reason. Create a function with sanity checks, use PHP's chown()/chgrp() functions instead of exec() and refuse to recursively chown invalid targets.
  • Stop creating a symlink to itself instead of /usr/local/etc/raddb directory
  • Use safe_mkdir() in buch of places and fix some wrong checks while here.

Note: Would be worth getting everywhere, incl. RELENG_2_3_2:
https://forum.pfsense.org/index.php?topic=119569.0
https://forum.pfsense.org/index.php?topic=87441.0

doktornotor added 3 commits January 26, 2017 00:09
This breaks things due to restarting the service multiple times once here and more times when custom_php_resync_config_command is run on install, which in turn runs freeradius_settings_resync() which restarts the service, and then freeradius_users_resync() runs which restarts the service yet again.
It will restart after freeradius_users_resync() is finished.
@doktornotor doktornotor changed the title freeradius service handling fixes freeradius service handling fixes (Bug #6404) Jan 26, 2017
doktornotor added 5 commits January 26, 2017 05:35
…ectory

Probably some leftover from 2.2.x/PBI junk.
If $frlib was empty, the code would run chown -R on the entire /usr/local/lib. Create a function with sanity checks, use PHP's chown()/chgrp() functions instead of exec() and refuse to recursively chown invalid targets.
@doktornotor doktornotor changed the title freeradius service handling fixes (Bug #6404) freeradius service handling fixes (Bug #6404), fix chown handling and various bugs Jan 26, 2017
}

function freeradius_users_resync() {
function freeradius_users_resync($via_rpc = "no") {
Copy link
Member

Choose a reason for hiding this comment

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

Please use boolean type for $via_rpc

}


function freeradius_authorizedmacs_resync() {
function freeradius_authorizedmacs_resync($via_rpc = "no") {
Copy link
Member

Choose a reason for hiding this comment

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

Please use boolean type for $via_rpc

@doktornotor
Copy link
Contributor Author

doktornotor commented Jan 26, 2017

@rbgarga - Done. There should be a lot more done here, but I'd like to keep changes here to a minimum, considering this should target a stable release.

BTW, would be good to have something like safe_chown_recursive() available in pfSense itself.

Needed to avoid more restarts madness
@doktornotor
Copy link
Contributor Author

Found yet more restart madness. Argh!!!

@netgate-git-updates netgate-git-updates merged commit af938f7 into pfsense:devel Jan 26, 2017
@doktornotor doktornotor deleted the patch-3 branch January 26, 2017 18:52
netgate-git-updates pushed a commit that referenced this pull request Aug 17, 2017
  [ Robert Edmonds ]
  * Release 1.3.0.

  * Add test case for the issue in #220 (#254).

  * Fix issue #251, "Bad enums with multiple oneofs" (#256).

  * Add warning flags to my_CFLAGS (#257).

  * Fix namespace errors when compiled with latest protobuf (#280).

  * Bump minimum required header version for proto3 syntax (#282).

  [ Paolo Borelli ]
  * Turn the compiler into a protoc plugin (#206). This allows the protobuf-c
    compiler to be invoked as "protoc --c_out=...". For backwards
    compatibility, we still ship a protoc-c command, but it's a symlink to the
    protoc-gen-c binary.

  * proto3 support (#228).

  * Remove leftover FIXME comment (#258).

  * Fix proto3 "is zeroish" evaluation (#264).

  * Small cleanup in oneof handling (#265).

  * Rework is_zeroish one more time (#267).

  * proto3: make strings default to "" instead of NULL (#274).

  [ Tomek Wasilczyk ]
  * Fix -Wsign-compare warnings (#213).

  * Fix ISO C90 -Wdeclaration-after-statement warnings (#214).

  * Fix bigendian -Wunused-label warning (#215).

  [ Ilya Lipnitsky ]
  * protoc-c/c_message.cc: Force int size on oneof enums (#221). Fixes wrong
    enum generation and handling for onceof cases (#220).

  [ Adnan ]
  * Fix cmake build if built as part of an external project (#231).

  [ Gregory Detal ]
  * Remove .pb.{cc,h} in distdir instead of top_distdir in order to prevent
    removing files from other projects when protobuf-c is included as an
    autotools subproject (#232).

  [ Ben Farnham ]
  * Relax autoconf constraint from v2.64 to v2.63 so that it works on older
    Linux distros (#233).

  [ Thomas Koeckerbauer ]
  * rm argument fix for Solaris (#234).

  * Add 'const' qualifier to 'init_value' variable in generated files (#236).

  [ Richard Kettlewell ]
  * Document and extend the effect of passing NULL to ..._free_unpacked
    functions (#255).

  [ Alex Milich ]
  * CMake: Workaround for static builds that use MSVC (#243).

  [ Josh Junon ]
  * CMake: Allow protobuf-c to be included via include_subdirectory (#245).

  [ Alexei Kasatkin ]
  * CMake: Windows fixes (#266).

This fixes the build breakage with devel/protobuf 1.3.0 [1]

PR:		221572 [1]
Sponsored by:	Farsight Security, Inc.
netgate-git-updates pushed a commit that referenced this pull request Jun 24, 2023
ChangeLog: https://www.nlnetlabs.nl/news/2023/Jun/07/nsd-4.7.0-released/

4.7.0
================
FEATURES:
- Merge #263: Add bash autocompletion script for nsd-control.
- Fix #267: Allow unencrypted local operation of nsd-control.
- Merge #269 from Fale: Add systemd service unit.
- Fix #271: DNSTAP over TCP, with dnstap-ip: "127.0.0.1@3333".
- dnstap over TLS, default enabled. Configured with the
  options dnstap-tls, dnstap-tls-server-name, dnstap-tls-cert-bundle,
  dnstap-tls-client-key-file and dnstap-tls-client-cert-file.

BUG FIXES:
- Fix #239: -Wincompatible-pointer-types warning in remote.c.
- Fix configure for -Wstrict-prototypes.
- Fix #262: Zone(s) not synchronizing properly via TLS.
- Fix for #262: More error logging for SSL read failures for zone
  transfers.
- Merge #265: Fix C99 compatibility issue.
- Fix #266: Fix build with --without-ssl.
- Fix for #267: neater variable definitions.
- Fix #270: reserved identifier violation.
- Fix to clean more memory on exit of dnstap collector.
- Fix dnstap to not check socket path when using IP address.
- Fix to compile without ssl with dnstap-tls code.
- Dnstap tls code fixes.
- Fix include brackets for ssl.h include statements, instead of quotes.
- Fix static analyzer warning about nsd_event_method initialization.
- Fix #273: Large TXT record breaks AXFR.
- Fix ixfr create from adding too many record types.
- Fix cirrus script for submit to coverity scan to libtoolize
  the configure script components config.guess and config.sub.
- Fix readme status badge links.
- make depend.
- Fix for build to run flex and bison before compiling code that needs
  the headers.
- Fix to remove unused whitespace from acx_nlnetlabs.m4 and config.h.
- For #279: Note that autoreconf -fi creates the configure script
  and also the needed auxiliary files, for autoconf 2.69 and 2.71.
- Fix unused variable warning in unit test, from clang compile.
- Fix #240: Prefix messages originating from verifier.
- Fix #275: Drop unnecessary root server checks.

PR:		272096
Reported by:	jaap@NLnetLabs.nl (maintainer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants