From eb63b9b8f4cecb34c2478282567862bc48ef256d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 7 Dec 2006 00:25:41 +0100 Subject: Imported from util-linux-2.10f tarball. --- lib/pathnames.h | 96 +++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 69 insertions(+), 27 deletions(-) (limited to 'lib/pathnames.h') diff --git a/lib/pathnames.h b/lib/pathnames.h index ab7b97dc8..60797f94e 100644 --- a/lib/pathnames.h +++ b/lib/pathnames.h @@ -1,43 +1,78 @@ /* - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * + * Vaguely based on * @(#)pathnames.h 5.3 (Berkeley) 5/9/89 - * - * Changed: Sun Nov 21 12:30:54 1993 by faith@cs.unc.edu - * Changed: Wed Jun 22 20:47:27 1994 by faith@cs.unc.edu, based on changes - * from poe@daimi.aau.dk - * Changed: Wed Jun 22 22:50:13 1994 by faith@cs.unc.edu - * Changed: Sat Feb 4 16:02:10 1995 by faith@cs.unc.edu - * Changed: Tue Jul 2 09:37:36 1996 by janl@math.uio.no, axp patches - * Changed: Thu Nov 9 21:58:36 1995 by joey@infodrom.north.de + * This code is in the public domain. */ +#include #ifndef __STDC__ # error "we need an ANSI compiler" #endif -/* The paths for some of these are wrong in /usr/include/paths.h, but we - re-define them here. */ +/* The paths for some of these are wrong in /usr/include/paths.h, + but we re-define them here. */ +/* Used in login.c, agetty.c, simpleinit.c, shutdown.c, write.c */ #undef _PATH_UTMP +/* Used in login.c, agetty.c, simpleinit.c, shutdown.c, last.c */ #undef _PATH_WTMP +/* These four are used in login.c only */ #undef _PATH_DEFPATH #undef _PATH_DEFPATH_ROOT #undef _PATH_LASTLOG -#undef _PATH_MAILDIR + +/* + * HISTORY + * +What is the history of these six, and related defines? +------------------------------------------------------------------------ +_PATH_UTMP and UTMP_FILE and UTMP_FILENAME: + /etc/utmp > /var/adm/utmp > /var/run/utmp. +Traditionally we have /etc/utmp. +In we have /etc/utmp, but since 4.6.0 /var/adm/utmp +and since 5.0.9 (and in glibc2) /var/run/utmp. +In login/pathnames.h we have /etc/utmp, but since 4.6.6 /var/adm/utmp. +In UTMP_FILE is defined as /etc/utmp, but in 4.6.* as _PATH_UTMP. + +_PATH_WTMP and WTMP_FILE and WTMP_FILENAME: + /etc/wtmp > /usr/adm/wtmp > /var/adm/wtmp > /var/log/wtmp. +Traditionally we have /etc/wtmp. +In we have /usr/adm/wtmp, but since 4.5.13 /var/adm/wtmp, +and since 5.0.9 (and in glibc2) /var/log/wtmp. +In login/pathnames.h. we have /etc/wtmp, but since 4.6.6 /var/adm/wtmp. +In WTMP_FILE is defined as /usr/adm/wtmp, but in 4.5.* as +/var/adm/wtmp, and in 4.6.* as _PATH_WTMP. + +_PATH_DEFPATH) +Long ago this was ".:/bin:/usr/bin". +In libc 4.4.1-4.4.4 have "/usr/bin:/bin" +and libc 4.5.21-5.4.23 have "/usr/local/bin:/usr/bin:/bin:." +and libc 5.4.38-5.4.46 have "/usr/local/bin:/usr/bin:/bin". +In login/pathnames.h libc4 and libc5 have "/usr/local/bin:/bin:/usr/bin:." + +_PATH_DEFPATH_ROOT) +Long ago this was identical to _PATH_DEFPATH. +In no definition is present before libc 4.5.13. +Libc 4.5.13 has "/bin:/usr/bin:/etc" +Libc 4.5.14-5.4.46 have "/sbin:/bin:/usr/sbin:/usr/bin" +In login/pathnames.h libc4 and libc5 have "/bin:/usr/bin:/etc" + +_PATH_LASTLOG) + /etc/lastlog > /usr/adm/lastlog > /var/adm/lastlog > /var/log/lastlog. +Traditionally we have /etc/lastlog. +In libc 4.4.1-4.5.12 have /usr/adm/lastlog, 4.5.13 and +later have /var/adm/lastlog. +In paths.h all libc5 and glibc2 versions have /var/log/lastlog. +In login/pathnames.h all libc4 and libc5 versions have /usr/adm/lastlog. + +_PATH_MAILDIR) + /usr/spool/mail > /var/spool/mail > /var/mail. +Traditionally we have /usr/spool/mail. +In we have /usr/spool/mail, but since libc 4.5.13 /var/spool/mail. +In login/pathnames.h all libc4 versions have /var/spool/mail. +Libc5 and glibc 2.0-2.1 have /var/spool/mail, but glibc 2.1.1 has /var/mail. +------------------------------------------------------------------------*/ + #ifndef SBINDIR #define SBINDIR "/sbin" @@ -73,7 +108,10 @@ #define _PATH_DEFPATH_ROOT SBINDIR ":/bin:" USRSBINDIR ":/usr/bin" #define _PATH_HUSHLOGIN ".hushlogin" #define _PATH_LASTLOG LOGDIR "/lastlog" + +#ifndef _PATH_MAILDIR #define _PATH_MAILDIR VARPATH "/spool/mail" +#endif #define _PATH_MOTDFILE "/etc/motd" #define _PATH_NOLOGIN "/etc/nologin" @@ -87,18 +125,22 @@ #define _PATH_SECURE "/etc/securesingle" #define _PATH_USERTTY "/etc/usertty" +/* used in login-utils/shutdown.c */ #define _PATH_MTAB "/etc/mtab" #define _PATH_UMOUNT "/bin/umount" #define UMOUNT_ARGS "umount", "-a" #define SWAPOFF_ARGS "swapoff", "-a" +/* used in login-utils/setpwnam.h and login-utils/islocal.c */ #define _PATH_PASSWD "/etc/passwd" + +/* used in login-utils/setpwnam.h */ #define _PATH_PTMP "/etc/ptmp" #define _PATH_PTMPTMP "/etc/ptmptmp" - #define _PATH_GROUP "/etc/group" #define _PATH_GTMP "/etc/gtmp" #define _PATH_GTMPTMP "/etc/gtmptmp" +/* used in misc-utils/look.c */ #define _PATH_WORDS "/usr/dict/words" #define _PATH_WORDS_ALT "/usr/dict/web2" -- cgit v1.2.3-55-g7522