1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/servers/openpts/ptsc.patch
2015-08-11 13:38:58 +02:00

29 lines
782 B
Diff

diff -urNp openpts-0.2.6-patched/src/ptsc.c openpts-0.2.6-current/src/ptsc.c
--- openpts-0.2.6-patched/src/ptsc.c 2012-08-21 15:57:07.733841433 -0400
+++ openpts-0.2.6-current/src/ptsc.c 2012-08-21 16:13:26.479732504 -0400
@@ -457,7 +457,10 @@ void ptsc_lock(void) {
exit(1);
}
oldgrp = getegid();
- setegid(grp.gr_gid);
+ if(setegid(grp.gr_gid) != 0){
+ LOG(LOG_ERR, "setegid fail");
+ exit(1);
+ }
}
oldmask = umask(0);
@@ -467,7 +470,10 @@ void ptsc_lock(void) {
}
if (grpent) {
chmod(LOCK_DIR, 02775);
- setegid(oldgrp);
+ if(setegid(oldgrp) != 0){
+ LOG(LOG_ERR, "setegid fail");
+ exit(1);
+ }
}
fd = open(LOCK_FILE, O_RDWR | O_CREAT | O_TRUNC, 0660);
if (fd < 0) {