r12076: Ensure setmntent() returns with != NULL in the disk_quotas() Linux
authorLars Müller <lmuelle@samba.org>
Mon, 5 Dec 2005 16:51:19 +0000 (16:51 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:05:43 +0000 (11:05 -0500)
version.

The IRIX 6.2 version is still without this check as I'm not sure if
setmntent() is implemented in the same way.
(This used to be commit 519ed7ca0ecffbc341c7516758a678af59f98586)

source3/smbd/quotas.c

index 8cb94bca3d8399252a8f93a854e355a84d9ed6cc..de31376d6c6bb8ee80a3627975500dfe9e36feac 100644 (file)
@@ -216,7 +216,9 @@ BOOL disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
 
        devno = S.st_dev ;
   
-       fp = setmntent(MOUNTED,"r");
+       if ((fp = setmntent(MOUNTED,"r")) == NULL)
+               return(False) ;
+
        found = False ;
   
        while ((mnt = getmntent(fp))) {