summaryrefslogtreecommitdiffstats
path: root/login-utils
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:53 +0100
committerKarel Zak2006-12-07 00:25:53 +0100
commitffc4374869b9ac10539a3c18e13b29d1b0c64484 (patch)
tree1b8054e83f7f70e8fa77499fc9246d1cc16faa15 /login-utils
parentImported from util-linux-2.11n tarball. (diff)
downloadkernel-qcow2-util-linux-ffc4374869b9ac10539a3c18e13b29d1b0c64484.tar.gz
kernel-qcow2-util-linux-ffc4374869b9ac10539a3c18e13b29d1b0c64484.tar.xz
kernel-qcow2-util-linux-ffc4374869b9ac10539a3c18e13b29d1b0c64484.zip
Imported from util-linux-2.11o tarball.
Diffstat (limited to 'login-utils')
-rw-r--r--login-utils/README.admutil249
-rw-r--r--login-utils/chfn.c2
-rw-r--r--login-utils/chsh.c2
-rw-r--r--login-utils/last.c2
-rw-r--r--login-utils/login.c2
-rw-r--r--login-utils/mesg.c2
-rw-r--r--login-utils/passwd.c3
-rw-r--r--login-utils/wall.13
-rw-r--r--login-utils/wall.c2
9 files changed, 11 insertions, 256 deletions
diff --git a/login-utils/README.admutil b/login-utils/README.admutil
deleted file mode 100644
index 448f99f09..000000000
--- a/login-utils/README.admutil
+++ /dev/null
@@ -1,249 +0,0 @@
-README file for the admutils V1.23 for Linux.
-
-See installation instructions at the bottom. Currently the latest versions
-of this software are maintained at ftp://ftp.daimi.aau.dk/pub/linux/poe/
-
-LICENSE:
-This software is distributed as is without any warranty what so ever.
-With respect to copyrights it is covered by the GNU Public License.
-
-Version 1.24 (20-Jun-97)
- Small patches for glibc compat.
-
-Version 1.23 (6-Jun-97):
- Patch by Christophe Thaelemans <thaele@chick.vub.ac.be> to last.c,
- no longer considers all users logged out in case of a run-level
- change.
-
-Version 1.22 (28-Jan-97):
- Clean-up release.
-
-Version 1.21c (27-Jan-97):
- Updated setpwnam.[hc] to be in sync with util-linux 2.6, this
- also prevents passwd from copying the entire passwd YP/NIS map
- into the local /etc/passwd. Edited setpwnam.c somewhat to
- improve error checking, beautify the code, and remove output
- to stderr.
- Fixed a couple of buffer overrun nits in passwd.c, patches from
- David Holland.
-
-Version 1.21b (23-Jan-97):
- Shutdown now supports a message on the command line, a'la
- "shutdown -f +5 'for some reason'"
-
-Version 1.20 (2-Nov-96):
- Fix by Steffen Zahn <zahn@berlin.snafu.de> for shutdown.c so it
- prints its final message.
-
-Version 1.19 (8-Jul-96):
- Fix by faith@cs.unc.edu to allow C-A-D after halting in shutdown.c
-
-Version 1.18 (19-Nov-95):
- passwd almost completely rewritten by Martin Schulze
- <joey@infodrom.north.de> to use setpwnam() and support
- more long options. There's a new man-page as well.
- Hacked some more on Martins passwd.c to support -s and -f options.
- The old passwd.c is in the Attic/ sub-directory.
- Bugfix in shutdown.c to fix file modes.
-
-Version 1.17 (7-Oct-95):
- Added setrlimit() calls to passwd.c and chsh.c to fix security hole
- caused by resource limitations. Inspired by Zefram
- <A.Main@dcs.warwick.ac.uk>. Also beefed up the ptmp locking in
- chsh.c.
- Added swap_off() function to shutdown.c by baekgrd@ibm.net
- (Anders Baekgaard).
- Bugfix in shutdown.c that makes sure wtmp gets closed. By
- Alexandre Julliard <julliard@sunsite.unc.edu>.
- Fixed bug in passwd.c that made it impossible to change from having
- no password into having one.
-
-Version 1.16 (18-Sep-95):
- Added feature to passwd.c by Arpad Magossanyi (mag@tas.vein.hu),
- so root can give a password for a user on the command line. This
- might be useful in a shell script autogenerating passwords for
- new users.
-
- Added and updated manual pages for all commands by Rick Faith.
-
-Version 1.15d (21-Aug-95):
- Fixed minor nit with salt generation in passwd.c
- By Steven Reisman <sar@beehive.mn.org>.
-
-Version 1.15c (5-Jul-95):
- passwd does not allow reuse of the old password when changing.
- passwd returns 1 if the password is not changed. This was
- suggested by Anibal Jodorcovsky <anibal@ee.mcgill.ca> who
- also fixed my initial bug in this feature.
-
- passwd uses O_EXCL for opening /etc/ptmp instead of access/fopen.
- This was suggested by jorge@un1.satlink.com (Jorge).
-
-Version 1.15a (12-Jun-95):
- Fix in last.c so it does not print wtmp entries marked DEAD_PROCESS.
- By Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
-
-Version 1.15 (5-Jun-95):
- Man-page fixes, fixes in pathnames.h to adhere to the FSSTND.
- Fix by Rickard Faith <faith@cs.unc.edu> to passwd.c, so sanity
- checks come before the second entry of the new password.
- This is for Linux 1.2, GCC 2.6.2 or later.
-
-Version 1.14a (12-Mar-95):
- Fixed passwd and chsh so a username that is a prefix of another
- doesn't affect the other's password. After suggested patch
- by Valtteri J. Karu <vatekaru@tuug.utu.fi>, but differently!
-
-Version 1.14 (12-Feb-95):
- Added options -l, -y, -i to last.c. See last.man
-
-Version 1.13d (26-Jan-95):
- Added some comments on request from Rik Faith. Compiled succesfully
- on Linux 1.1.73, GCC 2.5.8, libc 4.5.26
-
-Version 1.13c (6-Dec-94):
- New versions of passwd and chsh due to Alvaro Martinez Echevarria
- <alvaro@enano.etsit.upm.es>, so they will coexist with YP/NIS
- passwords.
-
-Version 1.13b (7-Nov-94):
- Use fgets() + atoi() in chsh.c instead of scanf().
-
-Version 1.12 (17-Sep-94):
- Rik Faith provided patches for passwd.c to let non-alphabetics count
- as digits as well, allows more obscure passwords.
-
- Applied patches from Dave Gentzel <gentzel@nova.enet.dec.com>
- to prevent dereferencing a NULL pointer, and turn off accounting
- in shutdown.c
-
-Version 1.11 (18-Aug-94):
- Finally got around to making it a non-alpha version. Just a
- little cleanup in Makefile
-
-Version 1.10b (8-Jun-94):
- David A. Holland <dholland@husc.harvard.edu> made me aware of a
- security leak in passwd and chsh. /etc/ptmp could be forced to
- be world-writeable. Fixed by hardwiring an umask of 022 into
- passwd and chsh.
-
- Vesa Ruokonen <ruokonen@taivas.lut.fi> sent me a new pathnames.h
- file that shouldn't conflict with paths.h.
-
- Cleaned the source a bit for -Wall
-
-Version 1.10a (31-May-94):
- Vesa Ruokonen <ruokonen@taivas.lut.fi> provided a patch for
- passwd.c such that it will work for multiple usernames for
- the same uid. I mimicked his actions on chsh.c. In both cases
- I added a check to ensure that even if utmp is hacked, one can
- only change the password for users with the same uid.
-
-Version 1.9 (9-Feb-94):
- Vesa Ruokonen suggested that newgrp should support passwords in
- /etc/group. It now does. I mostly rewrote newgrp to make it
- cleaner.
-
-Version 1.8 (19-Jan-94):
- Rik Faith provided several patches, especially for passwd.c and
- some man-pages.
-
-Version 1.7 (3-Nov-93): changes since 1.6
- Shutdown can now be used as a login shell. I forget who sent me the
- patch. Example /etc/passwd entry:
-
- shutdown:dLbVbIMx7bVHw:0:0:Stopper:/:/etc/halt
-
- The package should now be prepared to have shutdown in /sbin as well
- as in /etc. utmp and wtmp are allowed in /usr/adm too. Both things
- are configurable in the Makefile.
-
- <flebbe@cygnus.tat.physik.uni-tuebingen.de> Olaf Flebbe provided a
- patch for chsh.c to make it work.
-
- This version is built under linux 0.99.13 with gcc 2.4.3 and
- libc 4.4.1
-
-Version 1.6 (1-Jun-93)
- Shutdown now looks more like shutdown on SunOS, but not quite. Most
- of this was done by Scott Telford (s.telford@ed.ac.uk), but I
- butchered his patches somewhat. This version was built under Linux
- 0.99.9 with GCC 2.3.3 and libc 4.3.3.
-
- "make install" will now install shutdown in /etc instead of /usr/bin
-
-Version 1.5 (13-Dec-92)
- This version is tested and built under Linux 0.98P6 with gcc-2.2.2d7
- You will have a hard time making it work with the older compilers and
- libraries.
-
- Su is now deprecated. I believe that the GNU/FSF version is better.
-
-CONTENTS.
-last - A new and better last command, a port from BSD done by
- Michael Haardt.
- I put a couple of if's in so LOGIN_PROCESS entries in wtmp
- are not printed.
-
-chsh - CHangeSHell changes the shell entry in the passwd file.
- Written from scratch by me.
-
-passwd - Changes the password in the passwd file.
- Also done from scratch by me.
-
-su - A su(1) command by me.
-
-newgrp - Sets the gid if possible, ala su(1), written by Michael
- Haardt.
-
-shutdown - Shuts down linux. Supports timed shutdowns, and sends
- warnings to all users currently logged in. It then
- kills all processes and unmounts file-systems etc.
-
- Shutdown also doubles as halt and reboot commands.
-
- Shutdown leaves the file /etc/nologin behind after shutdown,
- it is wise to have a "rm -f /etc/nologin" in ones /etc/rc
-
- Shutdown now supports a -s switch, that works in connection
- with the init program in poeigl-1.7 or later, so a singleuser
- reboot is possible.
-
- Rick Sladkey <jrs@world.std.com> provided patches for better
- umounting code, needed in connection with NFS.
-
- Remy Card <card@masi.ibp.fr> provided patches for support for
- fastboot/fasthalt. These create a /fastboot file on shutdown,
- and /etc/rc may check for the existance of this file, to
- optionally skip fsck.
-
-example.rc An example of an /etc/rc file. Edit it to suit your own setup.
-
-ctrlaltdel - Sets the behaviour of the Ctrl-Alt-Del combination.
- "ctrlaltdel hard" makes the key-combination instantly reboot
- the machine without syncing the disk or anything. This may
- very well corrupt the data on the disk.
-
- "ctrlaltdel soft" makes the key-combination send a SIGINT to
- the init process. Such a command would typically be in /etc/rc.
- For this to make sense you must run the init from the
- poeigl-1.4 package or later. The System V compatible init in
- this package won't reboot the machine when it gets a SIGINT.
- Linux version 0.96b-PL1 or later is also needed for this
- feature to work.
-
-init is gone as of V1.5, it was outdated and buggy. If you want a
-SYSV compatible init get the newest one from Mike Smoorenburg, called
-sysvinit.tar.Z
-
-INSTALLATION.
-Simply do a
-
- make
-
-and then (optionally) as root:
-
- make install
-
-
- - Peter (poe@daimi.aau.dk)
diff --git a/login-utils/chfn.c b/login-utils/chfn.c
index e25212e88..7c6bfac05 100644
--- a/login-utils/chfn.c
+++ b/login-utils/chfn.c
@@ -221,7 +221,7 @@ static boolean parse_argv (argc, argv, pinfo)
info_given = false;
while (true) {
c = getopt_long (argc, argv, "f:r:p:h:o:uv", long_options, &index);
- if (c == EOF) break;
+ if (c == -1) break;
/* version? output version and exit. */
if (c == 'v') {
printf ("%s\n", util_linux_version);
diff --git a/login-utils/chsh.c b/login-utils/chsh.c
index 4be7e555f..ce8c2ae90 100644
--- a/login-utils/chsh.c
+++ b/login-utils/chsh.c
@@ -217,7 +217,7 @@ parse_argv (int argc, char *argv[], struct sinfo *pinfo) {
while (c != EOF) {
c = getopt_long (argc, argv, "s:luv", long_options, &index);
switch (c) {
- case EOF:
+ case -1:
break;
case 'v':
printf ("%s\n", util_linux_version);
diff --git a/login-utils/last.c b/login-utils/last.c
index 8d3a8911a..6d0ce2ff6 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -113,7 +113,7 @@ main(int argc, char **argv) {
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- while ((ch = getopt(argc, argv, "0123456789yli:f:h:t:")) != EOF)
+ while ((ch = getopt(argc, argv, "0123456789yli:f:h:t:")) != -1)
switch((char)ch) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
diff --git a/login-utils/login.c b/login-utils/login.c
index c38abe442..048316bcc 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -390,7 +390,7 @@ main(int argc, char **argv)
fflag = hflag = pflag = 0;
passwd_req = 1;
- while ((ch = getopt(argc, argv, "fh:p")) != EOF)
+ while ((ch = getopt(argc, argv, "fh:p")) != -1)
switch (ch) {
case 'f':
fflag = 1;
diff --git a/login-utils/mesg.c b/login-utils/mesg.c
index 2b08d8350..a94ef6650 100644
--- a/login-utils/mesg.c
+++ b/login-utils/mesg.c
@@ -70,7 +70,7 @@ main(argc, argv)
textdomain(PACKAGE);
- while ((ch = getopt(argc, argv, "")) != EOF)
+ while ((ch = getopt(argc, argv, "")) != -1)
switch (ch) {
case '?':
default:
diff --git a/login-utils/passwd.c b/login-utils/passwd.c
index cb50c0ef2..eb3303899 100644
--- a/login-utils/passwd.c
+++ b/login-utils/passwd.c
@@ -257,7 +257,8 @@ main(int argc, char *argv[]) {
textdomain(PACKAGE);
optind = 0;
- while ( (c = getopt_long(argc, argv, "foqsvV", long_options, &opt_index)) != -1 ) {
+ while ((c = getopt_long(argc, argv, "foqsvV",
+ long_options, &opt_index)) != -1) {
switch (c) {
case 'f':
fullname = 1;
diff --git a/login-utils/wall.1 b/login-utils/wall.1
index 788f5f2b7..f774ebd54 100644
--- a/login-utils/wall.1
+++ b/login-utils/wall.1
@@ -53,6 +53,9 @@ Only the super-user can write on the
terminals of users who have chosen
to deny messages or are using a program which
automatically denies messages.
+.Pp
+Reading from a file is refused when the invoker is not superuser
+and the program is suid or sgid.
.Sh SEE ALSO
.Xr mesg 1 ,
.Xr talk 1 ,
diff --git a/login-utils/wall.c b/login-utils/wall.c
index 0bd3b79a9..2797f4651 100644
--- a/login-utils/wall.c
+++ b/login-utils/wall.c
@@ -91,7 +91,7 @@ main(int argc, char **argv) {
if (p)
progname = p+1;
- while ((ch = getopt(argc, argv, "n")) != EOF)
+ while ((ch = getopt(argc, argv, "n")) != -1)
switch (ch) {
case 'n':
/* undoc option for shutdown: suppress banner */