Project

General

Profile

Download (18.8 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
 * xmlrpc.php
4
 *
5
 * part of pfSense (https://www.pfsense.org)
6
 * Copyright (c) 2004-2013 BSD Perimeter
7
 * Copyright (c) 2013-2016 Electric Sheep Fencing
8
 * Copyright (c) 2014-2019 Rubicon Communications, LLC (Netgate)
9
 * Copyright (c) 2005 Colin Smith
10
 * All rights reserved.
11
 *
12
 * Licensed under the Apache License, Version 2.0 (the "License");
13
 * you may not use this file except in compliance with the License.
14
 * You may obtain a copy of the License at
15
 *
16
 * http://www.apache.org/licenses/LICENSE-2.0
17
 *
18
 * Unless required by applicable law or agreed to in writing, software
19
 * distributed under the License is distributed on an "AS IS" BASIS,
20
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
 * See the License for the specific language governing permissions and
22
 * limitations under the License.
23
 */
24

    
25
##|+PRIV
26
##|*IDENT=page-xmlrpclibrary
27
##|*NAME=XMLRPC Library
28
##|*DESCR=Allow access to the 'XMLRPC Library' page.
29
##|*MATCH=xmlrpc.php*
30
##|-PRIV
31

    
32
require_once("config.inc");
33
require_once("functions.inc");
34
require_once("auth.inc");
35
require_once("filter.inc");
36
require_once("ipsec.inc");
37
require_once("vpn.inc");
38
require_once("captiveportal.inc");
39
require_once("shaper.inc");
40
require_once("XML/RPC2/Server.php");
41

    
42
class pfsense_xmlrpc_server {
43

    
44
	private $loop_detected = false;
45
	private $remote_addr;
46

    
47
	private function auth() {
48
		global $config;
49
		$username = $_SERVER['PHP_AUTH_USER'];
50
		$password = $_SERVER['PHP_AUTH_PW'];
51

    
52
		$login_ok = false;
53
		if (!empty($username) && !empty($password)) {
54
			$attributes = array();
55
			$authcfg = auth_get_authserver(
56
			    $config['system']['webgui']['authmode']);
57

    
58
			if (authenticate_user($username, $password,
59
			    $authcfg, $attributes) ||
60
			    authenticate_user($username, $password)) {
61
				$login_ok = true;
62
			}
63
		}
64

    
65
		if (!$login_ok) {
66
			log_auth("webConfigurator authentication error for '" .
67
			    $username . "' from " . $this->remote_addr);
68

    
69
			require_once("XML/RPC2/Exception.php");
70
			throw new XML_RPC2_FaultException(gettext(
71
			    'Authentication failed: Invalid username or password'),
72
			    -1);
73
		}
74

    
75
		$user_entry = getUserEntry($username);
76
		/*
77
		 * admin (uid = 0) is allowed
78
		 * or regular user with necessary privilege
79
		 */
80
		if (isset($user_entry['uid']) && $user_entry['uid'] != '0' &&
81
		    !userHasPrivilege($user_entry, 'system-xmlrpc-ha-sync')) {
82
			log_auth("webConfigurator authentication error for '" .
83
			    $username . "' from " . $this->remote_addr .
84
			    " not enough privileges");
85

    
86
			require_once("XML/RPC2/Exception.php");
87
			throw new XML_RPC2_FaultException(gettext(
88
			    'Authentication failed: not enough privileges'),
89
			    -2);
90
		}
91

    
92
		return;
93
	}
94

    
95
	private function array_overlay($a1, $a2) {
96
		foreach ($a1 as $k => $v) {
97
			if (!array_key_exists($k, $a2)) {
98
				continue;
99
			}
100
			if (is_array($v) && is_array($a2[$k])) {
101
				$a1[$k] = $this->array_overlay($v, $a2[$k]);
102
			} else {
103
				$a1[$k] = $a2[$k];
104
			}
105
		}
106

    
107
		return $a1;
108
	}
109

    
110
	public function __construct() {
111
		global $config;
112

    
113
		$this->remote_addr = $_SERVER['REMOTE_ADDR'];
114

    
115
		/* grab sync to ip if enabled */
116
		if (isset($config['hasync']['synchronizetoip']) &&
117
		    $config['hasync']['synchronizetoip'] == $this->remote_addr) {
118
			$this->loop_detected = true;
119
		}
120
	}
121

    
122
	/**
123
	 * Get host version information
124
	 *
125
	 * @return array
126
	 */
127
	public function host_firmware_version($dummy = 1) {
128
		$this->auth();
129
		return host_firmware_version();
130
	}
131

    
132
	/**
133
	 * Executes a PHP block of code
134
	 *
135
	 * @param string $code
136
	 *
137
	 * @return bool
138
	 */
139
	public function exec_php($code) {
140
		$this->auth();
141

    
142
		eval($code);
143
		if ($toreturn) {
144
			return $toreturn;
145
		}
146

    
147
		return true;
148
	}
149

    
150
	/**
151
	 * Executes shell commands
152
	 *
153
	 * @param string $code
154
	 *
155
	 * @return bool
156
	 */
157
	public function exec_shell($code) {
158
		$this->auth();
159

    
160
		mwexec($code);
161
		return true;
162
	}
163

    
164
	/**
165
	 * Backup chosen config sections
166
	 *
167
	 * @param array $section
168
	 *
169
	 * @return array
170
	 */
171
	public function backup_config_section($section) {
172
		$this->auth();
173

    
174
		global $config;
175

    
176
		return array_intersect_key($config, array_flip($section));
177
	}
178

    
179
	/**
180
	 * Restore defined config section into local config
181
	 *
182
	 * @param array $sections
183
	 *
184
	 * @return bool
185
	 */
186
	public function restore_config_section($sections) {
187
		$this->auth();
188

    
189
		global $config, $cpzone, $cpzoneid;
190

    
191
		$old_config = $config;
192
		$old_ipsec_enabled = ipsec_enabled();
193

    
194
		if ($this->loop_detected) {
195
			log_error("Disallowing CARP sync loop");
196
			return true;
197
		}
198

    
199
		/*
200
		 * Some sections should just be copied and not merged or we end
201
		 * up unable to sync the deletion of the last item in a section
202
		 */
203
		$sync_full_sections = array(
204
			'aliases',
205
			'ca',
206
			'cert',
207
			'crl',
208
			'dhcpd',
209
			'dhcpv6',
210
			'dnsmasq',
211
			'filter',
212
			'ipsec',
213
			'nat',
214
			'openvpn',
215
			'schedules',
216
			'unbound',
217
			'wol',
218
		);
219

    
220
		$syncd_full_sections = array();
221

    
222
		foreach ($sync_full_sections as $section) {
223
			if (!isset($sections[$section])) {
224
				continue;
225
			}
226

    
227
			$config[$section] = $sections[$section];
228
			unset($sections[$section]);
229
			$syncd_full_sections[] = $section;
230
		}
231

    
232
		/* Create a list of CP zones to be deleted locally */
233
		$cp_to_del = array();
234
		if (is_array($config['captiveportal'])) {
235
			if (is_array($sections['captiveportal'])) {
236
				$remote_cp = $sections['captiveportal'];
237
			} else {
238
				$remote_cp = array();
239
			}
240
			foreach ($config['captiveportal'] as $zone => $item) {
241
				if (!isset($remote_cp[$zone])) {
242
					$cp_to_del[] = $zone;
243
				}
244
			}
245
			unset($remote_cp);
246
		}
247

    
248
		/* Only touch users if users are set to synchronize from the primary node
249
		 * See https://redmine.pfsense.org/issues/8450
250
		 */
251
		if ($sections['system']['user'] && $sections['system']['group']) {
252
			$g2add = array();
253
			$g2del = array();
254
			$g2del_idx = array();
255
			$g2keep = array();
256
			if (is_array($sections['system']['group'])) {
257
				$local_groups = isset($config['system']['group'])
258
				    ? $config['system']['group']
259
				    : array();
260

    
261
				foreach ($sections['system']['group'] as $group) {
262
					$idx = array_search($group['name'],
263
					    array_column($local_groups, 'name'));
264

    
265
					if ($idx === false) {
266
						$g2add[] = $group;
267
					} else if ($group['gid'] < 1999) {
268
						$g2keep[] = $idx;
269
					} else if ($group != $local_groups[$idx]) {
270
						$g2add[] = $group;
271
						$g2del[] = $group;
272
						$g2del_idx[] = $idx;
273
					} else {
274
						$g2keep[] = $idx;
275
					}
276
				}
277
			}
278
			if (is_array($config['system']['group'])) {
279
				foreach ($config['system']['group'] as $idx => $group) {
280
					if (array_search($idx, $g2keep) === false &&
281
					    array_search($idx, $g2del_idx) === false) {
282
						$g2del[] = $group;
283
						$g2del_idx[] = $idx;
284
					}
285
				}
286
			}
287
			unset($sections['system']['group'], $g2keep, $g2del_idx);
288

    
289
			$u2add = array();
290
			$u2del = array();
291
			$u2del_idx = array();
292
			$u2keep = array();
293
			if (is_array($sections['system']['user'])) {
294
				$local_users = isset($config['system']['user'])
295
				    ? $config['system']['user']
296
				    : array();
297

    
298
				foreach ($sections['system']['user'] as $user) {
299
					$idx = array_search($user['name'],
300
					    array_column($local_users, 'name'));
301

    
302
					if ($idx === false) {
303
						$u2add[] = $user;
304
					} else if ($user['uid'] < 2000) {
305
						$u2keep[] = $idx;
306
					} else if ($user != $local_users[$idx]) {
307
						$u2add[] = $user;
308
						$u2del[] = $user;
309
						$u2del_idx[] = $idx;
310
					} else {
311
						$u2keep[] = $idx;
312
					}
313
				}
314
			}
315
			if (is_array($config['system']['user'])) {
316
				foreach ($config['system']['user'] as $idx => $user) {
317
					if (array_search($idx, $u2keep) === false &&
318
					    array_search($idx, $u2del_idx) === false) {
319
						$u2del[] = $user;
320
						$u2del_idx[] = $idx;
321
					}
322
				}
323
			}
324
			unset($sections['system']['user'], $u2keep, $u2del_idx);
325
		}
326

    
327
		$voucher = array();
328
		if (is_array($sections['voucher'])) {
329
			/* Save voucher rolls to process after merge */
330
			$voucher = $sections['voucher'];
331

    
332
			foreach($sections['voucher'] as $zone => $item) {
333
				unset($sections['voucher'][$zone]['roll']);
334
				if (isset($config['voucher'][$zone]['vouchersyncdbip'])) {
335
					$sections['voucher'][$zone]['vouchersyncdbip'] =
336
					    $config['voucher'][$zone]['vouchersyncdbip'];
337
				} else {
338
					unset($sections['voucher'][$zone]['vouchersyncdbip']);
339
				}
340
				if (isset($config['voucher'][$zone]['vouchersyncport'])) {
341
					$sections['voucher'][$zone]['vouchersyncport'] =
342
					    $config['voucher'][$zone]['vouchersyncport'];
343
				} else {
344
					unset($sections['voucher'][$zone]['vouchersyncport']);
345
				}
346
				if (isset($config['voucher'][$zone]['vouchersyncusername'])) {
347
					$sections['voucher'][$zone]['vouchersyncusername'] =
348
					    $config['voucher'][$zone]['vouchersyncusername'];
349
				} else {
350
					unset($sections['voucher'][$zone]['vouchersyncusername']);
351
				}
352
				if (isset($config['voucher'][$zone]['vouchersyncpass'])) {
353
					$sections['voucher'][$zone]['vouchersyncpass'] =
354
					    $config['voucher'][$zone]['vouchersyncpass'];
355
				} else {
356
					unset($sections['voucher'][$zone]['vouchersyncpass']);
357
				}
358
			}
359
		}
360

    
361
		$vipbackup = array();
362
		$oldvips = array();
363
		if (isset($sections['virtualip']) &&
364
		    is_array($config['virtualip']['vip'])) {
365
			foreach ($config['virtualip']['vip'] as $vip) {
366
				if ($vip['mode'] == "carp") {
367
					$key = $vip['interface'] .
368
					    "_vip" . $vip['vhid'];
369

    
370
					$oldvips[$key]['content'] =
371
					    $vip['password'] .
372
					    $vip['advskew'] .
373
					    $vip['subnet'] .
374
					    $vip['subnet_bits'] .
375
					    $vip['advbase'];
376
					$oldvips[$key]['interface'] =
377
					    $vip['interface'];
378
					$oldvips[$key]['subnet'] =
379
					    $vip['subnet'];
380
				} else if ($vip['mode'] == "ipalias" &&
381
				    (substr($vip['interface'], 0, 4) == '_vip'
382
				    || strstr($vip['interface'], "lo0"))) {
383
					$oldvips[$vip['subnet']]['content'] =
384
					    $vip['interface'] .
385
					    $vip['subnet'] .
386
					    $vip['subnet_bits'];
387
					$oldvips[$vip['subnet']]['interface'] =
388
					    $vip['interface'];
389
					$oldvips[$vip['subnet']]['subnet'] =
390
					    $vip['subnet'];
391
				} else if (($vip['mode'] == "ipalias" ||
392
				    $vip['mode'] == 'proxyarp') &&
393
				    !(substr($vip['interface'], 0, 4) == '_vip')
394
				    || strstr($vip['interface'], "lo0")) {
395
					$vipbackup[] = $vip;
396
				}
397
			}
398
		}
399

    
400
		/* For vip section, first keep items sent from the master */
401
		$config = array_merge_recursive_unique($config, $sections);
402

    
403
		/* Remove local CP zones removed remote */
404
		foreach ($cp_to_del as $zone) {
405
			$cpzone = $zone;
406
			$cpzoneid = $config['captiveportal'][$cpzone]['zoneid'];
407
			unset($config['captiveportal'][$cpzone]['enable']);
408
			captiveportal_configure_zone(
409
			    $config['captiveportal'][$cpzone]);
410
			unset($config['captiveportal'][$cpzone]);
411
			if (isset($config['voucher'][$cpzone])) {
412
				unset($config['voucher'][$cpzone]);
413
			}
414
		}
415

    
416
		/* Remove locally items removed remote */
417
		foreach ($voucher as $zone => $item) {
418
			/* No rolls on master, delete local ones */
419
			if (!is_array($item['roll'])) {
420
				unset($config['voucher'][$zone]['roll']);
421
			}
422
		}
423

    
424
		$l_rolls = array();
425
		if (is_array($config['voucher'])) {
426
			foreach ($config['voucher'] as $zone => $item) {
427
				if (!is_array($item['roll'])) {
428
					continue;
429
				}
430
				foreach ($item['roll'] as $idx => $roll) {
431
					/* Make it easy to find roll by # */
432
					$l_rolls[$zone][$roll['number']] = $idx;
433
				}
434
			}
435
		}
436

    
437
		/*
438
		 * Process vouchers sent by primary node and:
439
		 * - Add new items
440
		 * - Update existing items based on 'lastsync' field
441
		 */
442
		foreach ($voucher as $zone => $item) {
443
			if (!is_array($item['roll'])) {
444
				continue;
445
			}
446
			foreach ($item['roll'] as $idx => $roll) {
447
				if (!isset($l_rolls[$zone][$roll['number']])) {
448
					$config['voucher'][$zone]['roll'][] =
449
					    $roll;
450
					continue;
451
				}
452
				$l_roll_idx = $l_rolls[$zone][$roll['number']];
453
				init_config_arr(array('voucher', $zone));
454
				$l_vouchers = &$config['voucher'][$zone];
455
				$l_roll = $l_vouchers['roll'][$l_roll_idx];
456
				if (!isset($l_roll['lastsync'])) {
457
					$l_roll['lastsync'] = 0;
458
				}
459

    
460
				if (isset($roll['lastsync']) &&
461
				    $roll['lastsync'] != $l_roll['lastsync']) {
462
					$l_vouchers['roll'][$l_roll_idx] =
463
					    $roll;
464
					unset($l_rolls[$zone][$roll['number']]);
465
				}
466
			}
467
		}
468

    
469
		/*
470
		 * At this point $l_rolls contains only items that are not
471
		 * present on primary node. They must be removed
472
		 */
473
		foreach ($l_rolls as $zone => $item) {
474
			foreach ($item as $number => $idx) {
475
				unset($config['voucher'][$zone][$idx]);
476
			}
477
		}
478

    
479
		/*
480
		 * Then add ipalias and proxyarp types already defined
481
		 * on the backup
482
		 */
483
		if (is_array($vipbackup) && !empty($vipbackup)) {
484
			if (!is_array($config['virtualip'])) {
485
				$config['virtualip'] = array();
486
			}
487
			if (!is_array($config['virtualip']['vip'])) {
488
				$config['virtualip']['vip'] = array();
489
			}
490
			foreach ($vipbackup as $vip) {
491
				array_unshift($config['virtualip']['vip'], $vip);
492
			}
493
		}
494

    
495
		/* Log what happened */
496
		$mergedkeys = implode(", ", array_merge(array_keys($sections),
497
		    $syncd_full_sections));
498
		write_config(sprintf(gettext(
499
		    "Merged in config (%s sections) from XMLRPC client."),
500
		    $mergedkeys));
501

    
502
		/*
503
		 * The real work on handling the vips specially
504
		 * This is a copy of intefaces_vips_configure with addition of
505
		 * not reloading existing/not changed carps
506
		 */
507
		if (isset($sections['virtualip']) &&
508
		    is_array($config['virtualip']) &&
509
		    is_array($config['virtualip']['vip'])) {
510
			$carp_setuped = false;
511
			$anyproxyarp = false;
512

    
513
			foreach ($config['virtualip']['vip'] as $vip) {
514
				$key = "{$vip['interface']}_vip{$vip['vhid']}";
515

    
516
				if ($vip['mode'] == "carp" &&
517
				    isset($oldvips[$key])) {
518
					if ($oldvips[$key]['content'] ==
519
					    $vip['password'] .
520
					    $vip['advskew'] .
521
					    $vip['subnet'] .
522
					    $vip['subnet_bits'] .
523
					    $vip['advbase'] &&
524
					    does_vip_exist($vip)) {
525
						unset($oldvips[$key]);
526
						/*
527
						 * Skip reconfiguring this vips
528
						 * since nothing has changed.
529
						 */
530
						continue;
531
					}
532

    
533
				} elseif ($vip['mode'] == "ipalias" &&
534
				    (substr($vip['interface'], 0, 4) == '_vip'
535
				    || strstr($vip['interface'], "lo0")) &&
536
				    isset($oldvips[$vip['subnet']])) {
537
					$key = $vip['subnet'];
538
					if ($oldvips[$key]['content'] ==
539
					    $vip['interface'] .
540
					    $vip['subnet'] .
541
					    $vip['subnet_bits'] &&
542
					    does_vip_exist($vip)) {
543
						unset($oldvips[$key]);
544
						/*
545
						 * Skip reconfiguring this vips
546
						 * since nothing has changed.
547
						 */
548
						continue;
549
					}
550
					unset($oldvips[$key]);
551
				}
552

    
553
				switch ($vip['mode']) {
554
				case "proxyarp":
555
					$anyproxyarp = true;
556
					break;
557
				case "ipalias":
558
					interface_ipalias_configure($vip);
559
					break;
560
				case "carp":
561
					$carp_setuped = true;
562
					interface_carp_configure($vip);
563
					break;
564
				}
565
			}
566

    
567
			/* Cleanup remaining old carps */
568
			foreach ($oldvips as $oldvipar) {
569
				$oldvipif = get_real_interface(
570
				    $oldvipar['interface']);
571

    
572
				if (empty($oldvipif)) {
573
					continue;
574
				}
575

    
576
				if (is_ipaddrv6($oldvipar['subnet'])) {
577
					 mwexec("/sbin/ifconfig " .
578
					     escapeshellarg($oldvipif) .
579
					     " inet6 " .
580
					     escapeshellarg($oldvipar['subnet']) .
581
					     " delete");
582
				} else {
583
					pfSense_interface_deladdress($oldvipif,
584
					    $oldvipar['subnet']);
585
				}
586
			}
587
			if ($carp_setuped == true) {
588
				interfaces_sync_setup();
589
			}
590
			if ($anyproxyarp == true) {
591
				interface_proxyarp_configure();
592
			}
593
		}
594

    
595
		if ($old_ipsec_enabled !== ipsec_enabled()) {
596
			vpn_ipsec_configure();
597
		}
598

    
599
		unset($old_config);
600

    
601
		local_sync_accounts($u2add, $u2del, $g2add, $g2del);
602
		$this->filter_configure(false);
603

    
604
		return true;
605
	}
606

    
607
	/**
608
	 * Merge items into installedpackages config section
609
	 *
610
	 * @param array $section
611
	 *
612
	 * @return bool
613
	 */
614
	public function merge_installedpackages_section($section) {
615
		$this->auth();
616

    
617
		global $config;
618

    
619
		if ($this->loop_detected) {
620
			log_error("Disallowing CARP sync loop");
621
			return true;
622
		}
623

    
624
		$config['installedpackages'] = array_merge(
625
		    $config['installedpackages'], $section);
626
		$mergedkeys = implode(", ", array_keys($section));
627
		write_config(sprintf(gettext(
628
		    "Merged in config (%s sections) from XMLRPC client."),
629
		    $mergedkeys));
630

    
631
		return true;
632
	}
633

    
634
	/**
635
	 * Merge items into config
636
	 *
637
	 * @param array $section
638
	 *
639
	 * @return bool
640
	 */
641
	public function merge_config_section($section) {
642
		$this->auth();
643

    
644
		global $config;
645

    
646
		if ($this->loop_detected) {
647
			log_error("Disallowing CARP sync loop");
648
			return true;
649
		}
650

    
651
		$config_new = $this->array_overlay($config, $section);
652
		$config = $config_new;
653
		$mergedkeys = implode(", ", array_keys($section));
654
		write_config(sprintf(gettext(
655
		    "Merged in config (%s sections) from XMLRPC client."),
656
		    $mergedkeys));
657

    
658
		return true;
659
	}
660

    
661
	/**
662
	 * Wrapper for filter_configure()
663
	 *
664
	 * @return bool
665
	 */
666
	public function filter_configure($reset_accounts = true) {
667
		$this->auth();
668

    
669
		global $g, $config;
670

    
671
		filter_configure();
672
		system_routing_configure();
673
		setup_gateways_monitor();
674
		require_once("openvpn.inc");
675
		openvpn_resync_all();
676

    
677
		/*
678
		 * The DNS Resolver and the DNS Forwarder may both be active so
679
		 * long as * they are running on different ports.
680
		 * See ticket #5882
681
		 */
682
		if (isset($config['dnsmasq']['enable'])) {
683
			/* Configure dnsmasq but tell it NOT to restart DHCP */
684
			services_dnsmasq_configure(false);
685
		} else {
686
			/* kill any running dnsmasq instance */
687
			if (isvalidpid("{$g['varrun_path']}/dnsmasq.pid")) {
688
				sigkillbypid("{$g['varrun_path']}/dnsmasq.pid",
689
				    "TERM");
690
			}
691
		}
692
		if (isset($config['unbound']['enable'])) {
693
			/* Configure unbound but tell it NOT to restart DHCP */
694
			services_unbound_configure(false);
695
		} else {
696
			/* kill any running Unbound instance */
697
			if (isvalidpid("{$g['varrun_path']}/unbound.pid")) {
698
				sigkillbypid("{$g['varrun_path']}/unbound.pid",
699
				    "TERM");
700
			}
701
		}
702

    
703
		/*
704
		 * Call this separately since the above are manually set to
705
		 * skip the DHCP restart they normally perform.
706
		 * This avoids restarting dhcpd twice as described on
707
		 * ticket #3797
708
		 */
709
		services_dhcpd_configure();
710

    
711
		if ($reset_accounts) {
712
			local_reset_accounts();
713
		}
714

    
715
		captiveportal_configure();
716

    
717
		return true;
718
	}
719

    
720
	/**
721
	 * Wrapper for configuring CARP interfaces
722
	 *
723
	 * @return bool
724
	 */
725
	public function interfaces_carp_configure() {
726
		$this->auth();
727

    
728
		if ($this->loop_detected) {
729
			log_error("Disallowing CARP sync loop");
730
			return true;
731
		}
732

    
733
		interfaces_vips_configure();
734

    
735
		return true;
736
	}
737

    
738
	/**
739
	 * Wrapper for rc.reboot
740
	 *
741
	 * @return bool
742
	 */
743
	public function reboot() {
744
		$this->auth();
745

    
746
		mwexec_bg("/etc/rc.reboot");
747

    
748
		return true;
749
	}
750
}
751

    
752
// run script untill its done and can 'unlock' the xmlrpc.lock, this prevents hanging php-fpm / webgui
753
ignore_user_abort(true);
754
set_time_limit(0);
755

    
756
$xmlrpclockkey = lock('xmlrpc', LOCK_EX);
757

    
758
XML_RPC2_Backend::setBackend('php');
759
$HTTP_RAW_POST_DATA = file_get_contents('php://input');
760

    
761
$options = array(
762
	'prefix' => 'pfsense.',
763
	'encoding' => 'utf-8',
764
	'autoDocument' => false,
765
);
766

    
767
$server = XML_RPC2_Server::create(new pfsense_xmlrpc_server(), $options);
768
$server->handleCall();
769

    
770
unlock($xmlrpclockkey);
771

    
772
?>
(225-225/225)