[Samba] Disc quotas bug

David Nixon D.J.Nixon at csc.liv.ac.uk
Thu May 1 10:30:13 GMT 2003


Hello,
         This HP specific bug report deals with the optional disc quota 
support.

Local Environment
=================

Machine Arch: HP-PA 

Machine OS: HP-UX OS Version: 11.0 

Kernel: patched up to and including PHKL_27553,PHNE_27393

Compiler: HP ANSI C compiler

Libc Version: PHCO_28425 (libc cumulative patch)

Samba Version: 2.2.8a

Network Layout (description): Medium size; well switched

What else is on machine (services, etc): NFS 

Bug Description
===============

      The (optional) disc quota support no longer works.

      The size and free space of a disc; rather than a user's disc quota,
      was being returned to the Windows 2000 client.

      Examination of the source code [smbd/quotas.c, line 915] revealed that 
      an "#ifdef HPUX"  hash define enclosing a new optimisation - involving
      devnm(3) caching - had caused the following line: 

      euser_id = geteuid();

      not to be executed: Hence failure of the subsequent line:

      r=quotactl(Q_GETQUOTA, dev_disk, euser_id, &D);

      to return quota information.

Bug Fix
=======

[djn /home/staff3/tech/djn]$ diff -U 10 quotas.c.cln quotas.c

XXXXXXXXXXXXXXXXXXXXXXXXX  SNIP  XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

--- quotas.c.cln	Wed Mar 26 11:45:19 2003
+++ quotas.c	Wed Apr 30 10:21:57 2003
@@ -913,22 +913,22 @@
   /* find the block device file */
 
 #ifdef HPUX
   /* Need to set the cache flag to 1 for HPUX. Seems
    * to have a significant performance boost when
    * lstat calls on /dev access this function.
    */
   if ((sys_stat(path, &S)<0) || (devnm(S_IFBLK, S.st_dev, dev_disk, 256, 1)<0))
 #else
   if ((sys_stat(path, &S)<0) || (devnm(S_IFBLK, S.st_dev, dev_disk, 256, 0)<0)) 
-	return (False);
 #endif /* ifdef HPUX */
+	return (False);
 
 #endif /* !defined(__FreeBSD__) && !defined(AIX) && !defined(__OpenBSD__) */
 
   euser_id = geteuid();
 
 #ifdef HPUX
   /* for HPUX, real uid must be same as euid to execute quotactl for euid */
   save_re_uid();
   if (set_re_uid() != 0) return False;
   


More information about the samba mailing list