]> git.sur5r.net Git - openldap/commitdiff
ITS#4875 ignore zero-length st_size
authorHoward Chu <hyc@openldap.org>
Tue, 3 Apr 2007 01:40:52 +0000 (01:40 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 3 Apr 2007 01:40:52 +0000 (01:40 +0000)
libraries/liblutil/passfile.c

index c84cda736765d76c5cc7a5a27ae49e4cb69a6793..c6d9ff4163856341bec2308e84bf210f8d1b43de 100644 (file)
@@ -44,7 +44,7 @@ lutil_get_filed_password(
        }
 
        passwd->bv_val = NULL;
-       passwd->bv_len = 4196;
+       passwd->bv_len = 4096;
 
 #ifdef HAVE_FSTAT
        {
@@ -56,7 +56,8 @@ lutil_get_filed_password(
                                        filename );
                        }
 
-                       passwd->bv_len = sb.st_size;
+                       if ( sb.st_size )
+                               passwd->bv_len = sb.st_size;
                }
        }
 #endif /* HAVE_FSTAT */