|
Lines 80-86
string MCOPUtils::createFilePath(string
Link Here
|
| 80 |
// S. Voitzsch Sebastian.Voitzsch@web.de |
80 |
// S. Voitzsch Sebastian.Voitzsch@web.de |
| 81 |
// 2002-12-03 |
81 |
// 2002-12-03 |
| 82 |
struct passwd *pwd = NULL; |
82 |
struct passwd *pwd = NULL; |
| 83 |
pwd = getpwuid(geteuid()); |
83 |
uid_t uid = geteuid(); |
|
|
84 |
pwd = getpwuid(uid); |
| 84 |
if (pwd == NULL) |
85 |
if (pwd == NULL) |
| 85 |
arts_fatal("could not get user name from user id"); |
86 |
arts_fatal("could not get user name from user id"); |
| 86 |
|
87 |
|
|
Lines 95-101
string MCOPUtils::createFilePath(string
Link Here
|
| 95 |
if(lstat(tmpdir.c_str(),&st) != 0) |
96 |
if(lstat(tmpdir.c_str(),&st) != 0) |
| 96 |
arts_fatal("can't stat %s (%s)", tmpdir.c_str(),strerror(errno)); |
97 |
arts_fatal("can't stat %s (%s)", tmpdir.c_str(),strerror(errno)); |
| 97 |
|
98 |
|
| 98 |
if (st.st_uid != getuid ()) |
99 |
if (st.st_uid != uid) |
| 99 |
arts_fatal("%s is not owned by user", tmpdir.c_str()); |
100 |
arts_fatal("%s is not owned by user", tmpdir.c_str()); |
| 100 |
|
101 |
|
| 101 |
if(st.st_mode & 0077) |
102 |
if(st.st_mode & 0077) |