[PATCH] typo in misc.c, function resolve_user?
Hi, a Cygwin user got a message in the syslog every time the syslog-ng service started up: Error resolving user; user='system' He also found why this message was generated. The function resolve_user() in misc.c appears to have a typo. If the incoming user argument points to a non-empty string, resolve_user() just returns NULL. So, the following getpwnam is only called for an empty user string. This looks like a typo. One possible fix below. However, maybe the intention was actually to test for if (!user) instead of if (!*user) ??? Corinna --- src/misc.c.ORIG 2009-03-25 17:01:15.000000000 +0100 +++ src/misc.c 2009-03-25 17:01:29.000000000 +0100 @@ -274,7 +274,7 @@ resolve_user(const char *user, uid_t *ui struct passwd *pw; *uid = 0; - if (*user) + if (!*user) return FALSE; pw = getpwnam(user); -- Corinna Vinschen Cygwin Project Co-Leader Red Hat
Ping? On Mar 25 17:18, Corinna Vinschen wrote:
Hi,
a Cygwin user got a message in the syslog every time the syslog-ng service started up:
Error resolving user; user='system'
He also found why this message was generated. The function resolve_user() in misc.c appears to have a typo. If the incoming user argument points to a non-empty string, resolve_user() just returns NULL. So, the following getpwnam is only called for an empty user string. This looks like a typo.
One possible fix below. However, maybe the intention was actually to test for
if (!user)
instead of
if (!*user)
???
Corinna
--- src/misc.c.ORIG 2009-03-25 17:01:15.000000000 +0100 +++ src/misc.c 2009-03-25 17:01:29.000000000 +0100 @@ -274,7 +274,7 @@ resolve_user(const char *user, uid_t *ui struct passwd *pw;
*uid = 0; - if (*user) + if (!*user) return FALSE;
pw = getpwnam(user);
This has already been fixed in recent git. On Wed, 2009-04-01 at 15:21 +0200, Corinna Vinschen wrote:
Ping?
On Mar 25 17:18, Corinna Vinschen wrote:
Hi,
a Cygwin user got a message in the syslog every time the syslog-ng service started up:
Error resolving user; user='system'
He also found why this message was generated. The function resolve_user() in misc.c appears to have a typo. If the incoming user argument points to a non-empty string, resolve_user() just returns NULL. So, the following getpwnam is only called for an empty user string. This looks like a typo.
One possible fix below. However, maybe the intention was actually to test for
if (!user)
instead of
if (!*user)
-- Bazsi
On Apr 1 15:31, Balazs Scheidler wrote:
This has already been fixed in recent git.
Uh, ok, thanks. Corinna -- Corinna Vinschen Cygwin Project Co-Leader Red Hat
participants (2)
-
Balazs Scheidler
-
Corinna Vinschen