aboutsummaryrefslogtreecommitdiff
path: root/lib/parse_ini.c
AgeCommit message (Collapse)Author
2014-06-18lib/parse_ini.c: Print proper read error messageGravatar Holger Weiss
Print a useful error message if opening the configuration file fails.
2014-06-18lib/parse_ini.c: Drop privileges for reading fileGravatar Holger Weiss
Read the configuration file with privileges temporarily dropped if the code is used by a setuid plugin.
2014-06-18lib/parse_ini.c: Add newline to die() callsGravatar Holger Weiss
Our die() function doesn't append a newline character to the message.
2014-06-18lib/parse_ini.c: Cosmetic changeGravatar Holger Weiss
Replace an "if" with the ternary operator.
2014-06-18lib/parse_ini.c: Search for INI file in subdirsGravatar Holger Weiss
Add two path names to the list of default INI file locations, as some users/distributions prefer to put configuration files into subdirectories.
2014-06-18lib/parse_ini.c: Add comment on NAGIOS_CONFIG_PATHGravatar Holger Weiss
We might want to spit out a warning when NAGIOS_CONFIG_PATH is used. While at it, move the function that handles this environment variable to the bottom.
2014-06-18lib/parse_ini.c: Cosmetic changes to commentsGravatar Holger Weiss
2014-06-18lib/parse_ini.c: Fix Clang warningsGravatar Holger Weiss
2014-06-18lib/parse_ini.[ch]: Change code formattingGravatar Holger Weiss
Change the indentation and formatting of the code in lib/parse_ini.c. This breaks patches against that file and makes it harder to track its history, but it (hopefully) improves readability a lot.
2014-06-18lib/parse_ini.c: Don't cast malloc(3) resultGravatar Holger Weiss
There's no need to cast malloc(3)'s return value.
2014-06-18lib/parse_ini.c: Remove outdated comment and codeGravatar Holger Weiss
The lib/parse_ini.c:np_get_defaults() function now dies if no configuration file is found.
2014-06-18lib/parse_ini.c: Read $MP_CONFIG_FILEGravatar Holger Weiss
Read $MP_CONFIG_FILE if that variable is set in the environment.
2014-06-18lib/parse_ini.c: Read "monitoring-plugins.ini"Gravatar Holger Weiss
Read "monitoring-plugins.ini" if that file exists, but fall back to reading "plugins.ini" or "nagios-plugins.ini" for backward compatibility.
2014-06-18lib/parse_ini.[ch]: Simplify codeGravatar Holger Weiss
Rewrite the code that looks up the INI configuration file path (used by the Extra-Opts feature) in order to improve readability. The behaviour should not have changed.
2014-01-25Clean up parse_ini error messages, add missing newlinesGravatar Thomas Guyot-Sionnest
2014-01-24Use access() instead of stat() in parse_ini.cGravatar Thomas Guyot-Sionnest
2014-01-20Minor fixes to be amended into "rename" commitGravatar Holger Weiss
2014-01-19Project rename initial commit.Gravatar Monitoring Plugins Development Team
This is an initial take at renaming the project to Monitoring Plugins. It's not expected to be fully complete, and it is expected to break things (The perl module for instance). More testing will be required before this goes mainline.
2009-01-22Return UNKNOWN if none of the default files can be found.Gravatar Thomas Guyot-Sionnest
It makes no sense to return unknown if an implicit section is not found, but go on if the file is missing
2008-11-23Removing CVS/SVN tags and replacing with git-based versioningGravatar Thomas Guyot-Sionnest
For contrib/, full tags have been imported from subversion git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-19Bulk EOL cleanupGravatar Thomas Guyot-Sionnest
$ git diff --ignore-space-change|diffstat 0 files changed git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2087 f882894a-f735-0410-b71e-b25c423dba1c
2008-11-04Make extra-opts (C plugins) behave more like N::P:Gravatar Thomas Guyot-Sionnest
N::P allows both '#' and ';' for comments. Extra-opts used to allow only '#', it now allows both (';' is the standard for ini files) Extra-opts does not allow trailing comments anymore (like N::P) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2063 f882894a-f735-0410-b71e-b25c423dba1c
2008-08-21Typos in commentsGravatar Thomas Guyot-Sionnest
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2035 f882894a-f735-0410-b71e-b25c423dba1c
2008-04-04make parse_ini die like in N::P if section isn't foundGravatar Thomas Guyot-Sionnest
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1976 f882894a-f735-0410-b71e-b25c423dba1c
2008-04-02- Add --enable-extra-opts configure option for compiling extra-opts supportGravatar Thomas Guyot-Sionnest
- Auto-update po/pot files git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1973 f882894a-f735-0410-b71e-b25c423dba1c
2008-04-01fix the obvious...Gravatar Thomas Guyot-Sionnest
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1972 f882894a-f735-0410-b71e-b25c423dba1c
2008-03-31Fix for last commit - I accidentaly broke my local Makefile and tests ↵Gravatar Thomas Guyot-Sionnest
weren't being re-compiled. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1968 f882894a-f735-0410-b71e-b25c423dba1c
2008-03-26write ini-file lookup function + testsGravatar Thomas Guyot-Sionnest
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1962 f882894a-f735-0410-b71e-b25c423dba1c
2008-03-24Replace broken usage of NAGIOS_CONFIG_PATH with a stub function (that will ↵Gravatar Thomas Guyot-Sionnest
try to find a config file in the future...) Allow NULL locator (default file/section) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1960 f882894a-f735-0410-b71e-b25c423dba1c
2008-03-15parse_ini now reads the default section if the request one can't be found.Gravatar Thomas Guyot-Sionnest
All tests should return ok now. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1950 f882894a-f735-0410-b71e-b25c423dba1c
2008-03-15Oops - this line shouldn't have been here (doesn't even work anyways) ;)Gravatar Thomas Guyot-Sionnest
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1949 f882894a-f735-0410-b71e-b25c423dba1c
2008-03-15- Make equal-less parameters illegalGravatar Thomas Guyot-Sionnest
- parameters without argument after '=' are now assumed to be argument-less - Add a testcase for space in stanza and various argument-less parameters git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1948 f882894a-f735-0410-b71e-b25c423dba1c
2008-03-15Fix handling of leading and trailing spaces in stanzaGravatar Thomas Guyot-Sionnest
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1947 f882894a-f735-0410-b71e-b25c423dba1c
2008-03-15Fix segfault in test_ini.c and uncomment the affected testsGravatar Thomas Guyot-Sionnest
Fix bug in stanza parsing where full section could be skipped Fix single-argument options git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1946 f882894a-f735-0410-b71e-b25c423dba1c
2008-03-15This commit consist of two changes:Gravatar Thomas Guyot-Sionnest
1. Make np_get_defaults return a linked list instead of a string. It will then be easy to convert the linked list back to an argument array. 2. Fix tests 3-4 of test_ini.c. A test_ini.t was added too. parse_ini and test_ini aren't included yet in the build makefiles. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1945 f882894a-f735-0410-b71e-b25c423dba1c
2008-01-30Bump /lib to GPLv3Gravatar Thomas Guyot-Sionnest
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1913 f882894a-f735-0410-b71e-b25c423dba1c
2008-01-30new standardized GPLv3 header (will be applied to all C files)Gravatar Thomas Guyot-Sionnest
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1912 f882894a-f735-0410-b71e-b25c423dba1c
2007-02-07Added test files to test the parse_ini.c routines. Requires libtapGravatar Ton Voon
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1614 f882894a-f735-0410-b71e-b25c423dba1c
2007-02-06initial version of ini file parsing routines in CGravatar M. Sean Finney
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1610 f882894a-f735-0410-b71e-b25c423dba1c