Ignore:
Timestamp:
Nov 27, 2012, 4:56:06 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated vendor to 3.6.9

Location:
vendor/current/source3/rpc_server
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/rpc_server/lsa/srv_lsa_nt.c

    r740 r746  
    24492449        struct security_descriptor *psd;
    24502450        size_t sd_size;
     2451        uint32_t owner_access = (LSA_ACCOUNT_ALL_ACCESS &
     2452                        ~(LSA_ACCOUNT_ADJUST_PRIVILEGES|
     2453                        LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS|
     2454                        SEC_STD_DELETE));
    24512455
    24522456        /* find the connection policy handle. */
     
    24742478        status = make_lsa_object_sd(p->mem_ctx, &psd, &sd_size,
    24752479                                    &lsa_account_mapping,
    2476                                     r->in.sid, LSA_POLICY_ALL_ACCESS);
     2480                                    r->in.sid, owner_access);
    24772481        if (!NT_STATUS_IS_OK(status)) {
    24782482                return status;
     
    25152519        uint32_t des_access = r->in.access_mask;
    25162520        uint32_t acc_granted;
     2521        uint32_t owner_access = (LSA_ACCOUNT_ALL_ACCESS &
     2522                        ~(LSA_ACCOUNT_ADJUST_PRIVILEGES|
     2523                        LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS|
     2524                        SEC_STD_DELETE));
    25172525        NTSTATUS status;
    25182526
     
    25392547        status = make_lsa_object_sd(p->mem_ctx, &psd, &sd_size,
    25402548                                &lsa_account_mapping,
    2541                                 r->in.sid, LSA_ACCOUNT_ALL_ACCESS);
     2549                                r->in.sid, owner_access);
    25422550        if (!NT_STATUS_IS_OK(status)) {
    25432551                return status;
     
    28872895        status = make_lsa_object_sd(p->mem_ctx, &psd, &sd_size,
    28882896                                &lsa_account_mapping,
    2889                                 r->in.sid, LSA_ACCOUNT_ALL_ACCESS);
     2897                                NULL, 0);
    28902898        if (!NT_STATUS_IS_OK(status)) {
    28912899                return status;
     
    29582966        status = make_lsa_object_sd(p->mem_ctx, &psd, &sd_size,
    29592967                                &lsa_account_mapping,
    2960                                 r->in.sid, LSA_ACCOUNT_ALL_ACCESS);
     2968                                NULL, 0);
    29612969        if (!NT_STATUS_IS_OK(status)) {
    29622970                return status;
  • vendor/current/source3/rpc_server/netlogon/srv_netlog_nt.c

    r740 r746  
    11211121        }
    11221122
     1123        become_root();
    11231124        status = samr_find_machine_account(mem_ctx,
    11241125                                           h,
     
    11281129                                           NULL,
    11291130                                           &user_handle);
     1131        unbecome_root();
    11301132        if (!NT_STATUS_IS_OK(status)) {
    11311133                goto out;
     
    11711173        info->info18 = info18;
    11721174
     1175        become_root();
    11731176        status = dcerpc_samr_SetUserInfo2(h,
    11741177                                          mem_ctx,
     
    11771180                                          info,
    11781181                                          &result);
     1182        unbecome_root();
    11791183        if (!NT_STATUS_IS_OK(status)) {
    11801184                goto out;
     
    12481252{
    12491253        NTSTATUS status;
    1250         struct netlogon_creds_CredentialState *creds;
     1254        struct netlogon_creds_CredentialState *creds = NULL;
    12511255        DATA_BLOB plaintext;
    12521256        struct samr_CryptPassword password_buf;
     
    12621266
    12631267        if (!NT_STATUS_IS_OK(status)) {
     1268                const char *computer_name = "<unknown>";
     1269
     1270                if (creds && creds->computer_name) {
     1271                        computer_name = creds->computer_name;
     1272                }
    12641273                DEBUG(2,("_netr_ServerPasswordSet2: netlogon_creds_server_step "
    12651274                        "failed. Rejecting auth request from client %s machine account %s\n",
    1266                         r->in.computer_name, creds->computer_name));
     1275                        r->in.computer_name, computer_name));
    12671276                TALLOC_FREE(creds);
    12681277                return status;
     
    12741283
    12751284        if (!extract_pw_from_buffer(p->mem_ctx, password_buf.data, &plaintext)) {
     1285                TALLOC_FREE(creds);
    12761286                return NT_STATUS_WRONG_PASSWORD;
    12771287        }
     
    12841294                                                   creds->account_name,
    12851295                                                   &nt_hash);
     1296        TALLOC_FREE(creds);
    12861297        return status;
    12871298}
  • vendor/current/source3/rpc_server/samr/srv_samr_nt.c

    r740 r746  
    28252825
    28262826        must_change_time = pdb_get_pass_must_change_time(pw);
    2827         if (must_change_time == get_time_t_max()) {
     2827        if (pdb_is_password_change_time_max(must_change_time)) {
    28282828                unix_to_nt_time_abs(&force_password_change, must_change_time);
    28292829        } else {
  • vendor/current/source3/rpc_server/spoolss/srv_spoolss_nt.c

    r740 r746  
    296296        if (prn_hnd->notify.cli_chan) {
    297297                prn_hnd->notify.cli_chan->active_connections--;
     298                prn_hnd->notify.cli_chan = NULL;
    298299        }
    299300}
     
    20422043};
    20432044
     2045static const int drv_cversion[] = {SPOOLSS_DRIVER_VERSION_9X,
     2046                                   SPOOLSS_DRIVER_VERSION_NT35,
     2047                                   SPOOLSS_DRIVER_VERSION_NT4,
     2048                                   SPOOLSS_DRIVER_VERSION_200X,
     2049                                   -1};
     2050
    20442051static int get_version_id(const char *arch)
    20452052{
     
    20642071
    20652072        struct spoolss_DriverInfo8 *info = NULL;
    2066         struct spoolss_DriverInfo8 *info_win2k = NULL;
    20672073        int                             version;
    20682074        WERROR                          status;
    20692075        struct dcerpc_binding_handle *b;
     2076        TALLOC_CTX *tmp_ctx = NULL;
     2077        int i;
     2078        bool found;
    20702079
    20712080        /* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege,
     
    20892098                return WERR_INVALID_ENVIRONMENT;
    20902099
    2091         status = winreg_printer_binding_handle(p->mem_ctx,
     2100        tmp_ctx = talloc_new(p->mem_ctx);
     2101        if (!tmp_ctx) {
     2102                return WERR_NOMEM;
     2103        }
     2104
     2105        status = winreg_printer_binding_handle(tmp_ctx,
    20922106                                               get_session_info_system(),
    20932107                                               p->msg_ctx,
    20942108                                               &b);
    20952109        if (!W_ERROR_IS_OK(status)) {
    2096                 return status;
    2097         }
    2098 
    2099         status = winreg_get_driver(p->mem_ctx, b,
    2100                                    r->in.architecture, r->in.driver,
    2101                                    version, &info);
    2102         if (!W_ERROR_IS_OK(status)) {
    2103                 /* try for Win2k driver if "Windows NT x86" */
    2104 
    2105                 if ( version == 2 ) {
    2106                         version = 3;
    2107 
    2108                         status = winreg_get_driver(p->mem_ctx, b,
    2109                                                    r->in.architecture,
    2110                                                    r->in.driver,
    2111                                                    version, &info);
    2112                         if (!W_ERROR_IS_OK(status)) {
    2113                                 status = WERR_UNKNOWN_PRINTER_DRIVER;
    2114                                 goto done;
    2115                         }
    2116                 }
    2117                 /* otherwise it was a failure */
    2118                 else {
    2119                         status = WERR_UNKNOWN_PRINTER_DRIVER;
     2110                goto done;
     2111        }
     2112
     2113        for (found = false, i = 0; drv_cversion[i] >= 0; i++) {
     2114                status = winreg_get_driver(tmp_ctx, b,
     2115                                           r->in.architecture, r->in.driver,
     2116                                           drv_cversion[i], &info);
     2117                if (!W_ERROR_IS_OK(status)) {
     2118                        DEBUG(5, ("skipping del of driver with version %d\n",
     2119                                  drv_cversion[i]));
     2120                        continue;
     2121                }
     2122                found = true;
     2123
     2124                if (printer_driver_in_use(tmp_ctx, get_session_info_system(),
     2125                                          p->msg_ctx, info)) {
     2126                        status = WERR_PRINTER_DRIVER_IN_USE;
    21202127                        goto done;
    21212128                }
    21222129
    2123         }
    2124 
    2125         if (printer_driver_in_use(p->mem_ctx,
    2126                                   get_session_info_system(),
    2127                                   p->msg_ctx,
    2128                                   info)) {
     2130                status = winreg_del_driver(tmp_ctx, b, info, drv_cversion[i]);
     2131                if (!W_ERROR_IS_OK(status)) {
     2132                        DEBUG(0, ("failed del of driver with version %d\n",
     2133                                  drv_cversion[i]));
     2134                        goto done;
     2135                }
     2136        }
     2137        if (found == false) {
     2138                DEBUG(0, ("driver %s not found for deletion\n", r->in.driver));
     2139                status = WERR_UNKNOWN_PRINTER_DRIVER;
     2140        } else {
     2141                status = WERR_OK;
     2142        }
     2143
     2144done:
     2145        talloc_free(tmp_ctx);
     2146        return status;
     2147}
     2148
     2149static WERROR spoolss_dpd_version(TALLOC_CTX *mem_ctx,
     2150                                  struct pipes_struct *p,
     2151                                  struct spoolss_DeletePrinterDriverEx *r,
     2152                                  struct dcerpc_binding_handle *b,
     2153                                  struct spoolss_DriverInfo8 *info)
     2154{
     2155        WERROR status;
     2156        bool delete_files;
     2157
     2158        if (printer_driver_in_use(mem_ctx, get_session_info_system(),
     2159                                  p->msg_ctx, info)) {
    21292160                status = WERR_PRINTER_DRIVER_IN_USE;
    21302161                goto done;
    21312162        }
    21322163
    2133         if (version == 2) {
    2134                 status = winreg_get_driver(p->mem_ctx, b,
    2135                                            r->in.architecture,
    2136                                            r->in.driver, 3, &info_win2k);
    2137                 if (W_ERROR_IS_OK(status)) {
    2138                         /* if we get to here, we now have 2 driver info structures to remove */
    2139                         /* remove the Win2k driver first*/
    2140 
    2141                         status = winreg_del_driver(p->mem_ctx, b,
    2142                                                    info_win2k, 3);
    2143                         talloc_free(info_win2k);
    2144 
    2145                         /* this should not have failed---if it did, report to client */
    2146                         if (!W_ERROR_IS_OK(status)) {
    2147                                 goto done;
    2148                         }
    2149                 }
    2150         }
    2151 
    2152         status = winreg_del_driver(p->mem_ctx, b,
    2153                                    info, version);
     2164        /*
     2165         * we have a couple of cases to consider.
     2166         * (1) Are any files in use?  If so and DPD_DELETE_ALL_FILES is set,
     2167         *     then the delete should fail if **any** files overlap with
     2168         *     other drivers
     2169         * (2) If DPD_DELETE_UNUSED_FILES is set, then delete all
     2170         *     non-overlapping files
     2171         * (3) If neither DPD_DELETE_ALL_FILES nor DPD_DELETE_UNUSED_FILES
     2172         *     is set, then do not delete any files
     2173         * Refer to MSDN docs on DeletePrinterDriverEx() for details.
     2174         */
     2175
     2176        delete_files = r->in.delete_flags
     2177                        & (DPD_DELETE_ALL_FILES | DPD_DELETE_UNUSED_FILES);
     2178
     2179        if (delete_files) {
     2180                bool in_use = printer_driver_files_in_use(mem_ctx,
     2181                                                get_session_info_system(),
     2182                                                          p->msg_ctx,
     2183                                                          info);
     2184                if (in_use && (r->in.delete_flags & DPD_DELETE_ALL_FILES)) {
     2185                        status = WERR_PRINTER_DRIVER_IN_USE;
     2186                        goto done;
     2187                }
     2188                /*
     2189                 * printer_driver_files_in_use() has trimmed overlapping files
     2190                 * from info so they are not removed on DPD_DELETE_UNUSED_FILES
     2191                 */
     2192        }
     2193
     2194        status = winreg_del_driver(mem_ctx, b, info, info->version);
     2195        if (!W_ERROR_IS_OK(status)) {
     2196                goto done;
     2197        }
     2198
     2199        /*
     2200         * now delete any associated files if delete_files is
     2201         * true. Even if this part failes, we return succes
     2202         * because the driver doesn not exist any more
     2203         */
     2204        if (delete_files) {
     2205                delete_driver_files(get_session_info_system(), info);
     2206        }
    21542207
    21552208done:
    2156         talloc_free(info);
    2157 
    21582209        return status;
    21592210}
     
    21662217                                      struct spoolss_DeletePrinterDriverEx *r)
    21672218{
    2168         struct spoolss_DriverInfo8      *info = NULL;
    2169         struct spoolss_DriverInfo8      *info_win2k = NULL;
    2170         int                             version;
    2171         bool                            delete_files;
     2219        struct spoolss_DriverInfo8 *info = NULL;
    21722220        WERROR                          status;
    21732221        struct dcerpc_binding_handle *b;
     2222        TALLOC_CTX *tmp_ctx = NULL;
     2223        int i;
     2224        bool found;
    21742225
    21752226        /* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege,
     
    21882239
    21892240        /* check that we have a valid driver name first */
    2190         if ((version = get_version_id(r->in.architecture)) == -1) {
     2241        if (get_version_id(r->in.architecture) == -1) {
    21912242                /* this is what NT returns */
    21922243                return WERR_INVALID_ENVIRONMENT;
    21932244        }
    21942245
    2195         if (r->in.delete_flags & DPD_DELETE_SPECIFIC_VERSION)
    2196                 version = r->in.version;
    2197 
    2198         status = winreg_printer_binding_handle(p->mem_ctx,
     2246        tmp_ctx = talloc_new(p->mem_ctx);
     2247        if (!tmp_ctx) {
     2248                return WERR_NOMEM;
     2249        }
     2250
     2251        status = winreg_printer_binding_handle(tmp_ctx,
    21992252                                               get_session_info_system(),
    22002253                                               p->msg_ctx,
    22012254                                               &b);
    22022255        if (!W_ERROR_IS_OK(status)) {
    2203                 return status;
    2204         }
    2205 
    2206         status = winreg_get_driver(p->mem_ctx, b,
    2207                                    r->in.architecture,
    2208                                    r->in.driver,
    2209                                    version,
    2210                                    &info);
    2211         if (!W_ERROR_IS_OK(status)) {
     2256                goto done;
     2257        }
     2258
     2259        for (found = false, i = 0; drv_cversion[i] >= 0; i++) {
     2260                if ((r->in.delete_flags & DPD_DELETE_SPECIFIC_VERSION)
     2261                 && (drv_cversion[i] != r->in.version)) {
     2262                        continue;
     2263                }
     2264
     2265                /* check if a driver with this version exists before delete */
     2266                status = winreg_get_driver(tmp_ctx, b,
     2267                                           r->in.architecture, r->in.driver,
     2268                                           drv_cversion[i], &info);
     2269                if (!W_ERROR_IS_OK(status)) {
     2270                        DEBUG(5, ("skipping del of driver with version %d\n",
     2271                                  drv_cversion[i]));
     2272                        continue;
     2273                }
     2274                found = true;
     2275
     2276                status = spoolss_dpd_version(tmp_ctx, p, r, b, info);
     2277                if (!W_ERROR_IS_OK(status)) {
     2278                        DEBUG(0, ("failed to delete driver with version %d\n",
     2279                                  drv_cversion[i]));
     2280                        goto done;
     2281                }
     2282        }
     2283        if (found == false) {
     2284                DEBUG(0, ("driver %s not found for deletion\n", r->in.driver));
    22122285                status = WERR_UNKNOWN_PRINTER_DRIVER;
    2213 
    2214                 /*
    2215                  * if the client asked for a specific version,
    2216                  * or this is something other than Windows NT x86,
    2217                  * then we've failed
    2218                  */
    2219 
    2220                 if ( (r->in.delete_flags & DPD_DELETE_SPECIFIC_VERSION) || (version !=2) )
    2221                         goto done;
    2222 
    2223                 /* try for Win2k driver if "Windows NT x86" */
    2224 
    2225                 version = 3;
    2226                 status = winreg_get_driver(info, b,
    2227                                            r->in.architecture,
    2228                                            r->in.driver,
    2229                                            version, &info);
    2230                 if (!W_ERROR_IS_OK(status)) {
    2231                         status = WERR_UNKNOWN_PRINTER_DRIVER;
    2232                         goto done;
    2233                 }
    2234         }
    2235 
    2236         if (printer_driver_in_use(info,
    2237                                   get_session_info_system(),
    2238                                   p->msg_ctx,
    2239                                   info)) {
    2240                 status = WERR_PRINTER_DRIVER_IN_USE;
    2241                 goto done;
    2242         }
    2243 
    2244         /*
    2245          * we have a couple of cases to consider.
    2246          * (1) Are any files in use?  If so and DPD_DELTE_ALL_FILE is set,
    2247          *     then the delete should fail if **any** files overlap with
    2248          *     other drivers
    2249          * (2) If DPD_DELTE_UNUSED_FILES is sert, then delete all
    2250          *     non-overlapping files
    2251          * (3) If neither DPD_DELTE_ALL_FILE nor DPD_DELTE_ALL_FILES
    2252          *     is set, the do not delete any files
    2253          * Refer to MSDN docs on DeletePrinterDriverEx() for details.
    2254          */
    2255 
    2256         delete_files = r->in.delete_flags & (DPD_DELETE_ALL_FILES|DPD_DELETE_UNUSED_FILES);
    2257 
    2258         /* fail if any files are in use and DPD_DELETE_ALL_FILES is set */
    2259 
    2260         if (delete_files &&
    2261             (r->in.delete_flags & DPD_DELETE_ALL_FILES) &&
    2262             printer_driver_files_in_use(info,
    2263                                         get_session_info_system(),
    2264                                         p->msg_ctx,
    2265                                         info)) {
    2266                 /* no idea of the correct error here */
    2267                 status = WERR_ACCESS_DENIED;
    2268                 goto done;
    2269         }
    2270 
    2271 
    2272         /* also check for W32X86/3 if necessary; maybe we already have? */
    2273 
    2274         if ( (version == 2) && ((r->in.delete_flags & DPD_DELETE_SPECIFIC_VERSION) != DPD_DELETE_SPECIFIC_VERSION)  ) {
    2275                 status = winreg_get_driver(info, b,
    2276                                            r->in.architecture,
    2277                                            r->in.driver, 3, &info_win2k);
    2278                 if (W_ERROR_IS_OK(status)) {
    2279 
    2280                         if (delete_files &&
    2281                             (r->in.delete_flags & DPD_DELETE_ALL_FILES) &&
    2282                             printer_driver_files_in_use(info,
    2283                                                         get_session_info_system(),
    2284                                                         p->msg_ctx,
    2285                                                         info_win2k)) {
    2286                                 /* no idea of the correct error here */
    2287                                 talloc_free(info_win2k);
    2288                                 status = WERR_ACCESS_DENIED;
    2289                                 goto done;
    2290                         }
    2291 
    2292                         /* if we get to here, we now have 2 driver info structures to remove */
    2293                         /* remove the Win2k driver first*/
    2294 
    2295                         status = winreg_del_driver(info, b,
    2296                                                    info_win2k,
    2297                                                    3);
    2298 
    2299                         /* this should not have failed---if it did, report to client */
    2300 
    2301                         if (!W_ERROR_IS_OK(status)) {
    2302                                 goto done;
    2303                         }
    2304 
    2305                         /*
    2306                          * now delete any associated files if delete_files is
    2307                          * true. Even if this part failes, we return succes
    2308                          * because the driver doesn not exist any more
    2309                          */
    2310                         if (delete_files) {
    2311                                 delete_driver_files(get_session_info_system(),
    2312                                                     info_win2k);
    2313                         }
    2314                 }
    2315         }
    2316 
    2317         status = winreg_del_driver(info, b,
    2318                                    info,
    2319                                    version);
    2320         if (!W_ERROR_IS_OK(status)) {
    2321                 goto done;
    2322         }
    2323 
    2324         /*
    2325          * now delete any associated files if delete_files is
    2326          * true. Even if this part failes, we return succes
    2327          * because the driver doesn not exist any more
    2328          */
    2329         if (delete_files) {
    2330                 delete_driver_files(get_session_info_system(), info);
     2286        } else {
     2287                status = WERR_OK;
    23312288        }
    23322289
    23332290done:
    2334         talloc_free(info);
     2291        talloc_free(tmp_ctx);
    23352292        return status;
    23362293}
     
    32633220                                        TALLOC_CTX *mem_ctx)
    32643221{
    3265         SETUP_SPOOLSS_NOTIFY_DATA_INTEGER(data, queue->job);
     3222        SETUP_SPOOLSS_NOTIFY_DATA_INTEGER(data, queue->sysjob);
    32663223}
    32673224
     
    36963653        }
    36973654
     3655        /*
     3656         * When sending a PRINTER_NOTIFY_FIELD_SERVER_NAME we should send the
     3657         * correct servername.
     3658         */
     3659        pinfo2->servername = talloc_strdup(pinfo2, Printer->servername);
     3660        if (pinfo2->servername == NULL) {
     3661                return WERR_NOMEM;
     3662        }
     3663
    36983664        for (i=0; i<option->count; i++) {
    36993665                option_type = option->types[i];
     
    37203686                                                           pinfo2, snum,
    37213687                                                           &option_type,
    3722                                                            queue[j].job,
     3688                                                           queue[j].sysjob,
    37233689                                                           mem_ctx);
    37243690                        }
     
    68186784        t = gmtime(&queue->time);
    68196785
    6820         r->job_id               = queue->job;
     6786        r->job_id               = queue->sysjob;
    68216787
    68226788        r->printer_name         = talloc_strdup(mem_ctx, lp_servicename(snum));
     
    68596825        t = gmtime(&queue->time);
    68606826
    6861         r->job_id               = queue->job;
     6827        r->job_id               = queue->sysjob;
    68626828
    68636829        r->printer_name         = talloc_strdup(mem_ctx, lp_servicename(snum));
     
    69126878                             struct spoolss_PrinterInfo2 *pinfo2)
    69136879{
    6914         r->job_id               = queue->job;
     6880        r->job_id               = queue->sysjob;
    69156881        r->next_job_id          = 0;
    69166882        if (next_queue) {
    6917                 r->next_job_id  = next_queue->job;
     6883                r->next_job_id  = next_queue->sysjob;
    69186884        }
    69196885        r->reserved             = 0;
     
    72247190                break;
    72257191        case SPOOLSS_JOB_CONTROL_PAUSE:
    7226                 if (print_job_pause(session_info, p->msg_ctx,
    7227                                     snum, r->in.job_id, &errcode)) {
    7228                         errcode = WERR_OK;
    7229                 }
     7192                errcode = print_job_pause(session_info, p->msg_ctx,
     7193                                          snum, r->in.job_id);
    72307194                break;
    72317195        case SPOOLSS_JOB_CONTROL_RESTART:
    72327196        case SPOOLSS_JOB_CONTROL_RESUME:
    7233                 if (print_job_resume(session_info, p->msg_ctx,
    7234                                      snum, r->in.job_id, &errcode)) {
    7235                         errcode = WERR_OK;
    7236                 }
     7197                errcode = print_job_resume(session_info, p->msg_ctx,
     7198                                           snum, r->in.job_id);
    72377199                break;
    72387200        case 0:
     
    90639025
    90649026        for (i=0; i<count; i++) {
    9065                 if (queue[i].job == (int)jobid) {
     9027                if (queue[i].sysjob == (int)jobid) {
    90669028                        found = true;
    90679029                        break;
     
    90989060
    90999061        for (i=0; i<count; i++) {
    9100                 if (queue[i].job == (int)jobid) {
     9062                if (queue[i].sysjob == (int)jobid) {
    91019063                        found = true;
    91029064                        break;
     
    91169078         */
    91179079
    9118         devmode = print_job_devmode(lp_const_servicename(snum), jobid);
     9080        devmode = print_job_devmode(mem_ctx, lp_const_servicename(snum), jobid);
    91199081        if (!devmode) {
    91209082                result = spoolss_create_default_devmode(mem_ctx,
  • vendor/current/source3/rpc_server/srv_access_check.c

    r740 r746  
    5353        NTSTATUS status = NT_STATUS_ACCESS_DENIED;
    5454        uint32 saved_mask = 0;
     55        bool priv_granted = false;
    5556
    5657        /* check privileges; certain SAM access bits should be overridden
     
    6061        if ((needed_priv_1 != SEC_PRIV_INVALID && security_token_has_privilege(token, needed_priv_1)) ||
    6162            (needed_priv_2 != SEC_PRIV_INVALID && security_token_has_privilege(token, needed_priv_2))) {
     63                priv_granted = true;
    6264                saved_mask = (des_access & rights_mask);
    6365                des_access &= ~saved_mask;
     
    8284                DEBUGADD(4,("but overritten by euid == sec_initial_uid()\n"));
    8385
     86                priv_granted = true;
    8487                *acc_granted = des_access;
    8588
     
    9093
    9194done:
    92         /* add in any bits saved during the privilege check (only
    93            matters is status is ok) */
     95        if (priv_granted) {
     96                /* add in any bits saved during the privilege check (only
     97                   matters if status is ok) */
    9498
    95         *acc_granted |= rights_mask;
     99                *acc_granted |= rights_mask;
     100        }
    96101
    97102        DEBUG(4,("%s: access %s (requested: 0x%08x, granted: 0x%08x)\n",
  • vendor/current/source3/rpc_server/srvsvc/srv_srvsvc_nt.c

    r740 r746  
    23192319        security_info_sent = r->in.securityinformation;
    23202320
    2321         if (psd->owner_sid==0) {
    2322                 security_info_sent &= ~SECINFO_OWNER;
    2323         }
    2324         if (psd->group_sid==0) {
    2325                 security_info_sent &= ~SECINFO_GROUP;
    2326         }
    2327         if (psd->sacl==0) {
    2328                 security_info_sent &= ~SECINFO_SACL;
    2329         }
    2330         if (psd->dacl==0) {
    2331                 security_info_sent &= ~SECINFO_DACL;
    2332         }
    2333 
    2334         /* Convert all the generic bits. */
    2335         security_acl_map_generic(psd->dacl, &file_generic_mapping);
    2336         security_acl_map_generic(psd->sacl, &file_generic_mapping);
    2337 
    2338         nt_status = SMB_VFS_FSET_NT_ACL(fsp,
    2339                                         security_info_sent,
    2340                                         psd);
     2321        nt_status = set_sd(fsp, psd, security_info_sent);
    23412322
    23422323        if (!NT_STATUS_IS_OK(nt_status) ) {
  • vendor/current/source3/rpc_server/svcctl/srv_svcctl_reg.c

    r740 r746  
    393393        }
    394394
    395         if (ipath == NULL || dname == NULL || description == NULL) {
    396                 goto done;
    397         }
    398 
    399395        /* Default to an external service if we haven't found a match */
    400396        if (builtin_svcs[i].servicename == NULL) {
  • vendor/current/source3/rpc_server/wkssvc/srv_wkssvc_nt.c

    r740 r746  
    3333#include "smbd/smbd.h"
    3434#include "auth.h"
     35#include "krb5_env.h"
    3536
    3637#undef DBGC_CLASS
     
    868869
    869870        become_root();
     871        setenv(KRB5_ENV_CCNAME, "MEMORY:_wkssvc_NetrJoinDomain2", 1);
    870872        werr = libnet_Join(p->mem_ctx, j);
     873        unsetenv(KRB5_ENV_CCNAME);
    871874        unbecome_root();
    872875
     
    934937
    935938        become_root();
     939        setenv(KRB5_ENV_CCNAME, "MEMORY:_wkssvc_NetrUnjoinDomain2", 1);
    936940        werr = libnet_Unjoin(p->mem_ctx, u);
     941        unsetenv(KRB5_ENV_CCNAME);
    937942        unbecome_root();
    938943
Note: See TracChangeset for help on using the changeset viewer.