43 |
|
|
44 |
|
void Maker::samba() |
45 |
|
{ |
46 |
+ |
char credentials[17]; |
47 |
+ |
|
48 |
+ |
sprintf(credentials, "%s", "/tmp/spectre.XXXX"); |
49 |
+ |
mkstemp(credentials); |
50 |
+ |
|
51 |
+ |
ofstream fout(credentials); |
52 |
+ |
|
53 |
+ |
fout << "username = " << regular.remote << "\n" |
54 |
+ |
<< "password = " << password(regular.remote) << "\n"; |
55 |
+ |
|
56 |
+ |
fout.close(); |
57 |
+ |
|
58 |
|
vector<string> args; |
59 |
|
|
60 |
+ |
args.push_back("spectre"); |
61 |
|
args.push_back("-N"); |
62 |
|
args.push_back("-L"); |
63 |
|
args.push_back(host); |
64 |
< |
args.push_back("-U"); |
65 |
< |
args.push_back(regular.remote + "%" + password(regular.remote)); |
64 |
> |
args.push_back("-A"); |
65 |
> |
args.push_back(credentials); |
66 |
|
|
67 |
|
ipstream smbclient(config.smbclient, args); |
68 |
|
|
69 |
|
// |
70 |
+ |
|
71 |
+ |
unlink(credentials); |
72 |
|
} |
73 |
|
|
74 |
|
void Maker::make(const string& folder, const string& user) |