summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Bogatov <KAction@gnu.org>2017-09-01 04:11:07 +0300
committerDmitry Bogatov <KAction@gnu.org>2018-02-14 19:28:15 +0300
commit0f54d42cfb603888b202aa4130fa94d139726f71 (patch)
tree767b80f8a8e7503280acf78ec99cb9c99dd078ee
parente9d67d805b5d6285d370eb63a073617bd727d9c7 (diff)
[PATCH] Install login binaries into private directory
These binaries are never invoked directly and as such should not pollute PATH. Also, this way they do not have to have manpage.
-rw-r--r--Makefile6
-rw-r--r--fgetty.c2
-rw-r--r--login.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index a1ae4ad..f1bd217 100644
--- a/Makefile
+++ b/Makefile
@@ -29,9 +29,9 @@ debug: fgetty.c fmt_ulong.o
gcc -g -o debug fgetty.c fmt_ulong.o -DDEBUG
install:
- install -d $(DESTDIR)/bin $(DESTDIR)/sbin $(DESTDIR)/usr/share/man/man8
- install login $(DESTDIR)/bin/login1
- install login2 $(DESTDIR)/bin
+ install -d $(DESTDIR)/bin $(DESTDIR)/sbin $(DESTDIR)/usr/share/man/man8 $(DESTDIR)/lib/fgetty
+ install login $(DESTDIR)/lib/fgetty/login1
+ install login2 $(DESTDIR)/lib/fgetty/login2
install fgetty $(DESTDIR)/sbin
install checkpassword $(DESTDIR)/bin/checkpassword.login
install -m 644 fgetty.8 $(DESTDIR)/usr/share/man/man8/fgetty.8
diff --git a/fgetty.c b/fgetty.c
index c4a6241..6cadbdd 100644
--- a/fgetty.c
+++ b/fgetty.c
@@ -311,7 +311,7 @@ int main(int argc,char *argv[]) {
loginargv[2]=logname;
echo_off();
#ifdef TEST
- execve("/bin/login1", loginargv, environ);
+ execve("/lib/fgetty/login1", loginargv, environ);
#else
execve("/bin/login", loginargv, environ);
#endif
diff --git a/login.c b/login.c
index 8a46a76..6cd81c3 100644
--- a/login.c
+++ b/login.c
@@ -25,7 +25,7 @@
#define CHECKPASSWORD "/bin/checkpassword.login"
#define FALLBACKCHECKPASSWORD "/bin/checkpassword"
-#define LOGIN2 "/bin/login2"
+#define LOGIN2 "/lib/fgetty/login2"
#include <string.h>
#include <unistd.h>