- std::ofstream script(newFileName.c_str());
- script << "#!/bin/sh\n";
- if (!dropACLs(target, script)) {
+
+ if (_settings.dumpScripts()) {
+ stream = new std::ofstream(newFileName.c_str());
+ *stream << "#!/bin/sh\n";
+ } else {
+ stream = new std::stringstream;
+ }
+
+ if (!dropACLs(target, *stream)) {