Commit 4484e6f8 by Stéphane Graber Committed by GitHub

Merge pull request #1379 from brauner/2017-01-04/fix_android

tools: only check for O_RDONLY
parents 4d690b8c 37180208
......@@ -396,7 +396,7 @@ int main(int argc, char *argv[])
lxc_log_options_no_override();
if (geteuid()) {
if (access(my_args.lxcpath[0], O_RDWR) < 0) {
if (access(my_args.lxcpath[0], O_RDONLY) < 0) {
if (!my_args.quiet)
fprintf(stderr, "You lack access to %s\n", my_args.lxcpath[0]);
exit(EXIT_FAILURE);
......
......@@ -184,7 +184,7 @@ int main(int argc, char *argv[])
lxc_log_options_no_override();
if (geteuid()) {
if (access(my_args.lxcpath[0], O_RDWR) < 0) {
if (access(my_args.lxcpath[0], O_RDONLY) < 0) {
if (!my_args.quiet)
fprintf(stderr, "You lack access to %s\n", my_args.lxcpath[0]);
exit(ret);
......
......@@ -252,7 +252,7 @@ int main(int argc, char *argv[])
if (mkdir_p(my_args.lxcpath[0], 0755)) {
exit(EXIT_FAILURE);
}
if (access(my_args.lxcpath[0], O_RDWR) < 0) {
if (access(my_args.lxcpath[0], O_RDONLY) < 0) {
fprintf(stderr, "You lack access to %s\n", my_args.lxcpath[0]);
exit(EXIT_FAILURE);
}
......
......@@ -95,7 +95,7 @@ int main(int argc, char *argv[])
lxc_log_options_no_override();
if (geteuid()) {
if (access(my_args.lxcpath[0], O_RDWR) < 0) {
if (access(my_args.lxcpath[0], O_RDONLY) < 0) {
fprintf(stderr, "You lack access to %s\n",
my_args.lxcpath[0]);
exit(EXIT_FAILURE);
......
......@@ -231,7 +231,7 @@ int main(int argc, char *argv[])
exit(err);
lxc_log_options_no_override();
if (access(my_args.lxcpath[0], O_RDWR) < 0) {
if (access(my_args.lxcpath[0], O_RDONLY) < 0) {
if (!my_args.quiet)
fprintf(stderr, "You lack access to %s\n", my_args.lxcpath[0]);
exit(err);
......
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