Changeset 93019 in vbox for trunk/src/VBox/Runtime/r3/posix
- Timestamp:
- Dec 17, 2021 2:52:57 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 149013
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/localipc-posix.cpp
r92679 r93019 55 55 #include <signal.h> 56 56 #include <unistd.h> 57 #include <sys/stat.h> 57 58 58 59 #include "internal/magics.h" … … 270 271 Log(("RTLocalIpcServerCreate: failed, rc=%Rrc\n", rc)); 271 272 return rc; 273 } 274 275 276 277 RTDECL(int) RTLocalIpcServerGrantGroupAccess(RTLOCALIPCSERVER hServer, RTGID gid) 278 { 279 PRTLOCALIPCSERVERINT pThis = (PRTLOCALIPCSERVERINT)hServer; 280 281 AssertReturn(pThis, VERR_INVALID_PARAMETER); 282 AssertReturn(pThis->Name.sun_path, VERR_INVALID_PARAMETER); 283 284 if (chown(pThis->Name.sun_path, -1, gid) == 0) 285 { 286 if (chmod(pThis->Name.sun_path, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) == 0) 287 { 288 LogRel(("RTLocalIpcServerGrantGroupAccess: IPC socket %s access has been granted to group %RTgid\n", 289 pThis->Name.sun_path, gid)); 290 291 return VINF_SUCCESS; 292 } 293 else 294 LogRel(("RTLocalIpcServerGrantGroupAccess: cannot grant IPC socket %s write permission to group %RTgid, rc=%Rrc\n", 295 pThis->Name.sun_path, gid, RTErrConvertFromErrno(errno))); 296 } 297 else 298 LogRel(("RTLocalIpcServerGrantGroupAccess: cannot change IPC socket %s group ownership to %RTgid, rc=%Rrc\n", 299 pThis->Name.sun_path, gid, RTErrConvertFromErrno(errno))); 300 301 return VERR_ACCESS_DENIED; 272 302 } 273 303
Note:
See TracChangeset
for help on using the changeset viewer.