The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and
this was starting to cause some tools heartburn. It also made "make
V=1" almost useless, since trying to following the individual commands
run by make was lost in the noise of all of the defines.
So fix this by putting the configure-generated defines in lib/config.h
and the directory pathnames to lib/dirpaths.h.
In addition, clean up some vestigal defines in configure.in and in the
Makefiles to further shorten the cc command lines.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fn and/or array was not freed in some error paths.
[ Also make sure the array is NULL terminated before we free it in
get_dirlist(). --tytso]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This patch adds support for specifying 'reserved_ratio' (percent blocks
reserved for super user, same as '-m' command line option) in mke2fs.conf.
It adds profile_get_double function in profile.c that allows reading
floating point values from profile files.
Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
profile_set_default() sets the value of the pseudo file "<default>".
If the file "<default>" had previously been passed to profile_init(),
then def_string parameter will be parsed and used as the profile
information for the "<default>" file.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
At the second conditional iter->file could still be NULL. We need to
check for it again. Should never happen in practice, but better to be
sure.
Coverity ID: 6: Forward Null
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The profile must be freed early if the subsequent memory allocation
fails for 'expanded_filename'.
Coverity ID: 14: Resource Leak
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Integrate profile_std_line() into parse_line(), and profile_parse_file()
into profile_update_file() to make the code use less memory.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This also changes syntax accepted by the profile parser. The value of
profile relations must not contain spaces unless it is quoted;
otherwise the parser will throw an error. Previously something like
this was allowed:
[liboptions]
test = foo bar
Now, the relation must be in double quotes in order to be valid, i.e.,
"foo bar".
Comments are allowed anywhere and can be started with either a ';' or
a '#' character. The only place where comments will not be intepreted
as beginning a comment is in a quoted string.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
E2fsck will now report syntax errors in /etc/e2fsck.conf intead of simply
ignoring the config file when there are errors.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Unified batchmode and command-line handling.
profile_is_node_final() and profile_find_node_relation() are static,
unused functions.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Fix #include of com_err.h so that it isn't required that the com_err
development environment be installed. (Addresses Debian Bug: #345519)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The profile library was originally written by Theodore Ts'o in 1995
for use in the MIT Kerberos v5 library. It has been
modified/enhanced/bug-fixed over time by other members of the MIT
Kerberos team. This version was originally taken from the Kerberos
v5 distribution, version 1.4.2, and radically simplified for use in
e2fsprogs. (Support for locking for multi-threaded operations,
being able to modify and update the configuration file
programmatically, and Mac/Windows portability have been removed.
It has been folded into a single C source file to make it easier to
fold into an application program.)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>