Ignore:
Timestamp:
May 29, 2008, 12:22:03 PM (17 years ago)
Author:
Paul Smedley
Message:

Update trunk to 3.2.0rc1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samba/source/printing/nt_printing.c

    r133 r136  
    7171        SERVER_EXECUTE,
    7272        SERVER_ALL_ACCESS
     73};
     74
     75/* Map generic permissions to job object specific permissions */
     76
     77const struct generic_mapping job_generic_mapping = {
     78        JOB_READ,
     79        JOB_WRITE,
     80        JOB_EXECUTE,
     81        JOB_ALL_ACCESS
    7382};
    7483
     
    49935002{
    49945003        int i = 0;
    4995        
     5004
    49965005        if ( !info )
    49975006                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
    49995013        if ( strequal(file, info->driverpath) )
    50005014                return True;
     
    51095123  Upon return, *info has been modified to only contain the driver files
    51105124  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.
    51115131****************************************************************************/
    51125132
     
    51185138        fstring                         *list = NULL;
    51195139        NT_PRINTER_DRIVER_INFO_LEVEL    driver;
    5120        
     5140        bool in_use = false;
     5141
    51215142        if ( !info )
    51225143                return False;
     
    51535174                if ( !strequal(info->name, driver.info_3->name) ) {
    51545175                        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;
    51585180                        }
    51595181                }
     
    51715193                dump_a_printer_driver( driver, 3 );
    51725194
    5173         return False;
     5195        return in_use;
    51745196}
    51755197
     
    57075729}
    57085730
     5731void 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
    57095742/****************************************************************************
    57105743 Check a user has permissions to perform the given operation.  We use the
     
    57885821                }
    57895822
    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
    57995828        /* Check access */
    5800        
    5801         map_printer_permissions(secdesc->sd);
    5802 
    58035829        result = se_access_check(secdesc->sd, user->nt_user_token, access_type,
    58045830                                 &access_granted, &status);
Note: See TracChangeset for help on using the changeset viewer.