18552341 proftpd doesn't build on 45
authorTomas Klacko <tomas.klacko@oracle.com>
Thu, 24 Apr 2014 12:45:15 -0700
changeset 1848 289daf750b26
parent 1847 b43426a2f6ba
child 1849 039e7d9ae82b
18552341 proftpd doesn't build on 45
components/proftpd/mod_solaris_audit.c
--- a/components/proftpd/mod_solaris_audit.c	Tue Apr 22 12:43:58 2014 -0700
+++ b/components/proftpd/mod_solaris_audit.c	Thu Apr 24 12:45:15 2014 -0700
@@ -1,6 +1,6 @@
 /*
  * ProFTPD - FTP server daemon
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -111,6 +111,7 @@
   const char *how;
   int saved_errno = 0;
   struct passwd pwd;
+  struct passwd *result = NULL;
   char *pwdbuf = NULL;
   size_t pwdbuf_len;
   long pwdbuf_len_max;
@@ -133,7 +134,8 @@
   }
 
   if ((authuser != NULL) && (authuser[0] != NULL) &&
-    (getpwnam_r(authuser, &pwd, pwdbuf, pwdbuf_len) != NULL)) {
+    (getpwnam_r(authuser, &pwd, pwdbuf, pwdbuf_len, &result) == 0) &&
+    (result != NULL)) {
     uid = pwd.pw_uid;
     gid = pwd.pw_gid;
   }