]> git.proxmox.com Git - proxmox-backup.git/blob - src/tools.rs
src/tools.rs - file_set_contents_full: only call fchmod when we pass permissions
[proxmox-backup.git] / src / tools.rs
1 //! Tools and utilities
2 //!
3 //! This is a collection of small and useful tools.
4 use failure::*;
5 use nix::unistd;
6 use nix::sys::stat;
7 use nix::{convert_ioctl_res, request_code_read, ioc};
8
9 use lazy_static::lazy_static;
10
11 use std::fs::{File, OpenOptions};
12 use std::io::Write;
13 use std::path::Path;
14 use std::io::Read;
15 use std::io::ErrorKind;
16 use std::time::Duration;
17 use std::any::Any;
18
19 use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
20
21 use std::collections::HashMap;
22
23 use serde_json::Value;
24
25 use proxmox::tools::vec;
26
27 pub mod async_mutex;
28 pub mod timer;
29 pub mod wrapped_reader_stream;
30 #[macro_use]
31 pub mod common_regex;
32 pub mod ticket;
33 pub mod borrow;
34 pub mod fs;
35 pub mod tty;
36 pub mod signalfd;
37 pub mod daemon;
38 pub mod procfs;
39 pub mod acl;
40 pub mod xattr;
41 pub mod futures;
42
43 mod process_locker;
44 pub use process_locker::*;
45
46 #[macro_use]
47 mod file_logger;
48 pub use file_logger::*;
49
50 mod broadcast_future;
51 pub use broadcast_future::*;
52
53 /// Macro to write error-handling blocks (like perl eval {})
54 ///
55 /// #### Example:
56 /// ```
57 /// # #[macro_use] extern crate proxmox_backup;
58 /// # use failure::*;
59 /// # let some_condition = false;
60 /// let result = try_block!({
61 /// if (some_condition) {
62 /// bail!("some error");
63 /// }
64 /// Ok(())
65 /// })
66 /// .map_err(|e| format_err!("my try block returned an error - {}", e));
67 /// ```
68
69 #[macro_export]
70 macro_rules! try_block {
71 { $($token:tt)* } => {{ (|| -> Result<_,_> { $($token)* })() }}
72 }
73
74
75 /// The `BufferedRead` trait provides a single function
76 /// `buffered_read`. It returns a reference to an internal buffer. The
77 /// purpose of this traid is to avoid unnecessary data copies.
78 pub trait BufferedRead {
79 /// This functions tries to fill the internal buffers, then
80 /// returns a reference to the available data. It returns an empty
81 /// buffer if `offset` points to the end of the file.
82 fn buffered_read(&mut self, offset: u64) -> Result<&[u8], Error>;
83 }
84
85 /// Directly map a type into a binary buffer. This is mostly useful
86 /// for reading structured data from a byte stream (file). You need to
87 /// make sure that the buffer location does not change, so please
88 /// avoid vec resize while you use such map.
89 ///
90 /// This function panics if the buffer is not large enough.
91 pub fn map_struct<T>(buffer: &[u8]) -> Result<&T, Error> {
92 if buffer.len() < ::std::mem::size_of::<T>() {
93 bail!("unable to map struct - buffer too small");
94 }
95 Ok(unsafe { & * (buffer.as_ptr() as *const T) })
96 }
97
98 /// Directly map a type into a mutable binary buffer. This is mostly
99 /// useful for writing structured data into a byte stream (file). You
100 /// need to make sure that the buffer location does not change, so
101 /// please avoid vec resize while you use such map.
102 ///
103 /// This function panics if the buffer is not large enough.
104 pub fn map_struct_mut<T>(buffer: &mut [u8]) -> Result<&mut T, Error> {
105 if buffer.len() < ::std::mem::size_of::<T>() {
106 bail!("unable to map struct - buffer too small");
107 }
108 Ok(unsafe { &mut * (buffer.as_ptr() as *mut T) })
109 }
110
111 pub fn file_read_firstline<P: AsRef<Path>>(path: P) -> Result<String, Error> {
112
113 let path = path.as_ref();
114
115 try_block!({
116 let file = std::fs::File::open(path)?;
117
118 use std::io::{BufRead, BufReader};
119
120 let mut reader = BufReader::new(file);
121
122 let mut line = String::new();
123
124 let _ = reader.read_line(&mut line)?;
125
126 Ok(line)
127 }).map_err(|err: Error| format_err!("unable to read {:?} - {}", path, err))
128 }
129
130 pub fn file_get_contents<P: AsRef<Path>>(path: P) -> Result<Vec<u8>, Error> {
131
132 let path = path.as_ref();
133
134 try_block!({
135 std::fs::read(path)
136 }).map_err(|err| format_err!("unable to read {:?} - {}", path, err))
137 }
138
139 pub fn file_get_json<P: AsRef<Path>>(path: P, default: Option<Value>) -> Result<Value, Error> {
140
141 let path = path.as_ref();
142
143 let raw = match std::fs::read(path) {
144 Ok(v) => v,
145 Err(err) => {
146 if err.kind() == std::io::ErrorKind::NotFound {
147 if let Some(v) = default {
148 return Ok(v);
149 }
150 }
151 bail!("unable to read json {:?} - {}", path, err);
152 }
153 };
154
155 try_block!({
156 let data = String::from_utf8(raw)?;
157 let json = serde_json::from_str(&data)?;
158 Ok(json)
159 }).map_err(|err: Error| format_err!("unable to parse json from {:?} - {}", path, err))
160 }
161
162 /// Atomically write a file
163 ///
164 /// We first create a temporary file, which is then renamed.
165 pub fn file_set_contents<P: AsRef<Path>>(
166 path: P,
167 data: &[u8],
168 perm: Option<stat::Mode>,
169 ) -> Result<(), Error> {
170 file_set_contents_full(path, data, perm, None, None)
171 }
172
173 /// Atomically write a file with owner and group
174 pub fn file_set_contents_full<P: AsRef<Path>>(
175 path: P,
176 data: &[u8],
177 perm: Option<stat::Mode>,
178 owner: Option<unistd::Uid>,
179 group: Option<unistd::Gid>,
180 ) -> Result<(), Error> {
181
182 let path = path.as_ref();
183
184 // Note: we use mkstemp heŕe, because this worka with different
185 // processes, threads, and even tokio tasks.
186 let mut template = path.to_owned();
187 template.set_extension("tmp_XXXXXX");
188 let (fd, tmp_path) = match unistd::mkstemp(&template) {
189 Ok((fd, path)) => (fd, path),
190 Err(err) => bail!("mkstemp {:?} failed: {}", template, err),
191 };
192
193 let tmp_path = tmp_path.as_path();
194
195 let mode : stat::Mode = perm.unwrap_or(stat::Mode::from(
196 stat::Mode::S_IRUSR | stat::Mode::S_IWUSR |
197 stat::Mode::S_IRGRP | stat::Mode::S_IROTH
198 ));
199
200 if perm != None {
201 if let Err(err) = stat::fchmod(fd, mode) {
202 let _ = unistd::unlink(tmp_path);
203 bail!("fchmod {:?} failed: {}", tmp_path, err);
204 }
205 }
206
207 if owner != None || group != None {
208 if let Err(err) = fchown(fd, owner, group) {
209 let _ = unistd::unlink(tmp_path);
210 bail!("fchown {:?} failed: {}", tmp_path, err);
211 }
212 }
213
214 let mut file = unsafe { File::from_raw_fd(fd) };
215
216 if let Err(err) = file.write_all(data) {
217 let _ = unistd::unlink(tmp_path);
218 bail!("write failed: {}", err);
219 }
220
221 if let Err(err) = std::fs::rename(tmp_path, path) {
222 let _ = unistd::unlink(tmp_path);
223 bail!("Atomic rename failed for file {:?} - {}", path, err);
224 }
225
226 Ok(())
227 }
228
229 /// Create a file lock using fntl. This function allows you to specify
230 /// a timeout if you want to avoid infinite blocking.
231 pub fn lock_file<F: AsRawFd>(
232 file: &mut F,
233 exclusive: bool,
234 timeout: Option<Duration>,
235 ) -> Result<(), Error> {
236 let lockarg =
237 if exclusive {
238 nix::fcntl::FlockArg::LockExclusive
239 } else {
240 nix::fcntl::FlockArg::LockShared
241 };
242
243 let timeout = match timeout {
244 None => {
245 nix::fcntl::flock(file.as_raw_fd(), lockarg)?;
246 return Ok(());
247 }
248 Some(t) => t,
249 };
250
251 // unblock the timeout signal temporarily
252 let _sigblock_guard = timer::unblock_timeout_signal();
253
254 // setup a timeout timer
255 let mut timer = timer::Timer::create(
256 timer::Clock::Realtime,
257 timer::TimerEvent::ThisThreadSignal(timer::SIGTIMEOUT))?;
258
259 timer.arm(timer::TimerSpec::new()
260 .value(Some(timeout))
261 .interval(Some(Duration::from_millis(10))))?;
262
263 nix::fcntl::flock(file.as_raw_fd(), lockarg)?;
264 Ok(())
265 }
266
267 /// Open or create a lock file (append mode). Then try to
268 /// aquire a lock using `lock_file()`.
269 pub fn open_file_locked<P: AsRef<Path>>(path: P, timeout: Duration)
270 -> Result<File, Error>
271 {
272 let path = path.as_ref();
273 let mut file =
274 match OpenOptions::new()
275 .create(true)
276 .append(true)
277 .open(path)
278 {
279 Ok(file) => file,
280 Err(err) => bail!("Unable to open lock {:?} - {}",
281 path, err),
282 };
283 match lock_file(&mut file, true, Some(timeout)) {
284 Ok(_) => Ok(file),
285 Err(err) => bail!("Unable to aquire lock {:?} - {}",
286 path, err),
287 }
288 }
289
290 /// Split a file into equal sized chunks. The last chunk may be
291 /// smaller. Note: We cannot implement an `Iterator`, because iterators
292 /// cannot return a borrowed buffer ref (we want zero-copy)
293 pub fn file_chunker<C, R>(
294 mut file: R,
295 chunk_size: usize,
296 mut chunk_cb: C
297 ) -> Result<(), Error>
298 where C: FnMut(usize, &[u8]) -> Result<bool, Error>,
299 R: Read,
300 {
301
302 const READ_BUFFER_SIZE: usize = 4*1024*1024; // 4M
303
304 if chunk_size > READ_BUFFER_SIZE { bail!("chunk size too large!"); }
305
306 let mut buf = vec::undefined(READ_BUFFER_SIZE);
307
308 let mut pos = 0;
309 let mut file_pos = 0;
310 loop {
311 let mut eof = false;
312 let mut tmp = &mut buf[..];
313 // try to read large portions, at least chunk_size
314 while pos < chunk_size {
315 match file.read(tmp) {
316 Ok(0) => { eof = true; break; },
317 Ok(n) => {
318 pos += n;
319 if pos > chunk_size { break; }
320 tmp = &mut tmp[n..];
321 }
322 Err(ref e) if e.kind() == ErrorKind::Interrupted => { /* try again */ }
323 Err(e) => bail!("read chunk failed - {}", e.to_string()),
324 }
325 }
326 let mut start = 0;
327 while start + chunk_size <= pos {
328 if !(chunk_cb)(file_pos, &buf[start..start+chunk_size])? { break; }
329 file_pos += chunk_size;
330 start += chunk_size;
331 }
332 if eof {
333 if start < pos {
334 (chunk_cb)(file_pos, &buf[start..pos])?;
335 //file_pos += pos - start;
336 }
337 break;
338 } else {
339 let rest = pos - start;
340 if rest > 0 {
341 let ptr = buf.as_mut_ptr();
342 unsafe { std::ptr::copy_nonoverlapping(ptr.add(start), ptr, rest); }
343 pos = rest;
344 } else {
345 pos = 0;
346 }
347 }
348 }
349
350 Ok(())
351 }
352
353 /// Returns the Unix uid/gid for the sepcified system user.
354 pub fn getpwnam_ugid(username: &str) -> Result<(libc::uid_t,libc::gid_t), Error> {
355 let info = unsafe { libc::getpwnam(std::ffi::CString::new(username).unwrap().as_ptr()) };
356 if info == std::ptr::null_mut() {
357 bail!("getwpnam '{}' failed", username);
358 }
359
360 let info = unsafe { *info };
361
362 Ok((info.pw_uid, info.pw_gid))
363 }
364
365 /// Creates directory at the provided path with specified ownership
366 ///
367 /// Simply returns if the directory already exists.
368 pub fn create_dir_chown<P: AsRef<Path>>(
369 path: P,
370 perm: Option<stat::Mode>,
371 owner: Option<unistd::Uid>,
372 group: Option<unistd::Gid>,
373 ) -> Result<(), nix::Error>
374 {
375 let mode : stat::Mode = perm.unwrap_or(stat::Mode::from_bits_truncate(0o770));
376
377 let path = path.as_ref();
378
379 match nix::unistd::mkdir(path, mode) {
380 Ok(()) => {},
381 Err(nix::Error::Sys(nix::errno::Errno::EEXIST)) => {
382 return Ok(());
383 },
384 err => return err,
385 }
386
387 unistd::chown(path, owner, group)?;
388
389 Ok(())
390 }
391
392 /// Change ownership of an open file handle
393 pub fn fchown(
394 fd: RawFd,
395 owner: Option<nix::unistd::Uid>,
396 group: Option<nix::unistd::Gid>
397 ) -> Result<(), Error> {
398
399 // According to the POSIX specification, -1 is used to indicate that owner and group
400 // are not to be changed. Since uid_t and gid_t are unsigned types, we have to wrap
401 // around to get -1 (copied fron nix crate).
402 let uid = owner.map(Into::into).unwrap_or((0 as libc::uid_t).wrapping_sub(1));
403 let gid = group.map(Into::into).unwrap_or((0 as libc::gid_t).wrapping_sub(1));
404
405 let res = unsafe { libc::fchown(fd, uid, gid) };
406 nix::errno::Errno::result(res)?;
407
408 Ok(())
409 }
410
411 // Returns the hosts node name (UTS node name)
412 pub fn nodename() -> &'static str {
413
414 lazy_static!{
415 static ref NODENAME: String = {
416
417 nix::sys::utsname::uname()
418 .nodename()
419 .split('.')
420 .next()
421 .unwrap()
422 .to_owned()
423 };
424 }
425
426 &NODENAME
427 }
428
429 pub fn json_object_to_query(data: Value) -> Result<String, Error> {
430
431 let mut query = url::form_urlencoded::Serializer::new(String::new());
432
433 let object = data.as_object().ok_or_else(|| {
434 format_err!("json_object_to_query: got wrong data type (expected object).")
435 })?;
436
437 for (key, value) in object {
438 match value {
439 Value::Bool(b) => { query.append_pair(key, &b.to_string()); }
440 Value::Number(n) => { query.append_pair(key, &n.to_string()); }
441 Value::String(s) => { query.append_pair(key, &s); }
442 Value::Array(arr) => {
443 for element in arr {
444 match element {
445 Value::Bool(b) => { query.append_pair(key, &b.to_string()); }
446 Value::Number(n) => { query.append_pair(key, &n.to_string()); }
447 Value::String(s) => { query.append_pair(key, &s); }
448 _ => bail!("json_object_to_query: unable to handle complex array data types."),
449 }
450 }
451 }
452 _ => bail!("json_object_to_query: unable to handle complex data types."),
453 }
454 }
455
456 Ok(query.finish())
457 }
458
459 pub fn required_string_param<'a>(param: &'a Value, name: &str) -> Result<&'a str, Error> {
460 match param[name].as_str() {
461 Some(s) => Ok(s),
462 None => bail!("missing parameter '{}'", name),
463 }
464 }
465
466 pub fn required_integer_param<'a>(param: &'a Value, name: &str) -> Result<i64, Error> {
467 match param[name].as_i64() {
468 Some(s) => Ok(s),
469 None => bail!("missing parameter '{}'", name),
470 }
471 }
472
473 pub fn required_array_param<'a>(param: &'a Value, name: &str) -> Result<Vec<Value>, Error> {
474 match param[name].as_array() {
475 Some(s) => Ok(s.to_vec()),
476 None => bail!("missing parameter '{}'", name),
477 }
478 }
479
480 pub fn complete_file_name(arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
481
482 let mut result = vec![];
483
484 use nix::fcntl::OFlag;
485 use nix::sys::stat::Mode;
486 use nix::fcntl::AtFlags;
487
488 let mut dirname = std::path::PathBuf::from(if arg.len() == 0 { "./" } else { arg });
489
490 let is_dir = match nix::sys::stat::fstatat(libc::AT_FDCWD, &dirname, AtFlags::empty()) {
491 Ok(stat) => (stat.st_mode & libc::S_IFMT) == libc::S_IFDIR,
492 Err(_) => false,
493 };
494
495 if !is_dir {
496 if let Some(parent) = dirname.parent() {
497 dirname = parent.to_owned();
498 }
499 }
500
501 let mut dir = match nix::dir::Dir::openat(libc::AT_FDCWD, &dirname, OFlag::O_DIRECTORY, Mode::empty()) {
502 Ok(d) => d,
503 Err(_) => return result,
504 };
505
506 for item in dir.iter() {
507 if let Ok(entry) = item {
508 if let Ok(name) = entry.file_name().to_str() {
509 if name == "." || name == ".." { continue; }
510 let mut newpath = dirname.clone();
511 newpath.push(name);
512
513 if let Ok(stat) = nix::sys::stat::fstatat(libc::AT_FDCWD, &newpath, AtFlags::empty()) {
514 if (stat.st_mode & libc::S_IFMT) == libc::S_IFDIR {
515 newpath.push("");
516 if let Some(newpath) = newpath.to_str() {
517 result.push(newpath.to_owned());
518 }
519 continue;
520 }
521 }
522 if let Some(newpath) = newpath.to_str() {
523 result.push(newpath.to_owned());
524 }
525
526 }
527 }
528 }
529
530 result
531 }
532
533 /// Scan directory for matching file names.
534 ///
535 /// Scan through all directory entries and call `callback()` function
536 /// if the entry name matches the regular expression. This function
537 /// used unix `openat()`, so you can pass absolute or relative file
538 /// names. This function simply skips non-UTF8 encoded names.
539 pub fn scandir<P, F>(
540 dirfd: RawFd,
541 path: &P,
542 regex: &regex::Regex,
543 mut callback: F
544 ) -> Result<(), Error>
545 where F: FnMut(RawFd, &str, nix::dir::Type) -> Result<(), Error>,
546 P: ?Sized + nix::NixPath,
547 {
548 for entry in self::fs::scan_subdir(dirfd, path, regex)? {
549 let entry = entry?;
550 let file_type = match entry.file_type() {
551 Some(file_type) => file_type,
552 None => bail!("unable to detect file type"),
553 };
554
555 callback(entry.parent_fd(), unsafe { entry.file_name_utf8_unchecked() }, file_type)?;
556 }
557 Ok(())
558 }
559
560 pub fn get_hardware_address() -> Result<String, Error> {
561
562 static FILENAME: &str = "/etc/ssh/ssh_host_rsa_key.pub";
563
564 let contents = file_get_contents(FILENAME)?;
565 let digest = md5::compute(contents);
566
567 Ok(format!("{:0x}", digest))
568 }
569
570
571 pub fn assert_if_modified(digest1: &str, digest2: &str) -> Result<(), Error> {
572 if digest1 != digest2 {
573 bail!("detected modified configuration - file changed by other user? Try again.");
574 }
575 Ok(())
576 }
577
578 /// Extract authentication cookie from cookie header.
579 /// We assume cookie_name is already url encoded.
580 pub fn extract_auth_cookie(cookie: &str, cookie_name: &str) -> Option<String> {
581
582 for pair in cookie.split(';') {
583
584 let (name, value) = match pair.find('=') {
585 Some(i) => (pair[..i].trim(), pair[(i + 1)..].trim()),
586 None => return None, // Cookie format error
587 };
588
589 if name == cookie_name {
590 use url::percent_encoding::percent_decode;
591 if let Ok(value) = percent_decode(value.as_bytes()).decode_utf8() {
592 return Some(value.into());
593 } else {
594 return None; // Cookie format error
595 }
596 }
597 }
598
599 None
600 }
601
602 pub fn join(data: &Vec<String>, sep: char) -> String {
603
604 let mut list = String::new();
605
606 for item in data {
607 if list.len() != 0 { list.push(sep); }
608 list.push_str(item);
609 }
610
611 list
612 }
613
614 /// normalize uri path
615 ///
616 /// Do not allow ".", "..", or hidden files ".XXXX"
617 /// Also remove empty path components
618 pub fn normalize_uri_path(path: &str) -> Result<(String, Vec<&str>), Error> {
619
620 let items = path.split('/');
621
622 let mut path = String::new();
623 let mut components = vec![];
624
625 for name in items {
626 if name.is_empty() { continue; }
627 if name.starts_with(".") {
628 bail!("Path contains illegal components.");
629 }
630 path.push('/');
631 path.push_str(name);
632 components.push(name);
633 }
634
635 Ok((path, components))
636 }
637
638 pub fn fd_change_cloexec(fd: RawFd, on: bool) -> Result<(), Error> {
639 use nix::fcntl::{fcntl, F_GETFD, F_SETFD, FdFlag};
640 let mut flags = FdFlag::from_bits(fcntl(fd, F_GETFD)?)
641 .ok_or_else(|| format_err!("unhandled file flags"))?; // nix crate is stupid this way...
642 flags.set(FdFlag::FD_CLOEXEC, on);
643 fcntl(fd, F_SETFD(flags))?;
644 Ok(())
645 }
646
647
648 static mut SHUTDOWN_REQUESTED: bool = false;
649
650 pub fn request_shutdown() {
651 unsafe { SHUTDOWN_REQUESTED = true; }
652 crate::server::server_shutdown();
653 }
654
655 #[inline(always)]
656 pub fn shutdown_requested() -> bool {
657 unsafe { SHUTDOWN_REQUESTED }
658 }
659
660 pub fn fail_on_shutdown() -> Result<(), Error> {
661 if shutdown_requested() {
662 bail!("Server shutdown requested - aborting task");
663 }
664 Ok(())
665 }
666
667 /// Guard a raw file descriptor with a drop handler. This is mostly useful when access to an owned
668 /// `RawFd` is required without the corresponding handler object (such as when only the file
669 /// descriptor number is required in a closure which may be dropped instead of being executed).
670 pub struct Fd(pub RawFd);
671
672 impl Drop for Fd {
673 fn drop(&mut self) {
674 if self.0 != -1 {
675 unsafe {
676 libc::close(self.0);
677 }
678 }
679 }
680 }
681
682 impl AsRawFd for Fd {
683 fn as_raw_fd(&self) -> RawFd {
684 self.0
685 }
686 }
687
688 impl IntoRawFd for Fd {
689 fn into_raw_fd(mut self) -> RawFd {
690 let fd = self.0;
691 self.0 = -1;
692 fd
693 }
694 }
695
696 impl FromRawFd for Fd {
697 unsafe fn from_raw_fd(fd: RawFd) -> Self {
698 Self(fd)
699 }
700 }
701
702 // wrap nix::unistd::pipe2 + O_CLOEXEC into something returning guarded file descriptors
703 pub fn pipe() -> Result<(Fd, Fd), Error> {
704 let (pin, pout) = nix::unistd::pipe2(nix::fcntl::OFlag::O_CLOEXEC)?;
705 Ok((Fd(pin), Fd(pout)))
706 }
707
708 /// An easy way to convert types to Any
709 ///
710 /// Mostly useful to downcast trait objects (see RpcEnvironment).
711 pub trait AsAny {
712 fn as_any(&self) -> &dyn Any;
713 }
714
715 impl<T: Any> AsAny for T {
716 fn as_any(&self) -> &dyn Any { self }
717 }
718
719
720 // /usr/include/linux/fs.h: #define BLKGETSIZE64 _IOR(0x12,114,size_t)
721 // return device size in bytes (u64 *arg)
722 nix::ioctl_read!(blkgetsize64, 0x12, 114, u64);
723
724 /// Return file or block device size
725 pub fn image_size(path: &Path) -> Result<u64, Error> {
726
727 use std::os::unix::fs::FileTypeExt;
728
729 let file = std::fs::File::open(path)?;
730 let metadata = file.metadata()?;
731 let file_type = metadata.file_type();
732
733 if file_type.is_block_device() {
734 let mut size : u64 = 0;
735 let res = unsafe { blkgetsize64(file.as_raw_fd(), &mut size) };
736
737 if let Err(err) = res {
738 bail!("blkgetsize64 failed for {:?} - {}", path, err);
739 }
740 Ok(size)
741 } else if file_type.is_file() {
742 Ok(metadata.len())
743 } else {
744 bail!("image size failed - got unexpected file type {:?}", file_type);
745 }
746 }