25 Commits

Author SHA1 Message Date
Jeffrey Altman
3a52803e19 appl/kf: doit close socket before returning
Change-Id: Ida564ea4c27c1bd50004340ac7dbab5f11dbf531
2022-01-17 16:50:42 -05:00
Nicolas Williams
5f63215d0d Always perform == or != operation on cmp function result
Although not required to address bad code generation in
some versions of gcc 9 and 10, a coding style that requires
explicit comparison of the result to zero before use is
both clearer and would have avoided the generation of bad
code.

This change converts all use of cmp function usage from

```
    if (strcmp(a, b) || !strcmp(c, d)) ...
```

to

```
    if (strcmp(a, b) != 0 || strcmp(c, d)) == 0
```

for all C library cmp functions and related:

 - strcmp(), strncmp()
 - strcasecmp(), strncasecmp()
 - stricmp(), strnicmp()
 - memcmp()

Change-Id: Ic60c15e1e3a07e4faaf10648eefe3adae2543188
2021-11-24 22:30:44 -05:00
Nicolas Williams
3f1451a4c3 Remove get_default_username() 2018-12-25 22:11:19 -06:00
Roland C. Dowdeswell
e8779d5d4a Add -Wshadow and deal with the warnings. 2012-02-21 11:17:55 +00:00
Roland C. Dowdeswell
cc47c8fa7b Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer.  Note that we get different
warnings on different machines and so this will be a work in
progress.  So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).

Notably, we fixed

	1.  a lot of missing structure initialisers,

	2.  unchecked return values for functions that glibc
	    marks as __attribute__((warn-unused-result)),

	3.  made minor modifications to slc and asn1_compile
	    which can generate code which generates warnings,
	    and

	4.  a few stragglers here and there.

We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g.  rsh, rcp,
popper, ftp and telnet.

Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.

We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
2012-02-20 19:45:41 +00:00
Love Hornquist Astrand
b2aaf4f306 free auth_context on close [CID-97] 2009-07-30 11:55:42 +02:00
Love Hörnquist Åstrand
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
Love Hörnquist Åstrand
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
Johan Danielsson
af36f87126 fix warning string
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11400 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-09-05 15:00:03 +00:00
Johan Danielsson
cfcf1125e9 handle new protocol
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11378 ec53bebd-3082-4978-b11e-865c3cabbd6b
2002-09-04 20:32:18 +00:00
Assar Westerlund
67422a6b02 s/[gs]et_progname/[gs]etprogname/
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9704 ec53bebd-3082-4978-b11e-865c3cabbd6b
2001-02-20 01:44:56 +00:00
Assar Westerlund
633782864b (main): handle krb5_init_context failure consistently
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9443 ec53bebd-3082-4978-b11e-865c3cabbd6b
2000-12-31 08:05:03 +00:00
Assar Westerlund
c33ef3747d (doit): rewrite to use getaddrinfo
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7495 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-12-04 18:04:09 +00:00
Johan Danielsson
c5b916ca6f remove advertising clause
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7464 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-12-02 17:05:13 +00:00
Assar Westerlund
c139c81e0d (proto): don't trust errno if krb5_net_read hasn't returned -1
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6825 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-08-16 12:43:43 +00:00
Assar Westerlund
fd6e3126dc (doit): call freehostent
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6752 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-08-05 12:19:45 +00:00
Assar Westerlund
106427eaa1 make v6 friendly and simplify
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6751 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-08-05 11:39:57 +00:00
Assar Westerlund
cd4006ff87 add `-G' and forwardable option in krb5.conf. From Miroslav Ruda
<ruda@ics.muni.cz>


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6706 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-08-04 16:56:46 +00:00
Assar Westerlund
ac82f4ac5c (main): use warnx
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6518 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-07-24 09:23:03 +00:00
Assar Westerlund
ad41b97491 (proto): remove shadowing context
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6517 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-07-24 09:19:02 +00:00
Assar Westerlund
df035720d7 more fixes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6498 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-07-23 21:45:40 +00:00
Assar Westerlund
3893744243 (main): use warn
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6497 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-07-23 21:43:42 +00:00
Assar Westerlund
d0dedfb6b2 rename tk_file to ccache for consistency
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6493 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-07-23 21:28:57 +00:00
Assar Westerlund
fbef31bff2 more clean-up
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6492 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-07-23 21:27:36 +00:00
Assar Westerlund
aef43355c9 new program
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6486 ec53bebd-3082-4978-b11e-865c3cabbd6b
1999-07-22 11:36:30 +00:00