ports/net/samba3/files/patch-smbd_statvfs.c
Kirill Ponomarev cbf318b29d An update of net/samba3 to the 3.0.25 version plus security fixes.
Major features included in the 3.0.25 code base are:

  o Significant improvements in the winbind off-line logon support.
  o Support for secure DDNS updates as part of the 'net ads join'
    process.
  o Rewritten IdMap interface which allows for TTL based caching and
    per domain backends.
  o New plug-in interface for the "winbind nss info" parameter.
  o New file change notify subsystem which is able to make use of
    inotify on Linux.
  o Support for passing Windows security descriptors to a VFS
    plug-in allowing for multiple Unix ACL implements to running
    side by side on the Same server.
  o Improved compatibility with Windows Vista clients including
    improved read performance with Linux servers.
  o Man pages for IdMap and VFS plug-ins.

Security Fixes included in the Samba 3.0.25 release are:

  o CVE-2007-2444
        Versions: Samba 3.0.23d - 3.0.25pre2
        Local SID/Name translation bug can result in
        user privilege elevation

  o CVE-2007-2446
        Versions: Samba 3.0.0 - 3.0.24
        Multiple heap overflows allow remote code execution

  o CVE-2007-2447
        Versions: Samba 3.0.0 - 3.0.24
        Unescaped user input parameters are passed as
        arguments to /bin/sh allowing for remote command
        execution

PR:		ports/112836
Submitted by:	maintainer
Approved by:	portmgr (self)
2007-05-24 07:54:25 +00:00

47 lines
1.4 KiB
C

--- ./smbd/statvfs.c.orig Thu Mar 1 05:54:06 2007
+++ ./smbd/statvfs.c Tue Apr 17 02:06:59 2007
@@ -3,6 +3,7 @@
VFS API's statvfs abstraction
Copyright (C) Alexander Bokovoy 2005
Copyright (C) Steve French 2005
+ Copyright (C) Timur I. Bakeyev 2005
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
@@ -41,6 +42,27 @@
}
return result;
}
+#elif defined(FREEBSD)
+static int bsd_statvfs(const char *path, vfs_statvfs_struct *statbuf)
+{
+ struct statfs statfs_buf;
+ int result;
+
+ result = statfs(path, &statfs_buf);
+
+ if (!result) {
+ statbuf->OptimalTransferSize = statfs_buf.f_iosize;
+ statbuf->BlockSize = statfs_buf.f_bsize;
+ statbuf->TotalBlocks = statfs_buf.f_blocks;
+ statbuf->BlocksAvail = statfs_buf.f_bfree;
+ statbuf->UserBlocksAvail = statfs_buf.f_bavail;
+ statbuf->TotalFileNodes = statfs_buf.f_files;
+ statbuf->FreeFileNodes = statfs_buf.f_ffree;
+ statbuf->FsIdentifier =
+ (((SMB_BIG_UINT)statfs_buf.f_fsid.val[0]<<32) & 0xffffffff00000000LL) | (SMB_BIG_UINT)statfs_buf.f_fsid.val[1];
+ }
+ return result;
+}
#endif
/*
@@ -53,6 +75,8 @@
{
#if defined(LINUX) && defined(HAVE_FSID_INT)
return linux_statvfs(path, statbuf);
+#elif defined(FREEBSD)
+ return bsd_statvfs(path, statbuf);
#else
/* BB change this to return invalid level */
#ifdef EOPNOTSUPP