Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Apr 2000 05:22:44 +0200 (CEST)
From:      Bjoern Fischer <bfischer@Techfak.Uni-Bielefeld.DE>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/17875: [PATCH] /usr/bin/login logs errors in non-error situations
Message-ID:  <200004070322.FAA09601@broccoli.no-support.loc>

index | next in thread | raw e-mail


>Number:         17875
>Category:       bin
>Synopsis:       [PATCH] /usr/bin/login logs errors in non-error situations
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr  9 00:10:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Bjoern Fischer
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
No-Support
>Environment:

Any out-of-the-box FreeBSD 4.0 with /dev on a non FFS file system.

>Description:

If /dev/tty* is on a file system that does not support chflags(2) every
login procedure generates an error message in syslog.

>How-To-Repeat:

See description.

>Fix:

To fix this errno is checked if it is EOPNOTSUPP. No errors will be logged
in that case. See this patch:

--- ./usr.bin/login/login.c	2000/04/07 02:55:10	1.1
+++ ./usr.bin/login/login.c	2000/04/07 02:59:35
@@ -492,8 +492,11 @@
 	 * user sets them otherwise, this can cause the chown to fail.
 	 * Since it isn't clear that flags are useful on character
 	 * devices, we just clear them.
+	 *
+	 * chflags may fail due to lack of support on file system. In
+	 * this case we ignore the error silently.
 	 */
-	if (chflags(ttyn, 0))
+	if (chflags(ttyn, 0) && (errno != EOPNOTSUPP))
 		syslog(LOG_ERR, "chmod(%s): %m", ttyn);
 	if (chown(ttyn, pwd->pw_uid,
 	    (gr = getgrnam(TTYGRPNAME)) ? gr->gr_gid : pwd->pw_gid))
--- ./usr.bin/login/login_fbtab.c	2000/04/07 02:55:10	1.1
+++ ./usr.bin/login/login_fbtab.c	2000/04/07 03:02:46
@@ -132,8 +132,12 @@
     DIR    *dir;
 
     if (strcmp("/*", path + pathlen - 2) != 0) {
-	/* clear flags of the device */
-        if (chflags(path, 0) && errno != ENOENT)
+	/* clear flags of the device
+	 *
+	 * chflags may fail due to lack of support on file system. In
+	 * this case we ignore the error silently.
+	 */
+        if (chflags(path, 0) && (errno != ENOENT) && (errno != EOPNOTSUPP))
 	    syslog(LOG_ERR, "%s: chflags(%s): %m", table, path);
 	if (chmod(path, mask) && errno != ENOENT)
 	    syslog(LOG_ERR, "%s: chmod(%s): %m", table, path);

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004070322.FAA09601>