e2fsprogs/lib/et
Theodore Ts'o 6b6c27fb8a libcom_err: Fix sign-extension problem on 64-bit systems in error_message()
On 64-bit systems (or anything with sizeof(long) > sizeof(int)), we
sometimes get error codes passed to error_message which have been cast
from an (int) to an (unsigned int). This almost always happens if
you're using libgssapi_krb5, which returns an error code which is less
than 0 but is returned in an (unsigned int).

For example, -1765328377L gets cast to 2529638919, which is
0x96c73a07, not 0xffffffff96c73a07, so error_message() fails to find a
matching error table.

When error_message() then calls the error_table_name() function to get a
name to use in the "unknown code" message, it gets a correct value back.

This happens because error_table_name() drops most of the higher bits of
the parameter it's passed before doing anything else with it (& 077777777f,
or & 0xffffff). If we did the same thing in error_message(), we wouldn't
have a problem there, either.

Problem reported and fixed by: Nalin Dahyabhai

Addresses-Sourceforge-Bug: #1809658

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-12-15 22:31:03 -05:00
..
test_cases et_c.awk: Use a dynamically allocated structure in 2005-06-20 16:24:04 -04:00
com_err.3 com_err.3: Fix C syntax error pointed out by ESR. 2003-12-11 11:24:44 -05:00
com_err.c com_err.h, com_err.c: Use GCC attributes to mark com_err and 2003-11-26 23:19:28 -05:00
com_err.h com_err.h, com_err.c: Use GCC attributes to mark com_err and 2003-11-26 23:19:28 -05:00
com_err.pc.in Add pkg-config files to e2fsprogs's libraries. 2005-01-26 12:59:25 -05:00
com_err.texinfo Fix the info-dir line for the com_err.texinfo file 2007-06-24 16:59:36 -04:00
com_right.c Add full Heimdall compatibility. 2003-05-05 23:07:32 -04:00
compile_et.1 ChangeLog, compile_et.1: 2000-12-04 23:49:07 +00:00
compile_et.sh.in Set local environment variables to C so mk_cmds and compile_et always work 2006-11-12 10:43:31 -05:00
error_message.c libcom_err: Fix sign-extension problem on 64-bit systems in error_message() 2007-12-15 22:31:03 -05:00
error_table.h Change compile_et to generate header files that use <et/com_err.h> 2003-03-30 22:26:13 -05:00
et_c.awk Fix com_err bug in compile_et: # of error messages can be wrong 2005-07-19 08:24:59 -05:00
et_h.awk If the .c and .h file already exist, and they have not changed, use the 2005-05-06 09:42:34 -04:00
et_name.c Many files: 1999-10-23 01:16:22 +00:00
init_et.c error_message.c, init_et.c: Segregate error tables registered 2005-06-20 17:59:06 -04:00
internal.h Change compile_et to generate header files that use <et/com_err.h> 2003-03-30 22:26:13 -05:00
Makefile.in Address parallel build problem in the library Makefiles 2005-12-10 22:23:01 -05:00
texinfo.tex Many files: 1997-04-26 13:21:57 +00:00
vfprintf.c Many files: 1997-04-26 13:58:21 +00:00