~n-muench/ubuntu/precise/open-vm-tools/open-vm-tools-precise.sid-merge1

« back to all changes in this revision

Viewing changes to services/vmtoolsd/cmdLine.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:
37
37
#include "conf.h"
38
38
#include "rpcout.h"
39
39
#include "str.h"
 
40
#include "vmcheck.h"
40
41
#include "vmtoolsd_version.h"
41
42
#include "vmware/tools/utils.h"
42
43
#include "vmware/tools/i18n.h"
60
61
                    gpointer data,
61
62
                    GError **error)
62
63
{
63
 
   char *result = NULL;
64
 
   Bool status = FALSE;
65
 
 
66
 
   status = RpcOut_sendOne(&result, NULL, "%s", value);
67
 
 
68
 
   if (!status) {
69
 
      g_printerr("%s\n", result ? result : "NULL");
70
 
   } else {
71
 
      g_print("%s\n", result);
 
64
#if defined(_WIN32)
 
65
   VMTools_AttachConsole();
 
66
#endif
 
67
   if (VmCheck_IsVirtualWorld()) {
 
68
      char *result = NULL;
 
69
      Bool status = FALSE;
 
70
 
 
71
      status = RpcOut_sendOne(&result, NULL, "%s", value);
 
72
 
 
73
      if (!status) {
 
74
         g_printerr("%s\n", result ? result : "NULL");
 
75
      } else {
 
76
         g_print("%s\n", result);
 
77
      }
 
78
 
 
79
      vm_free(result);
 
80
      exit(status ? 0 : 1);
72
81
   }
73
 
 
74
 
   vm_free(result);
75
 
   exit(status ? 0 : 1);
 
82
   g_printerr("%s\n",
 
83
              SU_(cmdline.rpcerror, "Unable to send command to VMware hypervisor."));
 
84
   exit(1);
76
85
}
77
86
 
78
87
 
100
109
 
101
110
 
102
111
/**
103
 
 * Signals a specific event in a running service instance.
 
112
 * Signals a specific event in a running service instance. Since this function
 
113
 * doesn't know whether the service is running through the SCM, it first tries
 
114
 * to open a local event, and if that fails, tries a global event.
104
115
 *
105
116
 * @param[in]  svcname     Name of the service to be signaled.
106
117
 * @param[in]  evtFmt      Format string for the event name. It should expect
120
131
 
121
132
   ASSERT(svcname != NULL);
122
133
 
123
 
   evt = Str_Aswprintf(NULL, evtFmt, svcname);
 
134
   evt = Str_Aswprintf(NULL, evtFmt, L"Local", svcname);
 
135
   if (evt == NULL) {
 
136
      g_printerr("Out of memory!\n");
 
137
      goto exit;
 
138
   }
 
139
 
 
140
   h = OpenEvent(EVENT_MODIFY_STATE, FALSE, evt);
 
141
   if (h != NULL) {
 
142
      goto dispatch;
 
143
   }
 
144
 
 
145
   vm_free(evt);
 
146
   evt = Str_Aswprintf(NULL, evtFmt, L"Global", svcname);
124
147
   if (evt == NULL) {
125
148
      g_printerr("Out of memory!\n");
126
149
      goto exit;
131
154
      goto error;
132
155
   }
133
156
 
 
157
dispatch:
134
158
   if (!SetEvent(h)) {
135
159
      goto error;
136
160
   }
255
279
#endif
256
280
 
257
281
   context = g_option_context_new(NULL);
258
 
#if GLIB_MAJOR_VERSION >= 2 && GLIB_MINOR_VERSION >= 12
 
282
#if GLIB_CHECK_VERSION(2, 12, 0)
259
283
   g_option_context_set_summary(context, N_("Runs the VMware Tools daemon."));
260
284
#endif
261
285
   g_option_context_add_main_entries(context, clOptions, NULL);