autoconf: add another suggested package name for krb5 headers

Added an alternate package name for krb5 headers.

Noticed the following suggestion asks for the wrong package (at least
wrong for FC17)

checking krb5.h presence... no
checking for krb5.h... no
checking krb5/krb5.h usability... no
checking krb5/krb5.h presence... no
checking for krb5/krb5.h... no
configure: WARNING: krb5.h not found, consider installing
krb5-libs-devel. Disabling cifs.upcall.

[sfrench@w500smf cifs-utils]$ sudo yum install krb5-libs-devel
Loaded plugins: langpacks, presto, refresh-packagekit
No package krb5-libs-devel available.
Error: Nothing to do
[sfrench@w500smf cifs-utils]$ sudo yum install krb5-devel

(installing krb5-devel worked, but not krb5-libs-devel for this version)

Signed-off-by: Steve French <smfrench@gmail.com>
cifs.upcall: try to use default credcache if we didn't find one

Fedora is in the process of moving to KEYRING: credcaches which are not
currently handled by cifs.upcall. We could try to detect when they're in
use, but it's simpler and more robust to just try to use the default
credcache whenever we don't find a FILE: or DIR: cache.

Signed-off-by: Jeff Layton <jlayton@samba.org>
autoconf: update configure.ac a'la autoupdate

Signed-off-by: Jeff Layton <jlayton@samba.org>
autoconf: set version to 6.2

Signed-off-by: Jeff Layton <jlayton@samba.org>
autoconf: set release to 6.2.1 for interim builds

Signed-off-by: Jeff Layton <jlayton@samba.org>
get/setcifsacl: fix bad bit-shifts

A Coverity scan turned up this warning:

1. cifs-utils-6.2/setcifsacl.c:578:result_independent_of_operands – "(x & 0xff0000000000ULL) >> 48" is 0 regardless of the values of its operands. This occurs as the operand of assignment.

...which is entirely true. That shift should be 40 bits, not 48. Also
fix a similar bug in getcifsacl.c.

Signed-off-by: Jeff Layton <jlayton@samba.org>
getcifsacl: remove some dead code

Coverity says:

Error: DEADCODE (CWE-561): [#def5]
cifs-utils-6.2/getcifsacl.c:101: assignment: Assigning: "mflags" = "false".
cifs-utils-6.2/getcifsacl.c:109: const: At condition "mflags", the value of "mflags" must be equal to 0.
cifs-utils-6.2/getcifsacl.c:109: dead_error_condition: The condition "mflags" cannot be true.
cifs-utils-6.2/getcifsacl.c:110: dead_error_line: Execution cannot reach this statement "printf("|");".

Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Jeff Layton <jlayton@samba.org>
asn1: remove some usused functions

This cuts 30k out of the cifs.upcall binary on my x86_64 box.

Signed-off-by: Jeff Layton <jlayton@samba.org>
data_blob: clean out unused functions

Cut another 6k or so out of the cifs.upcall binary.

Signed-off-by: Jeff Layton <jlayton@samba.org>
mount.cifs: fix bad free() of string returned by dirname()

Coverity says:

  Error: CPPCHECK_WARNING: [#def10]
  cifs-utils-6.2/mount.cifs.c:1518: error[memleakOnRealloc]: Common realloc mistake: 'mtabdir' nulled but not freed upon failure

del_mtab has a number of bugs in handling of allocated memory:

a) the return value of strdup() is not checked

b) It calls realloc() on a pointer that wasn't returned by an allocation
   function (e.g. malloc, calloc, etc.)

c) If realloc() fails, it doesn't call free() on the original memory
   returned by strdup()

Fix all of these bugs and add newlines to the end of the error messages
in del_mtab.

Signed-off-by: Jeff Layton <jlayton@samba.org>
asn1: fix use-after-free in asn1_write

If the talloc_realloc() fails, asn1_write calls talloc_free on the
context and then immediately dereferences the pointer.

Fix this by skipping the talloc_free here. Let the caller handle it.

Signed-off-by: Jeff Layton <jlayton@samba.org>