33 |
|
} |
34 |
|
|
35 |
|
ext::RedBlackSet<Share> Daemon::shares; |
36 |
– |
//api::ThreadMutex Daemon::smbcLock; |
36 |
|
#ifdef __FreeBSD__ |
37 |
|
ext::String Daemon::secret(api::TheEnvironment.Get("HOME") + "/.nsmbrc"); |
38 |
|
api::ThreadMutex Daemon::secretLock; |
58 |
|
|
59 |
|
void Daemon::load() |
60 |
|
{ |
61 |
+ |
#ifndef __FreeBSD__ |
62 |
+ |
_foreach (const ext::RedBlackMap<ext::String>, secret, secrets) |
63 |
+ |
api::Posix::CheckError(::unlink(secret.NullTerminate())); |
64 |
+ |
|
65 |
+ |
secrets.Clear(); |
66 |
+ |
#endif |
67 |
|
shares.Clear(); |
68 |
|
Share::passwords.Clear(); |
69 |
|
|
133 |
|
_foreach (const ext::RedBlackSet<Share>, share, shares) |
134 |
|
workers.Add(etl::BindAll(&Daemon::work_<Worker>, this, *share)); |
135 |
|
|
131 |
– |
// XXX: not useful for solving the problem it was supposed to solve |
132 |
– |
/*_synchronized (smbcLock) if (++count % 8 == 0) try |
133 |
– |
{ |
134 |
– |
::SMBCCTX* context(::smbc_new_context()); |
135 |
– |
|
136 |
– |
context->debug = Spectre2::debug ? 2 : 0; |
137 |
– |
context->callbacks.auth_fn = authenticate; |
138 |
– |
|
139 |
– |
CheckError(::smbc_init_context(context)); |
140 |
– |
|
141 |
– |
::SMBCCTX* old(::smbc_set_context(context)); |
142 |
– |
|
143 |
– |
CheckError(::smbc_free_context(old, 0)); |
144 |
– |
} |
145 |
– |
catch (const Error&) { --count; }*/ |
146 |
– |
|
136 |
|
if (running && loaded) |
137 |
|
sleep(); |
138 |
|
|