From 424913b211f2a64fb7caf16d97f752af13b4711e Mon Sep 17 00:00:00 2001 From: Boris Popov Date: Wed, 5 Apr 2000 10:54:02 +0000 Subject: [PATCH] Do not panic if request issued by kernel. Reported by: Vladimir Poliakov --- sys/netncp/ncp_conn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netncp/ncp_conn.c b/sys/netncp/ncp_conn.c index 835176e63e98..026f2622ee59 100644 --- a/sys/netncp/ncp_conn.c +++ b/sys/netncp/ncp_conn.c @@ -93,7 +93,8 @@ int ncp_conn_access(struct ncp_conn *conn, struct ucred *cred, mode_t mode) { int error; - if (ncp_suser(cred) == 0 || cred->cr_uid == conn->nc_owner->cr_uid) + if (cred == NOCRED || ncp_suser(cred) == 0 || + cred->cr_uid == conn->nc_owner->cr_uid) return 0; mode >>= 3; if (!groupmember(conn->nc_group, cred))