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