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 !=
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
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;
}
游俊德 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;
>