- Timestamp:
- Apr 23, 2007, 2:25:01 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/fedora/ref-prepatch/suexec.c
r33 r296 96 96 /* variable name starts with */ 97 97 "HTTP_", 98 "HTTPS_",99 98 "SSL_", 100 99 … … 142 141 "USER_NAME=", 143 142 "TZ=", 144 "PHPRC=",145 143 NULL 146 144 }; … … 516 514 } 517 515 } 518 char *expected = malloc(strlen(target_homedir)+strlen(AP_USERDIR_SUFFIX)+1);519 sprintf(expected, "%s/%s", target_homedir, AP_USERDIR_SUFFIX);520 if ((strncmp(cwd, expected, strlen(expected))) != 0) {521 log_err("error: file's directory not a subdirectory of user's home directory (%s, %s)\n", cwd, expected);522 exit(114);523 }524 516 525 517 if ((strncmp(cwd, dwd, strlen(dwd))) != 0) { … … 539 531 * Error out if cwd is writable by others. 540 532 */ 541 #if 0542 533 if ((dir_info.st_mode & S_IWOTH) || (dir_info.st_mode & S_IWGRP)) { 543 534 log_err("directory is writable by others: (%s)\n", cwd); 544 535 exit(116); 545 536 } 546 #endif547 537 548 538 /* 549 539 * Error out if we cannot stat the program. 550 540 */ 551 if (((lstat(cmd, &prg_info)) != 0) /*|| (S_ISLNK(prg_info.st_mode))*/) {541 if (((lstat(cmd, &prg_info)) != 0) || (S_ISLNK(prg_info.st_mode))) { 552 542 log_err("cannot stat program: (%s)\n", cmd); 553 543 exit(117); … … 557 547 * Error out if the program is writable by others. 558 548 */ 559 #if 0560 549 if ((prg_info.st_mode & S_IWOTH) || (prg_info.st_mode & S_IWGRP)) { 561 550 log_err("file is writable by others: (%s/%s)\n", cwd, cmd); 562 551 exit(118); 563 552 } 564 #endif565 553 566 554 /* … … 576 564 * the name/group of the cwd or the program. 577 565 */ 578 #if 0579 566 if ((uid != dir_info.st_uid) || 580 567 (gid != dir_info.st_gid) || … … 588 575 exit(120); 589 576 } 590 #endif591 577 /* 592 578 * Error out if the program is not executable for the user.
Note: See TracChangeset
for help on using the changeset viewer.