From: Jeffrey Altman Date: Fri, 10 Jun 2005 22:37:37 +0000 (+0000) Subject: pipe-logging-fix-20050610 X-Git-Tag: openafs-devel-1_5_0~510 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=324cd9710526238056801d9b19ef1626db7f3c78;p=packages%2Fo%2Fopenafs.git pipe-logging-fix-20050610 fstat calls should be lstat ==================== This delta was composed from multiple commits as part of the CVS->Git migration. The checkin message with each commit was inconsistent. The following are the additional commit messages. ==================== fstat calls should be lstat bang in the wrong place --- diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index 9fab1c0e9..90a8bcab3 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -870,8 +870,8 @@ main(int argc, char **argv, char **envp) if ((!DoSyslog) #ifndef AFS_NT40_ENV - && (!(fstat(AFSDIR_BOZLOG_FILE, &sb) == 0) && - (S_ISFIFO(sb.st_mode))) + && ((lstat(AFSDIR_BOZLOG_FILE, &sb) == 0) && + !(S_ISFIFO(sb.st_mode))) #endif ) { strcpy(namebuf, AFSDIR_BOZLOG_FILE); diff --git a/src/util/serverLog.c b/src/util/serverLog.c index 5145e8e20..2f1e78b37 100644 --- a/src/util/serverLog.c +++ b/src/util/serverLog.c @@ -241,7 +241,7 @@ OpenLog(const char *fileName) } /* Support named pipes as logs by not rotating them */ - if ((fstat(fileName, &statbuf) == 0) && (S_ISFIFO(statbuf.st_mode))) { + if ((lstat(fileName, &statbuf) == 0) && (S_ISFIFO(statbuf.st_mode))) { isfifo = 1; } #endif @@ -314,7 +314,7 @@ ReOpenLog(const char *fileName) } /* Support named pipes as logs by not rotating them */ - if ((fstat(fileName, &statbuf) == 0) && (S_ISFIFO(statbuf.st_mode))) { + if ((lstat(fileName, &statbuf) == 0) && (S_ISFIFO(statbuf.st_mode))) { isfifo = 1; } #endif