77 |
|
{ |
78 |
|
struct stat share; |
79 |
|
|
80 |
< |
// XXX: _unsynchronized |
81 |
< |
// _synchronized (Daemon::smbcLock) |
82 |
< |
CheckError(::smbc_stat(getUri().NullTerminate(), &share)); |
80 |
> |
CheckError(::smbc_stat(getUri().NullTerminate(), &share)); |
81 |
|
|
82 |
|
return true; |
83 |
|
} |
92 |
|
void authenticate(const char* host, const char* name, char* work, int workSize, char* owner, int ownerSize, char* password, int passwordSize) |
93 |
|
{ |
94 |
|
const Share& share(*Daemon::shares.Find(Share(host, name))); |
95 |
+ |
const ext::Buffer& owner_(share.getOwner().GetData()); |
96 |
|
|
97 |
< |
if (!share.getOwner().IsEmpty()) |
98 |
< |
::snprintf(owner, ownerSize, "%s", share.getOwner().NullTerminate()); |
97 |
> |
if (!owner_.IsEmpty()) |
98 |
> |
{ |
99 |
> |
_foreach (const ext::Buffer, atom, owner_) |
100 |
> |
owner[_index] = *atom; |
101 |
> |
|
102 |
> |
owner[owner_.GetSize() < size_t(ownerSize) ? owner_.GetSize() : ownerSize - 1] = '\0'; |
103 |
> |
} |
104 |
|
|
105 |
< |
::snprintf(password, passwordSize, "%s", share.getPassword().NullTerminate()); |
105 |
> |
ext::Buffer password_(share.getPassword().GetData()); |
106 |
> |
|
107 |
> |
_foreach (ext::Buffer, atom, password_) |
108 |
> |
password[_index] = *atom; |
109 |
> |
|
110 |
> |
password[password_.GetSize() < size_t(passwordSize) ? password_.GetSize() : passwordSize - 1] = '\0'; |
111 |
|
} |
112 |
|
} |