Changeset 165 for branches/samba-3.0/source/libsmb/libsmbclient.c
- Timestamp:
- Mar 11, 2009, 9:14:55 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.0/source/libsmb/libsmbclient.c
r134 r165 4527 4527 */ 4528 4528 if (ipc_cli && (all || some_nt || all_nt_acls)) { 4529 pstring targetpath; 4530 struct cli_state *targetcli; 4531 4529 4532 /* Point to the portion after "system.nt_sec_desc." */ 4530 4533 name += 19; /* if (all) this will be invalid but unused */ 4531 4534 4535 if (!cli_resolve_path("", cli, filename, 4536 &targetcli, targetpath)) 4537 { 4538 d_printf("Could not resolve %s\n", filename); 4539 return -1; 4540 } 4541 4532 4542 /* ... then obtain any NT attributes which were requested */ 4533 fnum = cli_nt_create( cli, filename, CREATE_ACCESS_READ);4543 fnum = cli_nt_create(targetcli, targetpath, CREATE_ACCESS_READ); 4534 4544 4535 4545 if (fnum == -1) { 4536 4546 DEBUG(5, ("cacl_get failed to open %s: %s\n", 4537 filename, cli_errstr(cli)));4547 targetpath, cli_errstr(targetcli))); 4538 4548 errno = 0; 4539 4549 return -1; 4540 4550 } 4541 4551 4542 sd = cli_query_secdesc( cli, fnum, ctx);4552 sd = cli_query_secdesc(targetcli, fnum, ctx); 4543 4553 4544 4554 if (!sd) { … … 4549 4559 } 4550 4560 4551 cli_close( cli, fnum);4561 cli_close(targetcli, fnum); 4552 4562 4553 4563 if (! exclude_nt_revision) { … … 5149 5159 BOOL numeric = True; 5150 5160 5161 pstring targetpath; 5162 struct cli_state *targetcli; 5163 5151 5164 /* the_acl will be null for REMOVE_ALL operations */ 5152 5165 if (the_acl) { … … 5178 5191 } 5179 5192 5193 if (!cli_resolve_path("", cli, filename, 5194 &targetcli, targetpath)) 5195 { 5196 d_printf("Could not resolve %s\n", filename); 5197 errno = ENOENT; 5198 return -1; 5199 } 5200 5180 5201 /* The desired access below is the only one I could find that works 5181 5202 with NT4, W2KP and Samba */ 5182 5203 5183 fnum = cli_nt_create( cli, filename, CREATE_ACCESS_READ);5204 fnum = cli_nt_create(targetcli, targetpath, CREATE_ACCESS_READ); 5184 5205 5185 5206 if (fnum == -1) { 5186 5207 DEBUG(5, ("cacl_set failed to open %s: %s\n", 5187 filename, cli_errstr(cli)));5208 targetpath, cli_errstr(targetcli))); 5188 5209 errno = 0; 5189 5210 return -1; 5190 5211 } 5191 5212 5192 old = cli_query_secdesc( cli, fnum, ctx);5213 old = cli_query_secdesc(targetcli, fnum, ctx); 5193 5214 5194 5215 if (!old) { … … 5198 5219 } 5199 5220 5200 cli_close( cli, fnum);5221 cli_close(targetcli, fnum); 5201 5222 5202 5223 switch (mode) { … … 5287 5308 owner_sid, group_sid, NULL, dacl, &sd_size); 5288 5309 5289 fnum = cli_nt_create( cli, filename,5310 fnum = cli_nt_create(targetcli, targetpath, 5290 5311 WRITE_DAC_ACCESS | WRITE_OWNER_ACCESS); 5291 5312 5292 5313 if (fnum == -1) { 5293 5314 DEBUG(5, ("cacl_set failed to open %s: %s\n", 5294 filename, cli_errstr(cli)));5315 targetpath, cli_errstr(targetcli))); 5295 5316 errno = 0; 5296 5317 return -1; 5297 5318 } 5298 5319 5299 if (!cli_set_secdesc( cli, fnum, sd)) {5300 DEBUG(5, ("ERROR: secdesc set failed: %s\n", cli_errstr( cli)));5320 if (!cli_set_secdesc(targetcli, fnum, sd)) { 5321 DEBUG(5, ("ERROR: secdesc set failed: %s\n", cli_errstr(targetcli))); 5301 5322 ret = -1; 5302 5323 } … … 5305 5326 5306 5327 failed: 5307 cli_close( cli, fnum);5328 cli_close(targetcli, fnum); 5308 5329 5309 5330 if (err != 0) {
Note:
See TracChangeset
for help on using the changeset viewer.