Commit Graph

28 Commits (8df85fb64d4582a2e2c47a50b167d7f20cc38a0d)

Author SHA1 Message Date
Theodore Ts'o e5397d7ae9 blkid: suppress Coverity warning
The getopt() function will never let optarg be NULL (at least without
using the GNU double-colon extension, which we don't use because it's
not portable), so don't bother checking for that case.  It's harmless,
but it triggers a Coverity warning elsewhere, since it thinks optarg
could in fact be NULL.

Addresses-Coverity-Id: #1049156

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-30 18:25:15 -05:00
Theodore Ts'o 5bb4d0cec4 blkid: avoid potential integer overflow issues identified by Coverity
Addresses-Coverity-Id: #1049157
Addresses-Coverity-Id: #1049158

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-30 18:25:15 -05:00
Theodore Ts'o 2fc92dbc59 blkid: fix blkid -o list formatting with columns > 160
This bug is also in the util-linux version of blkid.

Addresses-Coverity-Id: #1049158

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-10 23:25:54 -05:00
Theodore Ts'o 6596c997f3 blkid: fix gcc -Wall nits
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-10 21:40:28 -05:00
Theodore Ts'o 46802efa15 blkid: add fallthrough comment
Addresses-Coverity-Id: #709484

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-09 15:03:40 -05:00
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
Theodore Ts'o 3c77b8ec54 Fix miscellaneous gcc -Wall warnings in blkid and tune2fs
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-11 23:56:49 -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 36f4c40802 blkid: Fix portability issue if TIOCGSIZE and TIOCGWINSZ are present
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-14 17:49:38 -04:00
Theodore Ts'o 3d05802f92 blkid: Add new option -L which pretty-prints the device list
Also accessed via -o list, this new output format is much more
user-friendly and lists whether or not a particular device is mounted.

Addresses-Debian-Bug #490527

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-07-13 16:06:47 -04:00
Theodore Ts'o f8efcda2db blkid: Output non-printing characters using ^ and M- notation
When printing the value of tags in a formatted format, print control
characters and characters with the high eight bit set using the ^ and
M- notation, respectively.  This prevents a filesystem with a garbage
label from potentially screwing up the user's screen (for example,
putting it into graphical mode).

Addresses-Ubuntu-Bug: #78087

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-16 12:26:57 -05:00
Theodore Ts'o 46100e3f6e Add -g option to the blkid program to garbage collect the blkid.tab file
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-05-18 00:16:02 -04:00
Matthias Andree a63830271b Declare getopt() according to POSIX 2001 if getopt.h not found.
Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
2006-05-30 16:27:45 +02:00
Theodore Ts'o ed6acfa337 Add a new option to the blkid program, -l, which will more efficiently search
for a single device.

Add a new function to the blkid library, blkid_probe_all_new().

Optimize blkid_find_dev_with_tag() so that extraneous device validation are
skipped.  (Makes a difference for system with a large number of disks).
2005-05-07 17:06:27 -04:00
Theodore Ts'o c37543df2f Add new two new functions to the blkid library: blkid_dev_set_search(), and
blkid_dev_has_tag(), and change the blkid program to take advantage of these
functions.
2005-05-07 13:32:47 -04:00
Theodore Ts'o 0af8c33be0 Fix potential portability issue in the blkid program. (On architectures
where char is unsigned).  (Addresses Sourceforge Bug: #1180585)
2005-05-06 00:10:52 -04:00
Theodore Ts'o 18d1296333 blkid.c (main, compare_search_type): Make blkid -t work more
consistently when the blkid cache file is explicitly set
	to /dev/null.  (Addresses Debian Bug #292425)

Also expose blkid_verify() as a public function to the blkid library.
2005-01-27 19:51:47 -05:00
Theodore Ts'o 8909292655 Make blkid -t display all devices that match the specified criteria,
not just the first one.  (Addresses Debian Bug #290530)

Update the blkid man page's description of the -t option.
2005-01-21 19:11:05 -05:00
Theodore Ts'o 9b2d5e912b Eliminate the partially implemented -p option in blkid. 2004-03-21 20:40:20 -05:00
Theodore Ts'o 8927998f82 blkid.c (main, print_tags): Add new option -o which allows the
user to control the output format of blkid.
2004-03-20 16:30:10 -05:00
Theodore Ts'o 544349270e Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
Theodore Ts'o 48e6e81362 Fixx gcc -Wall nitpicks. 2003-07-06 00:36:48 -04:00
Theodore Ts'o ed1b33e8fb Minor bug fixes in the blkid library.
Convert mke2fs, fsck, and tune2fs to use the blkid library.
2003-03-01 19:29:01 -05:00
Theodore Ts'o 98999c399d Rename blkid_get_devname() to blkid_get_dev(), and blkid_get_token()
to blkid_get_devname().
2003-02-16 00:47:07 -05:00
Theodore Ts'o 50b380b4d4 Wholesale changes to blkid library to simplify the implementation
and shrink its size.  Change library version to be 1.0.
2003-02-12 23:51:21 -05:00
Theodore Ts'o 7a603aa89f Separate public and private interfaces into separate header files.
Start separating internal implementation details from the
publically exported interface of the blkid library.
2003-01-26 01:54:39 -05:00
Theodore Ts'o e12f2ae74c Integrate new blkid library. 2003-01-23 16:45:16 -05:00