+
+
+void FileDiskRep::Writer::flush()
+{
+ size_t size = fd().listAttr(NULL, 0);
+ std::vector<char> buffer(size);
+ char *s = &buffer[0];
+ char *end = &buffer[size];
+ fd().listAttr(s, size);
+ while (s < end) {
+ std::string name = s;
+ s += strlen(s) + 1; // skip to next
+ if (name.compare(0, 13, "com.apple.cs.") == 0) // one of ours
+ if (mWrittenAttributes.find(name) == mWrittenAttributes.end()) { // not written by this signing operation
+ fd().removeAttr(name);
+ }
+ }
+}