Commit Graph

22 Commits

Author SHA1 Message Date
Toni Uhlig fdadefe599
login: fixed invalid sizeof usage
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
2020-06-19 20:37:44 +02:00
Karel Zak 19a353947d logindefs: use xalloc.h, code cleanup
- remove else-after-return
- use else-if
- use xalloc stuff

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-06-09 11:31:42 +02:00
Karel Zak fee9910661 build-sys: cleanup $vendordir use
- use --with-vendordir= (rather than --enable) to be compatible with
  another package stuuf

- add USE_VENDORDIR automake condition

- add vendordir to global AM_CPPFLAGS to avoid binary specific cflags
  modifications

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-25 13:44:22 +02:00
Karel Zak d5e8818e03 Merge branch 'libeconf' of https://github.com/thkukuk/util-linux
* 'libeconf' of https://github.com/thkukuk/util-linux:
  Adjust test output to pass test suite
  Add support for libeconf
2020-05-25 12:23:13 +02:00
Rosen Penev 042f62dfc5
[clang-tidy] do not use else after return
Found with readability-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-20 13:20:59 -07:00
Thorsten Kukuk b6b7348eee Adjust test output to pass test suite 2019-10-08 14:58:42 +02:00
Thorsten Kukuk 9e584ff324 Add support for libeconf 2019-09-03 15:04:43 +02:00
Karel Zak 2c308875a7 misc: consolidate version printing and close_stdout()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-16 15:14:13 +02:00
Karel Zak 623427456e login-utils/logindefs: clenaup API
The default value should be unsigned if the result is also unsigned...

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-01-11 12:15:22 +01:00
Karel Zak 832f5cd524 su: add control struct
* setup logindefs loader by function rather than by global pointer

* move basic booleans to the su_context struct

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-09-18 11:48:56 +02:00
Tobias Stoeckmann b0f97de5a4 login: prevent OOB read on illegal /etc/hushlogins
If the file /etc/hushlogins exists and a line starts with '\0', the
login tools are prone to an off-by-one read.

I see no reliability issue with this, as it would clearly need a
hostile action from a system administrator. But for the sake of
correctness, I've sent this patch nonetheless.
2017-03-13 12:46:49 +01:00
Ondrej Oprala 29cc2a5568 lslogins: add functionality
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Ondrej Oprala 78dd745089 login: extract get_hushlogin_status
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-05-15 13:55:59 +02:00
Karel Zak 4082ab2c6f su: fix compiler warning [-Wstrict-prototypes]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-09-21 12:38:18 +02:00
Sami Kerola c9baf5da86 logindefs: change getlogindefs_num() to return unsigned long
Where ever getlogindefs_num() is called return value is always
expected to be unsigned, such as sleep() input, gid_t or mode_t.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-06-02 11:57:42 +02:00
Ludwig Nussel 9c44ac503f use existing logindefs.c and pathnames.h
I'm not sure having /usr/local in _PATH_DEFPATH_ROOT and even putting it
in front is such a good idea though. /usr/local might be on NFS so could
prevent root from logging in if the network is down.
2012-05-25 10:55:40 +02:00
Sami Kerola 439cdf1e24 login-utils: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-04 19:58:34 +02:00
Karel Zak a807750932 login: minor spelling fixes
Reported-by: Elan Ruusamäe <glen@delfi.ee>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-06 11:38:51 +01:00
Elan Ruusamäe 466a826729 login: minor spelling fixes
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-06 11:32:37 +01:00
Karel Zak 607e6b7ce8 login: support crazy shadow-utils syntax in login.defs
standard syntax for FOO=data:

	ENV_FOO   data

additional syntax:

	ENV_FOO  FOO=data

Reported-by: Colin Guthrie colin@mageia.org
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-02-28 11:16:16 +01:00
Sami Kerola 3f9c237dcb logindefs: fix coding style
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-11-29 17:58:00 +01:00
Karel Zak c82d9c977c login: add login.defs code and tests
The new logindefs.c file contains /etc/login.defs parser and functions
for searching in the list of the login default variables. The patch
also contains a new regression test for the code.

Based on pam_login-4.0 from Suse.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-26 23:17:17 +02:00