In case mic compresses the image by tarfile module,it might fail
by pwd.getpwuid blocking; to avoid this,mic takes a comfirm for
user id from pwd.getpwuid after comfirming root permission.
Fixes: #1207
Change-Id: Iaa6a886936d5d6d60ba3b21608fa81d9f4c1a238
# Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import os, sys, re
+import pwd
from optparse import SUPPRESS_HELP
from mic import msger, rt_util
if os.geteuid() != 0:
raise msger.error("Root permission is required, abort")
+ try:
+ w = pwd.getpwuid(os.geteuid())
+ except KeyError:
+ msger.warning("Might fail in compressing stage for undetermined user")
+
return argv
def do_auto(self, subcmd, opts, *args):