Commit Graph

125 Commits

Author SHA1 Message Date
Daniel Mierswa 437fa54f05 replace usleep() for systems that don't have them
This function is marked obsolete in POSIX.1-2001 and removed in
POSIX.1-2008.

Conditionally replaced with nanosleep().

Signed-off-by: Daniel Mierswa <impulze@impulze.org>
2009-08-21 09:58:17 +02:00
Peter Breitenlohner dc21efac31 simpleinit.8: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:11 +02:00
Peter Breitenlohner ac4aadf973 shutdown.8: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:11 +02:00
Peter Breitenlohner c6447b6d14 newgrp.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:11 +02:00
Peter Breitenlohner 8d6047001b mesg.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:11 +02:00
Peter Breitenlohner dfa815f926 last.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:10 +02:00
Peter Breitenlohner caab730c3f initctl.8: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:10 +02:00
Peter Breitenlohner 2054a2b01c chsh.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:10 +02:00
Peter Breitenlohner 3e1dd9e846 chfn.1: formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:10 +02:00
Peter Breitenlohner 2fd71e5283 vipw.8: remove erroneous empty line, formatting
Signed-off-by: Peter Breitenlohner <peb@mppmu.mpg.de>
2009-08-17 12:11:04 +02:00
Daniel Mierswa c0f19ccff7 replace bcopy,bzero,index and rindex
Those 4 functions are marked as LEGACY in POSIX.1-2001 and removed in
POSIX.1-2008.

Replaced with memmove,memset,strchr and strrchr.

Signed-off-by: Daniel Mierswa <impulze@impulze.org>
2009-08-17 11:15:59 +02:00
Karel Zak 30688dde55 build-sys: rename to _execdir
The variable name "usrlibexecdir" is very confusing (because we have
/usr/libexec). The "exec" prefix is required for user-defined
directories, see

   http://www.gnu.org/software/hello/manual/automake/The-Two-Parts-of-Install.html#The-Two-Parts-of-Install

This patch renames all usr*execdir variables to usr*_execdir.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-07-04 01:23:41 +02:00
Karel Zak 6ed7a96dfb build-sys: fix exec/data install hooks
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-07-04 00:55:56 +02:00
Karel Zak c74c0dafff include: clean up _PATH_DEV_* macros
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-06-30 01:13:42 +02:00
Aurelien Jarno ee51904169 agetty: IUCLC and OLCUC are Linux extensions
IUCLC and OLCUC are Linux extensions to termios. The same way it is
already done for XCASE, they can be ignored if not supported.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2009-04-23 15:43:42 +02:00
Karel Zak 3c0e680cc2 login: use open(2) rather then access(2) for $HOME/.hushlogin
As an NFS client with home directories on mounted NFS share - If the
NFS server exports the share with default root squashed, login cannot
access the filesystem to check for the existence of .hushlogin file.

It seems better to use open(2) rather than access(2).

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-04-10 11:15:10 +02:00
Karel Zak 067f5343c8 login: use "remote" as a PAM service name for "login -h"
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-17 21:00:42 +01:00
Karel Zak bc4aa3b588 login: remove "switching users" nonsense from man page
For more details see the BUGS section in the man page.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-09 09:43:49 +01:00
Karel Zak e682ce7d61 simmpleinit: fix gcc warning (buffer size in read())
simpleinit.c:846:
/usr/include/bits/unistd.h:43  warning: call to ‘__read_chk_warn’
declared with attribute warning: read called with bigger length than
size of the destination buffer

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-03-03 15:31:39 +01:00
Karel Zak 30e8b186b4 agetty: check for termios.c_line struct member by autoconf
Reported-by: Robert Millan <rmh@aybabtu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-02-05 23:37:37 +01:00
Karel Zak 1205b9fe5f refresh gitignore
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-12 15:03:18 +01:00
Karel Zak 2449f6b0fa simpleinit: cleanup gettext calls, use snprintf()
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-12 15:01:15 +01:00
Karel Zak 26fb9222c4 chfn: several strings without gettext calls
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-12 14:44:04 +01:00
Karel Zak 12318be41b TODO: add request to use nl_langinfo()
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-12-12 14:41:34 +01:00
Karel Zak ad067f1625 Revert "login-utils: several strings without gettext calls"
This reverts commit 64fefaf5bf.

It does not make sense to localize config options (wdays in
checktty.c) and debug messages (main() in checktty.c.
2008-12-12 14:33:29 +01:00
Karel Zak 5476bf9b5b login: cleanup includes
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-11-26 14:38:36 +01:00
Karel Zak df73ad460d agetty: sys/types.h and time.h are included more than once
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-11-26 14:35:31 +01:00
Pedro Ribeiro 64fefaf5bf login-utils: several strings without gettext calls
Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-03 09:13:20 +02:00
Karel Zak a063e16c5d login: fix compiler warning (int32 time() arg)
login.c: In function ‘dolastlog’:
login.c:1438  warning: passing argument 1 of ‘time’ from incompatible pointer type

Unfortunately, on-disk lastlog format is always 32bit, bits/utmp.h:

  struct lastlog
  {
  #if __WORDSIZE == 64 && defined __WORDSIZE_COMPAT32
     int32_t ll_time;
  #else
     __time_t ll_time;
  #endif

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-29 13:08:06 +02:00
Karel Zak 53e9eda352 login: fix warning "dereferencing type-punned pointer will break strict-aliasing rules"
This patch fix problems with odd pam_get_iten( ..., void **) API.
(tested by gcc-4.1.2-42.el5.i386)

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-09-01 12:41:57 +02:00
maximilian attems d3e8f6598b remove CVS keywords
this patch removes old CVS keywords from comments.

mount(8) works for newer Linux then 0.99 ;)

Signed-off-by: maximilian attems <max@stro.at>
2008-07-28 11:10:08 +02:00
Karel Zak 4ba66edf82 selinux: is_selinux_enabled() returns 0, 1 and -1
Unfortunately, the current libselinux implementation of
is_selinux_enabled() returns -1 on error. This behavior is
undocumented.

The proper solution is to use "if (is_selinux_enabled() > 0)".

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-01 14:32:53 +02:00
Steve Grubb 8ccf0b253a login: audit log injection attack via login
A while back I found a couple audit log injection attacks which became
CVE-2007-3102. I forgot to look at login to see if its vulnerable and Mirek
found that it is. To verify the problem, type:

root addr=xyz.com

for the account name while logging in. It will look like root logged in with
an address of xyz.com.

Signed-off-by: Steve Grubb <sgrubb@redhat.com>
2008-04-21 13:34:31 +02:00
Karel Zak dee2383e8f build-sys: remove unnecessary check-local target from login-utils/
We have all tests in the tests/ directory.

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-16 22:04:46 +02:00
Benno Schulenberg 265095a2fe chfn, chsh, login: collapsing three similar messages into a single one
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2008-04-16 00:29:30 +02:00
Karel Zak 00077d4d53 build-sys: update .gitignore files
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14 14:24:03 +02:00
James Youngman c4e1583799 build-sys: ignore a bunch of generated files, mostly binaries
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14 14:08:00 +02:00
James Youngman 8e0259728e login: rewrite is_local() to remove limits on line length
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-14 13:12:14 +02:00
James Youngman 489374709c login-utils: cleanup strlen() and fgets() usage
The strlen() returns size_t, not int. The fgets() returns
pointer, not int.

Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-04-08 01:44:51 +02:00
Karel Zak 1afa7ab49d chfn: fix compiler warnings in selinux stuff
selinux_utils.c:16: warning: assignment discards qualifiers from pointer target type

Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-20 15:06:52 +01:00
Jim Meyering 71c445db69 remove useless if-before-free tests.
E.g., in this example, the "if (p)" test is useless.

  if (p)
    free (p);

I've been removing such tests systematically.
Here's where I proposed it to the git folks, along with justification
for why it's ok to perform this transformation, these days (no one
uses SunOS4 anymore):

    http://thread.gmane.org/gmane.comp.version-control.git/74187

Signed-off-by: Jim Meyering <meyering@redhat.com>
2008-03-12 12:00:39 +01:00
Hamish Coleman ff3d19bd8f agetty: make username-in-uppercase feature optional (off by default.)
The following patch makes the username-in-upper-case feature optional.

I have chosen to make it default to off since this feature was designed
to cater for serial terminals that were last sold almost 30 years ago,
thus the likelyhood that anyone will need this feature turned on is
vanishingly small.

Addresses-Debian-Bug: 156242
Signed-off-by: Hamish Coleman <hamish@zot.org>
Signed-off-by: LaMont Jones <lamont@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-03-06 12:47:48 +01:00
Karel Zak 30568eec59 login: fix a small memory leak and remove unnecessary zeroing
This patch fix a small memory leak (rh#251539) and also remove
unnecessary pam_set_item(). We needn't to zeroing PAM_USER when the
value is already NULL, it doesn't make sense.

Addresses-Red-Hat-Bugzilla: #251539
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-01-28 14:07:16 +01:00
Samuel Thibault ad3a3bfc7a login: replace termio with termios interface
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-01-03 16:40:48 +01:00
Samuel Thibault 1961482a4e agetty: replace termio with termios interface
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-01-03 16:40:32 +01:00
Stepan Kasal a3ca3a44c5 build-sys: use dist_man_MANS instead of man_MANS
Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-12-17 10:08:49 +01:00
Stepan Kasal 9af2166d11 shutdown: use _PATH_MOUNTED instead of _PATH_MTAB
Signed-off-by: Stepan Kasal <skasal@redhat.com>
2007-12-17 10:08:44 +01:00
Karel Zak e6590f06ad agetty: non-linux support (use pathnames.h)
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-28 13:19:42 +01:00
Karel Zak 2f4564eac4 include: cleanup pathnames.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2007-11-28 13:17:16 +01:00
Samuel Thibault e460a5bf89 build-sys: cleanup usage of linux/major.h
The utils like fdisk or login are usable on non-linux systems.
This patch allows to compile on systems without linux/major.h.

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2007-11-28 10:41:26 +01:00