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); |