]> git.ipfire.org Git - thirdparty/util-linux.git/blame - lib/pathnames.h
Imported from util-linux-2.10s tarball.
[thirdparty/util-linux.git] / lib / pathnames.h
CommitLineData
6dbe3af9 1/*
eb63b9b8 2 * Vaguely based on
6dbe3af9 3 * @(#)pathnames.h 5.3 (Berkeley) 5/9/89
eb63b9b8 4 * This code is in the public domain.
6dbe3af9 5 */
eb63b9b8 6#include <paths.h>
6dbe3af9
KZ
7
8#ifndef __STDC__
9# error "we need an ANSI compiler"
10#endif
11
eb63b9b8
KZ
12/* The paths for some of these are wrong in /usr/include/paths.h,
13 but we re-define them here. */
6dbe3af9 14
eb63b9b8 15/* Used in login.c, agetty.c, simpleinit.c, shutdown.c, write.c */
6dbe3af9 16#undef _PATH_UTMP
eb63b9b8 17/* Used in login.c, agetty.c, simpleinit.c, shutdown.c, last.c */
6dbe3af9 18#undef _PATH_WTMP
eb63b9b8 19/* These four are used in login.c only */
6dbe3af9
KZ
20#undef _PATH_DEFPATH
21#undef _PATH_DEFPATH_ROOT
22#undef _PATH_LASTLOG
eb63b9b8
KZ
23
24/*
25 * HISTORY
26 *
27What is the history of these six, and related defines?
28------------------------------------------------------------------------
29_PATH_UTMP and UTMP_FILE and UTMP_FILENAME:
30 /etc/utmp > /var/adm/utmp > /var/run/utmp.
31Traditionally we have /etc/utmp.
32In <paths.h> we have /etc/utmp, but since 4.6.0 /var/adm/utmp
33and since 5.0.9 (and in glibc2) /var/run/utmp.
34In login/pathnames.h we have /etc/utmp, but since 4.6.6 /var/adm/utmp.
35In <utmp.h> UTMP_FILE is defined as /etc/utmp, but in 4.6.* as _PATH_UTMP.
36
37_PATH_WTMP and WTMP_FILE and WTMP_FILENAME:
38 /etc/wtmp > /usr/adm/wtmp > /var/adm/wtmp > /var/log/wtmp.
39Traditionally we have /etc/wtmp.
40In <paths.h> we have /usr/adm/wtmp, but since 4.5.13 /var/adm/wtmp,
41and since 5.0.9 (and in glibc2) /var/log/wtmp.
42In login/pathnames.h. we have /etc/wtmp, but since 4.6.6 /var/adm/wtmp.
43In <utmp.h> WTMP_FILE is defined as /usr/adm/wtmp, but in 4.5.* as
44/var/adm/wtmp, and in 4.6.* as _PATH_WTMP.
45
46_PATH_DEFPATH)
47Long ago this was ".:/bin:/usr/bin".
48In <paths.h> libc 4.4.1-4.4.4 have "/usr/bin:/bin"
49and libc 4.5.21-5.4.23 have "/usr/local/bin:/usr/bin:/bin:."
50and libc 5.4.38-5.4.46 have "/usr/local/bin:/usr/bin:/bin".
51In login/pathnames.h libc4 and libc5 have "/usr/local/bin:/bin:/usr/bin:."
52
53_PATH_DEFPATH_ROOT)
54Long ago this was identical to _PATH_DEFPATH.
55In <paths.h> no definition is present before libc 4.5.13.
56Libc 4.5.13 has "/bin:/usr/bin:/etc"
57Libc 4.5.14-5.4.46 have "/sbin:/bin:/usr/sbin:/usr/bin"
58In login/pathnames.h libc4 and libc5 have "/bin:/usr/bin:/etc"
59
60_PATH_LASTLOG)
61 /etc/lastlog > /usr/adm/lastlog > /var/adm/lastlog > /var/log/lastlog.
62Traditionally we have /etc/lastlog.
63In <bsd/utmp.h> libc 4.4.1-4.5.12 have /usr/adm/lastlog, 4.5.13 and
64later have /var/adm/lastlog.
65In paths.h all libc5 and glibc2 versions have /var/log/lastlog.
66In login/pathnames.h all libc4 and libc5 versions have /usr/adm/lastlog.
67
68_PATH_MAILDIR)
69 /usr/spool/mail > /var/spool/mail > /var/mail.
70Traditionally we have /usr/spool/mail.
71In <paths.h> we have /usr/spool/mail, but since libc 4.5.13 /var/spool/mail.
72In login/pathnames.h all libc4 versions have /var/spool/mail.
73Libc5 and glibc 2.0-2.1 have /var/spool/mail, but glibc 2.1.1 has /var/mail.
74------------------------------------------------------------------------*/
75
6dbe3af9
KZ
76
77#ifndef SBINDIR
726f69e2 78#define SBINDIR "/sbin"
6dbe3af9
KZ
79#endif
80
81#ifndef USRSBINDIR
726f69e2 82#define USRSBINDIR "/usr/sbin"
6dbe3af9
KZ
83#endif
84
85#ifndef LOGDIR
726f69e2 86#define LOGDIR "/var/log"
6dbe3af9
KZ
87#endif
88
89#ifndef VARPATH
726f69e2 90#define VARPATH "/var"
6dbe3af9
KZ
91#endif
92
fd6b7a7f
KZ
93#ifndef UT_NAMESIZE
94#define UT_NAMESIZE 8
95#endif
96
6dbe3af9
KZ
97#define _PATH_BSHELL "/bin/sh"
98#define _PATH_CSHELL "/bin/csh"
6dbe3af9
KZ
99#define _PATH_TTY "/dev/tty"
100#define TTYTYPES "/etc/ttytype"
101#define SECURETTY "/etc/securetty"
726f69e2 102#define _PATH_UTMP "/var/run/utmp"
6dbe3af9 103#define _PATH_WTMP LOGDIR "/wtmp"
fd6b7a7f 104#define _PATH_WTMPLOCK "/etc/wtmplock"
6dbe3af9 105
5c36a0eb
KZ
106/* no more . in DEFPATH */
107#define _PATH_DEFPATH "/usr/local/bin:/bin:/usr/bin"
6dbe3af9
KZ
108#define _PATH_DEFPATH_ROOT SBINDIR ":/bin:" USRSBINDIR ":/usr/bin"
109#define _PATH_HUSHLOGIN ".hushlogin"
110#define _PATH_LASTLOG LOGDIR "/lastlog"
eb63b9b8
KZ
111
112#ifndef _PATH_MAILDIR
6dbe3af9 113#define _PATH_MAILDIR VARPATH "/spool/mail"
eb63b9b8 114#endif
6dbe3af9
KZ
115#define _PATH_MOTDFILE "/etc/motd"
116#define _PATH_NOLOGIN "/etc/nologin"
117
118#define _PATH_LOGIN "/bin/login"
119#define _PATH_INITTAB "/etc/inittab"
120#define _PATH_RC "/etc/rc"
121#define _PATH_REBOOT SBINDIR "/reboot"
122#define _PATH_SINGLE "/etc/singleboot"
5c36a0eb
KZ
123#define _PATH_SHUTDOWN_CONF "/etc/shutdown.conf"
124
6dbe3af9
KZ
125#define _PATH_SECURE "/etc/securesingle"
126#define _PATH_USERTTY "/etc/usertty"
127
eb63b9b8 128/* used in login-utils/shutdown.c */
6dbe3af9
KZ
129#define _PATH_MTAB "/etc/mtab"
130#define _PATH_UMOUNT "/bin/umount"
66ee8158 131#define UMOUNT_ARGS "umount", "-a", "-t", "nodevfs"
726f69e2 132#define SWAPOFF_ARGS "swapoff", "-a"
6dbe3af9 133
eb63b9b8 134/* used in login-utils/setpwnam.h and login-utils/islocal.c */
6dbe3af9 135#define _PATH_PASSWD "/etc/passwd"
eb63b9b8
KZ
136
137/* used in login-utils/setpwnam.h */
6dbe3af9
KZ
138#define _PATH_PTMP "/etc/ptmp"
139#define _PATH_PTMPTMP "/etc/ptmptmp"
fd6b7a7f
KZ
140#define _PATH_GROUP "/etc/group"
141#define _PATH_GTMP "/etc/gtmp"
142#define _PATH_GTMPTMP "/etc/gtmptmp"
143
eb63b9b8 144/* used in misc-utils/look.c */
6dbe3af9
KZ
145#define _PATH_WORDS "/usr/dict/words"
146#define _PATH_WORDS_ALT "/usr/dict/web2"