Drop support for fifos and devices

While the first was useful way back in the day when we were importing
Debian bits and /sbin/init was expecting to find /dev/.initctl as a
named pipe, that's no longer an issue with systemd since it uses
dynamic Unix sockets.

Likewise, character and block devices in /dev are now dynamically
created by the devtmpfs from the kernel.

Less complexity and code here if we just support directories, regular
files, and symbolic links.
This commit is contained in:
Colin Walters 2013-07-16 09:35:44 -04:00
parent 8724565291
commit 62a896350b
2 changed files with 1 additions and 39 deletions

View File

@ -1117,14 +1117,6 @@ ostree_file_header_parse (GVariant *metadata,
{
g_file_info_set_attribute_byte_string (ret_file_info, "standard::symlink-target", symlink_target);
}
else if (S_ISCHR (mode) || S_ISBLK (mode))
{
g_file_info_set_attribute_uint32 (ret_file_info, "unix::rdev", rdev);
}
else if (S_ISFIFO (mode))
{
;
}
else
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
@ -1178,14 +1170,6 @@ ostree_zlib_file_header_parse (GVariant *metadata,
{
g_file_info_set_attribute_byte_string (ret_file_info, "standard::symlink-target", symlink_target);
}
else if (S_ISCHR (mode) || S_ISBLK (mode))
{
g_file_info_set_attribute_uint32 (ret_file_info, "unix::rdev", rdev);
}
else if (S_ISFIFO (mode))
{
;
}
else
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
@ -1259,23 +1243,6 @@ ostree_create_file_from_input (GFile *dest_file,
goto out;
}
}
else if (S_ISCHR (mode) || S_ISBLK (mode))
{
guint32 dev = g_file_info_get_attribute_uint32 (finfo, "unix::rdev");
if (mknod (dest_path, mode, dev) < 0)
{
ot_util_set_error_from_errno (error, errno);
goto out;
}
}
else if (S_ISFIFO (mode))
{
if (mkfifo (dest_path, mode) < 0)
{
ot_util_set_error_from_errno (error, errno);
goto out;
}
}
else
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
@ -1625,11 +1592,7 @@ ostree_validate_structureof_file_mode (guint32 mode,
{
gboolean ret = FALSE;
if (!(S_ISREG (mode)
|| S_ISLNK (mode)
|| S_ISCHR (mode)
|| S_ISBLK (mode)
|| S_ISFIFO (mode)))
if (!(S_ISREG (mode) || S_ISLNK (mode)))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Invalid file metadata mode %u; not a valid file type", mode);

View File

@ -103,7 +103,6 @@ setup_test_repository () {
$OSTREE commit -b test2 -s "Test Commit 1" -m "Commit body first"
mkdir baz
mkfifo baz/afifo # named pipe
echo moo > baz/cow
echo alien > baz/saucer
mkdir baz/deeper