~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to lib/dynxdr/dynxdr.c

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
141
141
}
142
142
 
143
143
 
 
144
/*
 
145
 *-----------------------------------------------------------------------------
 
146
 *
 
147
 * DynXdrSetPos --
 
148
 *
 
149
 *    Sets the position of the XDR stream. The current data in the buffer is
 
150
 *    not affected, just the pointer to the current position.
 
151
 *
 
152
 * Results:
 
153
 *    TRUE if pos is within the bounds of the backing buffer.
 
154
 *
 
155
 * Side effects:
 
156
 *    None.
 
157
 *
 
158
 *-----------------------------------------------------------------------------
 
159
 */
 
160
 
 
161
static bool_t
 
162
DynXdrSetPos(XDR *xdrs, // IN
 
163
             u_int pos) // IN
 
164
{
 
165
   DynXdrData *priv = (DynXdrData *) xdrs->x_private;
 
166
   if (pos <= DynBuf_GetAllocatedSize(&priv->data)) {
 
167
      DynBuf_SetSize(&priv->data, (size_t) pos);
 
168
      return TRUE;
 
169
   }
 
170
   return FALSE;
 
171
}
 
172
 
 
173
 
144
174
#if defined(__GLIBC__) || (defined(sun) && (defined(_LP64) || defined(_KERNEL)))
145
175
/*
146
176
 *-----------------------------------------------------------------------------
288
318
      NULL,             /* x_getbytes */
289
319
      DynXdrPutBytes,   /* x_putbytes */
290
320
      DynXdrGetPos,     /* x_getpostn */
291
 
      NULL,             /* x_setpostn */
 
321
      DynXdrSetPos,     /* x_setpostn */
292
322
      DynXdrInline,     /* x_inline */
293
323
      NULL,             /* x_destroy */
294
324
#if defined(__GLIBC__)