CernVM-FS  2.11.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
magic_xattr.cc
Go to the documentation of this file.
1 
5 #include "magic_xattr.h"
6 
7 #include <cassert>
8 #include <string>
9 #include <vector>
10 
11 #include "catalog_mgr_client.h"
12 #include "crypto/signature.h"
13 #include "fetch.h"
14 #include "mountpoint.h"
15 #include "quota.h"
16 #include "util/logging.h"
17 #include "util/string.h"
18 
20  EVisibility visibility,
21  const std::set<std::string> &protected_xattrs,
22  const std::set<gid_t> &priviledged_xattr_gids)
23  : mount_point_(mountpoint),
24  visibility_(visibility),
25  protected_xattrs_(protected_xattrs),
26  privileged_xattr_gids_(priviledged_xattr_gids),
27  is_frozen_(false)
28 {
29  Register("user.catalog_counters", new CatalogCountersMagicXattr());
30  Register("user.external_host", new ExternalHostMagicXattr());
31  Register("user.external_timeout", new ExternalTimeoutMagicXattr());
32  Register("user.fqrn", new FqrnMagicXattr());
33  Register("user.host", new HostMagicXattr());
34  Register("user.host_list", new HostListMagicXattr());
35  Register("user.ncleanup24", new NCleanup24MagicXattr());
36  Register("user.nclg", new NClgMagicXattr());
37  Register("user.ndiropen", new NDirOpenMagicXattr());
38  Register("user.ndownload", new NDownloadMagicXattr());
39  Register("user.nioerr", new NIOErrMagicXattr());
40  Register("user.nopen", new NOpenMagicXattr());
41  Register("user.hitrate", new HitrateMagicXattr());
42  Register("user.logbuffer", new LogBufferXattr());
43  Register("user.proxy", new ProxyMagicXattr());
44  Register("user.pubkeys", new PubkeysMagicXattr());
45  Register("user.repo_counters", new RepoCountersMagicXattr());
46  Register("user.repo_metainfo", new RepoMetainfoMagicXattr());
47  Register("user.revision", new RevisionMagicXattr());
48  Register("user.root_hash", new RootHashMagicXattr());
49  Register("user.rx", new RxMagicXattr());
50  Register("user.speed", new SpeedMagicXattr());
51  Register("user.tag", new TagMagicXattr());
52  Register("user.timeout", new TimeoutMagicXattr());
53  Register("user.timeout_direct", new TimeoutDirectMagicXattr());
54  Register("user.timestamp_last_ioerr", new TimestampLastIOErrMagicXattr());
55  Register("user.usedfd", new UsedFdMagicXattr());
56  Register("user.useddirp", new UsedDirPMagicXattr());
57  Register("user.version", new VersionMagicXattr());
58 
59  Register("user.hash", new HashMagicXattr());
60  Register("user.lhash", new LHashMagicXattr());
61 
62  Register("user.chunk_list", new ChunkListMagicXattr());
63  Register("user.chunks", new ChunksMagicXattr());
64  Register("user.compression", new CompressionMagicXattr());
65  Register("user.direct_io", new DirectIoMagicXattr());
66  Register("user.external_file", new ExternalFileMagicXattr());
67 
68  Register("user.rawlink", new RawlinkMagicXattr());
69  Register("xfsroot.rawlink", new RawlinkMagicXattr());
70 
71  Register("user.authz", new AuthzMagicXattr());
72  Register("user.external_url", new ExternalURLMagicXattr());
73 }
74 
76  if (visibility() == kVisibilityNever) {
77  return "";
78  }
79  // Only the root entry has an empty name
80  if (visibility() == kVisibilityRootOnly && !dirent->name().IsEmpty()) {
81  return "";
82  }
83 
84  std::string result;
85  std::map<std::string, BaseMagicXattr *>::iterator it = xattr_list_.begin();
86  for (; it != xattr_list_.end(); ++it) {
87  MagicXattrFlavor flavor = (*it).second->GetXattrFlavor();
88  // Skip those which should not be displayed
89  switch (flavor) {
90  case kXattrBase:
91  break;
92  case kXattrWithHash:
93  if (dirent->checksum().IsNull()) continue;
94  break;
95  case kXattrRegular:
96  if (!dirent->IsRegular()) continue;
97  break;
98  case kXattrExternal:
99  if (!(dirent->IsRegular() && dirent->IsExternalFile())) continue;
100  break;
101  case kXattrSymlink:
102  if (!dirent->IsLink()) continue;
103  break;
104  case kXattrAuthz:
105  if (!mount_point_->has_membership_req()) continue;
106  break;
107  default:
108  PANIC("unknown magic xattr flavor");
109  }
110  result += (*it).first;
111  result.push_back('\0');
112  }
113 
114  return result;
115 }
116 
118  PathString path,
120 {
121  BaseMagicXattr *result;
122  if (xattr_list_.count(name) > 0) {
123  result = xattr_list_[name];
124  } else {
125  return NULL;
126  }
127 
128  result->Lock(path, d);
129 
130  return result;
131 }
132 
133 void MagicXattrManager::Register(const std::string &name,
134  BaseMagicXattr *magic_xattr)
135 {
136  assert(!is_frozen_);
137  if (xattr_list_.count(name) > 0) {
139  "Magic extended attribute with name %s already registered",
140  name.c_str());
141  }
142  magic_xattr->xattr_mgr_ = this;
143  xattr_list_[name] = magic_xattr;
144 
145  // Mark Xattr protected so that only certain fuse_gids' can access it.
146  // If Xattr with registered "name" is part of *protected_xattrs
147  if (protected_xattrs_.count(name) > 0) {
148  magic_xattr->MarkProtected();
149  }
150 }
151 
153  return privileged_xattr_gids_.count(gid) > 0;
154 }
155 
158  if (is_protected_ && !xattr_mgr_->IsPrivilegedGid(gid)) {
159  return false;
160  }
161 
162  return PrepareValueFenced();
163 }
164 
166  std::set<std::string>::const_iterator iter;
167  std::vector<string> tmp;
168  for (iter = protected_xattrs_.begin();
169  iter != protected_xattrs_.end(); iter++) {
170  if (xattr_list_.find(*iter) == xattr_list_.end()) {
171  tmp.push_back(*iter);
172  }
173  }
174 
175  if (tmp.size() > 0) {
176  std::string msg = JoinStrings(tmp, ",");
178  "Following CVMFS_XATTR_PROTECTED_XATTRS are "
179  "set but not recognized: %s", msg.c_str());
180  }
181 
182  tmp.clear();
183  std::set<gid_t>::const_iterator iter_gid;
184  for (iter_gid = privileged_xattr_gids_.begin();
185  iter_gid != privileged_xattr_gids_.end(); iter_gid++) {
186  tmp.push_back(StringifyUint(*iter_gid));
187  }
188 
189  if (tmp.size() > 0) {
190  std::string msg = JoinStrings(tmp, ",");
192  "Following CVMFS_XATTR_PRIVILEGED_GIDS are set: %s", msg.c_str());
193  }
194 }
195 
198 }
199 
202 }
203 
205  return kXattrAuthz;
206 }
207 
209  counters_ =
211  LookupCounters(path_, &subcatalog_path_, &hash_);
212  return true;
213 }
214 
216  std::string res;
217  res = "catalog_hash: " + hash_.ToString() + "\n";
218  res += "catalog_mountpoint: " + subcatalog_path_ + "\n";
219  res += counters_.GetCsvMap();
220  return res;
221 }
222 
224  chunk_list_ = "hash,offset,size\n";
225  if (!dirent_->IsRegular()) {
226  return false;
227  }
228  if (dirent_->IsChunkedFile()) {
229  FileChunkList chunks;
232  || chunks.IsEmpty())
233  {
234  LogCvmfs(kLogCvmfs, kLogDebug | kLogSyslogErr, "file %s is marked as "
235  "'chunked', but no chunks found.", path_.c_str());
236  return false;
237  } else {
238  for (size_t i = 0; i < chunks.size(); ++i) {
239  chunk_list_ += chunks.At(i).content_hash().ToString() + ",";
240  chunk_list_ += StringifyInt(chunks.At(i).offset()) + ",";
241  chunk_list_ += StringifyUint(chunks.At(i).size()) + "\n";
242  }
243  }
244  } else {
245  chunk_list_ += dirent_->checksum().ToString() + ",";
246  chunk_list_ += "0,";
247  chunk_list_ += StringifyUint(dirent_->size()) + "\n";
248  }
249  return true;
250 }
251 
253  return chunk_list_;
254 }
255 
257  if (!dirent_->IsRegular()) {
258  return false;
259  }
260  if (dirent_->IsChunkedFile()) {
261  FileChunkList chunks;
264  || chunks.IsEmpty())
265  {
266  LogCvmfs(kLogCvmfs, kLogDebug | kLogSyslogErr, "file %s is marked as "
267  "'chunked', but no chunks found.", path_.c_str());
268  return false;
269  } else {
270  n_chunks_ = chunks.size();
271  }
272  } else {
273  n_chunks_ = 1;
274  }
275 
276  return true;
277 }
278 
280  return StringifyUint(n_chunks_);
281 }
282 
284  return dirent_->IsRegular();
285 }
286 
289 }
290 
292  return dirent_->IsRegular();
293 }
294 
296  return dirent_->IsDirectIo() ? "1" : "0";
297 }
298 
300  return dirent_->IsRegular();
301 }
302 
304  return dirent_->IsExternalFile() ? "1" : "0";
305 }
306 
308  std::vector<string> host_chain;
309  std::vector<int> rtt;
310  unsigned current_host;
312  &host_chain, &rtt, &current_host);
313  if (host_chain.size()) {
314  return std::string(host_chain[current_host]);
315  } else {
316  return "internal error: no hosts defined";
317  }
318 }
319 
321  unsigned seconds, seconds_direct;
323  GetTimeout(&seconds, &seconds_direct);
324  return StringifyUint(seconds_direct);
325 }
326 
328  return xattr_mgr_->mount_point()->fqrn();
329 }
330 
332  return !dirent_->checksum().IsNull();
333 }
334 
336  return dirent_->checksum().ToString();
337 }
338 
340  std::vector<std::string> host_chain;
341  std::vector<int> rtt;
342  unsigned current_host;
344  GetHostInfo(&host_chain, &rtt, &current_host);
345  if (host_chain.size()) {
346  return std::string(host_chain[current_host]);
347  } else {
348  return "internal error: no hosts defined";
349  }
350 }
351 
353  std::string result;
354  std::vector<std::string> host_chain;
355  std::vector<int> rtt;
356  unsigned current_host;
358  GetHostInfo(&host_chain, &rtt, &current_host);
359  if (host_chain.size()) {
360  result = host_chain[current_host];
361  for (unsigned i = 1; i < host_chain.size(); ++i) {
362  result +=
363  ";" + host_chain[(i+current_host) % host_chain.size()];
364  }
365  } else {
366  result = "internal error: no hosts defined";
367  }
368  return result;
369 }
370 
372  return !dirent_->checksum().IsNull();
373 }
374 
376  string result;
377  CacheManager::ObjectInfo object_info;
378  object_info.description = path_.ToString();
380  object_info.type = CacheManager::kTypeVolatile;
381  int fd = xattr_mgr_->mount_point()->file_system()->cache_mgr()->Open(
382  CacheManager::Bless(dirent_->checksum(), object_info));
383  if (fd < 0) {
384  result = "Not in cache";
385  } else {
387  int retval_i =
389  ->ChecksumFd(fd, &hash);
390  if (retval_i != 0)
391  result = "I/O error (" + StringifyInt(retval_i) + ")";
392  else
393  result = hash.ToString();
395  }
396  return result;
397 }
398 
399 LogBufferXattr::LogBufferXattr() : BaseMagicXattr(), throttle_(1, 500, 2000) { }
400 
403  std::vector<LogBufferEntry> buffer = GetLogBuffer();
404  std::string result;
405  for (unsigned i = 0; i < buffer.size(); ++i) {
406  result += "[" + StringifyTime(buffer[i].timestamp, true /* UTC */) +
407  " UTC] " + buffer[i].message + "\n";
408  }
409  return result;
410 }
411 
413  QuotaManager *quota_mgr =
416  return StringifyInt(-1);
417  } else {
418  const uint64_t period_s = 24 * 60 * 60;
419  const uint64_t rate = quota_mgr->GetCleanupRate(period_s);
420  return StringifyInt(rate);
421  }
422 }
423 
426  return true;
427 }
428 
430  return StringifyInt(n_catalogs_);
431 }
432 
435 }
436 
438  return xattr_mgr_->mount_point()->statistics()->Lookup("fetch.n_downloads")
439  ->Print();
440 }
441 
444  ->count());
445 }
446 
449 }
450 
452  int64_t n_invocations =
453  xattr_mgr_->mount_point()->statistics()->Lookup("fetch.n_invocations")
454  ->Get();
455  if (n_invocations == 0)
456  return "n/a";
457 
458  int64_t n_downloads =
459  xattr_mgr_->mount_point()->statistics()->Lookup("fetch.n_downloads")->Get();
460  float hitrate = 100. * (1. -
461  (static_cast<float>(n_downloads) / static_cast<float>(n_invocations)));
462  return StringifyDouble(hitrate);
463 }
464 
466  vector< vector<download::DownloadManager::ProxyInfo> > proxy_chain;
467  unsigned current_group;
469  &proxy_chain, &current_group, NULL);
470  if (proxy_chain.size()) {
471  return proxy_chain[current_group][0].url;
472  } else {
473  return "DIRECT";
474  }
475 }
476 
479  return true;
480 }
481 
483  return pubkeys_;
484 }
485 
487  return dirent_->IsLink();
488 }
489 
491  return dirent_->symlink().ToString();
492 }
493 
496  ->GetCounters();
497  return true;
498 }
499 
501  return counters_.GetCsvMap();
502 }
503 
505 
507  if (!xattr_mgr_->mount_point()->catalog_mgr()->manifest()) {
508  error_reason_ = "manifest not available";
509  return true;
510  }
511 
513  ->meta_info();
514  if (metainfo_hash_.IsNull()) {
515  error_reason_ = "metainfo not available";
516  return true;
517  }
518  return true;
519 }
520 
522  if (metainfo_hash_.IsNull()) {
523  return error_reason_;
524  }
525 
526  int fd = xattr_mgr_->mount_point()->fetcher()->
528  "metainfo (" + metainfo_hash_.ToString() + ")",
530  if (fd < 0) {
531  return "Failed to open metadata file";
532  }
533  uint64_t actual_size = xattr_mgr_->mount_point()->file_system()->cache_mgr()
534  ->GetSize(fd);
535  if (actual_size > kMaxMetainfoLength) {
537  return "Failed to open: metadata file is too big";
538  }
539  char buffer[kMaxMetainfoLength];
540  int64_t bytes_read =
542  ->Pread(fd, buffer, actual_size, 0);
544  if (bytes_read < 0) {
545  return "Failed to read metadata file";
546  }
547  return string(buffer, buffer + bytes_read);
548 }
549 
552  return true;
553 }
554 
556  return StringifyUint(revision_);
557 }
558 
561  return true;
562 }
563 
565  return root_hash_.ToString();
566 }
567 
568 std::string RxMagicXattr::GetValue() {
570  int64_t rx = statistics->Lookup("download.sz_transferred_bytes")->Get();
571  return StringifyInt(rx/1024);
572 }
573 
576  int64_t rx = statistics->Lookup("download.sz_transferred_bytes")->Get();
577  int64_t time = statistics->Lookup("download.sz_transfer_time")->Get();
578  if (time == 0)
579  return "n/a";
580  else
581  return StringifyInt((1000 * (rx/1024))/time);
582 }
583 
586  return true;
587 }
588 
589 std::string TagMagicXattr::GetValue() {
590  return tag_;
591 }
592 
594  unsigned seconds, seconds_direct;
596  ->GetTimeout(&seconds, &seconds_direct);
597  return StringifyUint(seconds);
598 }
599 
601  unsigned seconds, seconds_direct;
603  ->GetTimeout(&seconds, &seconds_direct);
604  return StringifyUint(seconds_direct);
605 }
606 
608  return StringifyInt(
610  ->timestamp_last());
611 }
612 
615 }
616 
619 }
620 
622  return std::string(VERSION) + "." + std::string(CVMFS_PATCH_LEVEL);
623 }
624 
626  std::vector<std::string> host_chain;
627  std::vector<int> rtt;
628  unsigned current_host;
629  if (xattr_mgr_->mount_point()->external_download_mgr() != NULL) {
631  &host_chain, &rtt, &current_host);
632  if (host_chain.size()) {
633  return std::string(host_chain[current_host]) + std::string(path_.c_str());
634  }
635  }
636  return std::string("");
637 }
638 
640  return dirent_->IsRegular() && dirent_->IsExternalFile();
641 }
std::vector< LogBufferEntry > GetLogBuffer()
Definition: logging.cc:530
#define LogCvmfs(source, mask,...)
Definition: logging.h:22
std::string ToString()
Definition: statistics.cc:24
const std::set< gid_t > privileged_xattr_gids_
Definition: magic_xattr.h:211
int ChecksumFd(int fd, shash::Any *id)
Definition: cache.cc:39
virtual std::string GetValue()
Definition: magic_xattr.cc:412
bool IsExternalFile() const
const Counters & GetCounters() const
Definition: catalog.h:175
bool IsNull() const
Definition: hash.h:383
virtual int64_t GetSize(int fd)=0
FileSystem * file_system()
Definition: mountpoint.h:504
MagicXattrFlavor
Definition: magic_xattr.h:21
Item At(const size_t index) const
Definition: bigvector.h:50
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:223
bool PrepareValueFencedProtected(gid_t gid)
Definition: magic_xattr.cc:156
virtual std::string GetValue()
Definition: magic_xattr.cc:568
cvmfs::Fetcher * fetcher()
Definition: mountpoint.h:500
std::string subcatalog_path_
Definition: magic_xattr.h:226
virtual uint64_t GetCleanupRate(uint64_t period_s)=0
bool IsChunkedFile() const
perf::Statistics * statistics()
Definition: mountpoint.h:523
void Register(const std::string &name, BaseMagicXattr *magic_xattr)
Definition: magic_xattr.cc:133
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:559
std::string Print()
Definition: statistics.cc:25
MountPoint * mount_point()
Definition: magic_xattr.h:200
#define PANIC(...)
Definition: exception.h:27
virtual std::string GetValue()
Definition: magic_xattr.cc:215
uint64_t size() const
string JoinStrings(const vector< string > &strings, const string &joint)
Definition: string.cc:325
std::string ToString(const bool with_suffix=false) const
Definition: hash.h:249
virtual std::string GetValue()
Definition: magic_xattr.cc:574
virtual std::string GetValue()
Definition: magic_xattr.cc:307
std::string fqrn() const
Definition: mountpoint.h:502
catalog::Counters counters_
Definition: magic_xattr.h:228
void MarkProtected()
Definition: magic_xattr.h:58
BaseMagicXattr * GetLocked(const std::string &name, PathString path, catalog::DirectoryEntry *d)
Definition: magic_xattr.cc:117
const std::set< std::string > protected_xattrs_
Definition: magic_xattr.h:210
virtual std::string GetValue()
Definition: magic_xattr.cc:593
std::string error_reason_
Definition: magic_xattr.h:364
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:639
virtual std::string GetValue()
Definition: magic_xattr.cc:500
const shash::Any & content_hash() const
Definition: file_chunk.h:41
shash::Any root_hash_
Definition: magic_xattr.h:378
virtual std::string GetValue()
Definition: magic_xattr.cc:320
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:584
std::string AlgorithmName(const zlib::Algorithms alg)
Definition: compression.cc:158
assert((mem||(size==0))&&"Out Of Memory")
MountPoint * mount_point_
Definition: cvmfs.cc:123
virtual std::string GetValue()
Definition: magic_xattr.cc:617
bool IsDirectIo() const
virtual std::string GetValue()
Definition: magic_xattr.cc:625
catalog::DirectoryEntry * dirent_
Definition: magic_xattr.h:101
Algorithms algorithm
Definition: hash.h:125
virtual std::string GetValue()
Definition: magic_xattr.cc:279
virtual int Open(const BlessedObject &object)=0
string StringifyTime(const time_t seconds, const bool utc)
Definition: string.cc:105
string StringifyDouble(const double value)
Definition: string.cc:96
virtual std::string GetValue()
Definition: magic_xattr.cc:352
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:283
std::string StringifyUint(const uint64_t value)
Definition: string.cc:84
virtual std::string GetValue()
Definition: magic_xattr.cc:375
shash::Any checksum() const
bool IsPrivilegedGid(gid_t gid)
Definition: magic_xattr.cc:152
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:208
bool has_membership_req()
Definition: mountpoint.h:506
std::string description
Definition: cache.h:97
std::string chunk_list_
Definition: magic_xattr.h:235
virtual std::string GetValue()
Definition: magic_xattr.cc:200
static uint64_t kMaxMetainfoLength
Definition: magic_xattr.h:361
MountPoint * mount_point_
Definition: magic_xattr.h:205
virtual std::string GetValue()
Definition: magic_xattr.cc:451
perf::Counter * n_fs_open()
Definition: mountpoint.h:217
virtual std::string GetValue()
Definition: magic_xattr.cc:401
std::string membership_req()
Definition: mountpoint.h:517
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:424
void Throttle()
Definition: backoff.cc:50
MagicXattrManager * xattr_mgr_
Definition: magic_xattr.h:99
std::string GetListString(catalog::DirectoryEntry *dirent)
Definition: magic_xattr.cc:75
virtual std::string GetValue()
Definition: magic_xattr.cc:303
std::string GetActivePubkeys() const
Definition: signature.cc:385
Counter * Lookup(const std::string &name) const
Definition: statistics.cc:62
NameString name() const
virtual std::string GetValue()
Definition: magic_xattr.cc:555
bool IsLink() const
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:550
void GetProxyInfo(std::vector< std::vector< ProxyInfo > > *proxy_chain, unsigned *current_group, unsigned *fallback_group)
Definition: download.cc:2570
std::string repository_tag()
Definition: mountpoint.h:521
catalog::ClientCatalogManager * catalog_mgr()
Definition: mountpoint.h:491
bool is_frozen() const
Definition: magic_xattr.h:201
bool IsRegular() const
virtual std::string GetValue()
Definition: magic_xattr.cc:589
virtual std::string GetValue()
Definition: magic_xattr.cc:327
ObjectType type
Definition: cache.h:93
virtual std::string GetValue()
Definition: magic_xattr.cc:447
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:494
EVisibility visibility()
Definition: magic_xattr.h:197
perf::Counter * no_open_dirs()
Definition: mountpoint.h:227
virtual std::string GetValue()
Definition: magic_xattr.cc:613
Failures Fetch(const std::string &base_url, const std::string &repository_name, const uint64_t minimum_timestamp, const shash::Any *base_catalog, signature::SignatureManager *signature_manager, download::DownloadManager *download_manager, ManifestEnsemble *ensemble)
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:371
off_t offset() const
Definition: file_chunk.h:42
zlib::Algorithms compression_algorithm() const
CacheManager * cache_mgr()
Definition: mountpoint.h:196
perf::Counter * no_open_files()
Definition: mountpoint.h:228
virtual std::string GetValue()
Definition: magic_xattr.cc:335
LinkString symlink() const
IoErrorInfo * io_error_info()
Definition: mountpoint.h:224
download::DownloadManager * download_mgr()
Definition: mountpoint.h:493
virtual std::string GetValue()
Definition: magic_xattr.cc:621
virtual std::string GetValue()
Definition: magic_xattr.cc:564
string StringifyInt(const int64_t value)
Definition: string.cc:78
virtual std::string GetValue()
Definition: magic_xattr.cc:433
virtual int Close(int fd)=0
virtual std::string GetValue()
Definition: magic_xattr.cc:437
shash::Algorithms hash_algorithm() const
perf::Counter * n_fs_dir_open()
Definition: mountpoint.h:212
virtual std::string GetValue()
Definition: magic_xattr.cc:465
int64_t Get()
Definition: statistics.h:32
virtual std::string GetValue()
Definition: magic_xattr.cc:442
CatalogT * GetRootCatalog() const
Definition: catalog_mgr.h:192
std::string tag_
Definition: magic_xattr.h:393
bool IsEmpty() const
Definition: bigvector.h:72
static BlessedObject Bless(const shash::Any &id)
Definition: cache.h:125
MagicXattrManager(MountPoint *mountpoint, EVisibility visibility, const std::set< std::string > &protected_xattrs, const std::set< gid_t > &privileged_xattr_gids)
Definition: magic_xattr.cc:19
shash::Any metainfo_hash_
Definition: magic_xattr.h:363
signature::SignatureManager * signature_mgr()
Definition: mountpoint.h:524
BackoffThrottle throttle_
Definition: magic_xattr.h:301
uint64_t n_chunks_
Definition: magic_xattr.h:242
virtual std::string GetValue()
Definition: magic_xattr.cc:252
std::string ToString() const
Definition: shortstring.h:141
virtual std::string GetValue()
Definition: magic_xattr.cc:521
QuotaManager * quota_mgr()
Definition: cache.h:198
virtual std::string GetValue()
Definition: magic_xattr.cc:429
bool IsEmpty() const
Definition: shortstring.h:137
virtual std::string GetValue()
Definition: magic_xattr.cc:339
PathString path_
Definition: magic_xattr.h:100
virtual std::string GetValue()
Definition: magic_xattr.cc:607
virtual std::string GetValue()
Definition: magic_xattr.cc:287
bool ListFileChunks(const PathString &path, const shash::Algorithms interpret_hashes_as, FileChunkList *chunks)
size_t size() const
Definition: file_chunk.h:43
std::map< std::string, BaseMagicXattr * > xattr_list_
Definition: magic_xattr.h:204
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:331
void GetTimeout(unsigned *seconds_proxy, unsigned *seconds_direct)
Definition: download.cc:1910
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:506
virtual bool PrepareValueFenced()
Definition: magic_xattr.h:97
virtual std::string GetValue()
Definition: magic_xattr.cc:295
catalog::Counters counters_
Definition: magic_xattr.h:354
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:477
virtual MagicXattrFlavor GetXattrFlavor()
Definition: magic_xattr.cc:204
std::string pubkeys_
Definition: magic_xattr.h:342
manifest::Manifest * manifest() const
virtual std::string GetValue()
Definition: magic_xattr.cc:600
void Lock(PathString path, catalog::DirectoryEntry *dirent)
Definition: magic_xattr.h:79
std::string GetCsvMap() const
const char * c_str() const
Definition: shortstring.h:145
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:256
void GetHostInfo(std::vector< std::string > *host_chain, std::vector< int > *rtt, unsigned *current_host)
Definition: download.cc:1954
virtual std::string GetValue()
Definition: magic_xattr.cc:482
virtual int64_t Pread(int fd, void *buf, uint64_t size, uint64_t offset)=0
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:291
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:299
void SanityCheckProtectedXattrs()
Definition: magic_xattr.cc:165
shash::Any meta_info() const
Definition: manifest.h:131
virtual bool HasCapability(Capabilities capability)=0
static const uint64_t kSizeUnknown
Definition: cache.h:72
size_t size() const
Definition: bigvector.h:121
download::DownloadManager * external_download_mgr()
Definition: mountpoint.h:494
virtual bool PrepareValueFenced()
Definition: magic_xattr.cc:196