From e29f7b22ea16e3b4a64567229bd21cbb56e9b826 Mon Sep 17 00:00:00 2001 From: David Hill Date: Sun, 20 Nov 2016 00:10:21 +0000 Subject: [PATCH] fix non-root fstab permission issue --- oamapps/postConfigure/postConfigure.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index 0a103c591..8b049f363 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -4981,7 +4981,12 @@ void setSystemName() */ bool copyFstab(string moduleName) { - string cmd = "/bin/cp -f /etc/fstab " + installDir + "/local/etc/" + moduleName + "/. > /dev/null 2>&1"; + string cmd; + if ( rootUser) + cmd = "/bin/cp -f /etc/fstab " + installDir + "/local/etc/" + moduleName + "/. > /dev/null 2>&1"; + else + cmd = "/sudo bin/cp -f /etc/fstab " + installDir + "/local/etc/" + moduleName + "/. > /dev/null 2>&1"; + system(cmd.c_str()); return true;