From owner-svn-src-all@freebsd.org Wed Mar 22 19:08:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B33AD18D66; Wed, 22 Mar 2017 19:08:57 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4C9C105F; Wed, 22 Mar 2017 19:08:56 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([85.179.167.156]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MfEMs-1cWM9V1UC2-00OsqM; Wed, 22 Mar 2017 20:08:47 +0100 Date: Wed, 22 Mar 2017 20:08:41 +0100 From: "O. Hartmann" To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r315733 - in head: include lib/libc/gen libexec/getty Message-ID: <20170322200841.52e2f892@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201703221900.v2MJ0gC8058678@repo.freebsd.org> References: <201703221900.v2MJ0gC8058678@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/6oySx_E9B.oO88.dD3uDEkO"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:/s0JRSBWIKz+UNxq9STR5H+kpzFTW+wWyujZf0h9kMaxnBlH3L5 JOB7sQzj9pOZza+nDQyE8Y0B78x9WGUANAwiVutXmDeU14Au0affMX23XxYVKLy6SwZYE6d zIAKiDeyySjKg+QXuXk2iJ7PBmkA42SK4Omz/2BNtZzPZAmpqSY8x5y7AzM4ls5NmHnbxDR yQ6CgetcwFM/JR7JEOxhA== X-UI-Out-Filterresults: notjunk:1;V01:K0:2QG7pKEx2ZM=:7pgmPOzfxBsYvB77qoesNg 0m+aYeksZk8Dtr7Yf95Ec1WLGJlvqWzCVKie4lPKBMOUs2dbN1C2L5/YMs7Ngw3F+KxtD9coy aCvWou/Rleil6dBtiFEXGKxosCQxcVKv3sVY5aiTScjQ0C+yuM2+UhinNynSaLLX1GVzsbxcB k0CzygHcxi+bViKdjNnNjohhvsd5Lm5A4JourenqpTpGCCyuFI2/yXlnRimr5sktaHQIzn3Oz 2XZR91lGrZSjugZl8tcBJ3swT9PDwDq9DRINuyFPyfaavSrqfX1S51LTrWeweFz+pUstx76mU 3bkOC9tEcUEP7RMkVGeXuxtVPxsLxbgU6f4aaOtHdP8jaxXKuKAZtbnVsDuZc6k1L4ZtDvcFf z59JF6p6QzJiy89bFFkJhkDKwtF8C2j1HVSld7COHmZqZ7Gf6RADxg26MwnzJELxE6chnho8k NgoMq3oAFnGxJkfttfSJFPfzIFbB2Q7Q7KMnV8tgEqARls8oOAjXLcoDzmR9P3Emw+YYPKUAS GnzBGIpRiiSc765i4l/nAz8Fx4h+FXGWFiaFiBXbDfnPm5zso9MNolTlO9nRcq2TQPYwDZ0zr VOLIB3ysUeduTArNrZfXizT7tpGqeDYPIbpfhs7NbylsTQS2KwGO2LBKef4mP5H6A6tHN7kK4 cNml+KJDftZ2b0R004JKStV2kiPSlEM++QDKCG+5VWiarR9BOoTrjajyo8SKXPeidebw8Xkqf kaaIYpgRv8HSH4pY177dWppO22gJOAKRuXARvk/+lV09ACGIgWW0wuBA3t8= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Mar 2017 19:08:57 -0000 --Sig_/6oySx_E9B.oO88.dD3uDEkO Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Wed, 22 Mar 2017 19:00:42 +0000 (UTC) Warner Losh schrieb: > Author: imp > Date: Wed Mar 22 19:00:41 2017 > New Revision: 315733 > URL: https://svnweb.freebsd.org/changeset/base/315733 >=20 > Log: > Impelemnt ttys onifexists in init. > =20 > Implement a new init(8) option in /etc/ttys. If this option is present > on the entry in /etc/ttys, the entry will be active if and only if it > exists. If the name starts with a '/', it will be considered an > absolute path. If not, it will be a path relative to /dev. > =20 > This allows one to turn off video console getty that aren't present > (while running a getty on them even when they aren't the system > console). Likewise with serial ports. > =20 > It differs from onifconsole in only requiring the device exist rather > than it be listed as one of the system consoles. > =20 > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D10037 >=20 > Modified: > head/include/ttyent.h > head/lib/libc/gen/getttyent.c > head/libexec/getty/ttys.5 >=20 > Modified: head/include/ttyent.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/include/ttyent.h Wed Mar 22 18:45:13 2017 (r315732) > +++ head/include/ttyent.h Wed Mar 22 19:00:41 2017 (r315733) > @@ -38,6 +38,7 @@ > #define _TTYS_OFF "off" > #define _TTYS_ON "on" > #define _TTYS_ONIFCONSOLE "onifconsole" > +#define _TTYS_ONIFEXISTS "onifexists" > #define _TTYS_SECURE "secure" > #define _TTYS_INSECURE "insecure" > #define _TTYS_WINDOW "window" >=20 > Modified: head/lib/libc/gen/getttyent.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/gen/getttyent.c Wed Mar 22 18:45:13 2017 (r315732) > +++ head/lib/libc/gen/getttyent.c Wed Mar 22 19:00:41 2017 (r315733) > @@ -97,6 +97,26 @@ done: > return (0); > } > =20 > +static int > +auto_exists_status(const char *ty_name) > +{ > + struct stat sb; > + char *dev; > + int rv; > + > + rv =3D 0; > + if (*ty_name =3D=3D '/') > + asprintf(&dev, "%s", ty_name); > + else > + asprintf(&dev, "/dev/%s", ty_name); > + if (dev =3D=3D NULL) > + return 0; > + if (stat(dev, &sb) =3D=3D 0) > + rv =3D TTY_ON; > + free(dev); > + return (rv); > +} > + > struct ttyent * > getttyent(void) > { > @@ -161,6 +181,8 @@ getttyent(void) > tty.ty_status |=3D TTY_ON; > else if (scmp(_TTYS_ONIFCONSOLE)) > tty.ty_status |=3D auto_tty_status(tty.ty_name); > + else if (scmp(_TTYS_ONIFEXISTS)) > + tty.ty_status |=3D auto_exists_status(tty.ty_name); > else if (scmp(_TTYS_SECURE)) > tty.ty_status |=3D TTY_SECURE; > else if (scmp(_TTYS_INSECURE)) >=20 > Modified: head/libexec/getty/ttys.5 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/libexec/getty/ttys.5 Wed Mar 22 18:45:13 2017 (r315732) > +++ head/libexec/getty/ttys.5 Wed Mar 22 19:00:41 2017 (r315733) > @@ -28,7 +28,7 @@ > .\" from: @(#)ttys.5 8.1 (Berkeley) 6/4/93 > .\" $FreeBSD$ > .\" " > -.Dd March 9, 2014 > +.Dd March 16, 2017 > .Dt TTYS 5 > .Os > .Sh NAME > @@ -105,6 +105,12 @@ should (should not) execute the command=20 > ``onifconsole'' will cause this line to be enabled if and only if it is > an active kernel console device (it is equivalent to ``on'' in this > case). > +The flag ``onifexists'' will cause this line to be enabled if and only > +if the name exists. > +If the name starts with a ``/'', it will be considered an absolute > +path. > +Otherwise, it is considered a path relative to > +.Pa /dev . > The flag ``secure'' (if the console is enabled) allows users with a > uid of 0 to login on > this line. > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" Breaks buildworld: [...] /usr/src/lib/libc/gen/getttyent.c:114:6: warning: implicit declaration of f= unction 'stat' is invalid in C99 [-Wimplicit-function-declaration] if (stat(dev, &sb) =3D= =3D 0) ^ 1 warning and 1 error generated. *** [getttyent.pico] Error code 1 make[4]: stopped in /usr/src/lib/libc Regards, oh --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/6oySx_E9B.oO88.dD3uDEkO Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWNLLuQAKCRDS528fyFhY lFOdAf4m0abghkRBcwyXV23mc2Sveqsf6cOeu5qrb2qvQLsr458P3T6689ugQvKo L9GYN8u5U2njcPsg2IcE+jUR5OTtAgCg4RSEeiSh6Tb2Ve/bSp9/6wsjY5GBbrI3 dK1k9I94hHhCbq760iANWKddRkH35MtsNACUz4e5Di0Bdb95RS5E =i2Eh -----END PGP SIGNATURE----- --Sig_/6oySx_E9B.oO88.dD3uDEkO--