From owner-freebsd-bugs Sun Apr 9 0:10: 5 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 3454737B6CF for ; Sun, 9 Apr 2000 00:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id AAA26452; Sun, 9 Apr 2000 00:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from mail.uni-bielefeld.de (mail.uni-bielefeld.de [129.70.4.90]) by hub.freebsd.org (Postfix) with ESMTP id 3743737B652 for ; Sun, 9 Apr 2000 00:07:29 -0700 (PDT) (envelope-from bfischer@Techfak.uni-bielefeld.de) Received: from frolic.no-support.loc (ppp36-234.hrz.uni-bielefeld.de) by mail.uni-bielefeld.de (Sun Internet Mail Server sims.3.5.1999.05.24.18.28.p7) with ESMTP id <0FSQ00EN1MGAN9@mail.uni-bielefeld.de> for FreeBSD-gnats-submit@freebsd.org; Sun, 9 Apr 2000 09:07:25 +0200 (MET DST) Received: (from bjoern@localhost) by frolic.no-support.loc (8.9.3/8.9.3) id JAA24395 for FreeBSD-gnats-submit@freebsd.org; Sun, 09 Apr 2000 09:06:36 +0200 (CEST envelope-from bjoern) Received: (from bjoern@localhost) by broccoli.no-support.loc (8.9.3/8.9.3) id FAA09601; Fri, 07 Apr 2000 05:22:44 +0200 (CEST envelope-from bjoern) Message-Id: <200004070322.FAA09601@broccoli.no-support.loc> Date: Fri, 07 Apr 2000 05:22:44 +0200 (CEST) From: Bjoern Fischer Reply-To: bfischer@Techfak.Uni-Bielefeld.DE To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/17875: [PATCH] /usr/bin/login logs errors in non-error situations Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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