summaryrefslogtreecommitdiff
path: root/sbuild/sbuild-util.cc
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@debian.org>2006-06-25 12:55:50 +0000
committerRoger Leigh <rleigh@debian.org>2006-06-25 12:55:50 +0000
commitf6129f4635829f96a77f2f746dbe7734a7402b68 (patch)
tree77f7668c9244714ba05b6c1cafc20ace12006d13 /sbuild/sbuild-util.cc
parent0646350794d79022afe1251d655ea17546392df7 (diff)
downloadschroot-f6129f4635829f96a77f2f746dbe7734a7402b68.tar.gz
* NEWS: Document strict absolute path checks.
* sbuild/sbuild-chroot-config.cc (parse_data): Catch and report chroot deserialisation errors. * sbuild/sbuild-chroot-plain.cc (set_keyfile): "location" must be absolute. * sbuild/sbuild-chroot-file.cc (set_keyfile): "file" must be absolute. * sbuild/sbuild-chroot.cc (set_keyfile): "mount-device" and "mount-location" must be absolute. * sbuild/sbuild-chroot-lvm-snapshot.cc (set_keyfile): "lvm-snapshot-device" must be absolute. * sbuild/sbuild-chroot-block-device.cc (get_location): Remove unused function (set_location): Remove unused function (get_keyfile): Remove "location". (set_keyfile): Obsolete "location". "device" must be absolute. * sbuild/sbuild-chroot.h (sbuild): Add DEVICE_ABS, FILE_ABS and LOCATION_ABS error codes. * sbuild/sbuild-keyfile.cc (check_priority): Add missing break in switch. * dchroot-dsa/dchroot-dsa-session.cc (get_user_command): Throw a COMMAND_ABS error if the command is not absolute. * sbuild/sbuild-session.(cc|h): Add a COMMAND_ABS error code. * dchroot-dsa/dchroot-dsa-options.cc (check_options): Throw an error if the command is not an absolute path. This optimisation means a session is not set up if it is already known it will fail. * sbuild/sbuild-util.cc (is_absname): New function. This checks if a path is absolute.
Diffstat (limited to 'sbuild/sbuild-util.cc')
-rw-r--r--sbuild/sbuild-util.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sbuild/sbuild-util.cc b/sbuild/sbuild-util.cc
index c0b1e141..a6b1ab20 100644
--- a/sbuild/sbuild-util.cc
+++ b/sbuild/sbuild-util.cc
@@ -121,6 +121,15 @@ sbuild::normalname (std::string name,
return remove_duplicates(name, separator);
}
+bool
+sbuild::is_absname (std::string const& name)
+{
+ if (name.empty() || name[0] != '/')
+ return false;
+ else
+ return true;
+}
+
std::string
sbuild::string_list_to_string (sbuild::string_list const& list,
std::string const& separator)