Commit Graph

24 Commits (a3e87bcc32a21b1420a15385e0183d58dcaf19b1)

Author SHA1 Message Date
Theodore Ts'o d1154eb460 Shorten compile commands run by the build system
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>
2011-09-18 17:34:37 -04:00
Eric Sandeen 6d4ced2192 e2fsck: Fix leaks in error paths
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>
2011-09-16 19:55:55 -04:00
Aditya Kali d3859af33f mke2fs: Allow specifying reserved_ratio via mke2fs.conf
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>
2011-05-14 23:34:48 -04:00
Jim Meyering 45e338f533 remove useless if-before-free tests
In case you're wondering about whether this change is safe from a
portability standpoint, fear not.  This has been beaten to death
in other forums.  Here are a few threads:

  http://thread.gmane.org/gmane.comp.version-control.git/74187
  http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/12712
  http://thread.gmane.org/gmane.emacs.devel/98144
  http://thread.gmane.org/gmane.comp.lib.glibc.alpha/13092

There has been debate about whether it's a good idea from a
performance standpoint, too, but imho you'll have a hard time
finding an instance where this sort of change induces a
measurable performance penalty.  If you do, please let me know.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-03-08 20:37:12 -04:00
Theodore Ts'o efc6f628e1 Remove trailing whitespace for the entire source tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27 23:07:54 -04:00
Theodore Ts'o 6f890e516d Add new function: profile_set_default()
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>
2007-07-04 13:03:35 -04:00
Theodore Ts'o 6bde5c28ba Add PROFILE_FILE_NO_RELOAD flag which is used by profile_update_file()
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-07-04 10:36:15 -04:00
Brian Behlendorf 8f234d9650 [COVERITY] Free potential null dereference bug in e2fsck
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>
2007-05-31 11:42:48 -04:00
Theodore Ts'o 32460c1e4c Add new function profile_get_uint() in the e2fsck sources
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-22 20:51:47 -04:00
Brian Behlendorf 93503267c9 [COVERITY] Fix memory leak in profile library
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>
2007-03-21 16:14:37 -04:00
Brian Behlendorf 12f9195999 [COVERITY] Fix segfault bug if the profile directory is empty
Coverity ID: 5: Forward NULL

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-03-19 08:36:45 -04:00
Theodore Ts'o 642935c082 Fix misc. gcc -Wall complaints in the misc and e2fsck directories
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-11-14 23:38:17 -05:00
Theodore Ts'o 204ae371ad Tighten up profile parsing code by combining functions
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>
2006-03-22 10:01:24 -05:00
Theodore Ts'o 22fe674da4 Add support for quoted strings in tag and section names
Also changed top-level section name parsing to ignore leading and
trailing whitespace.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-01-06 15:04:39 -05:00
Theodore Ts'o 7d922f8bcb Add support to the profile library for /etc/foo/conf.d style directories
If a directory is passed to profile_init, then read all files which
match [0-9a-zA-Z]* in sort order.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-01-05 03:56:19 -05:00
Theodore Ts'o d45544ca54 More profile cleanups: remove prf_data_t data structure
Eliminate the prf_data_t data structure and fold it back into
prof_file_t.  Eschew needless complexity!

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-01-05 01:23:48 -05:00
Theodore Ts'o 95a8d1de51 Enhance profile library's parser to accept comments
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>
2006-01-05 00:47:34 -05:00
Theodore Ts'o f5f14fcfe9 Add syntax error reporting to the profile library
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>
2006-01-04 10:32:16 -05:00
Theodore Ts'o 9a4c209cd2 Simplify profile core functionality
Boil down and simplify profile.c, and move extra functionality that's
not needed into profile_helpers.c

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-01-02 22:04:41 -05:00
Theodore Ts'o 44dc5f8804 Clean up test driver program for profile.c and #ifdef unused static functions
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>
2006-01-02 12:25:03 -05:00
Theodore Ts'o cec7103d92 Fix profile.c so that com_err.h doesn't have to be installed
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>
2006-01-01 21:31:45 -05:00
Theodore Ts'o 5582275fe0 Slim down profile.c
#ifdef out functions not needed by e2fsck.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-12-31 16:24:07 -05:00
Theodore Ts'o fd7ac1fc98 Fix incorrect location of prof_err.h in profile.c.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-12-31 01:28:33 -05:00
Theodore Ts'o 2fa9ba9833 Add the profile library code to e2fsck
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>
2005-12-30 23:57:32 -05:00