You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set_xva_bridge: set owner and permissions in tar command
Erase the output archive members' owner and permissions directly through
tar command line. Make extracted temp files readable with chmod to
avoid using sudo for reading input files.
Signed-off-by: Tu Dinh <[email protected]>
Copy file name to clipboardExpand all lines: scripts/set_xva_bridge.sh
+4-8Lines changed: 4 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -105,10 +105,10 @@ else
105
105
exit 1
106
106
fi
107
107
108
+
chmod -R u+rX "${TMPFOLDER}"
109
+
108
110
if [ -e"${TMPFOLDER}/ova.xml" ];then
109
-
chmod +rw "${TMPFOLDER}/ova.xml"
110
-
sed -i "s/<member><name>bridge<\/name><value>[^<]*<\/value><\/member>/<member><name>bridge<\/name><value>${BRIDGE_VALUE}<\/value><\/member>/g"${TMPFOLDER}/ova.xml
111
-
chmod -rw "${TMPFOLDER}/ova.xml"
111
+
sed -i "s/<member><name>bridge<\/name><value>[^<]*<\/value><\/member>/<member><name>bridge<\/name><value>${BRIDGE_VALUE}<\/value><\/member>/g""${TMPFOLDER}/ova.xml"
112
112
else
113
113
echo"Error: File ova.xml not found during the sed."
114
114
exit 1
@@ -118,15 +118,11 @@ fi
118
118
# save first file
119
119
mv "${XVA_NAME}""${XVA_NAME}.save"
120
120
121
-
# create xva
122
-
cd"${TMPFOLDER}"
123
-
124
121
# Create the new XVA
125
-
sudo tar -cv --${COMPRESS_METHOD} -f ${XVA_NAME} --no-recursion -T ${TMP_LIST}
0 commit comments