summaryrefslogtreecommitdiff
path: root/net-dialup/mingetty
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-dialup/mingetty
reinit the tree, so we can have metadata
Diffstat (limited to 'net-dialup/mingetty')
-rw-r--r--net-dialup/mingetty/Manifest7
-rw-r--r--net-dialup/mingetty/files/mingetty-1.08-check_chroot_chdir_nice.patch36
-rw-r--r--net-dialup/mingetty/files/mingetty-1.08-utf8.patch156
-rw-r--r--net-dialup/mingetty/metadata.xml18
-rw-r--r--net-dialup/mingetty/mingetty-1.08-r1.ebuild33
5 files changed, 250 insertions, 0 deletions
diff --git a/net-dialup/mingetty/Manifest b/net-dialup/mingetty/Manifest
new file mode 100644
index 000000000000..70226b49f47f
--- /dev/null
+++ b/net-dialup/mingetty/Manifest
@@ -0,0 +1,7 @@
+AUX mingetty-1.08-check_chroot_chdir_nice.patch 1148 SHA256 cf82654c452dc43ec0a53bfc940429707cc54afefb57665471a0a16dc4fc5b40 SHA512 b296b8618218014bbe02b0d449d7e478a098d23e224ded632ea2e2f9ee95252930f31657adecb971e9e5d984491f6763295a0d269f3d6d59926e1f86ed49e0b2 WHIRLPOOL d2ee7ff7983dd4d56d699ec4d3e8973750842125baf5a6d75c0517aabe1447a34d0287501de12f6095bf878f9a651c0632cfbdf000a9d7c50dcbce7d7a36fcc4
+AUX mingetty-1.08-utf8.patch 4203 SHA256 690f5c2587de5f63a52fc2d61a8af8660773eefdba7e1a0f05cbb97740338938 SHA512 157ee0f38ad2175a3a5c1fd40a419e963c7310c2e1e7d8e8879ee17cca1283f2ea7ba39a0a67381347e75d5b691becf56f92c9ae2e5f65ca400687cb565ca31a WHIRLPOOL 7a954002f3075baa37091c65f96b59b66274d35712fe72c657f14a5ffc2de7717a4d9813674edf9d9e96f61bd57a82670d5797a92c23480335097a9cd25fdcd5
+DIST mingetty-1.08.tar.gz 13476 SHA256 0f55c90ba4faa913d91ef99cbf5cb2eb4dbe2780314c3bb17953f849c8cddd17 SHA512 d2c050a412af81d4635cbaa5610dfa2cf2addce0d3116fa53f73eb15cd6b53d476165a0509ae630a151de07a5bdc82cba1b5da0ab78d0313b200adece3c8872b WHIRLPOOL 090c778d6fdb43a4aa0dd916c344cc810df78a623ead391b4e06cc3a1e7a5f1497b05aadd558d3c031953e4941cbf1f521c307f148215af26bffb2708bc9e8bf
+EBUILD mingetty-1.08-r1.ebuild 754 SHA256 fcbbe3f89104d0657b92b0a7056632119fdec639baa064739f8326feadd9e7ec SHA512 8d7a84a5573aff99c6272277d55c89e27d8317814eb1a1a4d1a529d6d6b95a0d250ff3252e76996cf1074673564b77178e88c883ea3d54f6ac9788c9e4f97737 WHIRLPOOL f64eae77dde9629a0d764416a805ea70f37a2616f12fcad6c51c8559c5efe77f7266b8ba889f4b4c997f282b9968a7e9c568b50047a29761549bdb819a6038df
+MISC ChangeLog 5134 SHA256 67451d5103507e3693aca0aca6a992d8b8ff16ff869da9c060013cc1452df31d SHA512 8cfa1dc4d750975760c78e031113194118c9632c0cdee7c33438934dd2d39edc320b3324ed85ee870e8b63acae1d36d9624af3dc4fdc2415d42b8d870513f70e WHIRLPOOL b027ddedb8ad83ea2077aeeeb3e7554ea41a2f5e68c33608e5b724cebda86b3bc2cfd39e237365267de38ea11fc816cab72b4516b0ace4a9e64279e527000edc
+MISC ChangeLog-2015 7070 SHA256 353797719837668a941d1b704905d70d5b47375dcb1ea55ed3752f104876a57f SHA512 b19c747d1158e2d9a2e39e1032858dd3ee1d976e8dad39b80d5fb9772a6e803631f3d2784019ccb605d77c395a3b0f29ae8183d289370308f410a2b0267da2fa WHIRLPOOL dc3d1471dbc6e05689f1bc86862118ad7e99151f0fb9bccfe87fca389e9c252b0dd7a335caa5dcaa5b4b470b257d653705bc7203e76eb9bad22daf1ce1440a37
+MISC metadata.xml 674 SHA256 b00ecc64451c6922c2e784d79ebb7f2458af5b3e3df26cdbfc3ad7329137582c SHA512 0d35b42494edd2c4f8e7f2ad51463c2f9730f52d032adf6e3ea3156b05f090b0eaaaec95c4fc4db02e3ebc76cf7848571398bdccf3735adf5511ff1959431201 WHIRLPOOL e8b1c59c4caffbe4e0459b4b3d9a66c42538a00e7df75df4144c938a3f19d3817d0317d9e8f9e77b8bc3dd097bc2f84b982ea8536ed1304907f4b9e878fa59cc
diff --git a/net-dialup/mingetty/files/mingetty-1.08-check_chroot_chdir_nice.patch b/net-dialup/mingetty/files/mingetty-1.08-check_chroot_chdir_nice.patch
new file mode 100644
index 000000000000..84599667551b
--- /dev/null
+++ b/net-dialup/mingetty/files/mingetty-1.08-check_chroot_chdir_nice.patch
@@ -0,0 +1,36 @@
+Check chdir() on chroot() syscalls (and similar) as chroot without proper
+chdir() allows to escape from changed root.
+
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597382
+https://sourceforge.net/tracker/?func=detail&aid=3095679&group_id=80387&atid=559616
+
+--- mingetty-1.08/mingetty.c
++++ mingetty-1.08/mingetty.c
+@@ -422,12 +422,21 @@
+ while ((logname = get_logname ()) == 0)
+ /* do nothing */ ;
+
+- if (ch_root)
+- chroot (ch_root);
+- if (ch_dir)
+- chdir (ch_dir);
+- if (priority)
+- nice (priority);
++ if (ch_root) {
++ if (chroot (ch_root))
++ error ("chroot(\"%s\") failed: %s", ch_root, strerror (errno));
++ if (chdir("/"))
++ error ("chdir(\"/\") failed: %s", strerror (errno));
++ }
++ if (ch_dir) {
++ if (chdir (ch_dir))
++ error ("chdir(\"%s\") failed: %s", ch_dir, strerror (errno));
++ }
++ if (priority) {
++ errno = 0; /* see the nice(2) NOTES for why we do this */
++ if ((nice (priority) == -1) && (errno != 0))
++ error ("nice(%d) failed: %s", priority, strerror (errno));
++ }
+
+ execl (loginprog, loginprog, autologin? "-f" : "--", logname, NULL);
+ error ("%s: can't exec %s: %s", tty, loginprog, strerror (errno));
diff --git a/net-dialup/mingetty/files/mingetty-1.08-utf8.patch b/net-dialup/mingetty/files/mingetty-1.08-utf8.patch
new file mode 100644
index 000000000000..c57bc0b6ad4e
--- /dev/null
+++ b/net-dialup/mingetty/files/mingetty-1.08-utf8.patch
@@ -0,0 +1,156 @@
+diff -Nru mingetty-1.08.orig/mingetty.c mingetty-1.08/mingetty.c
+--- mingetty-1.08.orig/mingetty.c 2008-01-18 13:13:07.000000000 +0200
++++ mingetty-1.08/mingetty.c 2008-01-30 00:14:25.000000000 +0200
+@@ -16,10 +16,15 @@
+ * - autologin only at first login
+ * - /etc/mingetty.conf that can be used instead of /etc/inittab for
+ * command line options
+- * - Can UTF-8 setup be done within mingetty?
++ * - Can UTF-8 setup be done within mingetty? Let's try now :-) (VinzC)
+ * - Also add /bin/login-type functionality in here?
+ */
+
++/* Additional comments: Vincent Cadet <vcadet@hotmail.com> (2006-11-21)
++ * - Attempt to make mingetty support UTF-8. Modifications were imported
++ * from Suse migetty.c 0.9.6s.
++ */
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+@@ -39,6 +44,19 @@
+ #include <syslog.h>
+ #include <sys/utsname.h>
+ #include <time.h>
++#include <locale.h>
++#include <iconv.h>
++#include <wctype.h>
++#include <sys/kd.h>
++#include <sys/ttydefaults.h>
++
++#ifndef IUTF8
++# ifndef ASM_IUTF8
++# error ASM_IUTF8 input flag not defined - Cannot define IUTF8
++# else
++# define IUTF8 ASM_IUTF8
++# endif
++#endif
+
+ /* name of this program (argv[0]) */
+ static char *progname;
+@@ -76,6 +94,8 @@
+ static char *autologin = NULL;
+ /* try to read a char before dropping to login prompt */
+ static int loginpause = 0;
++/* terminal mode */
++static int mode = K_RAW;
+
+ /* error() - output error messages */
+ static void error (const char *fmt, ...)
+@@ -189,10 +209,21 @@
+ if (fd > 2)
+ close (fd);
+
++ /* Detect mode of current keyboard setup, e.g. for UTF-8 */
++ if (ioctl(0, KDGKBMODE, &mode) < 0)
++ mode = K_RAW;
++
+ /* Write a reset string to the terminal. This is very linux-specific
+ and should be checked for other systems. */
+ if (noclear == 0)
+- write (0, "\033c", 2);
++ /* don't write a full reset (ESC c) because this leaves the
++ unicode mode again if the terminal was in unicode mode
++ and also undos the ESC sequences in CONSOLE_MAGIC which
++ are needed for some languages/console-fonts.
++ Just put the cursor to the home position (ESC [ H),
++ erase everything below the cursor (ESC [ J), and set the
++ scrolling region to the full window (ESC [ r) */
++ write (0, "\033[r\033[H\033[J", 9);
+
+ sigaction (SIGHUP, &sa_old, NULL);
+ }
+@@ -298,32 +329,75 @@
+
+ static char *get_logname (void)
+ {
+- static char logname[40];
++ static char logname[4*UT_NAMESIZE];
+ char *bp;
+ unsigned char c;
++ int ascii;
++ iconv_t ic;
+
+ tcflush (0, TCIFLUSH); /* flush pending input */
++
++ /* Check for UTF-8 mode */
++ switch(mode) {
++ case K_UNICODE:
++ ascii = 0;
++ setlocale(LC_CTYPE, "en_US.UTF-8");
++ break;
++ case K_RAW:
++ case K_MEDIUMRAW:
++ case K_XLATE:
++ default:
++ ascii = 1;
++ setlocale(LC_CTYPE, "POSIX");
++ break;
++ }
++
+ for (*logname = 0; *logname == 0;) {
+ do_prompt (1);
+ for (bp = logname;;) {
+ if (read (0, &c, 1) < 1) {
+- if (errno == EINTR || errno == EIO
+- || errno == ENOENT)
++ if (errno == EINTR || errno == EAGAIN) {
++ usleep(1000);
++ continue;
++ }
++ if (errno == EIO || errno == ENOENT)
+ exit (EXIT_SUCCESS);
+ error ("%s: read: %s", tty, strerror (errno));
+ }
+ if (c == '\n' || c == '\r') {
+ *bp = 0;
+ break;
+- } else if (!isprint (c))
+- error ("%s: invalid character 0x%x in login"
+- " name", tty, c);
++ }
++
++ if (ascii && !isprint (c))
++ error ("%s: invalid character 0x%x in login name", tty, c);
+ else if ((size_t)(bp - logname) >= sizeof (logname) - 1)
+ error ("%s: too long login name", tty);
+- else
+- *bp++ = c;
++
++ *bp++ = c;
+ }
+ }
++
++ if (!ascii && (ic = iconv_open("WCHAR_T", "UTF-8"))) {
++ char tmpbuf[4*sizeof(logname)], *op, *lp;
++ size_t len = bp - logname;
++ size_t out = sizeof(tmpbuf) - 1;
++ size_t wcl;
++ wint_t *wcp;
++
++ op = tmpbuf;
++ lp = logname;
++ if ((wcl = iconv(ic , &lp, &len, &op, &out)) == (size_t)-1)
++ error ("%s: invalid character conversion for login name", tty);
++ iconv_close(ic);
++
++ wcp = (wint_t*)tmpbuf;
++ wcp[wcl] = (wint_t)0;
++ while (*wcp) {
++ if (!iswprint(*wcp++))
++ error ("%s: invalid character for login name found", tty);
++ }
++ }
+ return logname;
+ }
+
diff --git a/net-dialup/mingetty/metadata.xml b/net-dialup/mingetty/metadata.xml
new file mode 100644
index 000000000000..6ecb8ff961fe
--- /dev/null
+++ b/net-dialup/mingetty/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <longdescription>The mingetty program is a lightweight, minimalist getty program for
+use only on virtual consoles. Mingetty is not suitable for serial
+lines (you should use the mgetty program in that case).</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">mingetty</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-dialup/mingetty/mingetty-1.08-r1.ebuild b/net-dialup/mingetty/mingetty-1.08-r1.ebuild
new file mode 100644
index 000000000000..c70e8e1d5871
--- /dev/null
+++ b/net-dialup/mingetty/mingetty-1.08-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs eutils
+
+DESCRIPTION="A compact getty program for virtual consoles only"
+HOMEPAGE="https://sourceforge.net/projects/mingetty"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 sparc x86"
+IUSE="unicode"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.08-check_chroot_chdir_nice.patch"
+)
+
+src_prepare() {
+ use unicode && eapply "${FILESDIR}"/${PN}-1.08-utf8.patch
+ default
+}
+
+src_compile() {
+ emake CFLAGS="${CFLAGS} -Wall -W -pipe -D_GNU_SOURCE" CC="$(tc-getCC)"
+}
+
+src_install () {
+ dodir /sbin /usr/share/man/man8
+ emake DESTDIR="${D}" install
+}