Darin Petkov | c529c83 | 2012-04-18 14:59:42 +0200 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "shill/key_file_store.h" |
| 6 | |
Paul Stewart | 5b9ec98 | 2013-01-18 14:12:14 -0800 | [diff] [blame] | 7 | #include <map> |
| 8 | |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 9 | #include <base/file_util.h> |
Paul Stewart | dab3b5a | 2012-07-11 18:25:10 -0700 | [diff] [blame] | 10 | #include <base/string_number_conversions.h> |
Gary Morain | 9697024 | 2012-04-20 10:59:58 -0700 | [diff] [blame] | 11 | #include <fcntl.h> |
| 12 | #include <sys/stat.h> |
| 13 | #include <sys/types.h> |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 14 | |
Paul Stewart | 5b9ec98 | 2013-01-18 14:12:14 -0800 | [diff] [blame] | 15 | #include "shill/key_value_store.h" |
Christopher Wiley | b691efd | 2012-08-09 13:51:51 -0700 | [diff] [blame] | 16 | #include "shill/logging.h" |
Ben Chan | fad4a0b | 2012-04-18 15:49:59 -0700 | [diff] [blame] | 17 | |
Paul Stewart | 5b9ec98 | 2013-01-18 14:12:14 -0800 | [diff] [blame] | 18 | using std::map; |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 19 | using std::set; |
| 20 | using std::string; |
Darin Petkov | b2841fd | 2011-06-30 12:54:12 -0700 | [diff] [blame] | 21 | using std::vector; |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 22 | |
| 23 | namespace shill { |
| 24 | |
Paul Stewart | 2ebc16d | 2012-08-23 10:38:39 -0700 | [diff] [blame] | 25 | const char KeyFileStore::kCorruptSuffix[] = ".corrupted"; |
| 26 | |
Darin Petkov | 86964e0 | 2011-06-29 13:49:28 -0700 | [diff] [blame] | 27 | KeyFileStore::KeyFileStore(GLib *glib) |
| 28 | : glib_(glib), |
| 29 | crypto_(glib), |
| 30 | key_file_(NULL) {} |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 31 | |
| 32 | KeyFileStore::~KeyFileStore() { |
| 33 | ReleaseKeyFile(); |
| 34 | } |
| 35 | |
| 36 | void KeyFileStore::ReleaseKeyFile() { |
| 37 | if (key_file_) { |
| 38 | glib_->KeyFileFree(key_file_); |
| 39 | key_file_ = NULL; |
| 40 | } |
| 41 | } |
| 42 | |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 43 | bool KeyFileStore::IsNonEmpty() const { |
Paul Stewart | 5dc40aa | 2011-10-28 19:43:43 -0700 | [diff] [blame] | 44 | int64 file_size = 0; |
| 45 | return file_util::GetFileSize(path_, &file_size) && file_size != 0; |
| 46 | } |
| 47 | |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 48 | bool KeyFileStore::Open() { |
| 49 | CHECK(!path_.empty()); |
| 50 | CHECK(!key_file_); |
Darin Petkov | 86964e0 | 2011-06-29 13:49:28 -0700 | [diff] [blame] | 51 | crypto_.Init(); |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 52 | key_file_ = glib_->KeyFileNew(); |
Paul Stewart | 5dc40aa | 2011-10-28 19:43:43 -0700 | [diff] [blame] | 53 | if (!IsNonEmpty()) { |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 54 | LOG(INFO) << "Creating a new key file at " << path_.value(); |
| 55 | return true; |
| 56 | } |
| 57 | GError *error = NULL; |
| 58 | if (glib_->KeyFileLoadFromFile( |
| 59 | key_file_, |
| 60 | path_.value().c_str(), |
| 61 | static_cast<GKeyFileFlags>(G_KEY_FILE_KEEP_COMMENTS | |
| 62 | G_KEY_FILE_KEEP_TRANSLATIONS), |
| 63 | &error)) { |
| 64 | return true; |
| 65 | } |
| 66 | LOG(ERROR) << "Failed to load key file from " << path_.value() << ": " |
| 67 | << glib_->ConvertErrorToMessage(error); |
| 68 | ReleaseKeyFile(); |
| 69 | return false; |
| 70 | } |
| 71 | |
| 72 | bool KeyFileStore::Close() { |
Chris Masone | b9c0059 | 2011-10-06 13:10:39 -0700 | [diff] [blame] | 73 | bool success = Flush(); |
| 74 | ReleaseKeyFile(); |
| 75 | return success; |
| 76 | } |
| 77 | |
| 78 | bool KeyFileStore::Flush() { |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 79 | CHECK(key_file_); |
| 80 | GError *error = NULL; |
| 81 | gsize length = 0; |
| 82 | gchar *data = glib_->KeyFileToData(key_file_, &length, &error); |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 83 | |
| 84 | bool success = true; |
| 85 | if (path_.empty()) { |
| 86 | LOG(ERROR) << "Empty key file path."; |
| 87 | success = false; |
| 88 | } |
| 89 | if (success && (!data || error)) { |
| 90 | LOG(ERROR) << "Failed to convert key file to string: " |
| 91 | << glib_->ConvertErrorToMessage(error); |
| 92 | success = false; |
| 93 | } |
mukesh agrawal | f60e406 | 2011-05-27 13:13:41 -0700 | [diff] [blame] | 94 | if (success) { |
Gary Morain | 9697024 | 2012-04-20 10:59:58 -0700 | [diff] [blame] | 95 | // The profile file must be accessible by the owner only. |
| 96 | int fd = creat(path_.value().c_str(), S_IRUSR | S_IWUSR); |
| 97 | if (fd < 0) { |
| 98 | LOG(ERROR) << "Failed to create key file " << path_.value(); |
mukesh agrawal | f60e406 | 2011-05-27 13:13:41 -0700 | [diff] [blame] | 99 | success = false; |
Gary Morain | 9697024 | 2012-04-20 10:59:58 -0700 | [diff] [blame] | 100 | } else { |
| 101 | int written = file_util::WriteFileDescriptor(fd, data, length); |
| 102 | if (written < 0 || (static_cast<gsize>(written) != length)) { |
| 103 | LOG(ERROR) << "Failed to store key file: " << path_.value(); |
| 104 | success = false; |
| 105 | } |
| 106 | close(fd); |
mukesh agrawal | f60e406 | 2011-05-27 13:13:41 -0700 | [diff] [blame] | 107 | } |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 108 | } |
| 109 | glib_->Free(data); |
| 110 | return success; |
| 111 | } |
| 112 | |
Paul Stewart | 2ebc16d | 2012-08-23 10:38:39 -0700 | [diff] [blame] | 113 | bool KeyFileStore::MarkAsCorrupted() { |
| 114 | LOG(INFO) << "In " << __func__ << " for " << path_.value(); |
| 115 | if (path_.empty()) { |
| 116 | LOG(ERROR) << "Empty key file path."; |
| 117 | return false; |
| 118 | } |
| 119 | string corrupted_path = path_.value() + kCorruptSuffix; |
| 120 | int ret = rename(path_.value().c_str(), corrupted_path.c_str()); |
| 121 | if (ret != 0) { |
| 122 | PLOG(ERROR) << "File rename failed"; |
| 123 | return false; |
| 124 | } |
| 125 | return true; |
| 126 | } |
| 127 | |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 128 | set<string> KeyFileStore::GetGroups() const { |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 129 | CHECK(key_file_); |
| 130 | gsize length = 0; |
Paul Stewart | a41e38d | 2011-11-11 07:47:29 -0800 | [diff] [blame] | 131 | gchar **groups = glib_->KeyFileGetGroups(key_file_, &length); |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 132 | if (!groups) { |
| 133 | LOG(ERROR) << "Unable to obtain groups."; |
| 134 | return set<string>(); |
| 135 | } |
| 136 | set<string> group_set(groups, groups + length); |
| 137 | glib_->Strfreev(groups); |
| 138 | return group_set; |
| 139 | } |
| 140 | |
Paul Stewart | a41e38d | 2011-11-11 07:47:29 -0800 | [diff] [blame] | 141 | // Returns a set so that caller can easily test whether a particular group |
| 142 | // is contained within this collection. |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 143 | set<string> KeyFileStore::GetGroupsWithKey(const string &key) const { |
Paul Stewart | a41e38d | 2011-11-11 07:47:29 -0800 | [diff] [blame] | 144 | set<string> groups = GetGroups(); |
| 145 | set<string> groups_with_key; |
| 146 | for (set<string>::iterator it = groups.begin(); it != groups.end(); ++it) { |
| 147 | if (glib_->KeyFileHasKey(key_file_, (*it).c_str(), key.c_str(), NULL)) { |
| 148 | groups_with_key.insert(*it); |
| 149 | } |
| 150 | } |
| 151 | return groups_with_key; |
| 152 | } |
| 153 | |
Paul Stewart | 5b9ec98 | 2013-01-18 14:12:14 -0800 | [diff] [blame] | 154 | set<string> KeyFileStore::GetGroupsWithProperties( |
| 155 | const KeyValueStore &properties) const { |
| 156 | set<string> groups = GetGroups(); |
| 157 | set<string> groups_with_properties; |
| 158 | for (set<string>::iterator it = groups.begin(); it != groups.end(); ++it) { |
| 159 | if (DoesGroupMatchProperties(*it, properties)) { |
| 160 | groups_with_properties.insert(*it); |
| 161 | } |
| 162 | } |
| 163 | return groups_with_properties; |
| 164 | } |
| 165 | |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 166 | bool KeyFileStore::ContainsGroup(const string &group) const { |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 167 | CHECK(key_file_); |
| 168 | return glib_->KeyFileHasGroup(key_file_, group.c_str()); |
| 169 | } |
| 170 | |
| 171 | bool KeyFileStore::DeleteKey(const string &group, const string &key) { |
| 172 | CHECK(key_file_); |
| 173 | GError *error = NULL; |
| 174 | glib_->KeyFileRemoveKey(key_file_, group.c_str(), key.c_str(), &error); |
Chris Masone | 9d77993 | 2011-08-25 16:33:41 -0700 | [diff] [blame] | 175 | if (error && error->code != G_KEY_FILE_ERROR_KEY_NOT_FOUND) { |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 176 | LOG(ERROR) << "Failed to delete (" << group << ":" << key << "): " |
| 177 | << glib_->ConvertErrorToMessage(error); |
| 178 | return false; |
| 179 | } |
| 180 | return true; |
| 181 | } |
| 182 | |
| 183 | bool KeyFileStore::DeleteGroup(const string &group) { |
| 184 | CHECK(key_file_); |
| 185 | GError *error = NULL; |
| 186 | glib_->KeyFileRemoveGroup(key_file_, group.c_str(), &error); |
Chris Masone | 9d77993 | 2011-08-25 16:33:41 -0700 | [diff] [blame] | 187 | if (error && error->code != G_KEY_FILE_ERROR_GROUP_NOT_FOUND) { |
Darin Petkov | 86964e0 | 2011-06-29 13:49:28 -0700 | [diff] [blame] | 188 | LOG(ERROR) << "Failed to delete group " << group << ": " |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 189 | << glib_->ConvertErrorToMessage(error); |
| 190 | return false; |
| 191 | } |
| 192 | return true; |
| 193 | } |
| 194 | |
Paul Stewart | 5dc40aa | 2011-10-28 19:43:43 -0700 | [diff] [blame] | 195 | bool KeyFileStore::SetHeader(const string &header) { |
| 196 | GError *error = NULL; |
| 197 | glib_->KeyFileSetComment(key_file_, NULL, NULL, header.c_str(), &error); |
| 198 | if (error) { |
| 199 | LOG(ERROR) << "Failed to to set header: " |
| 200 | << glib_->ConvertErrorToMessage(error); |
| 201 | return false; |
| 202 | } |
| 203 | return true; |
| 204 | } |
| 205 | |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 206 | bool KeyFileStore::GetString(const string &group, |
| 207 | const string &key, |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 208 | string *value) const { |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 209 | CHECK(key_file_); |
| 210 | GError *error = NULL; |
| 211 | gchar *data = |
| 212 | glib_->KeyFileGetString(key_file_, group.c_str(), key.c_str(), &error); |
| 213 | if (!data) { |
Darin Petkov | c529c83 | 2012-04-18 14:59:42 +0200 | [diff] [blame] | 214 | string s = glib_->ConvertErrorToMessage(error); |
Ben Chan | fad4a0b | 2012-04-18 15:49:59 -0700 | [diff] [blame] | 215 | SLOG(Storage, 10) << "Failed to lookup (" << group << ":" << key << "): " |
| 216 | << s; |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 217 | return false; |
| 218 | } |
| 219 | if (value) { |
| 220 | *value = data; |
| 221 | } |
| 222 | glib_->Free(data); |
| 223 | return true; |
| 224 | } |
| 225 | |
| 226 | bool KeyFileStore::SetString(const string &group, |
| 227 | const string &key, |
| 228 | const string &value) { |
| 229 | CHECK(key_file_); |
| 230 | glib_->KeyFileSetString(key_file_, group.c_str(), key.c_str(), value.c_str()); |
| 231 | return true; |
| 232 | } |
| 233 | |
| 234 | bool KeyFileStore::GetBool(const string &group, |
| 235 | const string &key, |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 236 | bool *value) const { |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 237 | CHECK(key_file_); |
| 238 | GError *error = NULL; |
| 239 | gboolean data = |
| 240 | glib_->KeyFileGetBoolean(key_file_, group.c_str(), key.c_str(), &error); |
| 241 | if (error) { |
Darin Petkov | c529c83 | 2012-04-18 14:59:42 +0200 | [diff] [blame] | 242 | string s = glib_->ConvertErrorToMessage(error); |
Ben Chan | fad4a0b | 2012-04-18 15:49:59 -0700 | [diff] [blame] | 243 | SLOG(Storage, 10) << "Failed to lookup (" << group << ":" << key << "): " |
| 244 | << s; |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 245 | return false; |
| 246 | } |
| 247 | if (value) { |
| 248 | *value = data; |
| 249 | } |
| 250 | return true; |
| 251 | } |
| 252 | |
| 253 | bool KeyFileStore::SetBool(const string &group, const string &key, bool value) { |
| 254 | CHECK(key_file_); |
| 255 | glib_->KeyFileSetBoolean(key_file_, |
| 256 | group.c_str(), |
| 257 | key.c_str(), |
| 258 | value ? TRUE : FALSE); |
| 259 | return true; |
| 260 | } |
| 261 | |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 262 | bool KeyFileStore::GetInt( |
| 263 | const string &group, const string &key, int *value) const { |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 264 | CHECK(key_file_); |
| 265 | GError *error = NULL; |
| 266 | gint data = |
| 267 | glib_->KeyFileGetInteger(key_file_, group.c_str(), key.c_str(), &error); |
| 268 | if (error) { |
Darin Petkov | c529c83 | 2012-04-18 14:59:42 +0200 | [diff] [blame] | 269 | string s = glib_->ConvertErrorToMessage(error); |
Ben Chan | fad4a0b | 2012-04-18 15:49:59 -0700 | [diff] [blame] | 270 | SLOG(Storage, 10) << "Failed to lookup (" << group << ":" << key << "): " |
| 271 | << s; |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 272 | return false; |
| 273 | } |
| 274 | if (value) { |
| 275 | *value = data; |
| 276 | } |
| 277 | return true; |
| 278 | } |
| 279 | |
| 280 | bool KeyFileStore::SetInt(const string &group, const string &key, int value) { |
| 281 | CHECK(key_file_); |
| 282 | glib_->KeyFileSetInteger(key_file_, group.c_str(), key.c_str(), value); |
| 283 | return true; |
| 284 | } |
| 285 | |
Paul Stewart | dab3b5a | 2012-07-11 18:25:10 -0700 | [diff] [blame] | 286 | bool KeyFileStore::GetUint64( |
| 287 | const string &group, const string &key, uint64 *value) const { |
| 288 | // Read the value in as a string and then convert to uint64 because glib's |
| 289 | // g_key_file_set_uint64 appears not to work correctly on 32-bit platforms |
| 290 | // in unit tests. |
| 291 | string data_string; |
| 292 | if (!GetString(group, key, &data_string)) { |
| 293 | return false; |
| 294 | } |
| 295 | |
| 296 | uint64 data; |
| 297 | if (!base::StringToUint64(data_string, &data)) { |
| 298 | SLOG(Storage, 10) << "Failed to convert (" << group << ":" << key << "): " |
| 299 | << "string to uint64 conversion failed"; |
| 300 | return false; |
| 301 | } |
| 302 | |
| 303 | if (value) { |
| 304 | *value = data; |
| 305 | } |
| 306 | |
| 307 | return true; |
| 308 | } |
| 309 | |
| 310 | bool KeyFileStore::SetUint64( |
| 311 | const string &group, const string &key, uint64 value) { |
| 312 | // Convert the value to a string first, then save the value because glib's |
| 313 | // g_key_file_get_uint64 appears not to work on 32-bit platforms in our |
| 314 | // unit tests. |
| 315 | return SetString(group, key, base::Uint64ToString(value)); |
| 316 | } |
| 317 | |
Darin Petkov | b2841fd | 2011-06-30 12:54:12 -0700 | [diff] [blame] | 318 | bool KeyFileStore::GetStringList(const string &group, |
| 319 | const string &key, |
Paul Stewart | 0756db9 | 2012-01-27 08:34:47 -0800 | [diff] [blame] | 320 | vector<string> *value) const { |
Darin Petkov | b2841fd | 2011-06-30 12:54:12 -0700 | [diff] [blame] | 321 | CHECK(key_file_); |
| 322 | gsize length = 0; |
| 323 | GError *error = NULL; |
| 324 | gchar **data = glib_->KeyFileGetStringList(key_file_, |
| 325 | group.c_str(), |
| 326 | key.c_str(), |
| 327 | &length, |
| 328 | &error); |
| 329 | if (!data) { |
Darin Petkov | c529c83 | 2012-04-18 14:59:42 +0200 | [diff] [blame] | 330 | string s = glib_->ConvertErrorToMessage(error); |
Ben Chan | fad4a0b | 2012-04-18 15:49:59 -0700 | [diff] [blame] | 331 | SLOG(Storage, 10) << "Failed to lookup (" << group << ":" << key << "): " |
| 332 | << s; |
Darin Petkov | b2841fd | 2011-06-30 12:54:12 -0700 | [diff] [blame] | 333 | return false; |
| 334 | } |
| 335 | if (value) { |
| 336 | value->assign(data, data + length); |
| 337 | } |
| 338 | glib_->Strfreev(data); |
| 339 | return true; |
| 340 | } |
| 341 | |
| 342 | bool KeyFileStore::SetStringList(const string &group, |
| 343 | const string &key, |
| 344 | const vector<string> &value) { |
| 345 | CHECK(key_file_); |
| 346 | vector<const char *> list; |
| 347 | for (vector<string>::const_iterator it = value.begin(); |
| 348 | it != value.end(); ++it) { |
| 349 | list.push_back(it->c_str()); |
| 350 | } |
| 351 | glib_->KeyFileSetStringList(key_file_, |
| 352 | group.c_str(), |
| 353 | key.c_str(), |
| 354 | list.data(), |
| 355 | list.size()); |
| 356 | return true; |
| 357 | } |
| 358 | |
Darin Petkov | 86964e0 | 2011-06-29 13:49:28 -0700 | [diff] [blame] | 359 | bool KeyFileStore::GetCryptedString(const string &group, |
| 360 | const string &key, |
| 361 | string *value) { |
| 362 | if (!GetString(group, key, value)) { |
| 363 | return false; |
| 364 | } |
| 365 | if (value) { |
| 366 | *value = crypto_.Decrypt(*value); |
| 367 | } |
| 368 | return true; |
| 369 | } |
| 370 | |
| 371 | bool KeyFileStore::SetCryptedString(const string &group, |
| 372 | const string &key, |
| 373 | const string &value) { |
| 374 | return SetString(group, key, crypto_.Encrypt(value)); |
| 375 | } |
| 376 | |
Paul Stewart | 5b9ec98 | 2013-01-18 14:12:14 -0800 | [diff] [blame] | 377 | bool KeyFileStore::DoesGroupMatchProperties( |
| 378 | const string &group, const KeyValueStore &properties) const { |
| 379 | map<string, bool>::const_iterator bool_it; |
| 380 | for (bool_it = properties.bool_properties().begin(); |
| 381 | bool_it != properties.bool_properties().end(); |
| 382 | ++bool_it) { |
| 383 | bool value; |
| 384 | if (!GetBool(group, bool_it->first, &value) || |
| 385 | value != bool_it->second) { |
| 386 | return false; |
| 387 | } |
| 388 | } |
| 389 | map<string, int32>::const_iterator int_it; |
| 390 | for (int_it = properties.int_properties().begin(); |
| 391 | int_it != properties.int_properties().end(); |
| 392 | ++int_it) { |
| 393 | int value; |
| 394 | if (!GetInt(group, int_it->first, &value) || |
| 395 | value != int_it->second) { |
| 396 | return false; |
| 397 | } |
| 398 | } |
| 399 | map<string, string>::const_iterator string_it; |
| 400 | for (string_it = properties.string_properties().begin(); |
| 401 | string_it != properties.string_properties().end(); |
| 402 | ++string_it) { |
| 403 | string value; |
| 404 | if (!GetString(group, string_it->first, &value) || |
| 405 | value != string_it->second) { |
| 406 | return false; |
| 407 | } |
| 408 | } |
| 409 | return true; |
| 410 | } |
| 411 | |
Darin Petkov | 083047b | 2011-06-23 20:42:48 -0700 | [diff] [blame] | 412 | } // namespace shill |