1 |
douglas |
402 |
// Spectre 2 |
2 |
|
|
// |
3 |
|
|
// Douglas Thrift |
4 |
|
|
// |
5 |
|
|
// $Id$ |
6 |
|
|
|
7 |
|
|
#include "Mounter.hpp" |
8 |
|
|
|
9 |
douglas |
408 |
#include <menes-api/environment.hpp> |
10 |
|
|
|
11 |
douglas |
418 |
Mounter::Mounter(const api::Path& config) : Daemon(), config(config) {} |
12 |
douglas |
402 |
|
13 |
douglas |
408 |
Mounter::~Mounter() |
14 |
|
|
{ |
15 |
|
|
#ifdef __FreeBSD__ |
16 |
|
|
api::Posix::CheckError(::unlink(secret.NullTerminate())); |
17 |
|
|
#endif |
18 |
|
|
} |
19 |
|
|
|
20 |
|
|
#ifdef __FreeBSD__ |
21 |
|
|
ext::String Mounter::secret(api::TheEnvironment.Get("HOME") + "/.nsmbrc"); |
22 |
|
|
#endif |
23 |
|
|
|
24 |
douglas |
402 |
void Mounter::load() |
25 |
|
|
{ |
26 |
douglas |
415 |
if (Spectre2::debug) api::Cerr << "Mounter::load()" << ios::NewLine; |
27 |
douglas |
408 |
|
28 |
|
|
#ifdef __FreeBSD__ |
29 |
|
|
{ |
30 |
|
|
SecretFileWriter file(secret); |
31 |
|
|
|
32 |
|
|
// |
33 |
|
|
} |
34 |
|
|
#endif |
35 |
douglas |
402 |
|
36 |
|
|
loaded = true; |
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
void Mounter::run() |
40 |
|
|
{ |
41 |
douglas |
415 |
if (Spectre2::debug) api::Cerr << "Mounter::run()" << ios::NewLine; |
42 |
douglas |
402 |
|
43 |
douglas |
407 |
::sleep(5); |
44 |
douglas |
402 |
} |