~n-muench/ubuntu/precise/open-vm-tools/open-vm-tools.raring-precise.backport

« back to all changes in this revision

Viewing changes to modules/freebsd/vmhgfs/vnopscommon.c

  • Committer: Package Import Robot
  • Author(s): Nate Muench
  • Date: 2012-01-23 16:09:45 UTC
  • mfrom: (1.4.6) (2.4.26 sid)
  • Revision ID: package-import@ubuntu.com-20120123160945-b6s0r1vkcovucpf3
Tags: 2011.12.20-562307-0ubuntu1
* Merge latest upstream git tag. Fixes building on Precise
  (LP: #898289, LP: #905612)

* Items merged from Debian unstable:
  - debian/control:
    + open-vm-tools recommends open-vm-dkms. (LP: #598933)
    + open-vm-tools now suggests open-vm-toolbox. (LP: #604998)
  (From 2011.08.21-471295-1 release)
  - Updating maintainer and uploaders fields.
  - Removing vcs fields.
  - Removing references to Daniel's old email address.
  - Updating years in copyright file.
  - Updating to standards version 3.9.2.
  - Updating to debhelper version 8.
  - Switching to source format 3.0 (quilt).
  - Removing manual chrpath setting.
  - Removing exclusion from plugins from debhelper shlibs.
  - Rediffing kvers.patch.
  (From 2011.09.23-491607-1 release)
  - Marking binary architecture-dependend packages as linux and kfreebsd
  only.
  - Removing liburiparser-dev from build-depends as upstream dropped
  unity support.
  - Building with libproc-dev on amd64 again.
  - Dropping disabling of dnet support.
  (From 2011.09.23-491607-2 release)
  - Adding doxygen to build-depends for api documentation.
  - Adding libcunit1-dev to build-depends for test suites.
  - Minimizing rules file.
  - Adding open-vm-tools-dev package, containing only the api
    documentation for now.
  (From 2011.09.23-491607-3 release)
  - Sorting overrides in rules alphabetically.
  - Compacting copyright file.
  - Adding udev rule to set timeout for vmware scsi devices
  (From 2011.12.20-562307-1 release)
  - Adding patch to correct typo in upstreams dkms configuration

* Remaining Changes:
  - Remove Stable part of version numbering.
  - debian folder:
    + Re-added open-vm-dkms.postinst & open-vm-dkms.prerm.
      * Allows dkms modules to compile upon installation.
  - debian/control:
    + Re-add open-vm-source and make into a transitional package
      for open-vm-toolbox.
    + Return dependancies that were moved to open-vm-tools back to
      open-vm-toolbox.
  - debian/rules and debian/open-vm-toolbox.lintian-overrides:
    + Make vmware-user-suid-wrapper suid-root
  - debian/rules:
    + Added CFLAGS field with -Wno-deprecated-declarations
      * Will suppress issues with glib 2.31 or later.
    + Add line to copy vmware-xdg-detect-de into place.
    + Install vmware-user.desktop through toolbox package.
  - debian/open-vm-tools.init:
    + Re-add 'modprobe [-r] vmblock'.
    + Add 'modprobe [-r] vmxnet'.
      * Incase it's not loaded during boot.
    + Remove and re-add pcnet32 module
      * Will be done before (remove) and after (readd) vmxnet module
        is added.
      * If vmxnet doesn't exist (aka modules fail to build), pcnet32 can be
        still used for network connectivity.
      * Workaround until a better fix can be done.
  - Re-add gnome-session to debian/local/xautostart.conf
  - Manpages removed (from debian/manpages):
    + vmmemctl.9
    + vmxnet3.9
    + Remove references to manpages that have been removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
487
487
      HgfsAttrToBSD(vp, &hgfsAttrV2, vap);
488
488
   }
489
489
 
490
 
   DEBUG(VM_DEBUG_LOG, "Exit %s.\n",  HGFS_VP_TO_FILENAME(vp));
 
490
   DEBUG(VM_DEBUG_LOG, "Exit %s -> %d.\n",  HGFS_VP_TO_FILENAME(vp), ret);
491
491
   return ret;
492
492
}
493
493
 
701
701
   ret = HgfsDelete(sip, HGFS_VP_TO_FILENAME(vp), HGFS_OP_DELETE_FILE_V3);
702
702
 
703
703
out:
704
 
   DEBUG(VM_DEBUG_LOG, "Exit %s.\n",  HGFS_VP_TO_FILENAME(vp));
 
704
   DEBUG(VM_DEBUG_LOG, "Exit %s -> %d.\n",  HGFS_VP_TO_FILENAME(vp), ret);
705
705
   return ret;
706
706
}
707
707
 
1115
1115
 
1116
1116
   /* We can't read from directories, that's what readdir() is for. */
1117
1117
   if (HGFS_VP_TO_VTYPE(vp) != VREG) {
1118
 
      DEBUG(VM_DEBUG_FAIL, "Can only read regular files.\n");
1119
 
      return (HGFS_VP_TO_VTYPE(vp) == VDIR) ? EISDIR : EPERM;
 
1118
      ret = (HGFS_VP_TO_VTYPE(vp) == VDIR) ? EISDIR : EPERM;
 
1119
      DEBUG(VM_DEBUG_FAIL, "Read not a reg file type %d ret %d.\n", HGFS_VP_TO_VTYPE(vp), ret);
 
1120
      return ret;
1120
1121
   }
1121
1122
 
1122
1123
   /* off_t is a signed quantity */
1163
1164
   do {
1164
1165
      uint32_t size;
1165
1166
 
1166
 
      DEBUG(VM_DEBUG_INFO, "offset=%"FMT64"d, uio_offset=%"FMT64"d\n",
1167
 
            offset, HGFS_UIOP_TO_OFFSET(uiop));
1168
 
      DEBUG(VM_DEBUG_HANDLE, "** handle=%d, file=%s\n",
1169
 
            handle, HGFS_VP_TO_FILENAME(vp));
1170
 
 
1171
1167
      /* Request at most HGFS_IO_MAX bytes */
1172
1168
      size = (HGFS_UIOP_TO_RESID(uiop) > HGFS_IO_MAX) ? HGFS_IO_MAX :
1173
1169
                                                        HGFS_UIOP_TO_RESID(uiop);
1174
1170
 
 
1171
      DEBUG(VM_DEBUG_INFO, "offset=%"FMT64"d, uio_offset=%"FMT64"d\n",
 
1172
            offset, HGFS_UIOP_TO_OFFSET(uiop));
 
1173
      DEBUG(VM_DEBUG_HANDLE, "** handle=%d, file=%s to read %u\n",
 
1174
            handle, HGFS_VP_TO_FILENAME(vp), size);
 
1175
 
 
1176
      if (size == 0) {
 
1177
         /* For a zero byte length read we return success. */
 
1178
         DEBUG(VM_DEBUG_DONE, "size of 0 ret -> 0.\n");
 
1179
         return 0;
 
1180
      }
 
1181
 
1175
1182
      /* Send one read request. */
1176
1183
      ret = HgfsDoRead(sip, handle, offset, size, uiop);
1177
1184
      if (ret == 0) {
1524
1531
   fp = HGFS_VP_TO_FP(vp);
1525
1532
   ASSERT(fp);
1526
1533
 
1527
 
   DEBUG(VM_DEBUG_ENTRY, "opening \"%s\"\n", HGFS_VP_TO_FILENAME(vp));
 
1534
   DEBUG(VM_DEBUG_ENTRY, "opening dir \"%s\"\n", HGFS_VP_TO_FILENAME(vp));
1528
1535
 
1529
1536
   /*
1530
1537
    *  If the directory is already opened then we are done.
1668
1675
    * again. Thus, returning ENOENT to the Mac OS puts the guest kernel into infinite
1669
1676
    * loop. In order to resolve this issue, before passing on the request to the
1670
1677
    * server, we validate if user is attempting to create a new share. If yes,
1671
 
    * we return EPERM as the error code.
 
1678
    * we return EACCES as the error code.
1672
1679
    */
1673
1680
   if (HgfsAttemptToCreateShare(HGFS_VP_TO_FILENAME(vp), flag)) {
1674
1681
      DEBUG (VM_DEBUG_LOG, "An attempt to create a new share was made.\n");
1675
 
      return EPERM;
 
1682
      return EACCES;
1676
1683
   }
1677
1684
 
1678
1685
   /* Convert FreeBSD modes to Hgfs modes */
2977
2984
            hgfsAttrV2.ownerPerms | hgfsAttrV2.groupPerms | hgfsAttrV2.otherPerms;
2978
2985
      }
2979
2986
      if (!IsModeCompatible(mode, effectivePermissions)) {
2980
 
         ret = EPERM;
 
2987
         ret = EACCES;
2981
2988
         DEBUG(VM_DEBUG_FAIL, "HgfsAccessInt denied access: %s (%d, %d)\n",
2982
2989
               HGFS_VP_TO_FILENAME(vp), mode, effectivePermissions);
2983
2990
      }