Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

Location:
vendor/current/source4/ntvfs/simple
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/ntvfs/simple/svfs_util.c

    r740 r988  
    3939        struct svfs_private *p = ntvfs->private_data;
    4040        char *ret;
     41        char *name_lower = strlower_talloc(p, name);
    4142
    4243        if (*name != '\\') {
    43                 ret = talloc_asprintf(req, "%s/%s", p->connectpath, name);
     44                ret = talloc_asprintf(req, "%s/%s", p->connectpath, name_lower);
    4445        } else {
    45                 ret = talloc_asprintf(req, "%s%s", p->connectpath, name);
     46                ret = talloc_asprintf(req, "%s%s", p->connectpath, name_lower);
    4647        }
    4748        all_string_sub(ret, "\\", "/", 0);
    48 
    49         strlower(ret + strlen(p->connectpath));
    50 
     49        talloc_free(name_lower);
    5150        return ret;
    5251}
     
    8382        mask = p+1;
    8483
    85         low_mask = talloc_strdup(mem_ctx, mask);
     84        low_mask = strlower_talloc(mem_ctx, mask);
    8685        if (!low_mask) { return NULL; }
    87         strlower(low_mask);
    8886
    8987        odir = opendir(dir->unix_dir);
     
    10098                }
    10199
    102                 low_name = talloc_strdup(mem_ctx, dent->d_name);
     100                low_name = strlower_talloc(mem_ctx, dent->d_name);
    103101                if (!low_name) { continue; }
    104                 strlower(low_name);
    105102
    106103                /* check it matches the wildcard pattern */
    107                 if (ms_fnmatch(low_mask, low_name, PROTOCOL_NT1) != 0) {
     104                if (ms_fnmatch_protocol(low_mask, low_name, PROTOCOL_NT1) != 0) {
    108105                        continue;
    109106                }
  • vendor/current/source4/ntvfs/simple/vfs_simple.c

    r740 r988  
    8181        p->ntvfs = ntvfs;
    8282        p->next_search_handle = 0;
    83         p->connectpath = talloc_strdup(p, share_string_option(scfg, SHARE_PATH, ""));
     83        p->connectpath = share_string_option(p, scfg, SHARE_PATH, "");
    8484        p->open_files = NULL;
    8585        p->search = NULL;
     
    148148        /* ignoring wildcards ... */
    149149        if (unlink(unix_path) == -1) {
    150                 return map_nt_error_from_unix(errno);
     150                return map_nt_error_from_unix_common(errno);
    151151        }
    152152
     
    177177
    178178        if (stat(unix_path, &st) == -1) {
    179                 return map_nt_error_from_unix(errno);
     179                return map_nt_error_from_unix_common(errno);
    180180        }
    181181
     
    292292        if (stat(unix_path, &st) == -1) {
    293293                DEBUG(19,("svfs_qpathinfo: file %s errno=%d\n", unix_path, errno));
    294                 return map_nt_error_from_unix(errno);
     294                return map_nt_error_from_unix_common(errno);
    295295        }
    296296        DEBUG(19,("svfs_qpathinfo: file %s, stat done\n", unix_path));
     
    318318       
    319319        if (fstat(f->fd, &st) == -1) {
    320                 return map_nt_error_from_unix(errno);
     320                return map_nt_error_from_unix_common(errno);
    321321        }
    322322
     
    387387                        if (mkdir(unix_path, 0755) == -1) {
    388388                                DEBUG(9,("svfs_open: mkdir %s errno=%d\n", unix_path, errno));
    389                                 return map_nt_error_from_unix(errno);
     389                                return map_nt_error_from_unix_common(errno);
    390390                        }
    391391                        break;
     
    393393                        if (mkdir(unix_path, 0755) == -1 && errno != EEXIST) {
    394394                                DEBUG(9,("svfs_open: mkdir %s errno=%d\n", unix_path, errno));
    395                                 return map_nt_error_from_unix(errno);
     395                                return map_nt_error_from_unix_common(errno);
    396396                        }
    397397                        break;
     
    402402        fd = open(unix_path, flags, 0644);
    403403        if (fd == -1) {
    404                 return map_nt_error_from_unix(errno);
     404                return map_nt_error_from_unix_common(errno);
    405405        }
    406406
     
    408408                DEBUG(9,("svfs_open: fstat errno=%d\n", errno));
    409409                close(fd);
    410                 return map_nt_error_from_unix(errno);
     410                return map_nt_error_from_unix_common(errno);
    411411        }
    412412
     
    415415
    416416        f = talloc(handle, struct svfs_file);
    417         NT_STATUS_HAVE_NO_MEMORY(f);
     417        if (f == NULL) {
     418                close(fd);
     419                return NT_STATUS_NO_MEMORY;
     420        }
    418421        f->fd = fd;
    419422        f->name = talloc_strdup(f, unix_path);
     
    457460
    458461        if (mkdir(unix_path, 0777) == -1) {
    459                 return map_nt_error_from_unix(errno);
     462                return map_nt_error_from_unix_common(errno);
    460463        }
    461464
     
    476479
    477480        if (rmdir(unix_path) == -1) {
    478                 return map_nt_error_from_unix(errno);
     481                return map_nt_error_from_unix_common(errno);
    479482        }
    480483
     
    500503
    501504        if (rename(unix_path1, unix_path2) == -1) {
    502                 return map_nt_error_from_unix(errno);
     505                return map_nt_error_from_unix_common(errno);
    503506        }
    504507       
     
    539542                    rd->readx.in.offset);
    540543        if (ret == -1) {
    541                 return map_nt_error_from_unix(errno);
     544                return map_nt_error_from_unix_common(errno);
    542545        }
    543546
     
    575578                     wr->writex.in.offset);
    576579        if (ret == -1) {
    577                 return map_nt_error_from_unix(errno);
     580                return map_nt_error_from_unix_common(errno);
    578581        }
    579582               
     
    646649
    647650        if (close(f->fd) == -1) {
    648                 return map_nt_error_from_unix(errno);
     651                return map_nt_error_from_unix_common(errno);
    649652        }
    650653
     
    736739                if (ftruncate(f->fd,
    737740                              info->end_of_file_info.in.size) == -1) {
    738                         return map_nt_error_from_unix(errno);
     741                        return map_nt_error_from_unix_common(errno);
    739742                }
    740743                break;
     
    782785                        &fs->generic.out.blocks_free,
    783786                        &fs->generic.out.blocks_total) == -1) {
    784                 return map_nt_error_from_unix(errno);
     787                return map_nt_error_from_unix_common(errno);
    785788        }
    786789
     
    822825
    823826        if (stat(p->connectpath, &st) == -1) {
    824                 return map_nt_error_from_unix(errno);
     827                return map_nt_error_from_unix_common(errno);
    825828        }
    826829
     
    10591062
    10601063        /* fill in all the operations */
    1061         ops.connect = svfs_connect;
    1062         ops.disconnect = svfs_disconnect;
    1063         ops.unlink = svfs_unlink;
    1064         ops.chkpath = svfs_chkpath;
    1065         ops.qpathinfo = svfs_qpathinfo;
    1066         ops.setpathinfo = svfs_setpathinfo;
    1067         ops.open = svfs_open;
    1068         ops.mkdir = svfs_mkdir;
    1069         ops.rmdir = svfs_rmdir;
    1070         ops.rename = svfs_rename;
    1071         ops.copy = svfs_copy;
    1072         ops.ioctl = svfs_ioctl;
    1073         ops.read = svfs_read;
    1074         ops.write = svfs_write;
    1075         ops.seek = svfs_seek;
    1076         ops.flush = svfs_flush;
    1077         ops.close = svfs_close;
    1078         ops.exit = svfs_exit;
    1079         ops.lock = svfs_lock;
    1080         ops.setfileinfo = svfs_setfileinfo;
    1081         ops.qfileinfo = svfs_qfileinfo;
    1082         ops.fsinfo = svfs_fsinfo;
    1083         ops.lpq = svfs_lpq;
    1084         ops.search_first = svfs_search_first;
    1085         ops.search_next = svfs_search_next;
    1086         ops.search_close = svfs_search_close;
    1087         ops.trans = svfs_trans;
    1088         ops.logoff = svfs_logoff;
    1089         ops.async_setup = svfs_async_setup;
    1090         ops.cancel = svfs_cancel;
     1064        ops.connect_fn = svfs_connect;
     1065        ops.disconnect_fn = svfs_disconnect;
     1066        ops.unlink_fn = svfs_unlink;
     1067        ops.chkpath_fn = svfs_chkpath;
     1068        ops.qpathinfo_fn = svfs_qpathinfo;
     1069        ops.setpathinfo_fn = svfs_setpathinfo;
     1070        ops.open_fn = svfs_open;
     1071        ops.mkdir_fn = svfs_mkdir;
     1072        ops.rmdir_fn = svfs_rmdir;
     1073        ops.rename_fn = svfs_rename;
     1074        ops.copy_fn = svfs_copy;
     1075        ops.ioctl_fn = svfs_ioctl;
     1076        ops.read_fn = svfs_read;
     1077        ops.write_fn = svfs_write;
     1078        ops.seek_fn = svfs_seek;
     1079        ops.flush_fn = svfs_flush;
     1080        ops.close_fn = svfs_close;
     1081        ops.exit_fn = svfs_exit;
     1082        ops.lock_fn = svfs_lock;
     1083        ops.setfileinfo_fn = svfs_setfileinfo;
     1084        ops.qfileinfo_fn = svfs_qfileinfo;
     1085        ops.fsinfo_fn = svfs_fsinfo;
     1086        ops.lpq_fn = svfs_lpq;
     1087        ops.search_first_fn = svfs_search_first;
     1088        ops.search_next_fn = svfs_search_next;
     1089        ops.search_close_fn = svfs_search_close;
     1090        ops.trans_fn = svfs_trans;
     1091        ops.logoff_fn = svfs_logoff;
     1092        ops.async_setup_fn = svfs_async_setup;
     1093        ops.cancel_fn = svfs_cancel;
    10911094
    10921095        /* register ourselves with the NTVFS subsystem. We register
Note: See TracChangeset for help on using the changeset viewer.