python - os.chroot Operation not permitted -


i'm trying write python script generate debian package. i'm generating required folder structure in temporary folder. in order change uid , gid of /usr , subfolders root thought of using chroot.

however, on line

os.chroot(tmpdir) 

i get:

oserror: [errno 1] operation not permitted: '/tmp/tmpvntqw7/myproj' 

i've tried mini-tutorial same results: http://www.tutorialspoint.com/python/os_chroot.htm

why be? thanks

chroot() can done root.

do 1 of these:

  1. run script sudo

  2. make script setuid root, , setuid(geteuid()) equivalent python magic


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -