summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1998-08-02 13:01:16 +0000
committerbrian <brian@FreeBSD.org>1998-08-02 13:01:16 +0000
commit76039265401440844e2b890ed20a14378596a974 (patch)
treee7c4bd9ce6ead472c649f3b4021818fec061867f
parent2916928fb5566f8dfcd8aa8cd86476d568fb9d32 (diff)
downloadFreeBSD-src-76039265401440844e2b890ed20a14378596a974.zip
FreeBSD-src-76039265401440844e2b890ed20a14378596a974.tar.gz
PR: 7469
Be careful that the current or next prompt in the list that we're iterating through doesn't get changed by descriptor_Read().
-rw-r--r--usr.sbin/ppp/log.c4
-rw-r--r--usr.sbin/ppp/log.h3
-rw-r--r--usr.sbin/ppp/server.c8
3 files changed, 11 insertions, 4 deletions
diff --git a/usr.sbin/ppp/log.c b/usr.sbin/ppp/log.c
index 0c9c276b..acc76f5 100644
--- a/usr.sbin/ppp/log.c
+++ b/usr.sbin/ppp/log.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: log.c,v 1.30 1998/06/15 19:06:15 brian Exp $
+ * $Id: log.c,v 1.31 1998/06/15 19:06:48 brian Exp $
*/
#include <sys/types.h>
@@ -68,6 +68,7 @@ static u_long LogMask = MSK(LogPHASE);
static u_long LogMaskLocal = MSK(LogERROR) | MSK(LogALERT) | MSK(LogWARN);
static int LogTunno = -1;
static struct prompt *promptlist; /* Where to log local stuff */
+int log_PromptListChanged;
struct prompt *
log_PromptList()
@@ -123,6 +124,7 @@ log_UnRegisterPrompt(struct prompt *prompt)
break;
}
LogSetMaskLocal();
+ log_PromptListChanged++;
}
}
diff --git a/usr.sbin/ppp/log.h b/usr.sbin/ppp/log.h
index 3f8969c..399cde9 100644
--- a/usr.sbin/ppp/log.h
+++ b/usr.sbin/ppp/log.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: log.h,v 1.19 1998/05/21 21:46:30 brian Exp $
+ * $Id: log.h,v 1.20 1998/05/23 22:24:41 brian Exp $
*/
#define LogMIN (1)
@@ -81,6 +81,7 @@ extern int log_ShowLevel(struct cmdargs const *);
extern int log_SetLevel(struct cmdargs const *);
extern int log_ShowWho(struct cmdargs const *);
+extern int log_PromptListChanged;
extern void log_RegisterPrompt(struct prompt *);
extern void log_UnRegisterPrompt(struct prompt *);
extern void log_DestroyPrompts(struct server *);
diff --git a/usr.sbin/ppp/server.c b/usr.sbin/ppp/server.c
index 3fb1de5..2a6ccfe7 100644
--- a/usr.sbin/ppp/server.c
+++ b/usr.sbin/ppp/server.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: server.c,v 1.21 1998/06/24 19:33:36 brian Exp $
+ * $Id: server.c,v 1.22 1998/06/27 14:18:10 brian Exp $
*/
#include <sys/types.h>
@@ -152,9 +152,13 @@ server_Read(struct descriptor *d, struct bundle *bundle, const fd_set *fdset)
}
}
+ log_PromptListChanged = 0;
for (p = log_PromptList(); p; p = p->next)
- if (descriptor_IsSet(&p->desc, fdset))
+ if (descriptor_IsSet(&p->desc, fdset)) {
descriptor_Read(&p->desc, bundle, fdset);
+ if (log_PromptListChanged)
+ break;
+ }
}
static int
OpenPOWER on IntegriCloud