16 Commits

Author SHA1 Message Date
0f998cdbc2 ktutil: Avoid even doing arithmetic on res after realloc(res, ...).
Under C99, Sec 6.2.4, paragraph 2:

    The value of a pointer becomes indeterminate when the object it
    points to reaches the end of its lifetime.

`Indeterminate' (3.17.2) includes a trap representation, and any
reference to a trap representation is undefined behaviour.  Thus,
after realloc(res, ...) succeeds, any reference to res (or p) is
undefined behaviour.

So, instead of using `p - res` after res has been freed, use the
existing name for the value we know it has now: len.  (We could also
use alloced because p == end in this branch, and end = res + alloced,
and p = res + len.  Of course, we would have to move it up a line to
before we update alloced to have a different value.)

fix https://github.com/heimdal/heimdal/issues/1164
2023-11-07 14:20:40 -06:00
914cd2f31c ktutil: Fix leak 2023-01-04 01:36:02 -06:00
ceec364ed4 ktutil: Add import command and other improvements
- Add an import command that imports JSON as output by
   `ktutil list --json --keys`.

   This is enables one to filter/edit keytabs with jq!

 - Add a `merge` alias for the `copy` command, since that's effectively
   what it does.

 - Add a `--copy-duplicates` option to the `copy`/`merge` command.

 - Add a `--no-create` option to the `get` command.

 - Add a `--no-change-keys` option to the `get` command.

 - Make `add` complain if it can't finish writing to the keytab.
2022-10-03 09:44:22 -05:00
014f16883c libhcrypto: UI_UTIL_FLAG_VERIFY_SILENT 2018-12-30 15:39:49 -06:00
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
f5f9014c90 Warning fixes from Christos Zoulas
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
239d06f465 add option -H --hex to the add command
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14793 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-04-14 16:45:14 +00:00
3474819438 convert to slc
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@14260 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-09-23 14:45:29 +00:00
54fc57ccb5 s/des_read_pw_string/UI_UTIL_read_pw_string/
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12753 ec53bebd-3082-4978-b11e-865c3cabbd6b
2003-09-03 09:37:03 +00:00
b97a223d26 on second thoughts, back out previous
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11438 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-09-10 19:26:52 +00:00
c8fbdf457d use krb5_prompter_posix instead of calling des_read_pw_string directly
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11436 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-09-10 19:21:48 +00:00
4d7d46d8b7 move common code for opening the keytab to ktutil.c
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10383 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-07-23 09:46:41 +00:00
b341554465 (kt_add): reorganize some. open the keytab (defaulting to the modify
one)


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9884 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-05-10 15:39:15 +00:00
ee928b7492 split up ktutil in several files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7714 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-01-02 04:41:02 +00:00