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

« back to all changes in this revision

Viewing changes to lib/misc/idLinux.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:
32
32
#include <Security/Authorization.h>
33
33
#include <Security/AuthorizationTags.h>
34
34
#endif
 
35
#if defined __ANDROID__
 
36
#include <syscall-android.h>
 
37
#endif
35
38
 
36
39
#include "vmware.h"
37
40
#include "su.h"
38
41
#include "vm_atomic.h"
39
42
 
40
43
#if defined(__linux__)
41
 
#if !defined(GLIBC_VERSION_21) && (defined(__i386__) || defined(__x86_64__))
42
 
/*
43
 
 * SYS_ constants for glibc 2.0, some of which may already be defined on
44
 
 * some of those older systems.
45
 
 */
46
 
 
47
 
#ifndef SYS_setresuid
48
 
#define SYS_setresuid          164
49
 
#endif
50
 
#ifndef SYS_setresgid
51
 
#define SYS_setresgid          170
52
 
#endif
53
 
#define SYS_setreuid32         203
54
 
#define SYS_setregid32         204
55
 
#define SYS_setresuid32        208
56
 
#define SYS_setresgid32        210
57
 
#define SYS_setuid32           213
58
 
#define SYS_setgid32           214
59
 
#endif // ifndef GLIBC_VERSION_21
60
 
 
61
44
/*
62
45
 * 64bit linux has no 16 bit versions and
63
46
 * the 32bit versions have the un-suffixed names.
124
107
{
125
108
#if defined(__FreeBSD__) || defined(sun)
126
109
   return setuid(euid);
127
 
#elif defined(linux)
 
110
#elif defined(linux) || defined __ANDROID__
128
111
   if (uid32) {
129
112
      int r = syscall(SYS_setuid32, euid);
130
113
      if (r != -1 || errno != ENOSYS) {