Re: Question about shm_open and sem_open

2015-12-10 Thread Jeunder Yu
2015年11月20日 下午2:46於 "Ted Unangst" 寫道: > > 游俊德 wrote: > > Hello, > > > > I have a question about source code of shm_open and sem_open functions. > > > > int > > shm_open(const char *path, int flags, mode_t mode) > > { > > (skipped) > > > > if (sb,st_uid !=

Re: Question about shm_open and sem_open

2015-12-10 Thread Ted Unangst
Jeunder Yu wrote: > > geteuid may be better. though i would hope the difference doesn't matter. > > The difference is very important for me. > > In my application, I am root and change to different uid, create semaphore > and share memory, make some hand sharking to client app with different

Question about shm_open and sem_open

2015-11-19 Thread 游俊德
Hello, I have a question about source code of shm_open and sem_open functions. int shm_open(const char *path, int flags, mode_t mode) { (skipped) if (sb,st_uid != getuid()) { close(fd); errno = EPERM; return -1; }

Re: Question about shm_open and sem_open

2015-11-19 Thread Ted Unangst
游俊德 wrote: > Hello, > > I have a question about source code of shm_open and sem_open functions. > > int > shm_open(const char *path, int flags, mode_t mode) > { > (skipped) > > if (sb,st_uid != getuid()) { > close(fd); >errno = EPERM; >