Commit ae160475 authored by Colin Walters's avatar Colin Walters Committed by Bastien Nocera
Browse files

Don't use access() to check for writability

The gnome-ostree build system uses a FUSE mount to access disk images
as non-root.  The files appear to be owned by root, but are actually
modifable by the build user.  Unfortunately, the access() system call
is unaware of this, and will error out.

An earlier patch changed the xml save error to write out a "please
run me as root" notification, so we'll still have the hint.

https://bugs.freedesktop.org/show_bug.cgi?id=61472
parent bc765818
...@@ -3572,13 +3572,6 @@ int main(int argc, char **argv) ...@@ -3572,13 +3572,6 @@ int main(int argc, char **argv)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (access(mime_dir, W_OK))
{
g_warning(_("%s: I don't have write permission on %s. "
"Try rerunning me as root."), argv[0], mime_dir);
return EXIT_FAILURE;
}
g_message("Updating MIME database in %s...\n", mime_dir); g_message("Updating MIME database in %s...\n", mime_dir);
if (access(package_dir, F_OK)) if (access(package_dir, F_OK))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment