How to set file permissions in Init task?

OUTWATER ~ KEITH J /5G3110 vac4050 at cae597.rsc.raytheon.com
Thu Jan 25 22:16:24 UTC 2001


Joel - 
I was doing everything right except for this: chmod("/tmp", 0x777);

I should have known better.  chmod("/tmp", S_IRWXU | S_IRWXG | S_IRWXO);

works fine.

Keith


> OUTWATER ~ KEITH J /5G3110 wrote:
> > 
> > Greetings all -
> > 
> > I use Untar_Frommemory() to set up an initial file system which includes a
> > "/tmp" directory.
> > 
> > I am attempting to make this directory read/write by everyone in the Init 
task,
> > but chmod() fails (not owner).
> > 
> > Where, then, is the right place to set this permission?
> 
> Before you create the tar image.   My thinking is that the image on your
> local disk before you tar is exactly what you want to untar, permissions
> included.  There might be some tricks with seteuid() or something to make
> this work out easier.  I would not expect you to need to change permissions
> after untar'ing.
> 
> > Thanks!
> > 
> > Keith
> > 
> > Keith Outwater
> > Principal Engineer
> > Raytheon Missile Systems
> > Tucson, AZ
> > 
> > (520) 794-2518
> > vac4050 at nospam.cae597.rsc.raytheon.com
> 
> -- 
> Joel Sherrill, Ph.D.             Director of Research & Development
> joel at OARcorp.com                 On-Line Applications Research
> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
> Support Available                (256) 722-9985
> 


More information about the users mailing list