Changeset 136 for trunk/samba/source/printing/nt_printing.c
- Timestamp:
- May 29, 2008, 12:22:03 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/samba/source/printing/nt_printing.c
r133 r136 71 71 SERVER_EXECUTE, 72 72 SERVER_ALL_ACCESS 73 }; 74 75 /* Map generic permissions to job object specific permissions */ 76 77 const struct generic_mapping job_generic_mapping = { 78 JOB_READ, 79 JOB_WRITE, 80 JOB_EXECUTE, 81 JOB_ALL_ACCESS 73 82 }; 74 83 … … 4993 5002 { 4994 5003 int i = 0; 4995 5004 4996 5005 if ( !info ) 4997 5006 return False; 4998 5007 5008 /* mz: skip files that are in the list but already deleted */ 5009 if (!file || !file[0]) { 5010 return false; 5011 } 5012 4999 5013 if ( strequal(file, info->driverpath) ) 5000 5014 return True; … … 5109 5123 Upon return, *info has been modified to only contain the driver files 5110 5124 which are not in use 5125 5126 Fix from mz: 5127 5128 This needs to check all drivers to ensure that all files in use 5129 have been removed from *info, not just the ones in the first 5130 match. 5111 5131 ****************************************************************************/ 5112 5132 … … 5118 5138 fstring *list = NULL; 5119 5139 NT_PRINTER_DRIVER_INFO_LEVEL driver; 5120 5140 bool in_use = false; 5141 5121 5142 if ( !info ) 5122 5143 return False; … … 5153 5174 if ( !strequal(info->name, driver.info_3->name) ) { 5154 5175 if ( trim_overlap_drv_files(info, driver.info_3) ) { 5155 free_a_printer_driver(driver, 3); 5156 SAFE_FREE( list ); 5157 return True; 5176 /* mz: Do not instantly return - 5177 * we need to ensure this file isn't 5178 * also in use by other drivers. */ 5179 in_use = true; 5158 5180 } 5159 5181 } … … 5171 5193 dump_a_printer_driver( driver, 3 ); 5172 5194 5173 return False;5195 return in_use; 5174 5196 } 5175 5197 … … 5707 5729 } 5708 5730 5731 void map_job_permissions(SEC_DESC *sd) 5732 { 5733 int i; 5734 5735 for (i = 0; sd->dacl && i < sd->dacl->num_aces; i++) { 5736 se_map_generic(&sd->dacl->aces[i].access_mask, 5737 &job_generic_mapping); 5738 } 5739 } 5740 5741 5709 5742 /**************************************************************************** 5710 5743 Check a user has permissions to perform the given operation. We use the … … 5788 5821 } 5789 5822 5790 /* Now this is the bit that really confuses me. The access 5791 type needs to be changed from JOB_ACCESS_ADMINISTER to 5792 PRINTER_ACCESS_ADMINISTER for this to work. Something 5793 to do with the child (job) object becoming like a 5794 printer?? -tpot */ 5795 5796 access_type = PRINTER_ACCESS_ADMINISTER; 5797 } 5798 5823 map_job_permissions(secdesc->sd); 5824 } else { 5825 map_printer_permissions(secdesc->sd); 5826 } 5827 5799 5828 /* Check access */ 5800 5801 map_printer_permissions(secdesc->sd);5802 5803 5829 result = se_access_check(secdesc->sd, user->nt_user_token, access_type, 5804 5830 &access_granted, &status);
Note:
See TracChangeset
for help on using the changeset viewer.