Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 93400 | Differences between
and this patch

Collapse All | Expand All

(-)configure.in (+4 lines)
Lines 60-65 fi Link Here
60
AC_SUBST(DBUS_SYS_DIR)
60
AC_SUBST(DBUS_SYS_DIR)
61
AC_DEFINE_UNQUOTED(DBUS_SYSTEMD_DIR, "$DBUS_SYS_DIR", [Where system.d dir for DBUS is])
61
AC_DEFINE_UNQUOTED(DBUS_SYSTEMD_DIR, "$DBUS_SYS_DIR", [Where system.d dir for DBUS is])
62
62
63
if pkg-config dbus-1 --atleast-version=0.30 ; then
64
    AC_DEFINE(DBUS_USE_NEW_API, 1, [Whether to use the new API for DBUS 0.30])
65
fi
66
63
AC_SUBST(DBUS_CFLAGS)
67
AC_SUBST(DBUS_CFLAGS)
64
AC_SUBST(DBUS_LIBS)
68
AC_SUBST(DBUS_LIBS)
65
69
(-)src/nautilus-share.c (+8 lines)
Lines 19-24 Link Here
19
 * (C) Copyright 2005 Ethium, Inc.
19
 * (C) Copyright 2005 Ethium, Inc.
20
 */
20
 */
21
21
22
#ifdef HAVE_CONFIG_H
23
#include <config.h>
24
#endif
25
22
#include <libnautilus-extension/nautilus-extension-types.h>
26
#include <libnautilus-extension/nautilus-extension-types.h>
23
#include <libnautilus-extension/nautilus-column-provider.h>
27
#include <libnautilus-extension/nautilus-column-provider.h>
24
#include <libnautilus-extension/nautilus-extension-types.h>
28
#include <libnautilus-extension/nautilus-extension-types.h>
Lines 727-733 nautilus_module_initialize (GTypeModule Link Here
727
731
728
  /* FIXME error */
732
  /* FIXME error */
729
/*   dbus_bus_set_base_service(g_dbus, NAUTILUS_DBUS_SRV); */
733
/*   dbus_bus_set_base_service(g_dbus, NAUTILUS_DBUS_SRV); */
734
#ifndef DBUS_USE_NEW_API
730
  dbus_bus_acquire_service (g_dbus, NAUTILUS_DBUS_SRV,
735
  dbus_bus_acquire_service (g_dbus, NAUTILUS_DBUS_SRV,
736
#else /* DBUS_USE_NEW_API */
737
  dbus_bus_request_name (g_dbus, NAUTILUS_DBUS_SRV,
738
#endif /* DBUS_USE_NEW_API */
731
                            0, NULL);
739
                            0, NULL);
732
  
740
  
733
  dbus_connection_setup_with_g_main (g_dbus, NULL);
741
  dbus_connection_setup_with_g_main (g_dbus, NULL);
(-)src/smbparser-dbus-client.c (+85 lines)
Lines 19-24 Link Here
19
 * (C) Copyright 2005 Ethium, Inc.
19
 * (C) Copyright 2005 Ethium, Inc.
20
 */
20
 */
21
21
22
#ifdef HAVE_CONFIG_H
23
#include <config.h>
24
#endif
25
22
#include <glib.h>
26
#include <glib.h>
23
#include <string.h>
27
#include <string.h>
24
28
Lines 59-66 smbparser_dbus_remove_key(DBusConnection Link Here
59
    return FALSE;
63
    return FALSE;
60
  message = dbus_message_new_signal (SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "RemoveKey");
64
  message = dbus_message_new_signal (SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "RemoveKey");
61
  dbus_message_append_args (message,
65
  dbus_message_append_args (message,
66
#ifndef DBUS_USE_NEW_API
62
                            DBUS_TYPE_STRING, section,
67
                            DBUS_TYPE_STRING, section,
63
                            DBUS_TYPE_STRING, key,
68
                            DBUS_TYPE_STRING, key,
69
#else /* DBUS_USE_NEW_API */
70
                            DBUS_TYPE_STRING, &section,
71
                            DBUS_TYPE_STRING, &key,
72
#endif /* DBUS_USE_NEW_API */
64
                            DBUS_TYPE_INVALID);
73
                            DBUS_TYPE_INVALID);
65
  dbus_connection_send (bus, message, NULL);
74
  dbus_connection_send (bus, message, NULL);
66
  dbus_message_unref (message);
75
  dbus_message_unref (message);
Lines 77-85 smbparser_dbus_set_key(DBusConnection *b Link Here
77
    return FALSE;
86
    return FALSE;
78
  message = dbus_message_new_signal (SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "SetKey");
87
  message = dbus_message_new_signal (SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "SetKey");
79
  dbus_message_append_args (message,
88
  dbus_message_append_args (message,
89
#ifndef DBUS_USE_NEW_API
80
                            DBUS_TYPE_STRING, path,
90
                            DBUS_TYPE_STRING, path,
81
                            DBUS_TYPE_STRING, key,
91
                            DBUS_TYPE_STRING, key,
82
                            DBUS_TYPE_STRING, value,
92
                            DBUS_TYPE_STRING, value,
93
#else /* DBUS_USE_NEW_API */
94
                            DBUS_TYPE_STRING, &path,
95
                            DBUS_TYPE_STRING, &key,
96
                            DBUS_TYPE_STRING, &value,
97
#endif /* DBUS_USE_NEW_API */
83
                            DBUS_TYPE_INVALID);
98
                            DBUS_TYPE_INVALID);
84
  dbus_connection_send (bus, message, NULL);
99
  dbus_connection_send (bus, message, NULL);
85
  dbus_message_unref (message);
100
  dbus_message_unref (message);
Lines 96-103 smbparser_dbus_share_remove_key(DBusConn Link Here
96
    return FALSE;
111
    return FALSE;
97
  message = dbus_message_new_signal (SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "ShareRemoveKey");
112
  message = dbus_message_new_signal (SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "ShareRemoveKey");
98
  dbus_message_append_args (message,
113
  dbus_message_append_args (message,
114
#ifndef DBUS_USE_NEW_API
99
                            DBUS_TYPE_STRING, path,
115
                            DBUS_TYPE_STRING, path,
100
                            DBUS_TYPE_STRING, key,
116
                            DBUS_TYPE_STRING, key,
117
#else /* DBUS_USE_NEW_API */
118
                            DBUS_TYPE_STRING, &path,
119
                            DBUS_TYPE_STRING, &key,
120
#endif /* DBUS_USE_NEW_API */
101
                            DBUS_TYPE_INVALID);
121
                            DBUS_TYPE_INVALID);
102
  dbus_connection_send (bus, message, NULL);
122
  dbus_connection_send (bus, message, NULL);
103
  dbus_message_unref (message);
123
  dbus_message_unref (message);
Lines 114-122 smbparser_dbus_share_set_key(DBusConnect Link Here
114
    return FALSE;
134
    return FALSE;
115
  message = dbus_message_new_signal (SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "ShareSetKey");
135
  message = dbus_message_new_signal (SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "ShareSetKey");
116
  dbus_message_append_args (message,
136
  dbus_message_append_args (message,
137
#ifndef DBUS_USE_NEW_API
117
                            DBUS_TYPE_STRING, path,
138
                            DBUS_TYPE_STRING, path,
118
                            DBUS_TYPE_STRING, key,
139
                            DBUS_TYPE_STRING, key,
119
                            DBUS_TYPE_STRING, value,
140
                            DBUS_TYPE_STRING, value,
141
#else /* DBUS_USE_NEW_API */
142
                            DBUS_TYPE_STRING, &path,
143
                            DBUS_TYPE_STRING, &key,
144
                            DBUS_TYPE_STRING, &value,
145
#endif /* DBUS_USE_NEW_API */
120
                            DBUS_TYPE_INVALID);
146
                            DBUS_TYPE_INVALID);
121
  dbus_connection_send (bus, message, NULL);
147
  dbus_connection_send (bus, message, NULL);
122
  dbus_message_unref (message);
148
  dbus_message_unref (message);
Lines 133-139 smbparser_dbus_remove_section(DBusConnec Link Here
133
    return FALSE;
159
    return FALSE;
134
  message = dbus_message_new_signal (SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "RemoveSection");
160
  message = dbus_message_new_signal (SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "RemoveSection");
135
  dbus_message_append_args (message,
161
  dbus_message_append_args (message,
162
#ifndef DBUS_USE_NEW_API
136
                            DBUS_TYPE_STRING, section,
163
                            DBUS_TYPE_STRING, section,
164
#else /* DBUS_USE_NEW_API */
165
                            DBUS_TYPE_STRING, &section,
166
#endif /* DBUS_USE_NEW_API */
137
                            DBUS_TYPE_INVALID);
167
                            DBUS_TYPE_INVALID);
138
  dbus_connection_send (bus, message, NULL);
168
  dbus_connection_send (bus, message, NULL);
139
  dbus_message_unref (message);
169
  dbus_message_unref (message);
Lines 150-156 smbparser_dbus_share_remove(DBusConnecti Link Here
150
    return FALSE;
180
    return FALSE;
151
  message = dbus_message_new_signal (SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "ShareRemove");
181
  message = dbus_message_new_signal (SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "ShareRemove");
152
  dbus_message_append_args (message,
182
  dbus_message_append_args (message,
183
#ifndef DBUS_USE_NEW_API
153
                            DBUS_TYPE_STRING, path,
184
                            DBUS_TYPE_STRING, path,
185
#else /* DBUS_USE_NEW_API */
186
                            DBUS_TYPE_STRING, &path,
187
#endif /* DBUS_USE_NEW_API */
154
                            DBUS_TYPE_INVALID);
188
                            DBUS_TYPE_INVALID);
155
  dbus_connection_send (bus, message, NULL);
189
  dbus_connection_send (bus, message, NULL);
156
  dbus_message_unref (message);
190
  dbus_message_unref (message);
Lines 171-178 smbparser_dbus_rename_section(DBusConnec Link Here
171
    return FALSE;
205
    return FALSE;
172
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "RenameSection");
206
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "RenameSection");
173
  dbus_message_append_args (message,
207
  dbus_message_append_args (message,
208
#ifndef DBUS_USE_NEW_API
174
                            DBUS_TYPE_STRING, section,
209
                            DBUS_TYPE_STRING, section,
175
                            DBUS_TYPE_STRING, newname,
210
                            DBUS_TYPE_STRING, newname,
211
#else /* DBUS_USE_NEW_API */
212
                            DBUS_TYPE_STRING, &section,
213
                            DBUS_TYPE_STRING, &newname,
214
#endif /* DBUS_USE_NEW_API */
176
                            DBUS_TYPE_INVALID);
215
                            DBUS_TYPE_INVALID);
177
216
178
  dbus_error_init (&error);
217
  dbus_error_init (&error);
Lines 206-213 smbparser_dbus_share_rename(DBusConnecti Link Here
206
    return FALSE;
245
    return FALSE;
207
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "ShareRename");
246
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "ShareRename");
208
  dbus_message_append_args (message,
247
  dbus_message_append_args (message,
248
#ifndef DBUS_USE_NEW_API
209
                            DBUS_TYPE_STRING, path,
249
                            DBUS_TYPE_STRING, path,
210
                            DBUS_TYPE_STRING, newname,
250
                            DBUS_TYPE_STRING, newname,
251
#else /* DBUS_USE_NEW_API */
252
                            DBUS_TYPE_STRING, &path,
253
                            DBUS_TYPE_STRING, &newname,
254
#endif /* DBUS_USE_NEW_API */
211
                            DBUS_TYPE_INVALID);
255
                            DBUS_TYPE_INVALID);
212
256
213
  dbus_error_init (&error);
257
  dbus_error_init (&error);
Lines 241-247 smbparser_dbus_add_section(DBusConnectio Link Here
241
    return FALSE;
285
    return FALSE;
242
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "AddSection");
286
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "AddSection");
243
  dbus_message_append_args (message,
287
  dbus_message_append_args (message,
288
#ifndef DBUS_USE_NEW_API
244
                            DBUS_TYPE_STRING, section,
289
                            DBUS_TYPE_STRING, section,
290
#else /* DBUS_USE_NEW_API */
291
                            DBUS_TYPE_STRING, &section,
292
#endif /* DBUS_USE_NEW_API */
245
                            DBUS_TYPE_INVALID);
293
                            DBUS_TYPE_INVALID);
246
  dbus_error_init (&error);
294
  dbus_error_init (&error);
247
  if((reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error)))
295
  if((reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error)))
Lines 272-279 smbparser_dbus_share_add(DBusConnection Link Here
272
    return FALSE;
320
    return FALSE;
273
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "ShareAdd");
321
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "ShareAdd");
274
  dbus_message_append_args (message,
322
  dbus_message_append_args (message,
323
#ifndef DBUS_USE_NEW_API
275
                            DBUS_TYPE_STRING, path,
324
                            DBUS_TYPE_STRING, path,
276
                            DBUS_TYPE_STRING, name,
325
                            DBUS_TYPE_STRING, name,
326
#else /* DBUS_USE_NEW_API */
327
                            DBUS_TYPE_STRING, &path,
328
                            DBUS_TYPE_STRING, &name,
329
#endif /* DBUS_USE_NEW_API */
277
                            DBUS_TYPE_INVALID);
330
                            DBUS_TYPE_INVALID);
278
  dbus_error_init (&error);
331
  dbus_error_init (&error);
279
  if((reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error)))
332
  if((reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error)))
Lines 304-310 smbparser_dbus_section_used(DBusConnecti Link Here
304
    return FALSE;
357
    return FALSE;
305
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "SectionUsed");
358
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "SectionUsed");
306
  dbus_message_append_args (message,
359
  dbus_message_append_args (message,
360
#ifndef DBUS_USE_NEW_API
307
                            DBUS_TYPE_STRING, section,
361
                            DBUS_TYPE_STRING, section,
362
#else /* DBUS_USE_NEW_API */
363
                            DBUS_TYPE_STRING, &section,
364
#endif /* DBUS_USE_NEW_API */
308
                            DBUS_TYPE_INVALID);
365
                            DBUS_TYPE_INVALID);
309
  dbus_error_init (&error);
366
  dbus_error_init (&error);
310
  if((reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error)))
367
  if((reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error)))
Lines 337-344 smbparser_dbus_get_key(DBusConnection *b Link Here
337
394
338
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "GetKey");
395
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "GetKey");
339
  dbus_message_append_args (message,
396
  dbus_message_append_args (message,
397
#ifndef DBUS_USE_NEW_API
340
                            DBUS_TYPE_STRING, section,
398
                            DBUS_TYPE_STRING, section,
341
                            DBUS_TYPE_STRING, key,
399
                            DBUS_TYPE_STRING, key,
400
#else /* DBUS_USE_NEW_API */
401
                            DBUS_TYPE_STRING, &section,
402
                            DBUS_TYPE_STRING, &key,
403
#endif /* DBUS_USE_NEW_API */
342
                            DBUS_TYPE_INVALID);
404
                            DBUS_TYPE_INVALID);
343
  dbus_error_init (&error);
405
  dbus_error_init (&error);
344
  if((reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error)))
406
  if((reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error)))
Lines 347-353 smbparser_dbus_get_key(DBusConnection *b Link Here
347
      if (dbus_message_get_args (reply, &error_args, DBUS_TYPE_STRING, &dbus_string, DBUS_TYPE_INVALID))
409
      if (dbus_message_get_args (reply, &error_args, DBUS_TYPE_STRING, &dbus_string, DBUS_TYPE_INVALID))
348
	{
410
	{
349
	  value = ((dbus_string == NULL) || (strcmp(dbus_string,"")==0)  ? NULL : g_strdup (dbus_string));
411
	  value = ((dbus_string == NULL) || (strcmp(dbus_string,"")==0)  ? NULL : g_strdup (dbus_string));
412
#ifndef DBUS_USE_NEW_API
350
	  dbus_free (dbus_string);
413
	  dbus_free (dbus_string);
414
#endif /* ! DBUS_USE_NEW_API */
351
	}
415
	}
352
      else
416
      else
353
	g_print("GetKey error in dbus_message_get_args: %s\n",error_args.message);
417
	g_print("GetKey error in dbus_message_get_args: %s\n",error_args.message);
Lines 377-384 smbparser_dbus_share_get_key(DBusConnect Link Here
377
441
378
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "ShareGetKey");
442
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH, SMBPARSER_DBUS_INTERFACE, "ShareGetKey");
379
  dbus_message_append_args (message,
443
  dbus_message_append_args (message,
444
#ifndef DBUS_USE_NEW_API
380
                            DBUS_TYPE_STRING, path,
445
                            DBUS_TYPE_STRING, path,
381
                            DBUS_TYPE_STRING, key,
446
                            DBUS_TYPE_STRING, key,
447
#else /* DBUS_USE_NEW_API */
448
                            DBUS_TYPE_STRING, &path,
449
                            DBUS_TYPE_STRING, &key,
450
#endif /* DBUS_USE_NEW_API */
382
                            DBUS_TYPE_INVALID);
451
                            DBUS_TYPE_INVALID);
383
  dbus_error_init (&error);
452
  dbus_error_init (&error);
384
  if((reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error)))
453
  if((reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error)))
Lines 387-393 smbparser_dbus_share_get_key(DBusConnect Link Here
387
      if (dbus_message_get_args (reply, &error_args, DBUS_TYPE_STRING, &dbus_string, DBUS_TYPE_INVALID))
456
      if (dbus_message_get_args (reply, &error_args, DBUS_TYPE_STRING, &dbus_string, DBUS_TYPE_INVALID))
388
	{
457
	{
389
	  value = ((dbus_string == NULL) || (strcmp(dbus_string,"")==0)  ? NULL : g_strdup (dbus_string));
458
	  value = ((dbus_string == NULL) || (strcmp(dbus_string,"")==0)  ? NULL : g_strdup (dbus_string));
459
#ifndef DBUS_USE_NEW_API
390
	  dbus_free (dbus_string);
460
	  dbus_free (dbus_string);
461
#endif /* ! DBUS_USE_NEW_API */
391
	}
462
	}
392
      else
463
      else
393
	g_print("GetKey error in dbus_message_get_args: %s\n",error_args.message);
464
	g_print("GetKey error in dbus_message_get_args: %s\n",error_args.message);
Lines 415-421 smbparser_dbus_share_get_name(DBusConnec Link Here
415
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH,
486
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH,
416
                                     SMBPARSER_DBUS_INTERFACE, "ShareGetName");
487
                                     SMBPARSER_DBUS_INTERFACE, "ShareGetName");
417
  dbus_message_append_args (message,
488
  dbus_message_append_args (message,
489
#ifndef DBUS_USE_NEW_API
418
                            DBUS_TYPE_STRING, path,
490
                            DBUS_TYPE_STRING, path,
491
#else /* DBUS_USE_NEW_API */
492
                            DBUS_TYPE_STRING, &path,
493
#endif /* DBUS_USE_NEW_API */
419
                            DBUS_TYPE_INVALID);
494
                            DBUS_TYPE_INVALID);
420
495
421
  dbus_error_init (&error);
496
  dbus_error_init (&error);
Lines 425-431 smbparser_dbus_share_get_name(DBusConnec Link Here
425
      if (dbus_message_get_args (reply, &error_args, DBUS_TYPE_STRING, &dbus_string, DBUS_TYPE_INVALID))
500
      if (dbus_message_get_args (reply, &error_args, DBUS_TYPE_STRING, &dbus_string, DBUS_TYPE_INVALID))
426
	{
501
	{
427
	  value = ((dbus_string == NULL) || (strcmp(dbus_string,"")==0) ? NULL : g_strdup (dbus_string));
502
	  value = ((dbus_string == NULL) || (strcmp(dbus_string,"")==0) ? NULL : g_strdup (dbus_string));
503
#ifndef DBUS_USE_NEW_API
428
	  dbus_free (dbus_string);
504
	  dbus_free (dbus_string);
505
#endif /* ! DBUS_USE_NEW_API */
429
	}
506
	}
430
      else
507
      else
431
	g_print("ShareGetName error in dbus_message_get_args: %s\n",error_args.message);
508
	g_print("ShareGetName error in dbus_message_get_args: %s\n",error_args.message);
Lines 453-459 smbparser_dbus_share_is_writable(DBusCon Link Here
453
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH,
530
  message = dbus_message_new_method_call (SMBPARSER_DBUS_SRV, SMBPARSER_DBUS_PATH,
454
                                     SMBPARSER_DBUS_INTERFACE, "ShareIsWritable");
531
                                     SMBPARSER_DBUS_INTERFACE, "ShareIsWritable");
455
  dbus_message_append_args (message,
532
  dbus_message_append_args (message,
533
#ifndef DBUS_USE_NEW_API
456
                            DBUS_TYPE_STRING, path,
534
                            DBUS_TYPE_STRING, path,
535
#else /* DBUS_USE_NEW_API */
536
                            DBUS_TYPE_STRING, &path,
537
#endif /* DBUS_USE_NEW_API */
457
                            DBUS_TYPE_INVALID);
538
                            DBUS_TYPE_INVALID);
458
  dbus_error_init (&error);
539
  dbus_error_init (&error);
459
  if((reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error)))
540
  if((reply = dbus_connection_send_with_reply_and_block (bus, message, -1, &error)))
Lines 498-504 main (int argc, char **argv) Link Here
498
  }
579
  }
499
  dbus_error_free (&error);
580
  dbus_error_free (&error);
500
581
582
#ifndef DBUS_USE_NEW_API
501
  dbus_bus_acquire_service (bus, NAUTILUS_DBUS_SRV,
583
  dbus_bus_acquire_service (bus, NAUTILUS_DBUS_SRV,
584
#else /* DBUS_USE_NEW_API */
585
  dbus_bus_request_name (bus, NAUTILUS_DBUS_SRV,
586
#endif /* DBUS_USE_NEW_API */
502
                            0, NULL);
587
                            0, NULL);
503
  /* Set up this connection to work in a GLib event loop */
588
  /* Set up this connection to work in a GLib event loop */
504
  dbus_connection_setup_with_g_main (bus, NULL);
589
  dbus_connection_setup_with_g_main (bus, NULL);
(-)src/smbparser-dbus-server.c (+150 lines)
Lines 19-24 Link Here
19
 * (C) Copyright 2005 Ethium, Inc.
19
 * (C) Copyright 2005 Ethium, Inc.
20
 */
20
 */
21
21
22
#ifdef HAVE_CONFIG_H
23
#include <config.h>
24
#endif
25
22
#include <stdio.h>
26
#include <stdio.h>
23
#include <string.h>
27
#include <string.h>
24
#include <pwd.h>
28
#include <pwd.h>
Lines 195-210 path_message_func (DBusConnection *conn Link Here
195
      if((sharename = smbparser_get_sharename(shares, path)))
199
      if((sharename = smbparser_get_sharename(shares, path)))
196
	{
200
	{
197
	  value =  smbparser_get_key(shares,sharename,key);
201
	  value =  smbparser_get_key(shares,sharename,key);
202
#ifdef DBUS_USE_NEW_API
203
	  if (!value)
204
	    value = "";
205
#endif /* DBUS_USE_NEW_API */
198
	  daemon_log(LOG_INFO,"Share Get key %s in section %s -> %s\n", key, sharename,value);
206
	  daemon_log(LOG_INFO,"Share Get key %s in section %s -> %s\n", key, sharename,value);
207
#ifndef DBUS_USE_NEW_API
199
	  dbus_message_append_args (reply_message, DBUS_TYPE_STRING, value?value:"", DBUS_TYPE_INVALID);
208
	  dbus_message_append_args (reply_message, DBUS_TYPE_STRING, value?value:"", DBUS_TYPE_INVALID);
209
#endif /* ! DBUS_USE_NEW_API */
200
	}
210
	}
201
      else
211
      else
202
	{
212
	{
203
	  daemon_log(LOG_ERR,"Share Get key path: %s not found\n",path);
213
	  daemon_log(LOG_ERR,"Share Get key path: %s not found\n",path);
214
#ifndef DBUS_USE_NEW_API
204
	  dbus_message_append_args (reply_message, DBUS_TYPE_STRING, "", DBUS_TYPE_INVALID);
215
	  dbus_message_append_args (reply_message, DBUS_TYPE_STRING, "", DBUS_TYPE_INVALID);
216
#else /* DBUS_USE_NEW_API */
217
	  value = "";
218
#endif /* DBUS_USE_NEW_API */
205
	}
219
	}
220
#ifndef DBUS_USE_NEW_API
206
      dbus_free (path);
221
      dbus_free (path);
207
      dbus_free (key);
222
      dbus_free (key);
223
#else /* DBUS_USE_NEW_API */
224
      dbus_message_append_args (reply_message, DBUS_TYPE_STRING, &value, DBUS_TYPE_INVALID);
225
#endif /* DBUS_USE_NEW_API */
208
      if (reply_message)
226
      if (reply_message)
209
	{
227
	{
210
	  dbus_connection_send (connection, reply_message, NULL);
228
	  dbus_connection_send (connection, reply_message, NULL);
Lines 235-248 path_message_func (DBusConnection *conn Link Here
235
      if (!(sharename =  smbparser_get_sharename(shares, path)))
253
      if (!(sharename =  smbparser_get_sharename(shares, path)))
236
	{
254
	{
237
	  daemon_log(LOG_ERR,"SGN Sharename path:%s not found\n", path);
255
	  daemon_log(LOG_ERR,"SGN Sharename path:%s not found\n", path);
256
#ifndef DBUS_USE_NEW_API
238
	  dbus_message_append_args (reply_message, DBUS_TYPE_STRING, "", DBUS_TYPE_INVALID);
257
	  dbus_message_append_args (reply_message, DBUS_TYPE_STRING, "", DBUS_TYPE_INVALID);
258
#else /* DBUS_USE_NEW_API */
259
	  sharename = "";
260
#endif /* DBUS_USE_NEW_API */
239
	}
261
	}
240
      else
262
      else
241
	{
263
	{
242
	  daemon_log(LOG_INFO,"Path %s is sharename %s\n", path, sharename);
264
	  daemon_log(LOG_INFO,"Path %s is sharename %s\n", path, sharename);
265
#ifndef DBUS_USE_NEW_API
243
	  dbus_message_append_args (reply_message, DBUS_TYPE_STRING, sharename, DBUS_TYPE_INVALID);
266
	  dbus_message_append_args (reply_message, DBUS_TYPE_STRING, sharename, DBUS_TYPE_INVALID);
267
#endif /* ! DBUS_USE_NEW_API */
244
	}
268
	}
269
#ifndef DBUS_USE_NEW_API
245
      dbus_free (path);
270
      dbus_free (path);
271
#else /* DBUS_USE_NEW_API */
272
      dbus_message_append_args (reply_message, DBUS_TYPE_STRING, &sharename, DBUS_TYPE_INVALID);
273
#endif /* DBUS_USE_NEW_API */
246
      if (reply_message)
274
      if (reply_message)
247
	{
275
	{
248
	  dbus_connection_send (connection, reply_message, NULL);
276
	  dbus_connection_send (connection, reply_message, NULL);
Lines 264-269 path_message_func (DBusConnection *conn Link Here
264
    char *sharename;
292
    char *sharename;
265
    char *newname;
293
    char *newname;
266
    DBusMessage	*reply_message = NULL;
294
    DBusMessage	*reply_message = NULL;
295
#ifdef DBUS_USE_NEW_API
296
    dbus_uint32_t reply_val;
297
#endif /* DBUS_USE_NEW_API */
267
298
268
    dbus_error_init (&error);
299
    dbus_error_init (&error);
269
    if (dbus_message_get_args 
300
    if (dbus_message_get_args 
Lines 274-281 path_message_func (DBusConnection *conn Link Here
274
      reply_message = dbus_message_new_method_return (message);
305
      reply_message = dbus_message_new_method_return (message);
275
      if (!(sharename = smbparser_get_sharename(shares, path)))
306
      if (!(sharename = smbparser_get_sharename(shares, path)))
276
	{
307
	{
308
#ifdef DBUS_USE_NEW_API
309
	  reply_val = 2;
310
#endif /* DBUS_USE_NEW_API */
277
	  daemon_log(LOG_ERR,"ShareRename Sharename path:%s not found\n", path);
311
	  daemon_log(LOG_ERR,"ShareRename Sharename path:%s not found\n", path);
312
#ifndef DBUS_USE_NEW_API
278
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 2, DBUS_TYPE_INVALID);
313
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 2, DBUS_TYPE_INVALID);
314
#else /* DBUS_USE_NEW_API */
315
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
316
#endif /* DBUS_USE_NEW_API */
279
	}
317
	}
280
      else
318
      else
281
	{
319
	{
Lines 285-309 path_message_func (DBusConnection *conn Link Here
285
	      /* FIXME strlen(sharename) et meme modele que ShareAdd */
323
	      /* FIXME strlen(sharename) et meme modele que ShareAdd */
286
	      if(authorized_section(sharename) == FALSE)
324
	      if(authorized_section(sharename) == FALSE)
287
		{
325
		{
326
#ifdef DBUS_USE_NEW_API
327
		  reply_val = 1;
328
#endif /* DBUS_USE_NEW_API */
288
		  daemon_log(LOG_ERR,"ShareRename received, but error: authorized_section\n");
329
		  daemon_log(LOG_ERR,"ShareRename received, but error: authorized_section\n");
330
#ifndef DBUS_USE_NEW_API
289
		  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 1, DBUS_TYPE_INVALID);
331
		  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 1, DBUS_TYPE_INVALID);
332
#else /* DBUS_USE_NEW_API */
333
		  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
334
#endif /* DBUS_USE_NEW_API */
290
		}
335
		}
291
	      else
336
	      else
292
		if(find_sharename(shares,newname))
337
		if(find_sharename(shares,newname))
293
		  {
338
		  {
339
#ifdef DBUS_USE_NEW_API
340
		    reply_val = 1;
341
#endif /* DBUS_USE_NEW_API */
294
		    daemon_log(LOG_ERR,"ShareRename Sharename already in used: %s\n", newname);
342
		    daemon_log(LOG_ERR,"ShareRename Sharename already in used: %s\n", newname);
343
#ifndef DBUS_USE_NEW_API
295
		    dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 1, DBUS_TYPE_INVALID);
344
		    dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 1, DBUS_TYPE_INVALID);
345
#else /* DBUS_USE_NEW_API */
346
		    dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
347
#endif /* DBUS_USE_NEW_API */
296
		  }
348
		  }
297
		else
349
		else
298
		  {
350
		  {
351
#ifdef DBUS_USE_NEW_API
352
		    reply_val = 0;
353
#endif /* DBUS_USE_NEW_API */
299
		    daemon_log(LOG_ERR,"ShareRename Sharename not in used: %s\n", newname);
354
		    daemon_log(LOG_ERR,"ShareRename Sharename not in used: %s\n", newname);
300
		    shares =   smbparser_rename_section(shares,sharename,newname);
355
		    shares =   smbparser_rename_section(shares,sharename,newname);
356
#ifndef DBUS_USE_NEW_API
301
		    dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 0, DBUS_TYPE_INVALID);
357
		    dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 0, DBUS_TYPE_INVALID);
358
#else /* DBUS_USE_NEW_API */
359
		    dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
360
#endif /* DBUS_USE_NEW_API */
302
		  }
361
		  }
303
	    }
362
	    }
304
	}
363
	}
364
#ifndef DBUS_USE_NEW_API
305
      dbus_free (path);
365
      dbus_free (path);
306
      dbus_free (newname);
366
      dbus_free (newname);
367
#endif /* ! DBUS_USE_NEW_API */
307
      if (reply_message)
368
      if (reply_message)
308
	{
369
	{
309
	  dbus_connection_send (connection, reply_message, NULL);
370
	  dbus_connection_send (connection, reply_message, NULL);
Lines 325-330 path_message_func (DBusConnection *conn Link Here
325
      char	*name;
386
      char	*name;
326
      char	*username;
387
      char	*username;
327
      DBusMessage	*reply_message = NULL;
388
      DBusMessage	*reply_message = NULL;
389
#ifdef DBUS_USE_NEW_API
390
      dbus_uint32_t reply_val;
391
#endif /* DBUS_USE_NEW_API */
328
392
329
      dbus_error_init (&error);
393
      dbus_error_init (&error);
330
      if (!dbus_message_get_args
394
      if (!dbus_message_get_args
Lines 341-385 path_message_func (DBusConnection *conn Link Here
341
      reply_message = dbus_message_new_method_return (message);
405
      reply_message = dbus_message_new_method_return (message);
342
      if (name && (strlen(name) == 0))
406
      if (name && (strlen(name) == 0))
343
	{
407
	{
408
#ifdef DBUS_USE_NEW_API
409
	  reply_val = 4;
410
#endif /* DBUS_USE_NEW_API */
344
	  daemon_log(LOG_ERR,"ShareAdd received, but error: strlen(name) == 0\n");
411
	  daemon_log(LOG_ERR,"ShareAdd received, but error: strlen(name) == 0\n");
412
#ifndef DBUS_USE_NEW_API
345
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 4, DBUS_TYPE_INVALID);
413
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 4, DBUS_TYPE_INVALID);
414
#else /* DBUS_USE_NEW_API */
415
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
416
#endif /* DBUS_USE_NEW_API */
346
	  goto exit;
417
	  goto exit;
347
	}
418
	}
348
      if (!authorized_section(name))
419
      if (!authorized_section(name))
349
	{
420
	{
421
#ifdef DBUS_USE_NEW_API
422
	  reply_val = 3;
423
#endif /* DBUS_USE_NEW_API */
350
	  daemon_log(LOG_ERR,"ShareAdd received, but error: authorized_section\n");
424
	  daemon_log(LOG_ERR,"ShareAdd received, but error: authorized_section\n");
425
#ifndef DBUS_USE_NEW_API
351
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 3, DBUS_TYPE_INVALID);
426
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 3, DBUS_TYPE_INVALID);
427
#else /* DBUS_USE_NEW_API */
428
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
429
#endif /* DBUS_USE_NEW_API */
352
	  goto exit;
430
	  goto exit;
353
	}
431
	}
354
      if (!authorized_path(connection, path))
432
      if (!authorized_path(connection, path))
355
	{
433
	{
434
#ifdef DBUS_USE_NEW_API
435
	  reply_val = 2;
436
#endif /* DBUS_USE_NEW_API */
356
	  daemon_log(LOG_ERR,"ShareAdd received, but error: authorized_path\n");
437
	  daemon_log(LOG_ERR,"ShareAdd received, but error: authorized_path\n");
438
#ifndef DBUS_USE_NEW_API
357
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 2, DBUS_TYPE_INVALID);
439
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 2, DBUS_TYPE_INVALID);
440
#else /* DBUS_USE_NEW_API */
441
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
442
#endif /* DBUS_USE_NEW_API */
358
	  goto exit;
443
	  goto exit;
359
	}
444
	}
360
      if(find_sharename(shares,name))
445
      if(find_sharename(shares,name))
361
	{
446
	{
447
#ifdef DBUS_USE_NEW_API
448
	  reply_val = 1;
449
#endif /* DBUS_USE_NEW_API */
362
	  daemon_log(LOG_ERR,"ShareAdd Name already in used: %s\n", name);
450
	  daemon_log(LOG_ERR,"ShareAdd Name already in used: %s\n", name);
451
#ifndef DBUS_USE_NEW_API
363
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 1, DBUS_TYPE_INVALID);
452
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 1, DBUS_TYPE_INVALID);
453
#else /* DBUS_USE_NEW_API */
454
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
455
#endif /* DBUS_USE_NEW_API */
364
	  goto exit;
456
	  goto exit;
365
	}
457
	}
366
      if(smbparser_get_sharename(shares, path))
458
      if(smbparser_get_sharename(shares, path))
367
	{
459
	{
460
#ifdef DBUS_USE_NEW_API
461
	  reply_val = 3;
462
#endif /* DBUS_USE_NEW_API */
368
	  daemon_log(LOG_ERR,"ShareAdd Path already in used: %s\n", path);
463
	  daemon_log(LOG_ERR,"ShareAdd Path already in used: %s\n", path);
464
#ifndef DBUS_USE_NEW_API
369
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 3, DBUS_TYPE_INVALID);
465
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 3, DBUS_TYPE_INVALID);
466
#else /* DBUS_USE_NEW_API */
467
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
468
#endif /* DBUS_USE_NEW_API */
370
	  goto exit;
469
	  goto exit;
371
	}
470
	}
372
      if((username = get_nautilus_user(connection)))
471
      if((username = get_nautilus_user(connection)))
373
	{
472
	{
473
#ifdef DBUS_USE_NEW_API
474
	  reply_val = 0;
475
#endif /* DBUS_USE_NEW_API */
374
	  daemon_log(LOG_INFO,"ShareAdd Name not in used: %s\n", name);
476
	  daemon_log(LOG_INFO,"ShareAdd Name not in used: %s\n", name);
375
	  shares = smbparser_add_section(shares,name,username);
477
	  shares = smbparser_add_section(shares,name,username);
376
	  shares = smbparser_set_key(shares,name,"force user", username);
478
	  shares = smbparser_set_key(shares,name,"force user", username);
377
	  shares = smbparser_set_key(shares,name,"path",path);
479
	  shares = smbparser_set_key(shares,name,"path",path);
480
#ifndef DBUS_USE_NEW_API
378
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 0, DBUS_TYPE_INVALID);
481
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 0, DBUS_TYPE_INVALID);
482
#else /* DBUS_USE_NEW_API */
483
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
484
#endif /* DBUS_USE_NEW_API */
379
	}
485
	}
380
    exit:
486
    exit:
487
#ifndef DBUS_USE_NEW_API
381
      dbus_free (name);
488
      dbus_free (name);
382
      dbus_free (path);
489
      dbus_free (path);
490
#endif /* ! DBUS_USE_NEW_API */
383
      if (reply_message)
491
      if (reply_message)
384
	{
492
	{
385
	  dbus_connection_send (connection, reply_message, NULL);
493
	  dbus_connection_send (connection, reply_message, NULL);
Lines 396-401 path_message_func (DBusConnection *conn Link Here
396
    DBusError	error;
504
    DBusError	error;
397
    char	*sharename;
505
    char	*sharename;
398
    DBusMessage	*reply_message = NULL;
506
    DBusMessage	*reply_message = NULL;
507
#ifdef DBUS_USE_NEW_API
508
    dbus_uint32_t reply_val;
509
#endif /* DBUS_USE_NEW_API */
399
510
400
    dbus_error_init (&error);
511
    dbus_error_init (&error);
401
    if (dbus_message_get_args 
512
    if (dbus_message_get_args 
Lines 407-427 path_message_func (DBusConnection *conn Link Here
407
      
518
      
408
      if(authorized_section(sharename) == FALSE)
519
      if(authorized_section(sharename) == FALSE)
409
	{
520
	{
521
#ifdef DBUS_USE_NEW_API
522
	  reply_val = 1;
523
#endif /* DBUS_USE_NEW_API */
410
	  daemon_log(LOG_ERR,"SectionUsed received, but error: authorized_section\n");
524
	  daemon_log(LOG_ERR,"SectionUsed received, but error: authorized_section\n");
525
#ifndef DBUS_USE_NEW_API
411
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 1, DBUS_TYPE_INVALID);
526
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 1, DBUS_TYPE_INVALID);
527
#else /* DBUS_USE_NEW_API */
528
	  dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
529
#endif /* DBUS_USE_NEW_API */
412
	}
530
	}
413
      else
531
      else
414
	if(find_sharename(shares,sharename))
532
	if(find_sharename(shares,sharename))
415
	  {
533
	  {
534
#ifdef DBUS_USE_NEW_API
535
	    reply_val = 1;
536
#endif /* DBUS_USE_NEW_API */
416
	    daemon_log(LOG_ERR,"SU Sharename already in used: %s\n", sharename);
537
	    daemon_log(LOG_ERR,"SU Sharename already in used: %s\n", sharename);
538
#ifndef DBUS_USE_NEW_API
417
	    dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 1, DBUS_TYPE_INVALID);
539
	    dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 1, DBUS_TYPE_INVALID);
540
#else /* DBUS_USE_NEW_API */
541
	    dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
542
#endif /* DBUS_USE_NEW_API */
418
	  }
543
	  }
419
	else
544
	else
420
	  {
545
	  {
546
#ifdef DBUS_USE_NEW_API
547
	    reply_val = 0;
548
#endif /* DBUS_USE_NEW_API */
421
	    daemon_log(LOG_INFO,"SU Sharename not in used: %s\n", sharename);
549
	    daemon_log(LOG_INFO,"SU Sharename not in used: %s\n", sharename);
550
#ifndef DBUS_USE_NEW_API
422
	    dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 0, DBUS_TYPE_INVALID);
551
	    dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, 0, DBUS_TYPE_INVALID);
552
#else /* DBUS_USE_NEW_API */
553
	    dbus_message_append_args (reply_message, DBUS_TYPE_UINT32, &reply_val, DBUS_TYPE_INVALID);
554
#endif /* DBUS_USE_NEW_API */
423
	  }
555
	  }
556
#ifndef DBUS_USE_NEW_API
424
      dbus_free (sharename);
557
      dbus_free (sharename);
558
#endif /* ! DBUS_USE_NEW_API */
425
      if (reply_message)
559
      if (reply_message)
426
	{
560
	{
427
	  dbus_connection_send (connection, reply_message, NULL);
561
	  dbus_connection_send (connection, reply_message, NULL);
Lines 450-458 path_message_func (DBusConnection *conn Link Here
450
	DBUS_TYPE_INVALID)) {
584
	DBUS_TYPE_INVALID)) {
451
      writable =  smbparser_sharename_is_writable(shares,path);
585
      writable =  smbparser_sharename_is_writable(shares,path);
452
      daemon_log(LOG_INFO,"Path %s -> %d\n", path, writable);
586
      daemon_log(LOG_INFO,"Path %s -> %d\n", path, writable);
587
#ifndef DBUS_USE_NEW_API
453
      dbus_free (path);
588
      dbus_free (path);
589
#endif /* ! DBUS_USE_NEW_API */
454
      reply_message = dbus_message_new_method_return (message);
590
      reply_message = dbus_message_new_method_return (message);
591
#ifndef DBUS_USE_NEW_API
455
      dbus_message_append_args (reply_message, DBUS_TYPE_BOOLEAN, writable, DBUS_TYPE_INVALID);
592
      dbus_message_append_args (reply_message, DBUS_TYPE_BOOLEAN, writable, DBUS_TYPE_INVALID);
593
#else /* DBUS_USE_NEW_API */
594
      dbus_message_append_args (reply_message, DBUS_TYPE_BOOLEAN, &writable, DBUS_TYPE_INVALID);
595
#endif /* DBUS_USE_NEW_API */
456
      if (reply_message)
596
      if (reply_message)
457
	{
597
	{
458
	  dbus_connection_send (connection, reply_message, NULL);
598
	  dbus_connection_send (connection, reply_message, NULL);
Lines 475-481 signal_filter (DBusConnection *connectio Link Here
475
{
615
{
476
  GMainLoop *loop = user_data;
616
  GMainLoop *loop = user_data;
477
617
618
#ifndef DBUS_USE_NEW_API
478
  if (dbus_message_is_signal(message, DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL, "Disconnected")) {
619
  if (dbus_message_is_signal(message, DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL, "Disconnected")) {
620
#else /* DBUS_USE_NEW_API */
621
  if (dbus_message_is_signal(message, DBUS_INTERFACE_LOCAL, "Disconnected")) {
622
#endif /* DBUS_USE_NEW_API */
479
    g_main_loop_quit (loop);
623
    g_main_loop_quit (loop);
480
    return DBUS_HANDLER_RESULT_HANDLED;
624
    return DBUS_HANDLER_RESULT_HANDLED;
481
  }
625
  }
Lines 522-530 signal_filter (DBusConnection *connectio Link Here
522
      else
666
      else
523
	daemon_log(LOG_ERR,"SSK Sharename path:%s not found\n", path);
667
	daemon_log(LOG_ERR,"SSK Sharename path:%s not found\n", path);
524
	
668
	
669
#ifndef DBUS_USE_NEW_API
525
      dbus_free (path);
670
      dbus_free (path);
526
      dbus_free (key);
671
      dbus_free (key);
527
      dbus_free (value);
672
      dbus_free (value);
673
#endif /* ! DBUS_USE_NEW_API */
528
    } else {
674
    } else {
529
      daemon_log(LOG_ERR,"SetKey received, but error getting message: %s\n", error.message);
675
      daemon_log(LOG_ERR,"SetKey received, but error getting message: %s\n", error.message);
530
      dbus_error_free (&error);
676
      dbus_error_free (&error);
Lines 555-562 signal_filter (DBusConnection *connectio Link Here
555
      else
701
      else
556
	daemon_log(LOG_ERR,"SRK Sharename path:%s not found\n", path);
702
	daemon_log(LOG_ERR,"SRK Sharename path:%s not found\n", path);
557
703
704
#ifndef DBUS_USE_NEW_API
558
      dbus_free (path);
705
      dbus_free (path);
559
      dbus_free (key);
706
      dbus_free (key);
707
#endif /* ! DBUS_USE_NEW_API */
560
    } else {
708
    } else {
561
      daemon_log(LOG_ERR,"RemoveKey received, but error getting message: %s\n", error.message);
709
      daemon_log(LOG_ERR,"RemoveKey received, but error getting message: %s\n", error.message);
562
      dbus_error_free (&error);
710
      dbus_error_free (&error);
Lines 584-590 signal_filter (DBusConnection *connectio Link Here
584
	}
732
	}
585
      else
733
      else
586
	daemon_log(LOG_ERR,"SRS Sharename path:%s not found\n", path);
734
	daemon_log(LOG_ERR,"SRS Sharename path:%s not found\n", path);
735
#ifndef DBUS_USE_NEW_API
587
      dbus_free (path);
736
      dbus_free (path);
737
#endif /* ! DBUS_USE_NEW_API */
588
    } else {
738
    } else {
589
      daemon_log(LOG_ERR,"RemoveSection received, but error getting message: %s\n", error.message);
739
      daemon_log(LOG_ERR,"RemoveSection received, but error getting message: %s\n", error.message);
590
      dbus_error_free (&error);
740
      dbus_error_free (&error);
(-)src/smbshared.c (+8 lines)
Lines 19-24 Link Here
19
 * (C) Copyright 2005 Ethium, Inc.
19
 * (C) Copyright 2005 Ethium, Inc.
20
 */
20
 */
21
21
22
#ifdef HAVE_CONFIG_H
23
#include <config.h>
24
#endif
25
22
#include <signal.h>
26
#include <signal.h>
23
#include <errno.h>
27
#include <errno.h>
24
#include <string.h>
28
#include <string.h>
Lines 81-87 smbshared () Link Here
81
  dbus_connection_register_object_path(bus,SMBPARSER_DBUS_PATH,
85
  dbus_connection_register_object_path(bus,SMBPARSER_DBUS_PATH,
82
				       &smbparser_vtable,
86
				       &smbparser_vtable,
83
				       NULL);
87
				       NULL);
88
#ifndef DBUS_USE_NEW_API
84
  dbus_bus_acquire_service (bus, SMBPARSER_DBUS_SRV,
89
  dbus_bus_acquire_service (bus, SMBPARSER_DBUS_SRV,
90
#else /* DBUS_USE_NEW_API */
91
  dbus_bus_request_name (bus, SMBPARSER_DBUS_SRV,
92
#endif /* DBUS_USE_NEW_API */
85
			    0, &error);			
93
			    0, &error);			
86
  
94
  
87
  g_main_loop_run (loop);
95
  g_main_loop_run (loop);

Return to bug 93400