diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-04-20 18:29:57 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-04-20 18:29:57 +0000 |
commit | c1ceb8df6e9dda450c68e2e75999d1aac49530e9 (patch) | |
tree | a867ccc8c115c9870c18e8797971e30518f33d51 /usr.sbin/rpc.pcnfsd/pcnfsd_print.c | |
parent | f40416b64320c60dc8bb5471c04a65a8788387b5 (diff) |
According to the CA-96.08 (Vulnerability in PCNFSD)
apply the patch they support.
Diffstat (limited to 'usr.sbin/rpc.pcnfsd/pcnfsd_print.c')
-rw-r--r-- | usr.sbin/rpc.pcnfsd/pcnfsd_print.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/rpc.pcnfsd/pcnfsd_print.c b/usr.sbin/rpc.pcnfsd/pcnfsd_print.c index 7aa4cb5acb7..397805f2bff 100644 --- a/usr.sbin/rpc.pcnfsd/pcnfsd_print.c +++ b/usr.sbin/rpc.pcnfsd/pcnfsd_print.c @@ -156,6 +156,7 @@ char**sp; { int dir_mode = 0777; int rc; +mode_t oldmask; *sp = &pathname[0]; pathname[0] = '\0'; @@ -166,11 +167,11 @@ int rc; /* get pathname of current directory and return to client */ (void)sprintf(pathname,"%s/%s",sp_name, sys); + oldmask = umask(0); (void)mkdir(sp_name, dir_mode); /* ignore the return code */ - (void)chmod(sp_name, dir_mode); rc = mkdir(pathname, dir_mode); /* DON'T ignore this return code */ + umask(oldmak); if((rc < 0 && errno != EEXIST) || - (chmod(pathname, dir_mode) != 0) || (stat(pathname, &statbuf) != 0) || !(statbuf.st_mode & S_IFDIR)) { (void)sprintf(tempstr, @@ -313,7 +314,10 @@ char scratch[512]; ** filter with the appropriate arguments. **------------------------------------------------------ */ - (void)run_ps630(new_pathname, opts); + (void)sprintf(tempstr, + "rpc.pcnfsd: ps630 filter disabled for %s\n", pathname); + msg_out(tmpstr); + return(PS_RES_FAIL); } /* ** Try to match to an aliased printer |