| | 115 | #if 0 |
|---|
| | 116 | #ifdef VBOX |
|---|
| | 117 | // |
|---|
| | 118 | // Security checks |
|---|
| | 119 | // |
|---|
| | 120 | struct stat st; |
|---|
| | 121 | if (stat(baseDir, &st) == -1) |
|---|
| | 122 | { |
|---|
| | 123 | printf("Cannot stat '%s'.\n", baseDir); |
|---|
| | 124 | return ELockFileOwner; |
|---|
| | 125 | } |
|---|
| | 126 | |
|---|
| | 127 | if (st.st_uid != getuid() && st.st_uid != geteuid()) |
|---|
| | 128 | { |
|---|
| | 129 | printf("Wrong owner (%d) of '%s'.\n", st.st_uid, baseDir); |
|---|
| | 130 | return ELockFileOwner; |
|---|
| | 131 | } |
|---|
| | 132 | |
|---|
| | 133 | if (st.st_mode != (__S_IREAD | __S_IWRITE | __S_IEXEC | __S_IFDIR)) |
|---|
| | 134 | { |
|---|
| | 135 | printf("Wrong mode (%o) of '%s'.\n", st.st_mode, baseDir); |
|---|
| | 136 | return ELockFileOwner; |
|---|
| | 137 | } |
|---|
| | 138 | #endif |
|---|
| | 139 | #endif |
|---|
| | 140 | |
|---|
| | 154 | |
|---|
| | 155 | #if 0 |
|---|
| | 156 | #ifdef VBOX |
|---|
| | 157 | // |
|---|
| | 158 | // Security checks |
|---|
| | 159 | // |
|---|
| | 160 | if (fstat(ipcLockFD, &st) == -1) |
|---|
| | 161 | { |
|---|
| | 162 | printf("Cannot stat '%s'.\n", lockFile); |
|---|
| | 163 | free(lockFile); |
|---|
| | 164 | return ELockFileOwner; |
|---|
| | 165 | } |
|---|
| | 166 | |
|---|
| | 167 | if (st.st_uid != getuid() && st.st_uid != geteuid()) |
|---|
| | 168 | { |
|---|
| | 169 | printf("Wrong owner (%d) of '%s'.\n", st.st_uid, lockFile); |
|---|
| | 170 | free(lockFile); |
|---|
| | 171 | return ELockFileOwner; |
|---|
| | 172 | } |
|---|
| | 173 | |
|---|
| | 174 | if (st.st_mode != (__S_IREAD | __S_IWRITE | __S_IFREG)) |
|---|
| | 175 | { |
|---|
| | 176 | printf("Wrong mode (%o) of '%s'.\n", st.st_mode, lockFile); |
|---|
| | 177 | free(lockFile); |
|---|
| | 178 | return ELockFileOwner; |
|---|
| | 179 | } |
|---|
| | 180 | |
|---|
| | 181 | free(lockFile); |
|---|
| | 182 | #endif |
|---|
| | 183 | #endif |
|---|