r23792: convert Samba4 to GPLv3
[tprouty/samba.git] / source4 / ntvfs / posix / pvfs_fsinfo.c
index 72293fb746fdde9d471b1b415d67501e6672a160..9a836fac323e31edb1be5d994ee35cd015925b6d 100644 (file)
@@ -7,7 +7,7 @@
 
    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
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
 #include "vfs_posix.h"
 #include "librpc/gen_ndr/xattr.h"
+#include "librpc/ndr/libndr.h"
 
 /* We use libblkid out of e2fsprogs to identify UUID of a volume */
 #ifdef HAVE_LIBBLKID
@@ -38,19 +38,22 @@ static NTSTATUS pvfs_blkid_fs_uuid(struct pvfs_state *pvfs, struct stat *st, str
 
        devname = blkid_devno_to_devname(st->st_dev);
        if (!devname) {
-               return NT_STATUS_DEVICE_CONFIGURATION_ERROR;
+               ZERO_STRUCTP(uuid);
+               return NT_STATUS_OK;
        }
 
        uuid_value = blkid_get_tag_value(NULL, "UUID", devname);
        free(devname);
        if (!uuid_value) {
-               return NT_STATUS_DEVICE_CONFIGURATION_ERROR;
+               ZERO_STRUCTP(uuid);
+               return NT_STATUS_OK;
        }
 
        status = GUID_from_string(uuid_value, uuid);
        free(uuid_value);
        if (!NT_STATUS_IS_OK(status)) {
-               return NT_STATUS_DEVICE_CONFIGURATION_ERROR;
+               ZERO_STRUCTP(uuid);
+               return NT_STATUS_OK;
        }
        return NT_STATUS_OK;
 #else
@@ -124,7 +127,7 @@ NTSTATUS pvfs_fsinfo(struct ntvfs_module_context *ntvfs,
                fs->dskattr.out.units_free  = (blocks_free  * (double)block_size) / (bpunit * 512);
 
                /* we must return a maximum of 2G to old DOS systems, or they get very confused */
-               if (bpunit > 64 && req->smb_conn->negotiate.protocol <= PROTOCOL_LANMAN2) {
+               if (bpunit > 64 && req->ctx->protocol <= PROTOCOL_LANMAN2) {
                        fs->dskattr.out.blocks_per_unit = 64;
                        fs->dskattr.out.units_total = 0xFFFF;
                        fs->dskattr.out.units_free = 0xFFFF;