Changeset 988 for vendor/current/source4/ntvfs
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/source4/ntvfs
- Files:
-
- 3 added
- 1 deleted
- 65 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/ntvfs/cifs/vfs_cifs.c
r740 r988 35 35 #include "param/param.h" 36 36 #include "libcli/resolve/resolve.h" 37 #include "../libcli/smb/smbXcli_base.h" 37 38 38 39 struct cvfs_file { … … 64 65 }; 65 66 67 NTSTATUS ntvfs_cifs_init(void); 68 66 69 #define CHECK_UPSTREAM_OPEN do { \ 67 if (! p->transport->socket->sock) { \70 if (!smbXcli_conn_is_connected(p->transport->conn)) { \ 68 71 req->async_states->state|=NTVFS_ASYNC_STATE_CLOSE; \ 69 72 return NT_STATUS_CONNECTION_DISCONNECTED; \ … … 98 101 #define CIFS_SHARE "cifs:share" 99 102 #define CIFS_USE_MACHINE_ACCT "cifs:use-machine-account" 103 #define CIFS_USE_S4U2PROXY "cifs:use-s4u2proxy" 100 104 #define CIFS_MAP_GENERIC "cifs:map-generic" 101 105 #define CIFS_MAP_TRANS2 "cifs:map-trans2" 102 106 103 107 #define CIFS_USE_MACHINE_ACCT_DEFAULT false 108 #define CIFS_USE_S4U2PROXY_DEFAULT false 104 109 #define CIFS_MAP_GENERIC_DEFAULT false 105 110 #define CIFS_MAP_TRANS2_DEFAULT true … … 149 154 struct cli_credentials *credentials; 150 155 bool machine_account; 156 bool s4u2proxy; 151 157 const char* sharename; 158 TALLOC_CTX *tmp_ctx; 159 160 tmp_ctx = talloc_new(req); 161 if (tmp_ctx == NULL) { 162 return NT_STATUS_NO_MEMORY; 163 } 152 164 153 165 switch (tcon->generic.level) { … … 162 174 break; 163 175 default: 164 return NT_STATUS_INVALID_LEVEL; 176 status = NT_STATUS_INVALID_LEVEL; 177 goto out; 165 178 } 166 179 … … 174 187 /* Here we need to determine which server to connect to. 175 188 * For now we use parametric options, type cifs. 176 * Later we will use security=server and auth_server.c.177 189 */ 178 host = share_string_option( scfg, CIFS_SERVER, NULL);179 user = share_string_option( scfg, CIFS_USER, NULL);180 pass = share_string_option( scfg, CIFS_PASSWORD, NULL);181 domain = share_string_option( scfg, CIFS_DOMAIN, NULL);182 remote_share = share_string_option( scfg, CIFS_SHARE, NULL);190 host = share_string_option(tmp_ctx, scfg, CIFS_SERVER, NULL); 191 user = share_string_option(tmp_ctx, scfg, CIFS_USER, NULL); 192 pass = share_string_option(tmp_ctx, scfg, CIFS_PASSWORD, NULL); 193 domain = share_string_option(tmp_ctx, scfg, CIFS_DOMAIN, NULL); 194 remote_share = share_string_option(tmp_ctx, scfg, CIFS_SHARE, NULL); 183 195 if (!remote_share) { 184 196 remote_share = sharename; … … 186 198 187 199 machine_account = share_bool_option(scfg, CIFS_USE_MACHINE_ACCT, CIFS_USE_MACHINE_ACCT_DEFAULT); 200 s4u2proxy = share_bool_option(scfg, CIFS_USE_S4U2PROXY, CIFS_USE_S4U2PROXY_DEFAULT); 188 201 189 202 p = talloc_zero(ntvfs, struct cvfs_private); 190 203 if (!p) { 191 return NT_STATUS_NO_MEMORY; 204 status = NT_STATUS_NO_MEMORY; 205 goto out; 192 206 } 193 207 … … 196 210 if (!host) { 197 211 DEBUG(1,("CIFS backend: You must supply server\n")); 198 return NT_STATUS_INVALID_PARAMETER; 212 status = NT_STATUS_INVALID_PARAMETER; 213 goto out; 199 214 } 200 215 … … 203 218 credentials = cli_credentials_init(p); 204 219 if (!credentials) { 205 return NT_STATUS_NO_MEMORY; 220 status = NT_STATUS_NO_MEMORY; 221 goto out; 206 222 } 207 223 cli_credentials_set_conf(credentials, ntvfs->ctx->lp_ctx); … … 220 236 status = cli_credentials_set_machine_account(credentials, ntvfs->ctx->lp_ctx); 221 237 if (!NT_STATUS_IS_OK(status)) { 222 return status;238 goto out; 223 239 } 224 240 } else if (req->session_info->credentials) { 225 241 DEBUG(5, ("CIFS backend: Using delegated credentials\n")); 226 242 credentials = req->session_info->credentials; 243 } else if (s4u2proxy) { 244 struct ccache_container *ccc = NULL; 245 const char *err_str = NULL; 246 int ret; 247 char *impersonate_principal; 248 char *self_service; 249 char *target_service; 250 251 impersonate_principal = talloc_asprintf(req, "%s@%s", 252 req->session_info->info->account_name, 253 req->session_info->info->domain_name); 254 255 self_service = talloc_asprintf(req, "cifs/%s", 256 lpcfg_netbios_name(ntvfs->ctx->lp_ctx)); 257 258 target_service = talloc_asprintf(req, "cifs/%s", host); 259 260 DEBUG(5, ("CIFS backend: Using S4U2Proxy credentials\n")); 261 262 credentials = cli_credentials_init(p); 263 cli_credentials_set_conf(credentials, ntvfs->ctx->lp_ctx); 264 if (domain) { 265 cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED); 266 } 267 status = cli_credentials_set_machine_account(credentials, ntvfs->ctx->lp_ctx); 268 if (!NT_STATUS_IS_OK(status)) { 269 goto out; 270 } 271 cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED); 272 cli_credentials_set_impersonate_principal(credentials, 273 impersonate_principal, 274 self_service); 275 cli_credentials_set_target_service(credentials, target_service); 276 ret = cli_credentials_get_ccache(credentials, 277 ntvfs->ctx->event_ctx, 278 ntvfs->ctx->lp_ctx, 279 &ccc, 280 &err_str); 281 if (ret != 0) { 282 status = NT_STATUS_CROSSREALM_DELEGATION_FAILURE; 283 DEBUG(1,("S4U2Proxy: cli_credentials_get_ccache() gave: ret[%d] str[%s] - %s\n", 284 ret, err_str, nt_errstr(status))); 285 goto out; 286 } 287 227 288 } else { 228 289 DEBUG(1,("CIFS backend: NO delegated credentials found: You must supply server, user and password or the client must supply delegated credentials\n")); 229 return NT_STATUS_INVALID_PARAMETER; 290 status = NT_STATUS_INTERNAL_ERROR; 291 goto out; 230 292 } 231 293 … … 252 314 ntvfs->ctx->event_ctx); 253 315 status = smb_composite_connect_recv(creq, p); 254 NT_STATUS_NOT_OK_RETURN(status); 316 if (!NT_STATUS_IS_OK(status)) { 317 goto out; 318 } 255 319 256 320 p->tree = io.out.tree; … … 261 325 262 326 ntvfs->ctx->fs_type = talloc_strdup(ntvfs->ctx, "NTFS"); 263 NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->fs_type); 327 if (ntvfs->ctx->fs_type == NULL) { 328 status = NT_STATUS_NO_MEMORY; 329 goto out; 330 } 264 331 ntvfs->ctx->dev_type = talloc_strdup(ntvfs->ctx, "A:"); 265 NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->dev_type); 332 if (ntvfs->ctx->dev_type == NULL) { 333 status = NT_STATUS_NO_MEMORY; 334 goto out; 335 } 266 336 267 337 if (tcon->generic.level == RAW_TCON_TCONX) { … … 277 347 p->map_trans2 = share_bool_option(scfg, CIFS_MAP_TRANS2, CIFS_MAP_TRANS2_DEFAULT); 278 348 279 return NT_STATUS_OK; 349 status = NT_STATUS_OK; 350 351 out: 352 TALLOC_FREE(tmp_ctx); 353 return status; 280 354 } 281 355 … … 1141 1215 1142 1216 /* fill in all the operations */ 1143 ops.connect = cvfs_connect;1144 ops.disconnect = cvfs_disconnect;1145 ops.unlink = cvfs_unlink;1146 ops.chkpath = cvfs_chkpath;1147 ops.qpathinfo = cvfs_qpathinfo;1148 ops.setpathinfo = cvfs_setpathinfo;1149 ops.open = cvfs_open;1150 ops.mkdir = cvfs_mkdir;1151 ops.rmdir = cvfs_rmdir;1152 ops.rename = cvfs_rename;1153 ops.copy = cvfs_copy;1154 ops.ioctl = cvfs_ioctl;1155 ops.read = cvfs_read;1156 ops.write = cvfs_write;1157 ops.seek = cvfs_seek;1158 ops.flush = cvfs_flush;1159 ops.close = cvfs_close;1160 ops.exit = cvfs_exit;1161 ops.lock = cvfs_lock;1162 ops.setfileinfo = cvfs_setfileinfo;1163 ops.qfileinfo = cvfs_qfileinfo;1164 ops.fsinfo = cvfs_fsinfo;1165 ops.lpq = cvfs_lpq;1166 ops.search_first = cvfs_search_first;1167 ops.search_next = cvfs_search_next;1168 ops.search_close = cvfs_search_close;1169 ops.trans = cvfs_trans;1170 ops.logoff = cvfs_logoff;1171 ops.async_setup = cvfs_async_setup;1172 ops.cancel = cvfs_cancel;1173 ops.notify = cvfs_notify;1174 ops.trans2 = cvfs_trans2;1217 ops.connect_fn = cvfs_connect; 1218 ops.disconnect_fn = cvfs_disconnect; 1219 ops.unlink_fn = cvfs_unlink; 1220 ops.chkpath_fn = cvfs_chkpath; 1221 ops.qpathinfo_fn = cvfs_qpathinfo; 1222 ops.setpathinfo_fn = cvfs_setpathinfo; 1223 ops.open_fn = cvfs_open; 1224 ops.mkdir_fn = cvfs_mkdir; 1225 ops.rmdir_fn = cvfs_rmdir; 1226 ops.rename_fn = cvfs_rename; 1227 ops.copy_fn = cvfs_copy; 1228 ops.ioctl_fn = cvfs_ioctl; 1229 ops.read_fn = cvfs_read; 1230 ops.write_fn = cvfs_write; 1231 ops.seek_fn = cvfs_seek; 1232 ops.flush_fn = cvfs_flush; 1233 ops.close_fn = cvfs_close; 1234 ops.exit_fn = cvfs_exit; 1235 ops.lock_fn = cvfs_lock; 1236 ops.setfileinfo_fn = cvfs_setfileinfo; 1237 ops.qfileinfo_fn = cvfs_qfileinfo; 1238 ops.fsinfo_fn = cvfs_fsinfo; 1239 ops.lpq_fn = cvfs_lpq; 1240 ops.search_first_fn = cvfs_search_first; 1241 ops.search_next_fn = cvfs_search_next; 1242 ops.search_close_fn = cvfs_search_close; 1243 ops.trans_fn = cvfs_trans; 1244 ops.logoff_fn = cvfs_logoff; 1245 ops.async_setup_fn = cvfs_async_setup; 1246 ops.cancel_fn = cvfs_cancel; 1247 ops.notify_fn = cvfs_notify; 1248 ops.trans2_fn = cvfs_trans2; 1175 1249 1176 1250 /* register ourselves with the NTVFS subsystem. We register -
vendor/current/source4/ntvfs/cifs_posix_cli/svfs_util.c
r740 r988 42 42 struct cifspsx_private *p = ntvfs->private_data; 43 43 char *ret; 44 char *name_lower = strlower_talloc(p, name); 44 45 45 46 if (*name != '\\') { 46 ret = talloc_asprintf(req, "%s/%s", p->connectpath, name );47 ret = talloc_asprintf(req, "%s/%s", p->connectpath, name_lower); 47 48 } else { 48 ret = talloc_asprintf(req, "%s%s", p->connectpath, name );49 ret = talloc_asprintf(req, "%s%s", p->connectpath, name_lower); 49 50 } 50 51 all_string_sub(ret, "\\", "/", 0); 51 52 strlower(ret + strlen(p->connectpath)); 53 52 talloc_free(name_lower); 54 53 return ret; 55 54 } … … 86 85 mask = p+1; 87 86 88 low_mask = talloc_strdup(mem_ctx, mask);87 low_mask = strlower_talloc(mem_ctx, mask); 89 88 if (!low_mask) { return NULL; } 90 strlower(low_mask);91 89 92 90 odir = opendir(dir->unix_dir); … … 103 101 } 104 102 105 low_name = talloc_strdup(mem_ctx, dent->d_name);103 low_name = strlower_talloc(mem_ctx, dent->d_name); 106 104 if (!low_name) { continue; } 107 strlower(low_name);108 105 109 106 /* check it matches the wildcard pattern */ 110 if (ms_fnmatch (low_mask, low_name, PROTOCOL_NT1) != 0) {107 if (ms_fnmatch_protocol(low_mask, low_name, PROTOCOL_NT1) != 0) { 111 108 continue; 112 109 } -
vendor/current/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c
r740 r988 82 82 p->ntvfs = ntvfs; 83 83 p->next_search_handle = 0; 84 p->connectpath = talloc_strdup(p, share_string_option(scfg, SHARE_PATH, ""));84 p->connectpath = share_string_option(p, scfg, SHARE_PATH, ""); 85 85 p->open_files = NULL; 86 86 p->search = NULL; … … 151 151 /* ignoring wildcards ... */ 152 152 if (unlink(unix_path) == -1) { 153 return map_nt_error_from_unix (errno);153 return map_nt_error_from_unix_common(errno); 154 154 } 155 155 … … 180 180 181 181 if (stat(unix_path, &st) == -1) { 182 return map_nt_error_from_unix (errno);182 return map_nt_error_from_unix_common(errno); 183 183 } 184 184 … … 295 295 if (stat(unix_path, &st) == -1) { 296 296 DEBUG(19,("cifspsx_qpathinfo: file %s errno=%d\n", unix_path, errno)); 297 return map_nt_error_from_unix (errno);297 return map_nt_error_from_unix_common(errno); 298 298 } 299 299 DEBUG(19,("cifspsx_qpathinfo: file %s, stat done\n", unix_path)); … … 321 321 322 322 if (fstat(f->fd, &st) == -1) { 323 return map_nt_error_from_unix (errno);323 return map_nt_error_from_unix_common(errno); 324 324 } 325 325 … … 390 390 if (mkdir(unix_path, 0755) == -1) { 391 391 DEBUG(9,("cifspsx_open: mkdir %s errno=%d\n", unix_path, errno)); 392 return map_nt_error_from_unix (errno);392 return map_nt_error_from_unix_common(errno); 393 393 } 394 394 break; … … 396 396 if (mkdir(unix_path, 0755) == -1 && errno != EEXIST) { 397 397 DEBUG(9,("cifspsx_open: mkdir %s errno=%d\n", unix_path, errno)); 398 return map_nt_error_from_unix (errno);398 return map_nt_error_from_unix_common(errno); 399 399 } 400 400 break; … … 405 405 fd = open(unix_path, flags, 0644); 406 406 if (fd == -1) { 407 return map_nt_error_from_unix (errno);407 return map_nt_error_from_unix_common(errno); 408 408 } 409 409 … … 411 411 DEBUG(9,("cifspsx_open: fstat errno=%d\n", errno)); 412 412 close(fd); 413 return map_nt_error_from_unix (errno);413 return map_nt_error_from_unix_common(errno); 414 414 } 415 415 … … 460 460 461 461 if (mkdir(unix_path, 0777) == -1) { 462 return map_nt_error_from_unix (errno);462 return map_nt_error_from_unix_common(errno); 463 463 } 464 464 … … 479 479 480 480 if (rmdir(unix_path) == -1) { 481 return map_nt_error_from_unix (errno);481 return map_nt_error_from_unix_common(errno); 482 482 } 483 483 … … 503 503 504 504 if (rename(unix_path1, unix_path2) == -1) { 505 return map_nt_error_from_unix (errno);505 return map_nt_error_from_unix_common(errno); 506 506 } 507 507 … … 542 542 rd->readx.in.offset); 543 543 if (ret == -1) { 544 return map_nt_error_from_unix (errno);544 return map_nt_error_from_unix_common(errno); 545 545 } 546 546 … … 578 578 wr->writex.in.offset); 579 579 if (ret == -1) { 580 return map_nt_error_from_unix (errno);580 return map_nt_error_from_unix_common(errno); 581 581 } 582 582 … … 649 649 650 650 if (close(f->fd) == -1) { 651 return map_nt_error_from_unix (errno);651 return map_nt_error_from_unix_common(errno); 652 652 } 653 653 … … 739 739 if (ftruncate(f->fd, 740 740 info->end_of_file_info.in.size) == -1) { 741 return map_nt_error_from_unix (errno);741 return map_nt_error_from_unix_common(errno); 742 742 } 743 743 break; … … 785 785 &fs->generic.out.blocks_free, 786 786 &fs->generic.out.blocks_total) == -1) { 787 return map_nt_error_from_unix (errno);787 return map_nt_error_from_unix_common(errno); 788 788 } 789 789 … … 825 825 826 826 if (stat(p->connectpath, &st) == -1) { 827 return map_nt_error_from_unix (errno);827 return map_nt_error_from_unix_common(errno); 828 828 } 829 829 … … 1062 1062 1063 1063 /* fill in all the operations */ 1064 ops.connect = cifspsx_connect;1065 ops.disconnect = cifspsx_disconnect;1066 ops.unlink = cifspsx_unlink;1067 ops.chkpath = cifspsx_chkpath;1068 ops.qpathinfo = cifspsx_qpathinfo;1069 ops.setpathinfo = cifspsx_setpathinfo;1070 ops.open = cifspsx_open;1071 ops.mkdir = cifspsx_mkdir;1072 ops.rmdir = cifspsx_rmdir;1073 ops.rename = cifspsx_rename;1074 ops.copy = cifspsx_copy;1075 ops.ioctl = cifspsx_ioctl;1076 ops.read = cifspsx_read;1077 ops.write = cifspsx_write;1078 ops.seek = cifspsx_seek;1079 ops.flush = cifspsx_flush;1080 ops.close = cifspsx_close;1081 ops.exit = cifspsx_exit;1082 ops.lock = cifspsx_lock;1083 ops.setfileinfo = cifspsx_setfileinfo;1084 ops.qfileinfo = cifspsx_qfileinfo;1085 ops.fsinfo = cifspsx_fsinfo;1086 ops.lpq = cifspsx_lpq;1087 ops.search_first = cifspsx_search_first;1088 ops.search_next = cifspsx_search_next;1089 ops.search_close = cifspsx_search_close;1090 ops.trans = cifspsx_trans;1091 ops.logoff = cifspsx_logoff;1092 ops.async_setup = cifspsx_async_setup;1093 ops.cancel = cifspsx_cancel;1064 ops.connect_fn = cifspsx_connect; 1065 ops.disconnect_fn = cifspsx_disconnect; 1066 ops.unlink_fn = cifspsx_unlink; 1067 ops.chkpath_fn = cifspsx_chkpath; 1068 ops.qpathinfo_fn = cifspsx_qpathinfo; 1069 ops.setpathinfo_fn = cifspsx_setpathinfo; 1070 ops.open_fn = cifspsx_open; 1071 ops.mkdir_fn = cifspsx_mkdir; 1072 ops.rmdir_fn = cifspsx_rmdir; 1073 ops.rename_fn = cifspsx_rename; 1074 ops.copy_fn = cifspsx_copy; 1075 ops.ioctl_fn = cifspsx_ioctl; 1076 ops.read_fn = cifspsx_read; 1077 ops.write_fn = cifspsx_write; 1078 ops.seek_fn = cifspsx_seek; 1079 ops.flush_fn = cifspsx_flush; 1080 ops.close_fn = cifspsx_close; 1081 ops.exit_fn = cifspsx_exit; 1082 ops.lock_fn = cifspsx_lock; 1083 ops.setfileinfo_fn = cifspsx_setfileinfo; 1084 ops.qfileinfo_fn = cifspsx_qfileinfo; 1085 ops.fsinfo_fn = cifspsx_fsinfo; 1086 ops.lpq_fn = cifspsx_lpq; 1087 ops.search_first_fn = cifspsx_search_first; 1088 ops.search_next_fn = cifspsx_search_next; 1089 ops.search_close_fn = cifspsx_search_close; 1090 ops.trans_fn = cifspsx_trans; 1091 ops.logoff_fn = cifspsx_logoff; 1092 ops.async_setup_fn = cifspsx_async_setup; 1093 ops.cancel_fn = cifspsx_cancel; 1094 1094 1095 1095 /* register ourselves with the NTVFS subsystem. We register -
vendor/current/source4/ntvfs/common/brlock.c
r740 r988 27 27 #include "includes.h" 28 28 #include "system/filesys.h" 29 #include <tdb.h>30 29 #include "messaging/messaging.h" 31 30 #include "lib/messaging/irpc.h" … … 39 38 set the brl backend ops 40 39 */ 41 void brl _set_ops(const struct brlock_ops *new_ops)40 void brlock_set_ops(const struct brlock_ops *new_ops) 42 41 { 43 42 ops = new_ops; … … 46 45 /* 47 46 Open up the brlock database. Close it down using talloc_free(). We 48 need the messaging_ctx to allow for pending lock notifications.47 need the imessaging_ctx to allow for pending lock notifications. 49 48 */ 50 struct brl_context *brl _init(TALLOC_CTX *mem_ctx, struct server_id server,49 struct brl_context *brlock_init(TALLOC_CTX *mem_ctx, struct server_id server, 51 50 struct loadparm_context *lp_ctx, 52 struct messaging_context *messaging_ctx)51 struct imessaging_context *imessaging_ctx) 53 52 { 54 53 if (ops == NULL) { 55 54 brl_tdb_init_ops(); 56 55 } 57 return ops->brl_init(mem_ctx, server, lp_ctx, messaging_ctx);56 return ops->brl_init(mem_ctx, server, lp_ctx, imessaging_ctx); 58 57 } 59 58 60 struct brl_handle *brl _create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *ntvfs, DATA_BLOB *file_key)59 struct brl_handle *brlock_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *ntvfs, DATA_BLOB *file_key) 61 60 { 62 61 return ops->brl_create_handle(mem_ctx, ntvfs, file_key); … … 70 69 notification is sent, identified by the notify_ptr 71 70 */ 72 NTSTATUS brl _lock(struct brl_context *brl,71 NTSTATUS brlock_lock(struct brl_context *brl, 73 72 struct brl_handle *brlh, 74 73 uint32_t smbpid, … … 84 83 Unlock a range of bytes. 85 84 */ 86 NTSTATUS brl _unlock(struct brl_context *brl,85 NTSTATUS brlock_unlock(struct brl_context *brl, 87 86 struct brl_handle *brlh, 88 87 uint32_t smbpid, … … 97 96 getting it. In either case they no longer need to be notified. 98 97 */ 99 NTSTATUS brl _remove_pending(struct brl_context *brl,98 NTSTATUS brlock_remove_pending(struct brl_context *brl, 100 99 struct brl_handle *brlh, 101 100 void *notify_ptr) … … 108 107 Test if we are allowed to perform IO on a region of an open file 109 108 */ 110 NTSTATUS brl _locktest(struct brl_context *brl,109 NTSTATUS brlock_locktest(struct brl_context *brl, 111 110 struct brl_handle *brlh, 112 111 uint32_t smbpid, … … 121 120 Remove any locks associated with a open file. 122 121 */ 123 NTSTATUS brl _close(struct brl_context *brl,122 NTSTATUS brlock_close(struct brl_context *brl, 124 123 struct brl_handle *brlh) 125 124 { … … 130 129 Get a number of locks associated with a open file. 131 130 */ 132 NTSTATUS brl _count(struct brl_context *brl,131 NTSTATUS brlock_count(struct brl_context *brl, 133 132 struct brl_handle *brlh, 134 133 int *count) -
vendor/current/source4/ntvfs/common/brlock.h
r740 r988 25 25 struct brl_context *(*brl_init)(TALLOC_CTX *, struct server_id , 26 26 struct loadparm_context *lp_ctx, 27 struct messaging_context *);27 struct imessaging_context *); 28 28 struct brl_handle *(*brl_create_handle)(TALLOC_CTX *, struct ntvfs_handle *, DATA_BLOB *); 29 29 NTSTATUS (*brl_lock)(struct brl_context *, … … 52 52 }; 53 53 54 55 void brl_set_ops(const struct brlock_ops *new_ops); 54 void brlock_set_ops(const struct brlock_ops *new_ops); 56 55 void brl_tdb_init_ops(void); 57 void brl_ctdb_init_ops(void);58 -
vendor/current/source4/ntvfs/common/brlock_tdb.c
r740 r988 27 27 #include "includes.h" 28 28 #include "system/filesys.h" 29 #include <tdb.h>30 29 #include "messaging/messaging.h" 31 #include "lib/util/tdb_wrap.h"32 30 #include "lib/messaging/irpc.h" 33 31 #include "libcli/libcli.h" … … 36 34 #include "ntvfs/ntvfs.h" 37 35 #include "param/param.h" 36 #include "dbwrap/dbwrap.h" 38 37 39 38 /* … … 47 46 /* this struct is typicaly attached to tcon */ 48 47 struct brl_context { 49 struct tdb_wrap *w;48 struct db_context *db; 50 49 struct server_id server; 51 struct messaging_context *messaging_ctx;50 struct imessaging_context *imessaging_ctx; 52 51 }; 53 52 … … 90 89 /* 91 90 Open up the brlock.tdb database. Close it down using 92 talloc_free(). We need the messaging_ctx to allow for91 talloc_free(). We need the imessaging_ctx to allow for 93 92 pending lock notifications. 94 93 */ 95 94 static struct brl_context *brl_tdb_init(TALLOC_CTX *mem_ctx, struct server_id server, 96 95 struct loadparm_context *lp_ctx, 97 struct messaging_context *messaging_ctx)96 struct imessaging_context *imessaging_ctx) 98 97 { 99 98 struct brl_context *brl; … … 104 103 } 105 104 106 brl-> w = cluster_tdb_tmp_open(brl, lp_ctx, "brlock.tdb", TDB_DEFAULT);107 if (brl-> w== NULL) {105 brl->db = cluster_db_tmp_open(brl, lp_ctx, "brlock", TDB_DEFAULT); 106 if (brl->db == NULL) { 108 107 talloc_free(brl); 109 108 return NULL; … … 111 110 112 111 brl->server = server; 113 brl-> messaging_ctx =messaging_ctx;112 brl->imessaging_ctx = imessaging_ctx; 114 113 115 114 return brl; … … 152 151 struct lock_struct *lck2) 153 152 { 154 /* this extra check is not redund ent - it copes with locks153 /* this extra check is not redundant - it copes with locks 155 154 that go beyond the end of 64 bit file space */ 156 155 if (lck1->size != 0 && … … 243 242 244 243 /* in SMB2 mode always return NT_STATUS_LOCK_NOT_GRANTED! */ 245 if (lock->ntvfs->ctx->protocol == PROTOCOL_SMB2) {244 if (lock->ntvfs->ctx->protocol >= PROTOCOL_SMB2_02) { 246 245 return NT_STATUS_LOCK_NOT_GRANTED; 247 246 } … … 303 302 struct lock_struct lock, *locks=NULL; 304 303 NTSTATUS status; 304 struct db_record *locked; 305 305 306 306 kbuf.dptr = brlh->key.data; … … 311 311 } 312 312 313 if (tdb_chainlock(brl->w->tdb, kbuf) != 0) { 313 locked = dbwrap_fetch_locked(brl->db, brl, kbuf); 314 if (!locked) { 314 315 return NT_STATUS_INTERNAL_DB_CORRUPTION; 315 316 } … … 329 330 330 331 if (NT_STATUS_IS_OK(status)) { 331 t db_chainunlock(brl->w->tdb, kbuf);332 talloc_free(locked); 332 333 return NT_STATUS_OK; 333 334 } 334 335 } 335 336 336 dbuf = tdb_fetch(brl->w->tdb, kbuf);337 dbuf = dbwrap_record_get_value(locked); 337 338 338 339 lock.context.smbpid = smbpid; … … 359 360 360 361 /* no conflicts - add it to the list of locks */ 361 locks = realloc_p(locks, struct lock_struct, count+1); 362 /* FIXME: a dbwrap_record_append() would help here! */ 363 locks = talloc_array(locked, struct lock_struct, count+1); 362 364 if (!locks) { 363 365 status = NT_STATUS_NO_MEMORY; 364 366 goto fail; 365 } else { 366 dbuf.dptr = (uint8_t *)locks; 367 } 367 } 368 memcpy(locks, dbuf.dptr, dbuf.dsize); 368 369 locks[count] = lock; 370 371 dbuf.dptr = (unsigned char *)locks; 369 372 dbuf.dsize += sizeof(lock); 370 373 371 if (tdb_store(brl->w->tdb, kbuf, dbuf, TDB_REPLACE) != 0) {372 status = NT_STATUS_INTERNAL_DB_CORRUPTION;374 status = dbwrap_record_store(locked, dbuf, TDB_REPLACE); 375 if (!NT_STATUS_IS_OK(status)) { 373 376 goto fail; 374 377 } 375 378 376 free(dbuf.dptr); 377 tdb_chainunlock(brl->w->tdb, kbuf); 379 talloc_free(locked); 378 380 379 381 /* the caller needs to know if the real lock was granted. If … … 387 389 388 390 fail: 389 390 free(dbuf.dptr); 391 tdb_chainunlock(brl->w->tdb, kbuf); 391 talloc_free(locked); 392 392 return status; 393 393 } … … 420 420 last_notice = i; 421 421 } 422 messaging_send_ptr(brl->messaging_ctx, locks[i].context.server,422 imessaging_send_ptr(brl->imessaging_ctx, locks[i].context.server, 423 423 MSG_BRL_RETRY, locks[i].notify_ptr); 424 424 } … … 456 456 struct lock_struct *locks, *lock; 457 457 struct lock_context context; 458 struct db_record *locked; 458 459 NTSTATUS status; 459 460 … … 465 466 } 466 467 467 if (tdb_chainlock(brl->w->tdb, kbuf) != 0) { 468 locked = dbwrap_fetch_locked(brl->db, brl, kbuf); 469 if (!locked) { 468 470 return NT_STATUS_INTERNAL_DB_CORRUPTION; 469 471 } 470 471 dbuf = tdb_fetch(brl->w->tdb, kbuf); 472 if (!dbuf.dptr) { 473 tdb_chainunlock(brl->w->tdb, kbuf); 474 return NT_STATUS_RANGE_NOT_LOCKED; 475 } 472 dbuf = dbwrap_record_get_value(locked); 476 473 477 474 context.smbpid = smbpid; … … 510 507 /* found it - delete it */ 511 508 if (count == 1) { 512 if (tdb_delete(brl->w->tdb, kbuf) != 0) {513 status = NT_STATUS_INTERNAL_DB_CORRUPTION;509 status = dbwrap_record_delete(locked); 510 if (!NT_STATUS_IS_OK(status)) { 514 511 goto fail; 515 512 } … … 526 523 527 524 dbuf.dsize = count * sizeof(*locks); 528 529 if (tdb_store(brl->w->tdb, kbuf, dbuf, TDB_REPLACE) != 0) {530 status = NT_STATUS_INTERNAL_DB_CORRUPTION;525 526 status = dbwrap_record_store(locked, dbuf, TDB_REPLACE); 527 if (!NT_STATUS_IS_OK(status)) { 531 528 goto fail; 532 529 } 533 530 } 534 535 free(dbuf.dptr); 536 tdb_chainunlock(brl->w->tdb, kbuf); 531 532 talloc_free(locked); 537 533 return NT_STATUS_OK; 538 534 } … … 542 538 543 539 fail: 544 free(dbuf.dptr); 545 tdb_chainunlock(brl->w->tdb, kbuf); 540 talloc_free(locked); 546 541 return status; 547 542 } … … 561 556 struct lock_struct *locks; 562 557 NTSTATUS status; 558 struct db_record *locked; 563 559 564 560 kbuf.dptr = brlh->key.data; 565 561 kbuf.dsize = brlh->key.length; 566 562 567 if (tdb_chainlock(brl->w->tdb, kbuf) != 0) { 563 locked = dbwrap_fetch_locked(brl->db, brl, kbuf); 564 if (!locked) { 568 565 return NT_STATUS_INTERNAL_DB_CORRUPTION; 569 566 } 570 567 571 dbuf = tdb_fetch(brl->w->tdb, kbuf);568 dbuf = dbwrap_record_get_value(locked); 572 569 if (!dbuf.dptr) { 573 t db_chainunlock(brl->w->tdb, kbuf);570 talloc_free(locked); 574 571 return NT_STATUS_RANGE_NOT_LOCKED; 575 572 } … … 587 584 /* found it - delete it */ 588 585 if (count == 1) { 589 if (tdb_delete(brl->w->tdb, kbuf) != 0) {590 status = NT_STATUS_INTERNAL_DB_CORRUPTION;586 status = dbwrap_record_delete(locked); 587 if (!NT_STATUS_IS_OK(status)) { 591 588 goto fail; 592 589 } … … 598 595 count--; 599 596 dbuf.dsize = count * sizeof(*locks); 600 if (tdb_store(brl->w->tdb, kbuf, dbuf, TDB_REPLACE) != 0) { 601 status = NT_STATUS_INTERNAL_DB_CORRUPTION; 597 status = dbwrap_record_store(locked, dbuf, 598 TDB_REPLACE); 599 if (!NT_STATUS_IS_OK(status)) { 602 600 goto fail; 603 601 } 604 602 } 605 603 606 free(dbuf.dptr); 607 tdb_chainunlock(brl->w->tdb, kbuf); 604 talloc_free(locked); 608 605 return NT_STATUS_OK; 609 606 } … … 614 611 615 612 fail: 616 free(dbuf.dptr); 617 tdb_chainunlock(brl->w->tdb, kbuf); 613 talloc_free(locked); 618 614 return status; 619 615 } … … 632 628 int count, i; 633 629 struct lock_struct lock, *locks; 630 NTSTATUS status; 634 631 635 632 kbuf.dptr = brlh->key.data; … … 640 637 } 641 638 642 dbuf = tdb_fetch(brl->w->tdb, kbuf);643 if ( dbuf.dptr == NULL) {639 status = dbwrap_fetch(brl->db, brl, kbuf, &dbuf); 640 if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) { 644 641 return NT_STATUS_OK; 642 } else if (!NT_STATUS_IS_OK(status)) { 643 return status; 645 644 } 646 645 … … 659 658 for (i=0; i<count; i++) { 660 659 if (brl_tdb_conflict_other(&locks[i], &lock)) { 661 free(dbuf.dptr);660 talloc_free(dbuf.dptr); 662 661 return NT_STATUS_FILE_LOCK_CONFLICT; 663 662 } 664 663 } 665 664 666 free(dbuf.dptr);665 talloc_free(dbuf.dptr); 667 666 return NT_STATUS_OK; 668 667 } … … 678 677 int count, i, dcount=0; 679 678 struct lock_struct *locks; 679 struct db_record *locked; 680 680 NTSTATUS status; 681 681 … … 683 683 kbuf.dsize = brlh->key.length; 684 684 685 if (tdb_chainlock(brl->w->tdb, kbuf) != 0) { 685 locked = dbwrap_fetch_locked(brl->db, brl, kbuf); 686 if (!locked) { 686 687 return NT_STATUS_INTERNAL_DB_CORRUPTION; 687 688 } 688 689 dbuf = tdb_fetch(brl->w->tdb, kbuf); 689 dbuf = dbwrap_record_get_value(locked); 690 690 if (!dbuf.dptr) { 691 t db_chainunlock(brl->w->tdb, kbuf);691 talloc_free(locked); 692 692 return NT_STATUS_OK; 693 693 } … … 717 717 718 718 if (count == 0) { 719 if (tdb_delete(brl->w->tdb, kbuf) != 0) { 720 status = NT_STATUS_INTERNAL_DB_CORRUPTION; 721 } 719 status = dbwrap_record_delete(locked); 722 720 } else if (dcount != 0) { 723 721 /* tell all pending lock holders for this file that … … 728 726 dbuf.dsize = count * sizeof(*locks); 729 727 730 if (tdb_store(brl->w->tdb, kbuf, dbuf, TDB_REPLACE) != 0) { 731 status = NT_STATUS_INTERNAL_DB_CORRUPTION; 732 } 733 } 734 735 free(dbuf.dptr); 736 tdb_chainunlock(brl->w->tdb, kbuf); 728 status = dbwrap_record_store(locked, dbuf, TDB_REPLACE); 729 } 730 talloc_free(locked); 737 731 738 732 return status; … … 743 737 { 744 738 TDB_DATA kbuf, dbuf; 739 NTSTATUS status; 745 740 746 741 kbuf.dptr = brlh->key.data; … … 748 743 *count = 0; 749 744 750 if (tdb_chainlock(brl->w->tdb, kbuf) != 0) { 751 return NT_STATUS_INTERNAL_DB_CORRUPTION; 752 } 753 754 dbuf = tdb_fetch(brl->w->tdb, kbuf); 755 if (!dbuf.dptr) { 756 tdb_chainunlock(brl->w->tdb, kbuf); 745 status = dbwrap_fetch(brl->db, brl, kbuf, &dbuf); 746 if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) { 757 747 return NT_STATUS_OK; 758 } 759 748 } else if (!NT_STATUS_IS_OK(status)) { 749 return status; 750 } 760 751 *count = dbuf.dsize / sizeof(struct lock_struct); 761 752 762 free(dbuf.dptr); 763 tdb_chainunlock(brl->w->tdb, kbuf); 753 talloc_free(dbuf.dptr); 764 754 765 755 return NT_STATUS_OK; … … 780 770 void brl_tdb_init_ops(void) 781 771 { 782 brl _set_ops(&brlock_tdb_ops);783 } 772 brlock_set_ops(&brlock_tdb_ops); 773 } -
vendor/current/source4/ntvfs/common/init.c
r414 r988 27 27 #include "ntvfs/sysdep/sys_notify.h" 28 28 29 NTSTATUS ntvfs_common_init(void); 30 29 31 NTSTATUS ntvfs_common_init(void) 30 32 { -
vendor/current/source4/ntvfs/common/notify.c
r740 r988 26 26 #include "includes.h" 27 27 #include "system/filesys.h" 28 #include <tdb.h>29 #include "../lib/util/util_tdb.h"30 28 #include "messaging/messaging.h" 31 #include "lib/util/tdb_wrap.h"32 29 #include "lib/messaging/irpc.h" 33 #include "librpc/gen_ndr/ndr_ s4_notify.h"30 #include "librpc/gen_ndr/ndr_notify.h" 34 31 #include "../lib/util/dlinklist.h" 35 32 #include "ntvfs/common/ntvfs_common.h" … … 38 35 #include "param/param.h" 39 36 #include "lib/util/tsort.h" 37 #include "lib/dbwrap/dbwrap.h" 38 #include "../lib/util/util_tdb.h" 40 39 41 40 struct notify_context { 42 struct tdb_wrap *w;41 struct db_context *db; 43 42 struct server_id server; 44 struct messaging_context *messaging_ctx;43 struct imessaging_context *imessaging_ctx; 45 44 struct notify_list *list; 46 45 struct notify_array *array; 47 int seqnum;46 int64_t seqnum; 48 47 struct sys_notify_context *sys_notify_ctx; 49 48 }; … … 64 63 65 64 static NTSTATUS notify_remove_all(struct notify_context *notify); 66 static void notify_handler(struct messaging_context *msg_ctx, void *private_data,65 static void notify_handler(struct imessaging_context *msg_ctx, void *private_data, 67 66 uint32_t msg_type, struct server_id server_id, DATA_BLOB *data); 68 67 … … 72 71 static int notify_destructor(struct notify_context *notify) 73 72 { 74 messaging_deregister(notify->messaging_ctx, MSG_PVFS_NOTIFY, notify);73 imessaging_deregister(notify->imessaging_ctx, MSG_PVFS_NOTIFY, notify); 75 74 notify_remove_all(notify); 76 75 return 0; … … 79 78 /* 80 79 Open up the notify.tdb database. You should close it down using 81 talloc_free(). We need the messaging_ctx to allow for notifications80 talloc_free(). We need the imessaging_ctx to allow for notifications 82 81 via internal messages 83 82 */ 84 83 struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server, 85 struct messaging_context *messaging_ctx,84 struct imessaging_context *imessaging_ctx, 86 85 struct loadparm_context *lp_ctx, 87 86 struct tevent_context *ev, … … 103 102 } 104 103 105 notify-> w = cluster_tdb_tmp_open(notify, lp_ctx, "notify.tdb", TDB_SEQNUM);106 if (notify-> w== NULL) {104 notify->db = cluster_db_tmp_open(notify, lp_ctx, "notify", TDB_SEQNUM); 105 if (notify->db == NULL) { 107 106 talloc_free(notify); 108 107 return NULL; … … 110 109 111 110 notify->server = server; 112 notify-> messaging_ctx =messaging_ctx;111 notify->imessaging_ctx = imessaging_ctx; 113 112 notify->list = NULL; 114 113 notify->array = NULL; 115 notify->seqnum = tdb_get_seqnum(notify->w->tdb);114 notify->seqnum = dbwrap_get_seqnum(notify->db); 116 115 117 116 talloc_set_destructor(notify, notify_destructor); … … 119 118 /* register with the messaging subsystem for the notify 120 119 message type */ 121 messaging_register(notify->messaging_ctx, notify,120 imessaging_register(notify->imessaging_ctx, notify, 122 121 MSG_PVFS_NOTIFY, notify_handler); 123 122 … … 131 130 lock the notify db 132 131 */ 133 static NTSTATUS notify_lock(struct notify_context *notify) 134 { 135 if (tdb_lock_bystring(notify->w->tdb, NOTIFY_KEY) != 0) { 136 return NT_STATUS_INTERNAL_DB_CORRUPTION; 137 } 138 return NT_STATUS_OK; 139 } 140 141 /* 142 unlock the notify db 143 */ 144 static void notify_unlock(struct notify_context *notify) 145 { 146 tdb_unlock_bystring(notify->w->tdb, NOTIFY_KEY); 132 static struct db_record *notify_lock(struct notify_context *notify) 133 { 134 TDB_DATA key = string_term_tdb_data(NOTIFY_KEY); 135 136 return dbwrap_fetch_locked(notify->db, notify, key); 137 } 138 139 static void notify_unlock(struct db_record *lock) 140 { 141 talloc_free(lock); 147 142 } 148 143 … … 156 151 enum ndr_err_code ndr_err; 157 152 int seqnum; 158 159 seqnum = tdb_get_seqnum(notify->w->tdb); 153 NTSTATUS status; 154 155 seqnum = dbwrap_get_seqnum(notify->db); 160 156 161 157 if (seqnum == notify->seqnum && notify->array != NULL) { … … 169 165 NT_STATUS_HAVE_NO_MEMORY(notify->array); 170 166 171 dbuf = tdb_fetch_bystring(notify->w->tdb, NOTIFY_KEY);172 if ( dbuf.dptr == NULL) {167 status = dbwrap_fetch_bystring(notify->db, notify, NOTIFY_KEY, &dbuf); 168 if (!NT_STATUS_IS_OK(status)) { 173 169 return NT_STATUS_OK; 174 170 } … … 179 175 ndr_err = ndr_pull_struct_blob(&blob, notify->array, notify->array, 180 176 (ndr_pull_flags_fn_t)ndr_pull_notify_array); 181 free(dbuf.dptr);177 talloc_free(dbuf.dptr); 182 178 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 183 179 return ndr_map_error2ntstatus(ndr_err); … … 204 200 DATA_BLOB blob; 205 201 enum ndr_err_code ndr_err; 206 int ret;207 202 TALLOC_CTX *tmp_ctx; 203 NTSTATUS status; 208 204 209 205 /* if possible, remove some depth arrays */ … … 215 211 /* we might just be able to delete the record */ 216 212 if (notify->array->num_depths == 0) { 217 ret = tdb_delete_bystring(notify->w->tdb, NOTIFY_KEY); 218 if (ret != 0) { 219 return NT_STATUS_INTERNAL_DB_CORRUPTION; 220 } 221 return NT_STATUS_OK; 213 return dbwrap_delete_bystring(notify->db, NOTIFY_KEY); 222 214 } 223 215 … … 234 226 dbuf.dptr = blob.data; 235 227 dbuf.dsize = blob.length; 236 237 ret = tdb_store_bystring(notify->w->tdb, NOTIFY_KEY, dbuf, TDB_REPLACE); 228 229 status = dbwrap_store_bystring(notify->db, NOTIFY_KEY, dbuf, 230 TDB_REPLACE); 238 231 talloc_free(tmp_ctx); 239 if (ret != 0) { 240 return NT_STATUS_INTERNAL_DB_CORRUPTION; 241 } 242 243 return NT_STATUS_OK; 232 return status; 244 233 } 245 234 … … 248 237 handle incoming notify messages 249 238 */ 250 static void notify_handler(struct messaging_context *msg_ctx, void *private_data,239 static void notify_handler(struct imessaging_context *msg_ctx, void *private_data, 251 240 uint32_t msg_type, struct server_id server_id, DATA_BLOB *data) 252 241 { … … 355 344 size_t len; 356 345 int depth; 346 struct db_record *locked; 357 347 358 348 /* see if change notify is enabled at all */ … … 361 351 } 362 352 363 status = notify_lock(notify); 364 NT_STATUS_NOT_OK_RETURN(status); 353 locked = notify_lock(notify); 354 if (!locked) { 355 return NT_STATUS_INTERNAL_DB_CORRUPTION; 356 } 365 357 366 358 status = notify_load(notify); … … 416 408 417 409 done: 418 notify_unlock( notify);410 notify_unlock(locked); 419 411 talloc_free(tmp_path); 420 412 … … 431 423 int i, depth; 432 424 struct notify_depth *d; 425 struct db_record *locked; 433 426 434 427 /* see if change notify is enabled at all */ … … 451 444 talloc_free(listel); 452 445 453 status = notify_lock(notify); 454 NT_STATUS_NOT_OK_RETURN(status); 446 locked = notify_lock(notify); 447 if (!locked) { 448 return NT_STATUS_INTERNAL_DB_CORRUPTION; 449 } 455 450 456 451 status = notify_load(notify); 457 452 if (!NT_STATUS_IS_OK(status)) { 458 notify_unlock( notify);453 notify_unlock(locked); 459 454 return status; 460 455 } 461 456 462 457 if (depth >= notify->array->num_depths) { 463 notify_unlock( notify);458 notify_unlock(locked); 464 459 return NT_STATUS_OBJECT_NAME_NOT_FOUND; 465 460 } … … 475 470 } 476 471 if (i == d->num_entries) { 477 notify_unlock( notify);472 notify_unlock(locked); 478 473 return NT_STATUS_OBJECT_NAME_NOT_FOUND; 479 474 } … … 487 482 status = notify_save(notify); 488 483 489 notify_unlock( notify);484 notify_unlock(locked); 490 485 491 486 return status; … … 499 494 NTSTATUS status; 500 495 int i, depth, del_count=0; 496 struct db_record *locked; 501 497 502 498 if (notify->list == NULL) { … … 504 500 } 505 501 506 status = notify_lock(notify); 507 NT_STATUS_NOT_OK_RETURN(status); 502 locked = notify_lock(notify); 503 if (!locked) { 504 return NT_STATUS_INTERNAL_DB_CORRUPTION; 505 } 508 506 509 507 status = notify_load(notify); 510 508 if (!NT_STATUS_IS_OK(status)) { 511 notify_unlock( notify);509 notify_unlock(locked); 512 510 return status; 513 511 } … … 534 532 } 535 533 536 notify_unlock( notify);534 notify_unlock(locked); 537 535 538 536 return status; … … 553 551 554 552 ev.action = action; 553 ev.dir = discard_const_p(char, ""); 555 554 ev.path = path; 556 555 ev.private_data = e->private_data; … … 564 563 } 565 564 566 status = messaging_send(notify->messaging_ctx, e->server,565 status = imessaging_send(notify->imessaging_ctx, e->server, 567 566 MSG_PVFS_NOTIFY, &data); 567 if (!NT_STATUS_IS_OK(status)) { 568 talloc_free(tmp_ctx); 569 return; 570 } 571 568 572 talloc_free(tmp_ctx); 569 573 } -
vendor/current/source4/ntvfs/common/opendb.c
r414 r988 56 56 /* 57 57 Open up the openfiles.tdb database. Close it down using 58 talloc_free(). We need the messaging_ctx to allow for pending open58 talloc_free(). We need the imessaging_ctx to allow for pending open 59 59 notifications. 60 60 */ -
vendor/current/source4/ntvfs/common/opendb.h
r414 r988 58 58 void odb_set_ops(const struct opendb_ops *new_ops); 59 59 void odb_tdb_init_ops(void); 60 void odb_ctdb_init_ops(void); -
vendor/current/source4/ntvfs/common/opendb_tdb.c
r740 r988 41 41 #include "includes.h" 42 42 #include "system/filesys.h" 43 #include <tdb.h>43 #include "lib/dbwrap/dbwrap.h" 44 44 #include "messaging/messaging.h" 45 #include "lib/util/tdb_wrap.h"46 45 #include "lib/messaging/irpc.h" 47 46 #include "librpc/gen_ndr/ndr_opendb.h" … … 53 52 54 53 struct odb_context { 55 struct tdb_wrap *w;54 struct db_context *db; 56 55 struct ntvfs_context *ntvfs_ctx; 57 56 bool oplocks; … … 65 64 struct odb_lock { 66 65 struct odb_context *odb; 67 TDB_DATA key;66 struct db_record *locked; 68 67 69 68 struct opendb_file file; … … 75 74 }; 76 75 77 static NTSTATUS odb_oplock_break_send(struct messaging_context *msg_ctx,76 static NTSTATUS odb_oplock_break_send(struct imessaging_context *msg_ctx, 78 77 struct opendb_entry *e, 79 78 uint8_t level); … … 81 80 /* 82 81 Open up the openfiles.tdb database. Close it down using 83 talloc_free(). We need the messaging_ctx to allow for pending open82 talloc_free(). We need the imessaging_ctx to allow for pending open 84 83 notifications. 85 84 */ … … 94 93 } 95 94 96 odb->w = cluster_tdb_tmp_open(odb, ntvfs_ctx->lp_ctx, "openfiles.tdb", TDB_DEFAULT); 97 if (odb->w == NULL) { 95 odb->db = cluster_db_tmp_open(odb, ntvfs_ctx->lp_ctx, 96 "openfiles", TDB_DEFAULT); 97 if (odb->db == NULL) { 98 98 talloc_free(odb); 99 99 return NULL; … … 112 112 } 113 113 114 /*115 destroy a lock on the database116 */117 static int odb_lock_destructor(struct odb_lock *lck)118 {119 tdb_chainunlock(lck->odb->w->tdb, lck->key);120 return 0;121 }122 123 114 static NTSTATUS odb_pull_record(struct odb_lock *lck, struct opendb_file *file); 124 115 … … 132 123 struct odb_lock *lck; 133 124 NTSTATUS status; 125 TDB_DATA key; 134 126 135 127 lck = talloc(mem_ctx, struct odb_lock); … … 139 131 140 132 lck->odb = talloc_reference(lck, odb); 141 lck->key.dptr = talloc_memdup(lck, file_key->data, file_key->length);142 lck->key.dsize = file_key->length;143 if ( lck->key.dptr == NULL) {133 key.dptr = talloc_memdup(lck, file_key->data, file_key->length); 134 key.dsize = file_key->length; 135 if (key.dptr == NULL) { 144 136 talloc_free(lck); 145 137 return NULL; 146 138 } 147 139 148 if (tdb_chainlock(odb->w->tdb, lck->key) != 0) { 140 lck->locked = dbwrap_fetch_locked(odb->db, lck, key); 141 if (!lck->locked) { 149 142 talloc_free(lck); 150 143 return NULL; … … 152 145 153 146 ZERO_STRUCT(lck->can_open); 154 155 talloc_set_destructor(lck, odb_lock_destructor);156 147 157 148 status = odb_pull_record(lck, &lck->file); … … 169 160 static DATA_BLOB odb_tdb_get_key(TALLOC_CTX *mem_ctx, struct odb_lock *lck) 170 161 { 171 return data_blob_talloc(mem_ctx, lck->key.dptr, lck->key.dsize); 162 TDB_DATA key = dbwrap_record_get_key(lck->locked); 163 return data_blob_talloc(mem_ctx, key.dptr, key.dsize); 172 164 } 173 165 … … 234 226 static NTSTATUS odb_pull_record(struct odb_lock *lck, struct opendb_file *file) 235 227 { 236 struct odb_context *odb = lck->odb;237 228 TDB_DATA dbuf; 238 229 DATA_BLOB blob; 239 230 enum ndr_err_code ndr_err; 240 231 241 dbuf = tdb_fetch(odb->w->tdb, lck->key);242 if ( dbuf.dptr == NULL) {232 dbuf = dbwrap_record_get_value(lck->locked); 233 if (!dbuf.dptr) { 243 234 return NT_STATUS_OBJECT_NAME_NOT_FOUND; 244 235 } … … 248 239 249 240 ndr_err = ndr_pull_struct_blob(&blob, lck, file, (ndr_pull_flags_fn_t)ndr_pull_opendb_file); 250 free(dbuf.dptr);251 241 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { 252 242 return ndr_map_error2ntstatus(ndr_err); … … 261 251 static NTSTATUS odb_push_record(struct odb_lock *lck, struct opendb_file *file) 262 252 { 263 struct odb_context *odb = lck->odb;264 253 TDB_DATA dbuf; 265 254 DATA_BLOB blob; 266 255 enum ndr_err_code ndr_err; 267 int ret;256 NTSTATUS status; 268 257 269 258 if (file->num_entries == 0) { 270 ret = tdb_delete(odb->w->tdb, lck->key); 271 if (ret != 0) { 272 return NT_STATUS_INTERNAL_DB_CORRUPTION; 273 } 274 return NT_STATUS_OK; 259 return dbwrap_record_delete(lck->locked); 275 260 } 276 261 … … 283 268 dbuf.dsize = blob.length; 284 269 285 ret = tdb_store(odb->w->tdb, lck->key, dbuf, TDB_REPLACE);270 status = dbwrap_record_store(lck->locked, dbuf, TDB_REPLACE); 286 271 data_blob_free(&blob); 287 if (ret != 0) { 288 return NT_STATUS_INTERNAL_DB_CORRUPTION; 289 } 290 291 return NT_STATUS_OK; 272 return status; 292 273 } 293 274 … … 295 276 send an oplock break to a client 296 277 */ 297 static NTSTATUS odb_oplock_break_send(struct messaging_context *msg_ctx,278 static NTSTATUS odb_oplock_break_send(struct imessaging_context *msg_ctx, 298 279 struct opendb_entry *e, 299 280 uint8_t level) … … 312 293 blob = data_blob_const(&op_break, sizeof(op_break)); 313 294 314 status = messaging_send(msg_ctx, e->server,295 status = imessaging_send(msg_ctx, e->server, 315 296 MSG_NTVFS_OPLOCK_BREAK, &blob); 316 297 NT_STATUS_NOT_OK_RETURN(status); … … 612 593 /* send any pending notifications, removing them once sent */ 613 594 for (i=0;i<lck->file.num_pending;i++) { 614 messaging_send_ptr(odb->ntvfs_ctx->msg_ctx,595 imessaging_send_ptr(odb->ntvfs_ctx->msg_ctx, 615 596 lck->file.pending[i].server, 616 597 MSG_PVFS_RETRY_OPEN, … … 667 648 /* send any pending notifications, removing them once sent */ 668 649 for (i=0;i<lck->file.num_pending;i++) { 669 messaging_send_ptr(odb->ntvfs_ctx->msg_ctx,650 imessaging_send_ptr(odb->ntvfs_ctx->msg_ctx, 670 651 lck->file.pending[i].server, 671 652 MSG_PVFS_RETRY_OPEN, -
vendor/current/source4/ntvfs/common/wscript_build
r740 r988 4 4 source='init.c brlock.c brlock_tdb.c opendb.c opendb_tdb.c notify.c', 5 5 autoproto='proto.h', 6 deps='util_tdb tdb-wrap', 6 7 public_deps='NDR_OPENDB NDR_NOTIFY sys_notify sys_lease share' 7 8 ) -
vendor/current/source4/ntvfs/ipc/ipc_rap.c
r740 r988 256 256 struct rap_NetShareEnum r; 257 257 NTSTATUS result; 258 uint32_t offset_save = 0; 259 struct rap_heap_save heap_save = {0}; 258 260 259 261 RAP_GOTO(rap_srv_pull_word(call, &r.in.level)); … … 283 285 284 286 int i = r.out.count; 285 uint32_t offset_save;286 struct rap_heap_save heap_save;287 287 288 288 offset_save = call->ndr_push_data->offset; … … 336 336 struct rap_NetServerEnum2 r; 337 337 NTSTATUS result; 338 uint32_t offset_save = 0; 339 struct rap_heap_save heap_save = {0}; 338 340 339 341 RAP_GOTO(rap_srv_pull_word(call, &r.in.level)); … … 365 367 366 368 int i = r.out.count; 367 uint32_t offset_save;368 struct rap_heap_save heap_save;369 369 370 370 offset_save = call->ndr_push_data->offset; -
vendor/current/source4/ntvfs/ipc/rap_server.c
r740 r988 73 73 r->out.info[i].info1.reserved1 = 0; 74 74 r->out.info[i].info1.share_type = dcesrv_common_get_share_type(mem_ctx, NULL, scfg); 75 r->out.info[i].info1.comment = talloc_strdup(mem_ctx, share_string_option(scfg, SHARE_COMMENT, ""));75 r->out.info[i].info1.comment = share_string_option(mem_ctx, scfg, SHARE_COMMENT, ""); 76 76 talloc_free(scfg); 77 77 j++; -
vendor/current/source4/ntvfs/ipc/vfs_ipc.c
r740 r988 30 30 #include "../librpc/gen_ndr/rap.h" 31 31 #include "ntvfs/ipc/proto.h" 32 #include " libcli/raw/ioctl.h"32 #include "../libcli/smb/smb_constants.h" 33 33 #include "param/param.h" 34 34 #include "../lib/tsocket/tsocket.h" … … 39 39 #include "auth/credentials/credentials.h" 40 40 #include "auth/credentials/credentials_krb5.h" 41 #include <gssapi/gssapi.h> 41 #include "system/kerberos.h" 42 #include "system/gssapi.h" 42 43 #include "system/locale.h" 44 #include "system/filesys.h" 43 45 44 46 /* this is the private structure used to keep the state of an open … … 259 261 case RAW_OPEN_NTTRANS_CREATE: 260 262 fname = oi->ntcreatex.in.fname; 263 while (fname[0] == '\\') fname++; 261 264 break; 262 265 case RAW_OPEN_OPENX: 263 266 fname = oi->openx.in.fname; 267 while (fname[0] == '\\') fname++; 268 if (strncasecmp(fname, "PIPE\\", 5) != 0) { 269 return NT_STATUS_OBJECT_PATH_SYNTAX_BAD; 270 } 271 while (fname[0] == '\\') fname++; 264 272 break; 265 273 case RAW_OPEN_SMB2: … … 282 290 p = talloc(h, struct pipe_state); 283 291 NT_STATUS_HAVE_NO_MEMORY(p); 284 285 while (fname[0] == '\\') fname++;286 292 287 293 /* check for valid characters in name */ … … 354 360 TALLOC_FREE(subreq); 355 361 if (ret == -1) { 356 status = map_nt_error_from_unix (sys_errno);362 status = map_nt_error_from_unix_common(sys_errno); 357 363 goto reply; 358 364 } … … 603 609 TALLOC_FREE(subreq); 604 610 if (ret == -1) { 605 status = map_nt_error_from_unix (sys_errno);611 status = map_nt_error_from_unix_common(sys_errno); 606 612 goto reply; 607 613 } … … 688 694 TALLOC_FREE(subreq); 689 695 if (ret == -1) { 690 status = map_nt_error_from_unix (sys_errno);696 status = map_nt_error_from_unix_common(sys_errno); 691 697 goto reply; 692 698 } … … 732 738 struct pipe_state *p; 733 739 734 if (io->generic.level != RAW_CLOSE_ CLOSE) {740 if (io->generic.level != RAW_CLOSE_GENERIC) { 735 741 return ntvfs_map_close(ntvfs, req, io); 736 742 } 737 743 738 p = pipe_state_find(ipriv, io->close.in.file.ntvfs); 744 ZERO_STRUCT(io->generic.out); 745 746 p = pipe_state_find(ipriv, io->generic.in.file.ntvfs); 739 747 if (!p) { 740 748 return NT_STATUS_INVALID_HANDLE; … … 1010 1018 goto reply; 1011 1019 } else if (ret == -1) { 1012 status = map_nt_error_from_unix (sys_errno);1020 status = map_nt_error_from_unix_common(sys_errno); 1013 1021 goto reply; 1014 1022 } … … 1046 1054 TALLOC_FREE(subreq); 1047 1055 if (ret == -1) { 1048 status = map_nt_error_from_unix (sys_errno);1056 status = map_nt_error_from_unix_common(sys_errno); 1049 1057 goto reply; 1050 1058 } … … 1174 1182 io->smb2.out.unknown2 = 0; 1175 1183 io->smb2.out.unknown3 = 0; 1176 io->smb2.out.in = io->smb2.in.out;1184 io->smb2.out.in = data_blob_null; 1177 1185 io->smb2.out.out = data_blob_talloc(req, NULL, io->smb2.in.max_response_size); 1178 1186 NT_STATUS_HAVE_NO_MEMORY(io->smb2.out.out.data); … … 1216 1224 TALLOC_FREE(subreq); 1217 1225 if (ret == -1) { 1218 status = map_nt_error_from_unix (sys_errno);1226 status = map_nt_error_from_unix_common(sys_errno); 1219 1227 goto reply; 1220 1228 } … … 1252 1260 TALLOC_FREE(subreq); 1253 1261 if (ret == -1) { 1254 status = map_nt_error_from_unix (sys_errno);1262 status = map_nt_error_from_unix_common(sys_errno); 1255 1263 goto reply; 1256 1264 } … … 1303 1311 1304 1312 /* fill in all the operations */ 1305 ops.connect = ipc_connect;1306 ops.disconnect = ipc_disconnect;1307 ops.unlink = ipc_unlink;1308 ops.chkpath = ipc_chkpath;1309 ops.qpathinfo = ipc_qpathinfo;1310 ops.setpathinfo = ipc_setpathinfo;1311 ops.open = ipc_open;1312 ops.mkdir = ipc_mkdir;1313 ops.rmdir = ipc_rmdir;1314 ops.rename = ipc_rename;1315 ops.copy = ipc_copy;1316 ops.ioctl = ipc_ioctl;1317 ops.read = ipc_read;1318 ops.write = ipc_write;1319 ops.seek = ipc_seek;1320 ops.flush = ipc_flush;1321 ops.close = ipc_close;1322 ops.exit = ipc_exit;1323 ops.lock = ipc_lock;1324 ops.setfileinfo = ipc_setfileinfo;1325 ops.qfileinfo = ipc_qfileinfo;1326 ops.fsinfo = ipc_fsinfo;1327 ops.lpq = ipc_lpq;1328 ops.search_first = ipc_search_first;1329 ops.search_next = ipc_search_next;1330 ops.search_close = ipc_search_close;1331 ops.trans = ipc_trans;1332 ops.logoff = ipc_logoff;1333 ops.async_setup = ipc_async_setup;1334 ops.cancel = ipc_cancel;1313 ops.connect_fn = ipc_connect; 1314 ops.disconnect_fn = ipc_disconnect; 1315 ops.unlink_fn = ipc_unlink; 1316 ops.chkpath_fn = ipc_chkpath; 1317 ops.qpathinfo_fn = ipc_qpathinfo; 1318 ops.setpathinfo_fn = ipc_setpathinfo; 1319 ops.open_fn = ipc_open; 1320 ops.mkdir_fn = ipc_mkdir; 1321 ops.rmdir_fn = ipc_rmdir; 1322 ops.rename_fn = ipc_rename; 1323 ops.copy_fn = ipc_copy; 1324 ops.ioctl_fn = ipc_ioctl; 1325 ops.read_fn = ipc_read; 1326 ops.write_fn = ipc_write; 1327 ops.seek_fn = ipc_seek; 1328 ops.flush_fn = ipc_flush; 1329 ops.close_fn = ipc_close; 1330 ops.exit_fn = ipc_exit; 1331 ops.lock_fn = ipc_lock; 1332 ops.setfileinfo_fn = ipc_setfileinfo; 1333 ops.qfileinfo_fn = ipc_qfileinfo; 1334 ops.fsinfo_fn = ipc_fsinfo; 1335 ops.lpq_fn = ipc_lpq; 1336 ops.search_first_fn = ipc_search_first; 1337 ops.search_next_fn = ipc_search_next; 1338 ops.search_close_fn = ipc_search_close; 1339 ops.trans_fn = ipc_trans; 1340 ops.logoff_fn = ipc_logoff; 1341 ops.async_setup_fn = ipc_async_setup; 1342 ops.cancel_fn = ipc_cancel; 1335 1343 1336 1344 /* register ourselves with the NTVFS subsystem. */ -
vendor/current/source4/ntvfs/nbench/vfs_nbench.c
r740 r988 28 28 #include "system/filesys.h" 29 29 30 NTSTATUS ntvfs_nbench_init(void); 31 30 32 /* this is stored in ntvfs_private */ 31 33 struct nbench_private { … … 125 127 126 128 logname = talloc_asprintf(req, "/tmp/nbenchlog%d.%u", ntvfs->depth, 127 getpid());129 (unsigned int)getpid()); 128 130 NT_STATUS_HAVE_NO_MEMORY(logname); 129 131 nprivates->log_fd = open(logname, O_WRONLY|O_CREAT|O_APPEND, 0644); … … 164 166 { 165 167 union smb_unlink *unl = req->async_states->private_data; 166 167 168 nbench_log(req, "Unlink \"%s\" 0x%x %s\n", 168 169 unl->unlink.in.pattern, unl->unlink.in.attrib, 169 get_nt_error_c_code(req ->async_states->status));170 get_nt_error_c_code(req, req->async_states->status)); 170 171 171 172 PASS_THRU_REP_POST(req); … … 212 213 nbench_log(req, "Chkpath \"%s\" %s\n", 213 214 cp->chkpath.in.path, 214 get_nt_error_c_code(req ->async_states->status));215 get_nt_error_c_code(req, req->async_states->status)); 215 216 216 217 PASS_THRU_REP_POST(req); … … 238 239 info->generic.in.file.path, 239 240 info->generic.level, 240 get_nt_error_c_code(req ->async_states->status));241 get_nt_error_c_code(req, req->async_states->status)); 241 242 242 243 PASS_THRU_REP_POST(req); … … 263 264 nbench_ntvfs_handle_string(req, info->generic.in.file.ntvfs), 264 265 info->generic.level, 265 get_nt_error_c_code(req ->async_states->status));266 get_nt_error_c_code(req, req->async_states->status)); 266 267 267 268 PASS_THRU_REP_POST(req); … … 288 289 st->generic.in.file.path, 289 290 st->generic.level, 290 get_nt_error_c_code(req ->async_states->status));291 get_nt_error_c_code(req, req->async_states->status)); 291 292 292 293 PASS_THRU_REP_POST(req); … … 320 321 io->ntcreatex.in.open_disposition, 321 322 nbench_ntvfs_handle_string(req, io->ntcreatex.out.file.ntvfs), 322 get_nt_error_c_code(req ->async_states->status));323 get_nt_error_c_code(req, req->async_states->status)); 323 324 break; 324 325 … … 372 373 nbench_log(req, "Rmdir \"%s\" %s\n", 373 374 rd->in.path, 374 get_nt_error_c_code(req ->async_states->status));375 get_nt_error_c_code(req, req->async_states->status)); 375 376 376 377 PASS_THRU_REP_POST(req); … … 399 400 ren->rename.in.pattern1, 400 401 ren->rename.in.pattern2, 401 get_nt_error_c_code(req ->async_states->status));402 get_nt_error_c_code(req, req->async_states->status)); 402 403 break; 403 404 … … 458 459 rd->readx.in.maxcnt, 459 460 rd->readx.out.nread, 460 get_nt_error_c_code(req ->async_states->status));461 get_nt_error_c_code(req, req->async_states->status)); 461 462 break; 462 463 default: … … 496 497 wr->writex.in.count, 497 498 wr->writex.out.nwritten, 498 get_nt_error_c_code(req ->async_states->status));499 get_nt_error_c_code(req, req->async_states->status)); 499 500 break; 500 501 … … 508 509 wr->write.in.count, 509 510 wr->write.out.nwritten, 510 get_nt_error_c_code(req ->async_states->status));511 get_nt_error_c_code(req, req->async_states->status)); 511 512 break; 512 513 … … 562 563 nbench_log(req, "Flush %s %s\n", 563 564 nbench_ntvfs_handle_string(req, io->flush.in.file.ntvfs), 564 get_nt_error_c_code(req ->async_states->status));565 get_nt_error_c_code(req, req->async_states->status)); 565 566 break; 566 567 case RAW_FLUSH_ALL: 567 568 nbench_log(req, "Flush %d %s\n", 568 569 0xFFFF, 569 get_nt_error_c_code(req ->async_states->status));570 get_nt_error_c_code(req, req->async_states->status)); 570 571 break; 571 572 default: … … 600 601 nbench_log(req, "Close %s %s\n", 601 602 nbench_ntvfs_handle_string(req, io->close.in.file.ntvfs), 602 get_nt_error_c_code(req ->async_states->status));603 get_nt_error_c_code(req, req->async_states->status)); 603 604 break; 604 605 … … 717 718 (int)lck->lockx.in.locks[0].offset, 718 719 (int)lck->lockx.in.locks[0].count, 719 get_nt_error_c_code(req ->async_states->status));720 get_nt_error_c_code(req, req->async_states->status)); 720 721 } else if (lck->generic.level == RAW_LOCK_LOCKX && 721 722 lck->lockx.in.ulock_cnt == 1) { … … 724 725 (int)lck->lockx.in.locks[0].offset, 725 726 (int)lck->lockx.in.locks[0].count, 726 get_nt_error_c_code(req ->async_states->status));727 get_nt_error_c_code(req, req->async_states->status)); 727 728 } else { 728 729 nbench_log(req, "Lock-%d - NOT HANDLED\n", lck->generic.level); … … 752 753 nbench_ntvfs_handle_string(req, info->generic.in.file.ntvfs), 753 754 info->generic.level, 754 get_nt_error_c_code(req ->async_states->status));755 get_nt_error_c_code(req, req->async_states->status)); 755 756 756 757 PASS_THRU_REP_POST(req); … … 777 778 nbench_log(req, "QUERY_FS_INFORMATION %d %s\n", 778 779 fs->generic.level, 779 get_nt_error_c_code(req ->async_states->status));780 get_nt_error_c_code(req, req->async_states->status)); 780 781 781 782 PASS_THRU_REP_POST(req); … … 831 832 io->t2ffirst.in.max_count, 832 833 io->t2ffirst.out.count, 833 get_nt_error_c_code(req ->async_states->status));834 get_nt_error_c_code(req, req->async_states->status)); 834 835 break; 835 836 … … 930 931 931 932 /* fill in all the operations */ 932 ops.connect = nbench_connect;933 ops.disconnect = nbench_disconnect;934 ops.unlink = nbench_unlink;935 ops.chkpath = nbench_chkpath;936 ops.qpathinfo = nbench_qpathinfo;937 ops.setpathinfo = nbench_setpathinfo;938 ops.open = nbench_open;939 ops.mkdir = nbench_mkdir;940 ops.rmdir = nbench_rmdir;941 ops.rename = nbench_rename;942 ops.copy = nbench_copy;943 ops.ioctl = nbench_ioctl;944 ops.read = nbench_read;945 ops.write = nbench_write;946 ops.seek = nbench_seek;947 ops.flush = nbench_flush;948 ops.close = nbench_close;949 ops.exit = nbench_exit;950 ops.lock = nbench_lock;951 ops.setfileinfo = nbench_setfileinfo;952 ops.qfileinfo = nbench_qfileinfo;953 ops.fsinfo = nbench_fsinfo;954 ops.lpq = nbench_lpq;955 ops.search_first = nbench_search_first;956 ops.search_next = nbench_search_next;957 ops.search_close = nbench_search_close;958 ops.trans = nbench_trans;959 ops.logoff = nbench_logoff;960 ops.async_setup = nbench_async_setup;961 ops.cancel = nbench_cancel;933 ops.connect_fn = nbench_connect; 934 ops.disconnect_fn = nbench_disconnect; 935 ops.unlink_fn = nbench_unlink; 936 ops.chkpath_fn = nbench_chkpath; 937 ops.qpathinfo_fn = nbench_qpathinfo; 938 ops.setpathinfo_fn = nbench_setpathinfo; 939 ops.open_fn = nbench_open; 940 ops.mkdir_fn = nbench_mkdir; 941 ops.rmdir_fn = nbench_rmdir; 942 ops.rename_fn = nbench_rename; 943 ops.copy_fn = nbench_copy; 944 ops.ioctl_fn = nbench_ioctl; 945 ops.read_fn = nbench_read; 946 ops.write_fn = nbench_write; 947 ops.seek_fn = nbench_seek; 948 ops.flush_fn = nbench_flush; 949 ops.close_fn = nbench_close; 950 ops.exit_fn = nbench_exit; 951 ops.lock_fn = nbench_lock; 952 ops.setfileinfo_fn = nbench_setfileinfo; 953 ops.qfileinfo_fn = nbench_qfileinfo; 954 ops.fsinfo_fn = nbench_fsinfo; 955 ops.lpq_fn = nbench_lpq; 956 ops.search_first_fn = nbench_search_first; 957 ops.search_next_fn = nbench_search_next; 958 ops.search_close_fn = nbench_search_close; 959 ops.trans_fn = nbench_trans; 960 ops.logoff_fn = nbench_logoff; 961 ops.async_setup_fn = nbench_async_setup; 962 ops.cancel_fn = nbench_cancel; 962 963 963 964 /* we don't register a trans2 handler as we want to be able to 964 965 log individual trans2 requests */ 965 ops.trans2 = NULL;966 ops.trans2_fn = NULL; 966 967 967 968 /* register ourselves with the NTVFS subsystem. */ -
vendor/current/source4/ntvfs/ntvfs.h
r740 r988 25 25 #include "param/share.h" 26 26 #include "librpc/gen_ndr/security.h" 27 #include "librpc/gen_ndr/server_id 4.h"27 #include "librpc/gen_ndr/server_id.h" 28 28 29 29 /* modules can use the following to determine if the interface has changed */ … … 48 48 49 49 /* initial setup */ 50 NTSTATUS (*connect )(struct ntvfs_module_context *ntvfs,50 NTSTATUS (*connect_fn)(struct ntvfs_module_context *ntvfs, 51 51 struct ntvfs_request *req, 52 52 union smb_tcon *tcon); 53 NTSTATUS (*disconnect )(struct ntvfs_module_context *ntvfs);53 NTSTATUS (*disconnect_fn)(struct ntvfs_module_context *ntvfs); 54 54 55 55 /* async_setup - called when a backend is processing a async request */ 56 NTSTATUS (*async_setup )(struct ntvfs_module_context *ntvfs,56 NTSTATUS (*async_setup_fn)(struct ntvfs_module_context *ntvfs, 57 57 struct ntvfs_request *req, 58 58 void *private_data); 59 59 60 60 /* filesystem operations */ 61 NTSTATUS (*fsinfo )(struct ntvfs_module_context *ntvfs,61 NTSTATUS (*fsinfo_fn)(struct ntvfs_module_context *ntvfs, 62 62 struct ntvfs_request *req, 63 63 union smb_fsinfo *fs); 64 64 65 65 /* path operations */ 66 NTSTATUS (*unlink )(struct ntvfs_module_context *ntvfs,66 NTSTATUS (*unlink_fn)(struct ntvfs_module_context *ntvfs, 67 67 struct ntvfs_request *req, 68 68 union smb_unlink *unl); 69 NTSTATUS (*chkpath )(struct ntvfs_module_context *ntvfs,69 NTSTATUS (*chkpath_fn)(struct ntvfs_module_context *ntvfs, 70 70 struct ntvfs_request *req, 71 71 union smb_chkpath *cp); 72 NTSTATUS (*qpathinfo )(struct ntvfs_module_context *ntvfs,72 NTSTATUS (*qpathinfo_fn)(struct ntvfs_module_context *ntvfs, 73 73 struct ntvfs_request *req, 74 74 union smb_fileinfo *st); 75 NTSTATUS (*setpathinfo )(struct ntvfs_module_context *ntvfs,75 NTSTATUS (*setpathinfo_fn)(struct ntvfs_module_context *ntvfs, 76 76 struct ntvfs_request *req, 77 77 union smb_setfileinfo *st); 78 NTSTATUS (*mkdir )(struct ntvfs_module_context *ntvfs,78 NTSTATUS (*mkdir_fn)(struct ntvfs_module_context *ntvfs, 79 79 struct ntvfs_request *req, 80 80 union smb_mkdir *md); 81 NTSTATUS (*rmdir )(struct ntvfs_module_context *ntvfs,81 NTSTATUS (*rmdir_fn)(struct ntvfs_module_context *ntvfs, 82 82 struct ntvfs_request *req, 83 83 struct smb_rmdir *rd); 84 NTSTATUS (*rename )(struct ntvfs_module_context *ntvfs,84 NTSTATUS (*rename_fn)(struct ntvfs_module_context *ntvfs, 85 85 struct ntvfs_request *req, 86 86 union smb_rename *ren); 87 NTSTATUS (*copy )(struct ntvfs_module_context *ntvfs,87 NTSTATUS (*copy_fn)(struct ntvfs_module_context *ntvfs, 88 88 struct ntvfs_request *req, 89 89 struct smb_copy *cp); 90 NTSTATUS (*open )(struct ntvfs_module_context *ntvfs,90 NTSTATUS (*open_fn)(struct ntvfs_module_context *ntvfs, 91 91 struct ntvfs_request *req, 92 92 union smb_open *oi); 93 93 94 94 /* directory search */ 95 NTSTATUS (*search_first )(struct ntvfs_module_context *ntvfs,95 NTSTATUS (*search_first_fn)(struct ntvfs_module_context *ntvfs, 96 96 struct ntvfs_request *req, 97 97 union smb_search_first *io, void *private_data, 98 bool (*callback )(void *private_data, const union smb_search_data *file));99 NTSTATUS (*search_next )(struct ntvfs_module_context *ntvfs,98 bool (*callback_fn)(void *private_data, const union smb_search_data *file)); 99 NTSTATUS (*search_next_fn)(struct ntvfs_module_context *ntvfs, 100 100 struct ntvfs_request *req, 101 101 union smb_search_next *io, void *private_data, 102 bool (*callback )(void *private_data, const union smb_search_data *file));103 NTSTATUS (*search_close )(struct ntvfs_module_context *ntvfs,102 bool (*callback_fn)(void *private_data, const union smb_search_data *file)); 103 NTSTATUS (*search_close_fn)(struct ntvfs_module_context *ntvfs, 104 104 struct ntvfs_request *req, 105 105 union smb_search_close *io); 106 106 107 107 /* operations on open files */ 108 NTSTATUS (*ioctl )(struct ntvfs_module_context *ntvfs,108 NTSTATUS (*ioctl_fn)(struct ntvfs_module_context *ntvfs, 109 109 struct ntvfs_request *req, 110 110 union smb_ioctl *io); 111 NTSTATUS (*read )(struct ntvfs_module_context *ntvfs,111 NTSTATUS (*read_fn)(struct ntvfs_module_context *ntvfs, 112 112 struct ntvfs_request *req, 113 113 union smb_read *io); 114 NTSTATUS (*write )(struct ntvfs_module_context *ntvfs,114 NTSTATUS (*write_fn)(struct ntvfs_module_context *ntvfs, 115 115 struct ntvfs_request *req, 116 116 union smb_write *io); 117 NTSTATUS (*seek )(struct ntvfs_module_context *ntvfs,117 NTSTATUS (*seek_fn)(struct ntvfs_module_context *ntvfs, 118 118 struct ntvfs_request *req, 119 119 union smb_seek *io); 120 NTSTATUS (*flush )(struct ntvfs_module_context *ntvfs,120 NTSTATUS (*flush_fn)(struct ntvfs_module_context *ntvfs, 121 121 struct ntvfs_request *req, 122 122 union smb_flush *flush); 123 NTSTATUS (*lock )(struct ntvfs_module_context *ntvfs,123 NTSTATUS (*lock_fn)(struct ntvfs_module_context *ntvfs, 124 124 struct ntvfs_request *req, 125 125 union smb_lock *lck); 126 NTSTATUS (*qfileinfo )(struct ntvfs_module_context *ntvfs,126 NTSTATUS (*qfileinfo_fn)(struct ntvfs_module_context *ntvfs, 127 127 struct ntvfs_request *req, 128 128 union smb_fileinfo *info); 129 NTSTATUS (*setfileinfo )(struct ntvfs_module_context *ntvfs,129 NTSTATUS (*setfileinfo_fn)(struct ntvfs_module_context *ntvfs, 130 130 struct ntvfs_request *req, 131 131 union smb_setfileinfo *info); 132 NTSTATUS (*close )(struct ntvfs_module_context *ntvfs,132 NTSTATUS (*close_fn)(struct ntvfs_module_context *ntvfs, 133 133 struct ntvfs_request *req, 134 134 union smb_close *io); 135 135 136 136 /* trans interface - used by IPC backend for pipes and RAP calls */ 137 NTSTATUS (*trans )(struct ntvfs_module_context *ntvfs,137 NTSTATUS (*trans_fn)(struct ntvfs_module_context *ntvfs, 138 138 struct ntvfs_request *req, 139 139 struct smb_trans2 *trans); 140 140 141 141 /* trans2 interface - only used by CIFS backend to prover complete passthru for testing */ 142 NTSTATUS (*trans2 )(struct ntvfs_module_context *ntvfs,142 NTSTATUS (*trans2_fn)(struct ntvfs_module_context *ntvfs, 143 143 struct ntvfs_request *req, 144 144 struct smb_trans2 *trans2); 145 145 146 146 /* change notify request */ 147 NTSTATUS (*notify )(struct ntvfs_module_context *ntvfs,147 NTSTATUS (*notify_fn)(struct ntvfs_module_context *ntvfs, 148 148 struct ntvfs_request *req, 149 149 union smb_notify *info); 150 150 151 151 /* cancel - cancels any pending async request */ 152 NTSTATUS (*cancel )(struct ntvfs_module_context *ntvfs,152 NTSTATUS (*cancel_fn)(struct ntvfs_module_context *ntvfs, 153 153 struct ntvfs_request *req); 154 154 155 155 /* printing specific operations */ 156 NTSTATUS (*lpq )(struct ntvfs_module_context *ntvfs,156 NTSTATUS (*lpq_fn)(struct ntvfs_module_context *ntvfs, 157 157 struct ntvfs_request *req, 158 158 union smb_lpq *lpq); 159 159 160 160 /* logoff - called when a vuid is closed */ 161 NTSTATUS (*logoff )(struct ntvfs_module_context *ntvfs,161 NTSTATUS (*logoff_fn)(struct ntvfs_module_context *ntvfs, 162 162 struct ntvfs_request *req); 163 NTSTATUS (*exit )(struct ntvfs_module_context *ntvfs,163 NTSTATUS (*exit_fn)(struct ntvfs_module_context *ntvfs, 164 164 struct ntvfs_request *req); 165 165 }; … … 202 202 struct loadparm_context *lp_ctx; 203 203 struct tevent_context *event_ctx; 204 struct messaging_context *msg_ctx;204 struct imessaging_context *msg_ctx; 205 205 206 206 struct { … … 331 331 } 332 332 333 struct messaging_context;333 struct imessaging_context; 334 334 #include "librpc/gen_ndr/security.h" 335 #include "librpc/gen_ndr/ s4_notify.h"335 #include "librpc/gen_ndr/notify.h" 336 336 #include "ntvfs/ntvfs_proto.h" 337 337 -
vendor/current/source4/ntvfs/ntvfs_base.c
r740 r988 27 27 #include "ntvfs/ntvfs.h" 28 28 #include "param/param.h" 29 #include "lib/util/samba_modules.h" 29 30 30 31 /* the list of currently registered NTVFS backends, note that there … … 154 155 enum protocol_types protocol, 155 156 uint64_t ntvfs_client_caps, 156 struct tevent_context *ev, struct messaging_context *msg,157 struct tevent_context *ev, struct imessaging_context *msg, 157 158 struct loadparm_context *lp_ctx, 158 159 struct server_id server_id, struct ntvfs_context **_ctx) … … 190 191 } 191 192 ntvfs->depth = i; 192 DLIST_ADD_END(ctx->modules, ntvfs , struct ntvfs_module_context *);193 DLIST_ADD_END(ctx->modules, ntvfs); 193 194 } 194 195 … … 236 237 initialized = true; 237 238 238 shared_init = load_samba_modules(NULL, lp_ctx,"ntvfs");239 shared_init = load_samba_modules(NULL, "ntvfs"); 239 240 240 241 run_init_functions(static_init); -
vendor/current/source4/ntvfs/ntvfs_generic.c
r740 r988 256 256 sf->standard.in.write_time = write_time; 257 257 sf->standard.in.access_time = 0; 258 status = ntvfs->ops->setfileinfo (ntvfs, req, sf);258 status = ntvfs->ops->setfileinfo_fn(ntvfs, req, sf); 259 259 } 260 260 … … 265 265 sf->generic.in.file.ntvfs = io2->generic.out.file.ntvfs; 266 266 sf->end_of_file_info.in.size = set_size; 267 status = ntvfs->ops->setfileinfo (ntvfs, req, sf);267 status = ntvfs->ops->setfileinfo_fn(ntvfs, req, sf); 268 268 if (NT_STATUS_IS_OK(status)) { 269 269 io->openx.out.size = io->openx.in.size; … … 417 417 io2->generic.in.fname = io->openx.in.fname; 418 418 419 status = ntvfs->ops->open (ntvfs, req, io2);419 status = ntvfs->ops->open_fn(ntvfs, req, io2); 420 420 break; 421 421 … … 434 434 io2->generic.in.fname = io->openold.in.fname; 435 435 436 status = ntvfs->ops->open (ntvfs, req, io2);436 status = ntvfs->ops->open_fn(ntvfs, req, io2); 437 437 break; 438 438 … … 460 460 io2->generic.in.ea_list->eas = io->t2open.in.eas; 461 461 462 status = ntvfs->ops->open (ntvfs, req, io2);462 status = ntvfs->ops->open_fn(ntvfs, req, io2); 463 463 break; 464 464 … … 473 473 NTCREATEX_SHARE_ACCESS_READ | 474 474 NTCREATEX_SHARE_ACCESS_WRITE; 475 status = ntvfs->ops->open (ntvfs, req, io2);475 status = ntvfs->ops->open_fn(ntvfs, req, io2); 476 476 break; 477 477 … … 486 486 NTCREATEX_SHARE_ACCESS_READ | 487 487 NTCREATEX_SHARE_ACCESS_WRITE; 488 status = ntvfs->ops->open (ntvfs, req, io2);488 status = ntvfs->ops->open_fn(ntvfs, req, io2); 489 489 break; 490 490 … … 502 502 NTCREATEX_SHARE_ACCESS_READ | 503 503 NTCREATEX_SHARE_ACCESS_WRITE; 504 status = ntvfs->ops->open (ntvfs, req, io2);504 status = ntvfs->ops->open_fn(ntvfs, req, io2); 505 505 break; 506 506 case RAW_OPEN_SMB2: … … 550 550 io2->generic.in.create_options &= ~NTCREATEX_OPTIONS_ASYNC_ALERT; 551 551 552 status = ntvfs->ops->open (ntvfs, req, io2);552 status = ntvfs->ops->open_fn(ntvfs, req, io2); 553 553 break; 554 554 … … 577 577 /* and convert it to the required level */ 578 578 switch (fs->generic.level) { 579 case RAW_QFS_GENERIC:580 return NT_STATUS_INVALID_LEVEL;581 582 579 case RAW_QFS_DSKATTR: { 583 580 /* map from generic to DSKATTR */ … … 667 664 ZERO_STRUCT(fs->objectid_information.out.unknown); 668 665 return NT_STATUS_OK; 669 } 670 666 667 case RAW_QFS_SECTOR_SIZE_INFORMATION: 668 fs->sector_size_info.out.logical_bytes_per_sector 669 = fs2->generic.out.block_size; 670 fs->sector_size_info.out.phys_bytes_per_sector_atomic 671 = fs2->generic.out.block_size; 672 fs->sector_size_info.out.phys_bytes_per_sector_perf 673 = fs2->generic.out.block_size; 674 fs->sector_size_info.out.fs_effective_phys_bytes_per_sector_atomic 675 = fs2->generic.out.block_size; 676 fs->sector_size_info.out.flags 677 = QFS_SSINFO_FLAGS_ALIGNED_DEVICE 678 | QFS_SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE; 679 fs->sector_size_info.out.byte_off_sector_align = 0; 680 fs->sector_size_info.out.byte_off_partition_align = 0; 681 return NT_STATUS_OK; 682 683 case RAW_QFS_GENERIC: 684 case RAW_QFS_UNIX_INFO: 685 return NT_STATUS_INVALID_LEVEL; 686 } 671 687 672 688 return NT_STATUS_INVALID_LEVEL; … … 701 717 fs2->generic.level = RAW_QFS_GENERIC; 702 718 703 status = ntvfs->ops->fsinfo (ntvfs, req, fs2);719 status = ntvfs->ops->fsinfo_fn(ntvfs, req, fs2); 704 720 return ntvfs_map_async_finish(req, status); 705 721 } … … 716 732 /* and convert it to the required level using results in info2 */ 717 733 switch (info->generic.level) { 718 case RAW_FILEINFO_GENERIC:719 return NT_STATUS_INVALID_LEVEL;720 734 case RAW_FILEINFO_GETATTR: 721 735 info->getattr.out.attrib = info2->generic.out.attrib & 0xff; … … 911 925 info2->generic.out.alignment_requirement; 912 926 return NT_STATUS_OK; 913 #if 0914 927 case RAW_FILEINFO_UNIX_BASIC: 928 #if 1 929 return NT_STATUS_INVALID_LEVEL; 930 #else 915 931 info->unix_basic_info.out.end_of_file = info2->generic.out.end_of_file; 916 932 info->unix_basic_info.out.num_bytes = info2->generic.out.size; … … 927 943 info->unix_basic_info.out.nlink = info2->generic.out.nlink; 928 944 return NT_STATUS_OK; 929 945 #endif 930 946 case RAW_FILEINFO_UNIX_LINK: 947 #if 1 948 return NT_STATUS_INVALID_LEVEL; 949 #else 931 950 info->unix_link_info.out.link_dest = info2->generic.out.link_dest; 932 951 return NT_STATUS_OK; 933 952 #endif 953 case RAW_FILEINFO_GENERIC: 954 case RAW_FILEINFO_SEC_DESC: 955 case RAW_FILEINFO_EA_LIST: 956 case RAW_FILEINFO_UNIX_INFO2: 957 case RAW_FILEINFO_SMB2_ALL_EAS: 958 case RAW_FILEINFO_SMB2_ALL_INFORMATION: 959 return NT_STATUS_INVALID_LEVEL; 934 960 } 935 961 … … 982 1008 info2->generic.in.file.ntvfs= info->generic.in.file.ntvfs; 983 1009 984 status = ntvfs->ops->qfileinfo (ntvfs, req, info2);1010 status = ntvfs->ops->qfileinfo_fn(ntvfs, req, info2); 985 1011 return ntvfs_map_async_finish(req, status); 986 1012 } … … 1031 1057 info2->generic.in.file.path = info->generic.in.file.path; 1032 1058 1033 status = ntvfs->ops->qpathinfo (ntvfs, req, info2);1059 status = ntvfs->ops->qpathinfo_fn(ntvfs, req, info2); 1034 1060 return ntvfs_map_async_finish(req, status); 1035 1061 } … … 1175 1201 */ 1176 1202 1177 return ntvfs->ops->lock (ntvfs, req, lck2);1203 return ntvfs->ops->lock_fn(ntvfs, req, lck2); 1178 1204 } 1179 1205 … … 1218 1244 state = req->async_states->state; 1219 1245 req->async_states->state &= ~NTVFS_ASYNC_STATE_MAY_ASYNC; 1220 status = ntvfs->ops->lock (ntvfs, req, lck);1246 status = ntvfs->ops->lock_fn(ntvfs, req, lck); 1221 1247 req->async_states->state = state; 1222 1248 } … … 1239 1265 state = req->async_states->state; 1240 1266 req->async_states->state &= ~NTVFS_ASYNC_STATE_MAY_ASYNC; 1241 status = ntvfs->ops->close (ntvfs, req, cl);1267 status = ntvfs->ops->close_fn(ntvfs, req, cl); 1242 1268 req->async_states->state = state; 1243 1269 } … … 1296 1322 wr2->writex.in.count = wr->write.in.count; 1297 1323 wr2->writex.in.data = wr->write.in.data; 1298 status = ntvfs->ops->write (ntvfs, req, wr2);1324 status = ntvfs->ops->write_fn(ntvfs, req, wr2); 1299 1325 break; 1300 1326 … … 1306 1332 wr2->writex.in.count = wr->writeunlock.in.count; 1307 1333 wr2->writex.in.data = wr->writeunlock.in.data; 1308 status = ntvfs->ops->write (ntvfs, req, wr2);1334 status = ntvfs->ops->write_fn(ntvfs, req, wr2); 1309 1335 break; 1310 1336 … … 1316 1342 wr2->writex.in.count = wr->writeclose.in.count; 1317 1343 wr2->writex.in.data = wr->writeclose.in.data; 1318 status = ntvfs->ops->write (ntvfs, req, wr2);1344 status = ntvfs->ops->write_fn(ntvfs, req, wr2); 1319 1345 break; 1320 1346 … … 1326 1352 wr2->writex.in.count = wr->splwrite.in.count; 1327 1353 wr2->writex.in.data = wr->splwrite.in.data; 1328 status = ntvfs->ops->write (ntvfs, req, wr2);1354 status = ntvfs->ops->write_fn(ntvfs, req, wr2); 1329 1355 break; 1330 1356 … … 1336 1362 wr2->writex.in.count = wr->smb2.in.data.length; 1337 1363 wr2->writex.in.data = wr->smb2.in.data.data; 1338 status = ntvfs->ops->write (ntvfs, req, wr2);1364 status = ntvfs->ops->write_fn(ntvfs, req, wr2); 1339 1365 } 1340 1366 … … 1412 1438 rd2->readx.in.remaining = rd->read.in.remaining; 1413 1439 rd2->readx.out.data = rd->read.out.data; 1414 status = ntvfs->ops->read (ntvfs, req, rd2);1440 status = ntvfs->ops->read_fn(ntvfs, req, rd2); 1415 1441 break; 1416 1442 … … 1422 1448 rd2->readx.in.remaining = 0; 1423 1449 rd2->readx.out.data = rd->readbraw.out.data; 1424 status = ntvfs->ops->read (ntvfs, req, rd2);1450 status = ntvfs->ops->read_fn(ntvfs, req, rd2); 1425 1451 break; 1426 1452 … … 1439 1465 lck->lock.in.count = rd->lockread.in.count; 1440 1466 lck->lock.in.offset = rd->lockread.in.offset; 1441 status = ntvfs->ops->lock (ntvfs, req, lck);1467 status = ntvfs->ops->lock_fn(ntvfs, req, lck); 1442 1468 req->async_states->state = state; 1443 1469 … … 1450 1476 1451 1477 if (NT_STATUS_IS_OK(status)) { 1452 status = ntvfs->ops->read (ntvfs, req, rd2);1478 status = ntvfs->ops->read_fn(ntvfs, req, rd2); 1453 1479 } 1454 1480 break; … … 1461 1487 rd2->readx.in.remaining = 0; 1462 1488 rd2->readx.out.data = rd->smb2.out.data.data; 1463 status = ntvfs->ops->read (ntvfs, req, rd2);1489 status = ntvfs->ops->read_fn(ntvfs, req, rd2); 1464 1490 break; 1465 1491 } … … 1545 1571 NT_STATUS_NOT_OK_RETURN(status); 1546 1572 1547 status = ntvfs->ops->close (ntvfs, req, cl2);1573 status = ntvfs->ops->close_fn(ntvfs, req, cl2); 1548 1574 1549 1575 return ntvfs_map_async_finish(req, status); … … 1607 1633 nt2->nttrans.in.completion_filter = nt->smb2.in.completion_filter; 1608 1634 nt2->nttrans.in.recursive = nt->smb2.in.recursive; 1609 status = ntvfs->ops->notify (ntvfs, req, nt2);1635 status = ntvfs->ops->notify_fn(ntvfs, req, nt2); 1610 1636 break; 1611 1637 } -
vendor/current/source4/ntvfs/ntvfs_interface.c
r740 r988 27 27 { 28 28 struct ntvfs_module_context *ntvfs = req->ctx->modules; 29 if (!ntvfs->ops->connect ) {30 return NT_STATUS_NOT_IMPLEMENTED; 31 } 32 return ntvfs->ops->connect (ntvfs, req, tcon);29 if (!ntvfs->ops->connect_fn) { 30 return NT_STATUS_NOT_IMPLEMENTED; 31 } 32 return ntvfs->ops->connect_fn(ntvfs, req, tcon); 33 33 } 34 34 … … 40 40 } 41 41 ntvfs = ntvfs_ctx->modules; 42 if (!ntvfs->ops->disconnect ) {43 return NT_STATUS_NOT_IMPLEMENTED; 44 } 45 return ntvfs->ops->disconnect (ntvfs);42 if (!ntvfs->ops->disconnect_fn) { 43 return NT_STATUS_NOT_IMPLEMENTED; 44 } 45 return ntvfs->ops->disconnect_fn(ntvfs); 46 46 } 47 47 … … 51 51 { 52 52 struct ntvfs_module_context *ntvfs = req->ctx->modules; 53 if (!ntvfs->ops->async_setup ) {54 return NT_STATUS_NOT_IMPLEMENTED; 55 } 56 return ntvfs->ops->async_setup (ntvfs, req, private_data);53 if (!ntvfs->ops->async_setup_fn) { 54 return NT_STATUS_NOT_IMPLEMENTED; 55 } 56 return ntvfs->ops->async_setup_fn(ntvfs, req, private_data); 57 57 } 58 58 … … 61 61 { 62 62 struct ntvfs_module_context *ntvfs = req->ctx->modules; 63 if (!ntvfs->ops->fsinfo ) {64 return NT_STATUS_NOT_IMPLEMENTED; 65 } 66 return ntvfs->ops->fsinfo (ntvfs, req, fs);63 if (!ntvfs->ops->fsinfo_fn) { 64 return NT_STATUS_NOT_IMPLEMENTED; 65 } 66 return ntvfs->ops->fsinfo_fn(ntvfs, req, fs); 67 67 } 68 68 … … 71 71 { 72 72 struct ntvfs_module_context *ntvfs = req->ctx->modules; 73 if (!ntvfs->ops->unlink ) {74 return NT_STATUS_NOT_IMPLEMENTED; 75 } 76 return ntvfs->ops->unlink (ntvfs, req, unl);73 if (!ntvfs->ops->unlink_fn) { 74 return NT_STATUS_NOT_IMPLEMENTED; 75 } 76 return ntvfs->ops->unlink_fn(ntvfs, req, unl); 77 77 } 78 78 … … 80 80 { 81 81 struct ntvfs_module_context *ntvfs = req->ctx->modules; 82 if (!ntvfs->ops->chkpath ) {83 return NT_STATUS_NOT_IMPLEMENTED; 84 } 85 return ntvfs->ops->chkpath (ntvfs, req, cp);82 if (!ntvfs->ops->chkpath_fn) { 83 return NT_STATUS_NOT_IMPLEMENTED; 84 } 85 return ntvfs->ops->chkpath_fn(ntvfs, req, cp); 86 86 } 87 87 … … 89 89 { 90 90 struct ntvfs_module_context *ntvfs = req->ctx->modules; 91 if (!ntvfs->ops->qpathinfo ) {92 return NT_STATUS_NOT_IMPLEMENTED; 93 } 94 return ntvfs->ops->qpathinfo (ntvfs, req, st);91 if (!ntvfs->ops->qpathinfo_fn) { 92 return NT_STATUS_NOT_IMPLEMENTED; 93 } 94 return ntvfs->ops->qpathinfo_fn(ntvfs, req, st); 95 95 } 96 96 … … 98 98 { 99 99 struct ntvfs_module_context *ntvfs = req->ctx->modules; 100 if (!ntvfs->ops->setpathinfo ) {101 return NT_STATUS_NOT_IMPLEMENTED; 102 } 103 return ntvfs->ops->setpathinfo (ntvfs, req, st);100 if (!ntvfs->ops->setpathinfo_fn) { 101 return NT_STATUS_NOT_IMPLEMENTED; 102 } 103 return ntvfs->ops->setpathinfo_fn(ntvfs, req, st); 104 104 } 105 105 … … 107 107 { 108 108 struct ntvfs_module_context *ntvfs = req->ctx->modules; 109 if (!ntvfs->ops->open ) {110 return NT_STATUS_NOT_IMPLEMENTED; 111 } 112 return ntvfs->ops->open (ntvfs, req, oi);109 if (!ntvfs->ops->open_fn) { 110 return NT_STATUS_NOT_IMPLEMENTED; 111 } 112 return ntvfs->ops->open_fn(ntvfs, req, oi); 113 113 } 114 114 … … 116 116 { 117 117 struct ntvfs_module_context *ntvfs = req->ctx->modules; 118 if (!ntvfs->ops->mkdir ) {119 return NT_STATUS_NOT_IMPLEMENTED; 120 } 121 return ntvfs->ops->mkdir (ntvfs, req, md);118 if (!ntvfs->ops->mkdir_fn) { 119 return NT_STATUS_NOT_IMPLEMENTED; 120 } 121 return ntvfs->ops->mkdir_fn(ntvfs, req, md); 122 122 } 123 123 … … 125 125 { 126 126 struct ntvfs_module_context *ntvfs = req->ctx->modules; 127 if (!ntvfs->ops->rmdir ) {128 return NT_STATUS_NOT_IMPLEMENTED; 129 } 130 return ntvfs->ops->rmdir (ntvfs, req, rd);127 if (!ntvfs->ops->rmdir_fn) { 128 return NT_STATUS_NOT_IMPLEMENTED; 129 } 130 return ntvfs->ops->rmdir_fn(ntvfs, req, rd); 131 131 } 132 132 … … 134 134 { 135 135 struct ntvfs_module_context *ntvfs = req->ctx->modules; 136 if (!ntvfs->ops->rename ) {137 return NT_STATUS_NOT_IMPLEMENTED; 138 } 139 return ntvfs->ops->rename (ntvfs, req, ren);136 if (!ntvfs->ops->rename_fn) { 137 return NT_STATUS_NOT_IMPLEMENTED; 138 } 139 return ntvfs->ops->rename_fn(ntvfs, req, ren); 140 140 } 141 141 … … 143 143 { 144 144 struct ntvfs_module_context *ntvfs = req->ctx->modules; 145 if (!ntvfs->ops->copy ) {146 return NT_STATUS_NOT_IMPLEMENTED; 147 } 148 return ntvfs->ops->copy (ntvfs, req, cp);145 if (!ntvfs->ops->copy_fn) { 146 return NT_STATUS_NOT_IMPLEMENTED; 147 } 148 return ntvfs->ops->copy_fn(ntvfs, req, cp); 149 149 } 150 150 … … 154 154 { 155 155 struct ntvfs_module_context *ntvfs = req->ctx->modules; 156 if (!ntvfs->ops->search_first ) {157 return NT_STATUS_NOT_IMPLEMENTED; 158 } 159 return ntvfs->ops->search_first (ntvfs, req, io, private_data, ntvfs_callback);156 if (!ntvfs->ops->search_first_fn) { 157 return NT_STATUS_NOT_IMPLEMENTED; 158 } 159 return ntvfs->ops->search_first_fn(ntvfs, req, io, private_data, ntvfs_callback); 160 160 } 161 161 … … 164 164 { 165 165 struct ntvfs_module_context *ntvfs = req->ctx->modules; 166 if (!ntvfs->ops->search_next ) {167 return NT_STATUS_NOT_IMPLEMENTED; 168 } 169 return ntvfs->ops->search_next (ntvfs, req, io, private_data, ntvfs_callback);166 if (!ntvfs->ops->search_next_fn) { 167 return NT_STATUS_NOT_IMPLEMENTED; 168 } 169 return ntvfs->ops->search_next_fn(ntvfs, req, io, private_data, ntvfs_callback); 170 170 } 171 171 … … 173 173 { 174 174 struct ntvfs_module_context *ntvfs = req->ctx->modules; 175 if (!ntvfs->ops->search_close ) {176 return NT_STATUS_NOT_IMPLEMENTED; 177 } 178 return ntvfs->ops->search_close (ntvfs, req, io);175 if (!ntvfs->ops->search_close_fn) { 176 return NT_STATUS_NOT_IMPLEMENTED; 177 } 178 return ntvfs->ops->search_close_fn(ntvfs, req, io); 179 179 } 180 180 … … 183 183 { 184 184 struct ntvfs_module_context *ntvfs = req->ctx->modules; 185 if (!ntvfs->ops->ioctl ) {186 return NT_STATUS_NOT_IMPLEMENTED; 187 } 188 return ntvfs->ops->ioctl (ntvfs, req, io);185 if (!ntvfs->ops->ioctl_fn) { 186 return NT_STATUS_NOT_IMPLEMENTED; 187 } 188 return ntvfs->ops->ioctl_fn(ntvfs, req, io); 189 189 } 190 190 … … 192 192 { 193 193 struct ntvfs_module_context *ntvfs = req->ctx->modules; 194 if (!ntvfs->ops->read ) {195 return NT_STATUS_NOT_IMPLEMENTED; 196 } 197 return ntvfs->ops->read (ntvfs, req, io);194 if (!ntvfs->ops->read_fn) { 195 return NT_STATUS_NOT_IMPLEMENTED; 196 } 197 return ntvfs->ops->read_fn(ntvfs, req, io); 198 198 } 199 199 … … 201 201 { 202 202 struct ntvfs_module_context *ntvfs = req->ctx->modules; 203 if (!ntvfs->ops->write ) {204 return NT_STATUS_NOT_IMPLEMENTED; 205 } 206 return ntvfs->ops->write (ntvfs, req, io);203 if (!ntvfs->ops->write_fn) { 204 return NT_STATUS_NOT_IMPLEMENTED; 205 } 206 return ntvfs->ops->write_fn(ntvfs, req, io); 207 207 } 208 208 … … 210 210 { 211 211 struct ntvfs_module_context *ntvfs = req->ctx->modules; 212 if (!ntvfs->ops->seek ) {213 return NT_STATUS_NOT_IMPLEMENTED; 214 } 215 return ntvfs->ops->seek (ntvfs, req, io);212 if (!ntvfs->ops->seek_fn) { 213 return NT_STATUS_NOT_IMPLEMENTED; 214 } 215 return ntvfs->ops->seek_fn(ntvfs, req, io); 216 216 } 217 217 … … 220 220 { 221 221 struct ntvfs_module_context *ntvfs = req->ctx->modules; 222 if (!ntvfs->ops->flush ) {223 return NT_STATUS_NOT_IMPLEMENTED; 224 } 225 return ntvfs->ops->flush (ntvfs, req, flush);222 if (!ntvfs->ops->flush_fn) { 223 return NT_STATUS_NOT_IMPLEMENTED; 224 } 225 return ntvfs->ops->flush_fn(ntvfs, req, flush); 226 226 } 227 227 … … 229 229 { 230 230 struct ntvfs_module_context *ntvfs = req->ctx->modules; 231 if (!ntvfs->ops->lock ) {232 return NT_STATUS_NOT_IMPLEMENTED; 233 } 234 return ntvfs->ops->lock (ntvfs, req, lck);231 if (!ntvfs->ops->lock_fn) { 232 return NT_STATUS_NOT_IMPLEMENTED; 233 } 234 return ntvfs->ops->lock_fn(ntvfs, req, lck); 235 235 } 236 236 … … 238 238 { 239 239 struct ntvfs_module_context *ntvfs = req->ctx->modules; 240 if (!ntvfs->ops->qfileinfo ) {241 return NT_STATUS_NOT_IMPLEMENTED; 242 } 243 return ntvfs->ops->qfileinfo (ntvfs, req, info);240 if (!ntvfs->ops->qfileinfo_fn) { 241 return NT_STATUS_NOT_IMPLEMENTED; 242 } 243 return ntvfs->ops->qfileinfo_fn(ntvfs, req, info); 244 244 } 245 245 … … 247 247 { 248 248 struct ntvfs_module_context *ntvfs = req->ctx->modules; 249 if (!ntvfs->ops->setfileinfo ) {250 return NT_STATUS_NOT_IMPLEMENTED; 251 } 252 return ntvfs->ops->setfileinfo (ntvfs, req, info);249 if (!ntvfs->ops->setfileinfo_fn) { 250 return NT_STATUS_NOT_IMPLEMENTED; 251 } 252 return ntvfs->ops->setfileinfo_fn(ntvfs, req, info); 253 253 } 254 254 … … 256 256 { 257 257 struct ntvfs_module_context *ntvfs = req->ctx->modules; 258 if (!ntvfs->ops->close ) {259 return NT_STATUS_NOT_IMPLEMENTED; 260 } 261 return ntvfs->ops->close (ntvfs, req, io);258 if (!ntvfs->ops->close_fn) { 259 return NT_STATUS_NOT_IMPLEMENTED; 260 } 261 return ntvfs->ops->close_fn(ntvfs, req, io); 262 262 } 263 263 … … 266 266 { 267 267 struct ntvfs_module_context *ntvfs = req->ctx->modules; 268 if (!ntvfs->ops->trans ) {269 return NT_STATUS_NOT_IMPLEMENTED; 270 } 271 return ntvfs->ops->trans (ntvfs, req, trans);268 if (!ntvfs->ops->trans_fn) { 269 return NT_STATUS_NOT_IMPLEMENTED; 270 } 271 return ntvfs->ops->trans_fn(ntvfs, req, trans); 272 272 } 273 273 … … 276 276 { 277 277 struct ntvfs_module_context *ntvfs = req->ctx->modules; 278 if (!ntvfs->ops->trans2 ) {279 return NT_STATUS_NOT_IMPLEMENTED; 280 } 281 return ntvfs->ops->trans2 (ntvfs, req, trans2);278 if (!ntvfs->ops->trans2_fn) { 279 return NT_STATUS_NOT_IMPLEMENTED; 280 } 281 return ntvfs->ops->trans2_fn(ntvfs, req, trans2); 282 282 } 283 283 … … 286 286 { 287 287 struct ntvfs_module_context *ntvfs = req->ctx->modules; 288 if (!ntvfs->ops->lpq ) {289 return NT_STATUS_NOT_IMPLEMENTED; 290 } 291 return ntvfs->ops->lpq (ntvfs, req, lpq);288 if (!ntvfs->ops->lpq_fn) { 289 return NT_STATUS_NOT_IMPLEMENTED; 290 } 291 return ntvfs->ops->lpq_fn(ntvfs, req, lpq); 292 292 } 293 293 … … 296 296 { 297 297 struct ntvfs_module_context *ntvfs = req->ctx->modules; 298 if (!ntvfs->ops->logoff ) {299 return NT_STATUS_NOT_IMPLEMENTED; 300 } 301 return ntvfs->ops->logoff (ntvfs, req);298 if (!ntvfs->ops->logoff_fn) { 299 return NT_STATUS_NOT_IMPLEMENTED; 300 } 301 return ntvfs->ops->logoff_fn(ntvfs, req); 302 302 } 303 303 … … 305 305 { 306 306 struct ntvfs_module_context *ntvfs = req->ctx->modules; 307 if (!ntvfs->ops->exit ) {308 return NT_STATUS_NOT_IMPLEMENTED; 309 } 310 return ntvfs->ops->exit (ntvfs, req);307 if (!ntvfs->ops->exit_fn) { 308 return NT_STATUS_NOT_IMPLEMENTED; 309 } 310 return ntvfs->ops->exit_fn(ntvfs, req); 311 311 } 312 312 … … 317 317 { 318 318 struct ntvfs_module_context *ntvfs = req->ctx->modules; 319 if (!ntvfs->ops->notify ) {320 return NT_STATUS_NOT_IMPLEMENTED; 321 } 322 return ntvfs->ops->notify (ntvfs, req, info);319 if (!ntvfs->ops->notify_fn) { 320 return NT_STATUS_NOT_IMPLEMENTED; 321 } 322 return ntvfs->ops->notify_fn(ntvfs, req, info); 323 323 } 324 324 … … 329 329 { 330 330 struct ntvfs_module_context *ntvfs = req->ctx->modules; 331 if (!ntvfs->ops->cancel ) {332 return NT_STATUS_NOT_IMPLEMENTED; 333 } 334 return ntvfs->ops->cancel (ntvfs, req);331 if (!ntvfs->ops->cancel_fn) { 332 return NT_STATUS_NOT_IMPLEMENTED; 333 } 334 return ntvfs->ops->cancel_fn(ntvfs, req); 335 335 } 336 336 … … 340 340 union smb_tcon *tcon) 341 341 { 342 if (!ntvfs->next || !ntvfs->next->ops->connect ) {343 return NT_STATUS_NOT_IMPLEMENTED; 344 } 345 return ntvfs->next->ops->connect (ntvfs->next, req, tcon);342 if (!ntvfs->next || !ntvfs->next->ops->connect_fn) { 343 return NT_STATUS_NOT_IMPLEMENTED; 344 } 345 return ntvfs->next->ops->connect_fn(ntvfs->next, req, tcon); 346 346 } 347 347 348 348 NTSTATUS ntvfs_next_disconnect(struct ntvfs_module_context *ntvfs) 349 349 { 350 if (!ntvfs->next || !ntvfs->next->ops->disconnect ) {351 return NT_STATUS_NOT_IMPLEMENTED; 352 } 353 return ntvfs->next->ops->disconnect (ntvfs->next);350 if (!ntvfs->next || !ntvfs->next->ops->disconnect_fn) { 351 return NT_STATUS_NOT_IMPLEMENTED; 352 } 353 return ntvfs->next->ops->disconnect_fn(ntvfs->next); 354 354 } 355 355 … … 359 359 void *private_data) 360 360 { 361 if (!ntvfs->next || !ntvfs->next->ops->async_setup ) {362 return NT_STATUS_NOT_IMPLEMENTED; 363 } 364 return ntvfs->next->ops->async_setup (ntvfs->next, req, private_data);361 if (!ntvfs->next || !ntvfs->next->ops->async_setup_fn) { 362 return NT_STATUS_NOT_IMPLEMENTED; 363 } 364 return ntvfs->next->ops->async_setup_fn(ntvfs->next, req, private_data); 365 365 } 366 366 … … 370 370 union smb_fsinfo *fs) 371 371 { 372 if (!ntvfs->next || !ntvfs->next->ops->fsinfo ) {373 return NT_STATUS_NOT_IMPLEMENTED; 374 } 375 return ntvfs->next->ops->fsinfo (ntvfs->next, req, fs);372 if (!ntvfs->next || !ntvfs->next->ops->fsinfo_fn) { 373 return NT_STATUS_NOT_IMPLEMENTED; 374 } 375 return ntvfs->next->ops->fsinfo_fn(ntvfs->next, req, fs); 376 376 } 377 377 … … 381 381 union smb_unlink *unl) 382 382 { 383 if (!ntvfs->next || !ntvfs->next->ops->unlink ) {384 return NT_STATUS_NOT_IMPLEMENTED; 385 } 386 return ntvfs->next->ops->unlink (ntvfs->next, req, unl);383 if (!ntvfs->next || !ntvfs->next->ops->unlink_fn) { 384 return NT_STATUS_NOT_IMPLEMENTED; 385 } 386 return ntvfs->next->ops->unlink_fn(ntvfs->next, req, unl); 387 387 } 388 388 … … 391 391 union smb_chkpath *cp) 392 392 { 393 if (!ntvfs->next || !ntvfs->next->ops->chkpath ) {394 return NT_STATUS_NOT_IMPLEMENTED; 395 } 396 return ntvfs->next->ops->chkpath (ntvfs->next, req, cp);393 if (!ntvfs->next || !ntvfs->next->ops->chkpath_fn) { 394 return NT_STATUS_NOT_IMPLEMENTED; 395 } 396 return ntvfs->next->ops->chkpath_fn(ntvfs->next, req, cp); 397 397 } 398 398 … … 401 401 union smb_fileinfo *st) 402 402 { 403 if (!ntvfs->next || !ntvfs->next->ops->qpathinfo ) {404 return NT_STATUS_NOT_IMPLEMENTED; 405 } 406 return ntvfs->next->ops->qpathinfo (ntvfs->next, req, st);403 if (!ntvfs->next || !ntvfs->next->ops->qpathinfo_fn) { 404 return NT_STATUS_NOT_IMPLEMENTED; 405 } 406 return ntvfs->next->ops->qpathinfo_fn(ntvfs->next, req, st); 407 407 } 408 408 … … 411 411 union smb_setfileinfo *st) 412 412 { 413 if (!ntvfs->next || !ntvfs->next->ops->setpathinfo ) {414 return NT_STATUS_NOT_IMPLEMENTED; 415 } 416 return ntvfs->next->ops->setpathinfo (ntvfs->next, req, st);413 if (!ntvfs->next || !ntvfs->next->ops->setpathinfo_fn) { 414 return NT_STATUS_NOT_IMPLEMENTED; 415 } 416 return ntvfs->next->ops->setpathinfo_fn(ntvfs->next, req, st); 417 417 } 418 418 … … 421 421 union smb_mkdir *md) 422 422 { 423 if (!ntvfs->next || !ntvfs->next->ops->mkdir ) {424 return NT_STATUS_NOT_IMPLEMENTED; 425 } 426 return ntvfs->next->ops->mkdir (ntvfs->next, req, md);423 if (!ntvfs->next || !ntvfs->next->ops->mkdir_fn) { 424 return NT_STATUS_NOT_IMPLEMENTED; 425 } 426 return ntvfs->next->ops->mkdir_fn(ntvfs->next, req, md); 427 427 } 428 428 … … 431 431 struct smb_rmdir *rd) 432 432 { 433 if (!ntvfs->next || !ntvfs->next->ops->rmdir ) {434 return NT_STATUS_NOT_IMPLEMENTED; 435 } 436 return ntvfs->next->ops->rmdir (ntvfs->next, req, rd);433 if (!ntvfs->next || !ntvfs->next->ops->rmdir_fn) { 434 return NT_STATUS_NOT_IMPLEMENTED; 435 } 436 return ntvfs->next->ops->rmdir_fn(ntvfs->next, req, rd); 437 437 } 438 438 … … 441 441 union smb_rename *ren) 442 442 { 443 if (!ntvfs->next || !ntvfs->next->ops->rename ) {444 return NT_STATUS_NOT_IMPLEMENTED; 445 } 446 return ntvfs->next->ops->rename (ntvfs->next, req, ren);443 if (!ntvfs->next || !ntvfs->next->ops->rename_fn) { 444 return NT_STATUS_NOT_IMPLEMENTED; 445 } 446 return ntvfs->next->ops->rename_fn(ntvfs->next, req, ren); 447 447 } 448 448 … … 451 451 struct smb_copy *cp) 452 452 { 453 if (!ntvfs->next || !ntvfs->next->ops->copy ) {454 return NT_STATUS_NOT_IMPLEMENTED; 455 } 456 return ntvfs->next->ops->copy (ntvfs->next, req, cp);453 if (!ntvfs->next || !ntvfs->next->ops->copy_fn) { 454 return NT_STATUS_NOT_IMPLEMENTED; 455 } 456 return ntvfs->next->ops->copy_fn(ntvfs->next, req, cp); 457 457 } 458 458 … … 461 461 union smb_open *oi) 462 462 { 463 if (!ntvfs->next || !ntvfs->next->ops->open ) {464 return NT_STATUS_NOT_IMPLEMENTED; 465 } 466 return ntvfs->next->ops->open (ntvfs->next, req, oi);463 if (!ntvfs->next || !ntvfs->next->ops->open_fn) { 464 return NT_STATUS_NOT_IMPLEMENTED; 465 } 466 return ntvfs->next->ops->open_fn(ntvfs->next, req, oi); 467 467 } 468 468 … … 474 474 bool (*callback)(void *private_data, const union smb_search_data *file)) 475 475 { 476 if (!ntvfs->next || !ntvfs->next->ops->search_first ) {477 return NT_STATUS_NOT_IMPLEMENTED; 478 } 479 return ntvfs->next->ops->search_first (ntvfs->next, req, io, private_data, callback);476 if (!ntvfs->next || !ntvfs->next->ops->search_first_fn) { 477 return NT_STATUS_NOT_IMPLEMENTED; 478 } 479 return ntvfs->next->ops->search_first_fn(ntvfs->next, req, io, private_data, callback); 480 480 } 481 481 … … 485 485 bool (*callback)(void *private_data, const union smb_search_data *file)) 486 486 { 487 if (!ntvfs->next || !ntvfs->next->ops->search_next ) {488 return NT_STATUS_NOT_IMPLEMENTED; 489 } 490 return ntvfs->next->ops->search_next (ntvfs->next, req, io, private_data, callback);487 if (!ntvfs->next || !ntvfs->next->ops->search_next_fn) { 488 return NT_STATUS_NOT_IMPLEMENTED; 489 } 490 return ntvfs->next->ops->search_next_fn(ntvfs->next, req, io, private_data, callback); 491 491 } 492 492 … … 495 495 union smb_search_close *io) 496 496 { 497 if (!ntvfs->next || !ntvfs->next->ops->search_close ) {498 return NT_STATUS_NOT_IMPLEMENTED; 499 } 500 return ntvfs->next->ops->search_close (ntvfs->next, req, io);497 if (!ntvfs->next || !ntvfs->next->ops->search_close_fn) { 498 return NT_STATUS_NOT_IMPLEMENTED; 499 } 500 return ntvfs->next->ops->search_close_fn(ntvfs->next, req, io); 501 501 } 502 502 … … 506 506 union smb_ioctl *io) 507 507 { 508 if (!ntvfs->next || !ntvfs->next->ops->ioctl ) {509 return NT_STATUS_NOT_IMPLEMENTED; 510 } 511 return ntvfs->next->ops->ioctl (ntvfs->next, req, io);508 if (!ntvfs->next || !ntvfs->next->ops->ioctl_fn) { 509 return NT_STATUS_NOT_IMPLEMENTED; 510 } 511 return ntvfs->next->ops->ioctl_fn(ntvfs->next, req, io); 512 512 } 513 513 … … 516 516 union smb_read *io) 517 517 { 518 if (!ntvfs->next || !ntvfs->next->ops->read ) {519 return NT_STATUS_NOT_IMPLEMENTED; 520 } 521 return ntvfs->next->ops->read (ntvfs->next, req, io);518 if (!ntvfs->next || !ntvfs->next->ops->read_fn) { 519 return NT_STATUS_NOT_IMPLEMENTED; 520 } 521 return ntvfs->next->ops->read_fn(ntvfs->next, req, io); 522 522 } 523 523 … … 526 526 union smb_write *io) 527 527 { 528 if (!ntvfs->next || !ntvfs->next->ops->write ) {529 return NT_STATUS_NOT_IMPLEMENTED; 530 } 531 return ntvfs->next->ops->write (ntvfs->next, req, io);528 if (!ntvfs->next || !ntvfs->next->ops->write_fn) { 529 return NT_STATUS_NOT_IMPLEMENTED; 530 } 531 return ntvfs->next->ops->write_fn(ntvfs->next, req, io); 532 532 } 533 533 … … 536 536 union smb_seek *io) 537 537 { 538 if (!ntvfs->next || !ntvfs->next->ops->seek ) {539 return NT_STATUS_NOT_IMPLEMENTED; 540 } 541 return ntvfs->next->ops->seek (ntvfs->next, req, io);538 if (!ntvfs->next || !ntvfs->next->ops->seek_fn) { 539 return NT_STATUS_NOT_IMPLEMENTED; 540 } 541 return ntvfs->next->ops->seek_fn(ntvfs->next, req, io); 542 542 } 543 543 … … 546 546 union smb_flush *flush) 547 547 { 548 if (!ntvfs->next || !ntvfs->next->ops->flush ) {549 return NT_STATUS_NOT_IMPLEMENTED; 550 } 551 return ntvfs->next->ops->flush (ntvfs->next, req, flush);548 if (!ntvfs->next || !ntvfs->next->ops->flush_fn) { 549 return NT_STATUS_NOT_IMPLEMENTED; 550 } 551 return ntvfs->next->ops->flush_fn(ntvfs->next, req, flush); 552 552 } 553 553 … … 556 556 union smb_lock *lck) 557 557 { 558 if (!ntvfs->next || !ntvfs->next->ops->lock ) {559 return NT_STATUS_NOT_IMPLEMENTED; 560 } 561 return ntvfs->next->ops->lock (ntvfs->next, req, lck);558 if (!ntvfs->next || !ntvfs->next->ops->lock_fn) { 559 return NT_STATUS_NOT_IMPLEMENTED; 560 } 561 return ntvfs->next->ops->lock_fn(ntvfs->next, req, lck); 562 562 } 563 563 … … 566 566 union smb_fileinfo *info) 567 567 { 568 if (!ntvfs->next || !ntvfs->next->ops->qfileinfo ) {569 return NT_STATUS_NOT_IMPLEMENTED; 570 } 571 return ntvfs->next->ops->qfileinfo (ntvfs->next, req, info);568 if (!ntvfs->next || !ntvfs->next->ops->qfileinfo_fn) { 569 return NT_STATUS_NOT_IMPLEMENTED; 570 } 571 return ntvfs->next->ops->qfileinfo_fn(ntvfs->next, req, info); 572 572 } 573 573 … … 576 576 union smb_setfileinfo *info) 577 577 { 578 if (!ntvfs->next || !ntvfs->next->ops->setfileinfo ) {579 return NT_STATUS_NOT_IMPLEMENTED; 580 } 581 return ntvfs->next->ops->setfileinfo (ntvfs->next, req, info);578 if (!ntvfs->next || !ntvfs->next->ops->setfileinfo_fn) { 579 return NT_STATUS_NOT_IMPLEMENTED; 580 } 581 return ntvfs->next->ops->setfileinfo_fn(ntvfs->next, req, info); 582 582 } 583 583 … … 586 586 union smb_close *io) 587 587 { 588 if (!ntvfs->next || !ntvfs->next->ops->close ) {589 return NT_STATUS_NOT_IMPLEMENTED; 590 } 591 return ntvfs->next->ops->close (ntvfs->next, req, io);588 if (!ntvfs->next || !ntvfs->next->ops->close_fn) { 589 return NT_STATUS_NOT_IMPLEMENTED; 590 } 591 return ntvfs->next->ops->close_fn(ntvfs->next, req, io); 592 592 } 593 593 … … 597 597 struct smb_trans2 *trans) 598 598 { 599 if (!ntvfs->next || !ntvfs->next->ops->trans ) {600 return NT_STATUS_NOT_IMPLEMENTED; 601 } 602 return ntvfs->next->ops->trans (ntvfs->next, req, trans);599 if (!ntvfs->next || !ntvfs->next->ops->trans_fn) { 600 return NT_STATUS_NOT_IMPLEMENTED; 601 } 602 return ntvfs->next->ops->trans_fn(ntvfs->next, req, trans); 603 603 } 604 604 … … 608 608 struct smb_trans2 *trans2) 609 609 { 610 if (!ntvfs->next || !ntvfs->next->ops->trans2 ) {611 return NT_STATUS_NOT_IMPLEMENTED; 612 } 613 return ntvfs->next->ops->trans2 (ntvfs->next, req, trans2);610 if (!ntvfs->next || !ntvfs->next->ops->trans2_fn) { 611 return NT_STATUS_NOT_IMPLEMENTED; 612 } 613 return ntvfs->next->ops->trans2_fn(ntvfs->next, req, trans2); 614 614 } 615 615 … … 621 621 union smb_notify *info) 622 622 { 623 if (!ntvfs->next || !ntvfs->next->ops->notify ) {624 return NT_STATUS_NOT_IMPLEMENTED; 625 } 626 return ntvfs->next->ops->notify (ntvfs->next, req, info);623 if (!ntvfs->next || !ntvfs->next->ops->notify_fn) { 624 return NT_STATUS_NOT_IMPLEMENTED; 625 } 626 return ntvfs->next->ops->notify_fn(ntvfs->next, req, info); 627 627 } 628 628 … … 631 631 struct ntvfs_request *req) 632 632 { 633 if (!ntvfs->next || !ntvfs->next->ops->cancel ) {634 return NT_STATUS_NOT_IMPLEMENTED; 635 } 636 return ntvfs->next->ops->cancel (ntvfs->next, req);633 if (!ntvfs->next || !ntvfs->next->ops->cancel_fn) { 634 return NT_STATUS_NOT_IMPLEMENTED; 635 } 636 return ntvfs->next->ops->cancel_fn(ntvfs->next, req); 637 637 } 638 638 … … 642 642 union smb_lpq *lpq) 643 643 { 644 if (!ntvfs->next || !ntvfs->next->ops->lpq ) {645 return NT_STATUS_NOT_IMPLEMENTED; 646 } 647 return ntvfs->next->ops->lpq (ntvfs->next, req, lpq);644 if (!ntvfs->next || !ntvfs->next->ops->lpq_fn) { 645 return NT_STATUS_NOT_IMPLEMENTED; 646 } 647 return ntvfs->next->ops->lpq_fn(ntvfs->next, req, lpq); 648 648 } 649 649 … … 653 653 struct ntvfs_request *req) 654 654 { 655 if (!ntvfs->next || !ntvfs->next->ops->logoff ) {656 return NT_STATUS_NOT_IMPLEMENTED; 657 } 658 return ntvfs->next->ops->logoff (ntvfs->next, req);655 if (!ntvfs->next || !ntvfs->next->ops->logoff_fn) { 656 return NT_STATUS_NOT_IMPLEMENTED; 657 } 658 return ntvfs->next->ops->logoff_fn(ntvfs->next, req); 659 659 } 660 660 … … 662 662 struct ntvfs_request *req) 663 663 { 664 if (!ntvfs->next || !ntvfs->next->ops->exit ) {665 return NT_STATUS_NOT_IMPLEMENTED; 666 } 667 return ntvfs->next->ops->exit (ntvfs->next, req);664 if (!ntvfs->next || !ntvfs->next->ops->exit_fn) { 665 return NT_STATUS_NOT_IMPLEMENTED; 666 } 667 return ntvfs->next->ops->exit_fn(ntvfs->next, req); 668 668 } 669 669 -
vendor/current/source4/ntvfs/posix/pvfs_acl.c
r740 r988 21 21 22 22 #include "includes.h" 23 #include "system/passwd.h" 23 24 #include "auth/auth.h" 24 25 #include "vfs_posix.h" … … 27 28 #include "param/param.h" 28 29 #include "../lib/util/unix_privs.h" 29 30 #if defined(UID_WRAPPER) 31 #if !defined(UID_WRAPPER_REPLACE) && !defined(UID_WRAPPER_NOT_REPLACE) 32 #define UID_WRAPPER_REPLACE 33 #include "../uid_wrapper/uid_wrapper.h" 34 #endif 35 #else 36 #define uwrap_enabled() 0 37 #endif 30 #include "lib/util/samba_modules.h" 38 31 39 32 /* the list of currently registered ACL backends */ … … 90 83 } 91 84 92 NTSTATUS pvfs_acl_init( struct loadparm_context *lp_ctx)85 NTSTATUS pvfs_acl_init(void) 93 86 { 94 87 static bool initialized = false; … … 101 94 initialized = true; 102 95 103 shared_init = load_samba_modules(NULL, lp_ctx,"pvfs_acl");96 shared_init = load_samba_modules(NULL, "pvfs_acl"); 104 97 105 98 run_init_functions(static_init); … … 159 152 mode_t mode; 160 153 struct id_map *ids; 161 struct composite_context *ctx;162 154 163 155 *psd = security_descriptor_initialise(req); … … 178 170 ids[1].sid = NULL; 179 171 180 ctx = wbc_xids_to_sids_send(pvfs->wbc_ctx, ids, 2, ids); 181 NT_STATUS_HAVE_NO_MEMORY(ctx); 182 183 status = wbc_xids_to_sids_recv(ctx, &ids); 172 status = wbc_xids_to_sids(pvfs->ntvfs->ctx->event_ctx, ids, 2); 184 173 NT_STATUS_NOT_OK_RETURN(status); 185 174 … … 276 265 sd->sacl = NULL; 277 266 } 267 } 268 269 static bool pvfs_privileged_access(uid_t uid) 270 { 271 uid_t euid; 272 273 if (uid_wrapper_enabled()) { 274 setenv("UID_WRAPPER_MYUID", "1", 1); 275 } 276 277 euid = geteuid(); 278 279 if (uid_wrapper_enabled()) { 280 unsetenv("UID_WRAPPER_MYUID"); 281 } 282 283 return (uid == euid); 278 284 } 279 285 … … 295 301 gid_t new_gid = -1; 296 302 struct id_map *ids; 297 struct composite_context *ctx;298 303 299 304 if (pvfs->acl_ops != NULL) { … … 326 331 if (!dom_sid_equal(sd->owner_sid, new_sd->owner_sid)) { 327 332 ids->sid = new_sd->owner_sid; 328 ctx = wbc_sids_to_xids_send(pvfs->wbc_ctx, ids, 1, ids); 329 NT_STATUS_HAVE_NO_MEMORY(ctx); 330 status = wbc_sids_to_xids_recv(ctx, &ids); 333 status = wbc_sids_to_xids(pvfs->ntvfs->ctx->event_ctx, 334 ids, 1); 331 335 NT_STATUS_NOT_OK_RETURN(status); 332 336 … … 338 342 sd->owner_sid = new_sd->owner_sid; 339 343 } 344 340 345 if (secinfo_flags & SECINFO_GROUP) { 341 346 if (!(access_mask & SEC_STD_WRITE_OWNER)) { … … 344 349 if (!dom_sid_equal(sd->group_sid, new_sd->group_sid)) { 345 350 ids->sid = new_sd->group_sid; 346 ctx = wbc_sids_to_xids_send(pvfs->wbc_ctx, ids, 1, ids); 347 NT_STATUS_HAVE_NO_MEMORY(ctx); 348 status = wbc_sids_to_xids_recv(ctx, &ids); 351 status = wbc_sids_to_xids(pvfs->ntvfs->ctx->event_ctx, 352 ids, 1); 349 353 NT_STATUS_NOT_OK_RETURN(status); 350 354 … … 357 361 sd->group_sid = new_sd->group_sid; 358 362 } 363 359 364 if (secinfo_flags & SECINFO_DACL) { 360 365 if (!(access_mask & SEC_STD_WRITE_DAC)) { … … 363 368 sd->dacl = new_sd->dacl; 364 369 pvfs_translate_generic_bits(sd->dacl); 365 } 370 sd->type |= SEC_DESC_DACL_PRESENT; 371 } 372 366 373 if (secinfo_flags & SECINFO_SACL) { 367 374 if (!(access_mask & SEC_FLAG_SYSTEM_SECURITY)) { … … 370 377 sd->sacl = new_sd->sacl; 371 378 pvfs_translate_generic_bits(sd->sacl); 379 sd->type |= SEC_DESC_SACL_PRESENT; 380 } 381 382 if (secinfo_flags & SECINFO_PROTECTED_DACL) { 383 if (new_sd->type & SEC_DESC_DACL_PROTECTED) { 384 sd->type |= SEC_DESC_DACL_PROTECTED; 385 } else { 386 sd->type &= ~SEC_DESC_DACL_PROTECTED; 387 } 388 } 389 390 if (secinfo_flags & SECINFO_PROTECTED_SACL) { 391 if (new_sd->type & SEC_DESC_SACL_PROTECTED) { 392 sd->type |= SEC_DESC_SACL_PROTECTED; 393 } else { 394 sd->type &= ~SEC_DESC_SACL_PROTECTED; 395 } 372 396 } 373 397 … … 389 413 } 390 414 if (errno == EPERM) { 391 if ( uwrap_enabled()) {415 if (pvfs_privileged_access(name->st.st_uid)) { 392 416 ret = 0; 393 417 } else { … … 484 508 } 485 509 ngroups = getgroups(0, NULL); 486 if (ngroups == 0) {510 if (ngroups <= 0) { 487 511 return false; 488 512 } … … 515 539 uint32_t *access_mask) 516 540 { 517 uid_t uid = geteuid(); 518 uint32_t max_bits = SEC_RIGHTS_FILE_READ | SEC_FILE_ALL; 541 uint32_t max_bits = 0; 519 542 struct security_token *token = req->session_info->security_token; 520 543 … … 523 546 } 524 547 525 if (name == NULL || uid == name->st.st_uid) { 526 max_bits |= SEC_STD_ALL; 527 } else if (security_token_has_privilege(token, SEC_PRIV_RESTORE)) { 528 max_bits |= SEC_STD_DELETE; 529 } 530 531 if (name == NULL || 532 (name->st.st_mode & S_IWOTH) || 533 ((name->st.st_mode & S_IWGRP) && 534 pvfs_group_member(pvfs, name->st.st_gid))) { 535 max_bits |= SEC_STD_ALL; 536 } 537 538 if (uwrap_enabled()) { 539 /* when running with the uid wrapper, files will be created 540 owned by the ruid, but we may have a different simulated 541 euid. We need to force the permission bits as though the 542 files owner matches the euid */ 543 max_bits |= SEC_STD_ALL; 548 if (name == NULL) { 549 max_bits |= SEC_RIGHTS_FILE_ALL | SEC_STD_ALL; 550 } else if (pvfs_privileged_access(name->st.st_uid)) { 551 /* use the IxUSR bits */ 552 if ((name->st.st_mode & S_IWUSR)) { 553 max_bits |= SEC_RIGHTS_FILE_ALL | SEC_STD_ALL; 554 } else if ((name->st.st_mode & (S_IRUSR | S_IXUSR))) { 555 max_bits |= SEC_RIGHTS_FILE_READ | SEC_RIGHTS_FILE_EXECUTE | SEC_STD_ALL; 556 } 557 } else if (pvfs_group_member(pvfs, name->st.st_gid)) { 558 /* use the IxGRP bits */ 559 if ((name->st.st_mode & S_IWGRP)) { 560 max_bits |= SEC_RIGHTS_FILE_ALL | SEC_STD_ALL; 561 } else if ((name->st.st_mode & (S_IRGRP | S_IXGRP))) { 562 max_bits |= SEC_RIGHTS_FILE_READ | SEC_RIGHTS_FILE_EXECUTE | SEC_STD_ALL; 563 } 564 } else { 565 /* use the IxOTH bits */ 566 if ((name->st.st_mode & S_IWOTH)) { 567 max_bits |= SEC_RIGHTS_FILE_ALL | SEC_STD_ALL; 568 } else if ((name->st.st_mode & (S_IROTH | S_IXOTH))) { 569 max_bits |= SEC_RIGHTS_FILE_READ | SEC_RIGHTS_FILE_EXECUTE | SEC_STD_ALL; 570 } 544 571 } 545 572 … … 564 591 565 592 if (*access_mask & ~max_bits) { 566 DEBUG( 0,(__location__ " denied access to '%s' - wanted 0x%08x but got 0x%08x (missing 0x%08x)\n",593 DEBUG(5,(__location__ " denied access to '%s' - wanted 0x%08x but got 0x%08x (missing 0x%08x)\n", 567 594 name?name->full_name:"(new file)", *access_mask, max_bits, *access_mask & ~max_bits)); 568 595 return NT_STATUS_ACCESS_DENIED; 569 596 } 570 597 571 if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {598 if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) { 572 599 /* on SMB, this bit is always granted, even if not 573 600 asked for */ … … 596 623 597 624 /* on SMB2 a blank access mask is always denied */ 598 if (pvfs->ntvfs->ctx->protocol == PROTOCOL_SMB2 &&625 if (pvfs->ntvfs->ctx->protocol >= PROTOCOL_SMB2_02 && 599 626 *access_mask == 0) { 600 627 return NT_STATUS_ACCESS_DENIED; … … 622 649 /* expand the generic access bits to file specific bits */ 623 650 *access_mask = pvfs_translate_mask(*access_mask); 624 if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {651 if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) { 625 652 *access_mask &= ~SEC_FILE_READ_ATTRIBUTE; 626 653 } … … 647 674 status = se_access_check(sd, token, *access_mask, access_mask); 648 675 talloc_free(acl); 676 677 /* if we used a NT acl, then allow access override if the 678 share allows for posix permission override 679 */ 680 if (NT_STATUS_IS_OK(status)) { 681 name->allow_override = (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE) != 0; 682 } 683 649 684 done: 650 if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {685 if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) { 651 686 /* on SMB, this bit is always granted, even if not 652 687 asked for */ … … 746 781 } 747 782 748 if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {783 if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) { 749 784 /* on SMB, this bit is always granted, even if not 750 785 asked for */ … … 775 810 } 776 811 777 return pvfs_access_check_simple(pvfs, req, parent, access_mask); 812 status = pvfs_access_check_simple(pvfs, req, parent, access_mask); 813 if (NT_STATUS_IS_OK(status) && parent->allow_override) { 814 name->allow_override = true; 815 } 816 return status; 778 817 } 779 818 … … 899 938 struct security_descriptor *parent_sd, *sd; 900 939 struct id_map *ids; 901 struct composite_context *ctx;902 940 TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); 903 941 … … 905 943 906 944 acl = talloc(req, struct xattr_NTACL); 907 NT_STATUS_HAVE_NO_MEMORY_AND_FREE(acl, tmp_ctx); 945 if (acl == NULL) { 946 TALLOC_FREE(tmp_ctx); 947 return NT_STATUS_NO_MEMORY; 948 } 908 949 909 950 status = pvfs_acl_load(pvfs, parent, -1, acl); … … 912 953 return NT_STATUS_OK; 913 954 } 914 NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx); 955 if (!NT_STATUS_IS_OK(status)) { 956 TALLOC_FREE(tmp_ctx); 957 return status; 958 } 915 959 916 960 switch (acl->version) { … … 933 977 /* create the new sd */ 934 978 sd = security_descriptor_initialise(req); 935 NT_STATUS_HAVE_NO_MEMORY_AND_FREE(sd, tmp_ctx); 979 if (sd == NULL) { 980 TALLOC_FREE(tmp_ctx); 981 return NT_STATUS_NO_MEMORY; 982 } 936 983 937 984 ids = talloc_array(sd, struct id_map, 2); 938 NT_STATUS_HAVE_NO_MEMORY_AND_FREE(ids, tmp_ctx); 985 if (ids == NULL) { 986 TALLOC_FREE(tmp_ctx); 987 return NT_STATUS_NO_MEMORY; 988 } 939 989 940 990 ids[0].xid.id = geteuid(); … … 948 998 ids[1].status = ID_UNKNOWN; 949 999 950 ctx = wbc_xids_to_sids_send(pvfs->wbc_ctx, ids, 2, ids);951 NT_STATUS_HAVE_NO_MEMORY_AND_FREE(ctx, tmp_ctx);952 953 status = wbc_xids_to_sids_recv(ctx, &ids);954 NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx);1000 status = wbc_xids_to_sids(pvfs->ntvfs->ctx->event_ctx, ids, 2); 1001 if (!NT_STATUS_IS_OK(status)) { 1002 TALLOC_FREE(tmp_ctx); 1003 return status; 1004 } 955 1005 956 1006 sd->owner_sid = talloc_steal(sd, ids[0].sid); … … 961 1011 /* fill in the aces from the parent */ 962 1012 status = pvfs_acl_inherit_aces(pvfs, parent_sd, sd, container); 963 NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx); 1013 if (!NT_STATUS_IS_OK(status)) { 1014 TALLOC_FREE(tmp_ctx); 1015 return status; 1016 } 964 1017 965 1018 /* if there is nothing to inherit then we fallback to the -
vendor/current/source4/ntvfs/posix/pvfs_acl_nfs4.c
r740 r988 27 27 #include "libcli/security/security.h" 28 28 29 NTSTATUS pvfs_acl_nfs4_init(void); 30 29 31 #define ACE4_IDENTIFIER_GROUP 0x40 30 32 … … 41 43 int i, num_ids; 42 44 struct id_map *ids; 43 struct composite_context *ctx;44 45 45 46 acl = talloc_zero(mem_ctx, struct nfs4acl); … … 90 91 /* Allocate memory for the sids from the security descriptor to be on 91 92 * the safe side. */ 92 ctx = wbc_xids_to_sids_send(pvfs->wbc_ctx, sd, num_ids, ids); 93 NT_STATUS_HAVE_NO_MEMORY(ctx); 94 status = wbc_xids_to_sids_recv(ctx, &ids); 93 status = wbc_xids_to_sids(pvfs->ntvfs->ctx->event_ctx, ids, num_ids); 95 94 NT_STATUS_NOT_OK_RETURN(status); 96 95 … … 123 122 TALLOC_CTX *tmp_ctx; 124 123 struct id_map *ids; 125 struct composite_context *ctx;126 124 127 125 tmp_ctx = talloc_new(pvfs); … … 158 156 } 159 157 160 ctx = wbc_sids_to_xids_send(pvfs->wbc_ctx,ids, acl.a_count, ids); 161 if (ctx == NULL) { 162 talloc_free(tmp_ctx); 163 return NT_STATUS_NO_MEMORY; 164 } 165 status = wbc_sids_to_xids_recv(ctx, &ids); 158 status = wbc_sids_to_xids(pvfs->ntvfs->ctx->event_ctx, ids, 159 acl.a_count); 166 160 if (!NT_STATUS_IS_OK(status)) { 167 161 talloc_free(tmp_ctx); -
vendor/current/source4/ntvfs/posix/pvfs_acl_xattr.c
r740 r988 24 24 #include "../lib/util/unix_privs.h" 25 25 #include "librpc/gen_ndr/ndr_xattr.h" 26 27 NTSTATUS pvfs_acl_xattr_init(void); 26 28 27 29 /* -
vendor/current/source4/ntvfs/posix/pvfs_dirlist.c
r414 r988 200 200 (*ofs) = DIR_OFFSET_DOTDOT; 201 201 dir->offset = *ofs; 202 if (ms_fnmatch (dir->pattern, ".", protocol) == 0) {202 if (ms_fnmatch_protocol(dir->pattern, ".", protocol) == 0) { 203 203 dcache_add(dir, "."); 204 204 return "."; … … 209 209 (*ofs) = DIR_OFFSET_BASE; 210 210 dir->offset = *ofs; 211 if (ms_fnmatch (dir->pattern, "..", protocol) == 0) {211 if (ms_fnmatch_protocol(dir->pattern, "..", protocol) == 0) { 212 212 dcache_add(dir, ".."); 213 213 return ".."; … … 229 229 } 230 230 231 if (ms_fnmatch (dir->pattern, dname, protocol) != 0) {231 if (ms_fnmatch_protocol(dir->pattern, dname, protocol) != 0) { 232 232 char *short_name = pvfs_short_name_component(dir->pvfs, dname); 233 233 if (short_name == NULL || 234 ms_fnmatch (dir->pattern, short_name, protocol) != 0) {234 ms_fnmatch_protocol(dir->pattern, short_name, protocol) != 0) { 235 235 talloc_free(short_name); 236 236 continue; -
vendor/current/source4/ntvfs/posix/pvfs_fileinfo.c
r740 r988 82 82 name->dos.alloc_size = pvfs_round_alloc_size(pvfs, name->st.st_size); 83 83 name->dos.nlink = name->st.st_nlink; 84 name->dos.ea_size = 4; 85 if (pvfs->ntvfs->ctx->protocol == PROTOCOL_SMB2) {84 name->dos.ea_size = 4; /* TODO: Fill this in without hitting the stream bad in pvfs_doseas_load() */ 85 if (pvfs->ntvfs->ctx->protocol >= PROTOCOL_SMB2_02) { 86 86 /* SMB2 represents a null EA with zero bytes */ 87 87 name->dos.ea_size = 0; -
vendor/current/source4/ntvfs/posix/pvfs_fsinfo.c
r740 r988 202 202 return NT_STATUS_OK; 203 203 204 case RAW_QFS_SECTOR_SIZE_INFORMATION: 205 fs->sector_size_info.out.logical_bytes_per_sector = block_size; 206 fs->sector_size_info.out.phys_bytes_per_sector_atomic 207 = block_size; 208 fs->sector_size_info.out.phys_bytes_per_sector_perf 209 = block_size; 210 fs->sector_size_info.out.fs_effective_phys_bytes_per_sector_atomic 211 = block_size; 212 fs->sector_size_info.out.flags 213 = QFS_SSINFO_FLAGS_ALIGNED_DEVICE 214 | QFS_SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE; 215 fs->sector_size_info.out.byte_off_sector_align = 0; 216 fs->sector_size_info.out.byte_off_partition_align = 0; 217 return NT_STATUS_OK; 218 204 219 default: 205 220 break; -
vendor/current/source4/ntvfs/posix/pvfs_ioctl.c
r414 r988 22 22 #include "includes.h" 23 23 #include "vfs_posix.h" 24 #include " libcli/raw/ioctl.h"24 #include "../libcli/smb/smb_constants.h" 25 25 26 26 /* -
vendor/current/source4/ntvfs/posix/pvfs_lock.c
r740 r988 40 40 } 41 41 42 return brl _locktest(pvfs->brl_context,42 return brlock_locktest(pvfs->brl_context, 43 43 f->brl_handle, 44 44 smbpid, … … 71 71 /* undo the locks we just did */ 72 72 for (i--;i>=0;i--) { 73 brl _unlock(pvfs->brl_context,73 brlock_unlock(pvfs->brl_context, 74 74 f->brl_handle, 75 75 locks[i].pid, … … 117 117 /* we don't retry on a cancel */ 118 118 if (reason == PVFS_WAIT_CANCEL) { 119 if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {119 if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) { 120 120 status = NT_STATUS_FILE_LOCK_CONFLICT; 121 121 } else { … … 128 128 * FILE_LOCK_CONFLICT in the error case 129 129 */ 130 status = brl _lock(pvfs->brl_context,130 status = brlock_lock(pvfs->brl_context, 131 131 f->brl_handle, 132 132 locks[pending->pending_lock].pid, … … 144 144 if (NT_STATUS_IS_OK(status) || timed_out) { 145 145 NTSTATUS status2; 146 status2 = brl _remove_pending(pvfs->brl_context,146 status2 = brlock_remove_pending(pvfs->brl_context, 147 147 f->brl_handle, pending); 148 148 if (!NT_STATUS_IS_OK(status2)) { … … 178 178 } 179 179 180 status = brl _lock(pvfs->brl_context,180 status = brlock_lock(pvfs->brl_context, 181 181 f->brl_handle, 182 182 locks[i].pid, … … 226 226 DEBUG(5,("pvfs_lock: removing %.0f locks on close\n", 227 227 (double)f->lock_count)); 228 brl _close(f->pvfs->brl_context, f->brl_handle);228 brlock_close(f->pvfs->brl_context, f->brl_handle); 229 229 f->lock_count = 0; 230 230 } … … 325 325 326 326 pending->end_time = 327 timeval_current_ofs(lck->lockx.in.timeout/1000, 328 1000*(lck->lockx.in.timeout%1000)); 327 timeval_current_ofs_msec(lck->lockx.in.timeout); 329 328 } 330 329 … … 351 350 352 351 for (i=0;i<lck->lockx.in.ulock_cnt;i++) { 353 status = brl _unlock(pvfs->brl_context,352 status = brlock_unlock(pvfs->brl_context, 354 353 f->brl_handle, 355 354 locks[i].pid, … … 370 369 } 371 370 372 status = brl _lock(pvfs->brl_context,371 status = brlock_lock(pvfs->brl_context, 373 372 f->brl_handle, 374 373 locks[i].pid, … … 395 394 /* undo the locks we just did */ 396 395 for (i--;i>=0;i--) { 397 brl _unlock(pvfs->brl_context,396 brlock_unlock(pvfs->brl_context, 398 397 f->brl_handle, 399 398 locks[i].pid, -
vendor/current/source4/ntvfs/posix/pvfs_mkdir.c
r740 r988 52 52 mode = pvfs_fileperms(pvfs, FILE_ATTRIBUTE_DIRECTORY); 53 53 54 if (pvfs_sys_mkdir(pvfs, name->full_name, mode ) == -1) {54 if (pvfs_sys_mkdir(pvfs, name->full_name, mode, name->allow_override) == -1) { 55 55 return pvfs_map_errno(pvfs, errno); 56 56 } … … 70 70 status = pvfs_acl_inherit(pvfs, req, name, -1); 71 71 if (!NT_STATUS_IS_OK(status)) { 72 pvfs_sys_rmdir(pvfs, name->full_name );72 pvfs_sys_rmdir(pvfs, name->full_name, name->allow_override); 73 73 return status; 74 74 } … … 79 79 md->t2mkdir.in.eas); 80 80 if (!NT_STATUS_IS_OK(status)) { 81 pvfs_sys_rmdir(pvfs, name->full_name );81 pvfs_sys_rmdir(pvfs, name->full_name, name->allow_override); 82 82 return status; 83 83 } … … 128 128 mode = pvfs_fileperms(pvfs, FILE_ATTRIBUTE_DIRECTORY); 129 129 130 if (pvfs_sys_mkdir(pvfs, name->full_name, mode ) == -1) {130 if (pvfs_sys_mkdir(pvfs, name->full_name, mode, name->allow_override) == -1) { 131 131 return pvfs_map_errno(pvfs, errno); 132 132 } … … 137 137 status = pvfs_acl_inherit(pvfs, req, name, -1); 138 138 if (!NT_STATUS_IS_OK(status)) { 139 pvfs_sys_rmdir(pvfs, name->full_name );139 pvfs_sys_rmdir(pvfs, name->full_name, name->allow_override); 140 140 return status; 141 141 } … … 180 180 } 181 181 182 if (pvfs_sys_rmdir(pvfs, name->full_name ) == -1) {182 if (pvfs_sys_rmdir(pvfs, name->full_name, name->allow_override) == -1) { 183 183 /* some olders systems don't return ENOTEMPTY to rmdir() */ 184 184 if (errno == EEXIST) { -
vendor/current/source4/ntvfs/posix/pvfs_notify.c
r740 r988 110 110 would free the request, and the ntvfs modules above us 111 111 could use it, so call it on the next event */ 112 event_add_timed(req->ctx->event_ctx,112 tevent_add_timer(req->ctx->event_ctx, 113 113 req, timeval_zero(), pvfs_notify_send_next, req); 114 114 } … … 279 279 pending->info = info; 280 280 281 DLIST_ADD_END(f->notify_buffer->pending, pending , struct notify_pending *);281 DLIST_ADD_END(f->notify_buffer->pending, pending); 282 282 283 283 /* if the buffer is empty then start waiting */ -
vendor/current/source4/ntvfs/posix/pvfs_open.c
r740 r988 74 74 delete_path, nt_errstr(status))); 75 75 } 76 if (pvfs_sys_rmdir(h->pvfs, delete_path ) != 0) {76 if (pvfs_sys_rmdir(h->pvfs, delete_path, h->name->allow_override) != 0) { 77 77 DEBUG(0,("pvfs_dir_handle_destructor: failed to rmdir '%s' - %s\n", 78 78 delete_path, strerror(errno))); … … 345 345 mode_t mode = pvfs_fileperms(pvfs, attrib); 346 346 347 if (pvfs_sys_mkdir(pvfs, name->full_name, mode ) == -1) {347 if (pvfs_sys_mkdir(pvfs, name->full_name, mode, name->allow_override) == -1) { 348 348 return pvfs_map_errno(pvfs,errno); 349 349 } … … 433 433 434 434 cleanup_delete: 435 pvfs_sys_rmdir(pvfs, name->full_name );435 pvfs_sys_rmdir(pvfs, name->full_name, name->allow_override); 436 436 return status; 437 437 } … … 515 515 delete_path, nt_errstr(status))); 516 516 } 517 if (pvfs_sys_unlink(h->pvfs, delete_path ) != 0) {517 if (pvfs_sys_unlink(h->pvfs, delete_path, h->name->allow_override) != 0) { 518 518 DEBUG(0,("pvfs_close: failed to delete '%s' - %s\n", 519 519 delete_path, strerror(errno))); … … 591 591 } 592 592 593 h = brl _create_handle(mem_ctx, ntvfs, &key);593 h = brlock_create_handle(mem_ctx, ntvfs, &key); 594 594 NT_STATUS_HAVE_NO_MEMORY(h); 595 595 … … 678 678 679 679 /* create the file */ 680 fd = pvfs_sys_open(pvfs, name->full_name, flags | O_CREAT | O_EXCL| O_NONBLOCK, mode );680 fd = pvfs_sys_open(pvfs, name->full_name, flags | O_CREAT | O_EXCL| O_NONBLOCK, mode, name->allow_override); 681 681 if (fd == -1) { 682 682 return pvfs_map_errno(pvfs, errno); … … 718 718 status = pvfs_access_maximal_allowed(pvfs, req, name, 719 719 &io->generic.out.maximal_access); 720 NT_STATUS_NOT_OK_RETURN(status); 720 if (!NT_STATUS_IS_OK(status)) { 721 goto cleanup_delete; 722 } 721 723 } 722 724 … … 857 859 cleanup_delete: 858 860 close(fd); 859 pvfs_sys_unlink(pvfs, name->full_name );861 pvfs_sys_unlink(pvfs, name->full_name, name->allow_override); 860 862 return status; 861 863 } … … 1175 1177 pvfs->oplock_break_timeout, 1176 1178 0); 1177 end_time = timeval_current_ofs (0,(pvfs->sharing_violation_delay*4)/5);1179 end_time = timeval_current_ofs_usec((pvfs->sharing_violation_delay*4)/5); 1178 1180 end_time = timeval_min(final_timeout, &end_time); 1179 1181 } else { … … 1285 1287 1286 1288 /* what does this bit really mean?? */ 1287 if (req->ctx->protocol == PROTOCOL_SMB2 &&1289 if (req->ctx->protocol >= PROTOCOL_SMB2_02 && 1288 1290 access_mask == SEC_STD_SYNCHRONIZE) { 1289 1291 return NT_STATUS_ACCESS_DENIED; … … 1503 1505 */ 1504 1506 if (create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE && 1505 req->ctx->protocol == PROTOCOL_SMB2) {1507 req->ctx->protocol >= PROTOCOL_SMB2_02) { 1506 1508 del_on_close = true; 1507 1509 } else { … … 1550 1552 1551 1553 /* do the actual open */ 1552 fd = pvfs_sys_open(pvfs, f->handle->name->full_name, flags | O_NONBLOCK, 0 );1554 fd = pvfs_sys_open(pvfs, f->handle->name->full_name, flags | O_NONBLOCK, 0, name->allow_override); 1553 1555 if (fd == -1) { 1554 1556 status = pvfs_map_errno(f->pvfs, errno); … … 1570 1572 f->handle->fd = fd; 1571 1573 1572 status = brl _count(f->pvfs->brl_context, f->brl_handle, &count);1574 status = brlock_count(f->pvfs->brl_context, f->brl_handle, &count); 1573 1575 if (!NT_STATUS_IS_OK(status)) { 1574 1576 talloc_free(lck); … … 1636 1638 if (f->handle->name->st.st_mode != mode && 1637 1639 f->handle->name->dos.attrib != attrib && 1638 pvfs_sys_fchmod(pvfs, fd, mode ) == -1) {1640 pvfs_sys_fchmod(pvfs, fd, mode, name->allow_override) == -1) { 1639 1641 talloc_free(lck); 1640 1642 return pvfs_map_errno(pvfs, errno); -
vendor/current/source4/ntvfs/posix/pvfs_oplock.c
r414 r988 33 33 struct timeval break_to_level_II; 34 34 struct timeval break_to_none; 35 struct messaging_context *msg_ctx;35 struct imessaging_context *msg_ctx; 36 36 }; 37 37 … … 159 159 } 160 160 161 static void pvfs_oplock_break_dispatch(struct messaging_context *msg,161 static void pvfs_oplock_break_dispatch(struct imessaging_context *msg, 162 162 void *private_data, uint32_t msg_type, 163 163 struct server_id src, DATA_BLOB *data) … … 170 170 171 171 /* we need to check that this one is for us. See 172 messaging_send_ptr() for the other side of this.172 imessaging_send_ptr() for the other side of this. 173 173 */ 174 174 if (data->length == sizeof(struct opendb_oplock_break)) { … … 193 193 static int pvfs_oplock_destructor(struct pvfs_oplock *opl) 194 194 { 195 messaging_deregister(opl->msg_ctx, MSG_NTVFS_OPLOCK_BREAK, opl);195 imessaging_deregister(opl->msg_ctx, MSG_NTVFS_OPLOCK_BREAK, opl); 196 196 return 0; 197 197 } … … 229 229 opl->msg_ctx = f->pvfs->ntvfs->ctx->msg_ctx; 230 230 231 status = messaging_register(opl->msg_ctx,231 status = imessaging_register(opl->msg_ctx, 232 232 opl, 233 233 MSG_NTVFS_OPLOCK_BREAK, -
vendor/current/source4/ntvfs/posix/pvfs_qfileinfo.c
r740 r988 103 103 if (strcasecmp_m(eas->eas[i].name.s, 104 104 ealist->eas[j].name) == 0) { 105 if (ealist->eas[j].value.length == 0) { 106 continue; 107 } 105 108 eas->eas[i].value = ealist->eas[j].value; 106 109 break; … … 135 138 eas->eas[eas->num_eas].flags = 0; 136 139 eas->eas[eas->num_eas].name.s = ealist->eas[i].name; 140 if (ealist->eas[i].value.length == 0) { 141 continue; 142 } 137 143 eas->eas[eas->num_eas].value = ealist->eas[i].value; 138 144 eas->num_eas++; … … 150 156 { 151 157 switch (info->generic.level) { 152 case RAW_FILEINFO_GENERIC:153 return NT_STATUS_INVALID_LEVEL;154 155 158 case RAW_FILEINFO_GETATTR: 156 159 info->getattr.out.attrib = name->dos.attrib; … … 226 229 case RAW_FILEINFO_NAME_INFO: 227 230 case RAW_FILEINFO_NAME_INFORMATION: 228 if (req->ctx->protocol == PROTOCOL_SMB2) {231 if (req->ctx->protocol >= PROTOCOL_SMB2_02) { 229 232 /* strange that SMB2 doesn't have this */ 230 233 return NT_STATUS_NOT_SUPPORTED; … … 334 337 NT_STATUS_HAVE_NO_MEMORY(info->all_info2.out.fname.s); 335 338 return NT_STATUS_OK; 339 340 case RAW_FILEINFO_GENERIC: 341 case RAW_FILEINFO_UNIX_BASIC: 342 case RAW_FILEINFO_UNIX_INFO2: 343 case RAW_FILEINFO_UNIX_LINK: 344 return NT_STATUS_INVALID_LEVEL; 336 345 } 337 346 -
vendor/current/source4/ntvfs/posix/pvfs_read.c
r740 r988 60 60 61 61 maxcnt = rd->readx.in.maxcnt; 62 if (maxcnt > 2*UINT16_MAX && req->ctx->protocol < PROTOCOL_SMB2 ) {62 if (maxcnt > 2*UINT16_MAX && req->ctx->protocol < PROTOCOL_SMB2_02) { 63 63 DEBUG(3,(__location__ ": Invalid SMB maxcnt 0x%x\n", maxcnt)); 64 64 return NT_STATUS_INVALID_PARAMETER; … … 97 97 98 98 /* only SMB2 honors mincnt */ 99 if (req->ctx->protocol == PROTOCOL_SMB2) {99 if (req->ctx->protocol >= PROTOCOL_SMB2_02) { 100 100 if (rd->readx.in.mincnt > ret || 101 101 (ret == 0 && maxcnt > 0)) { -
vendor/current/source4/ntvfs/posix/pvfs_rename.c
r740 r988 38 38 NTSTATUS status; 39 39 40 if (pvfs_sys_rename(pvfs, name1->full_name, name2) == -1) { 40 if (pvfs_sys_rename(pvfs, name1->full_name, name2, 41 name1->allow_override) == -1) { 41 42 return pvfs_map_errno(pvfs, errno); 42 43 } … … 625 626 status = pvfs_access_check_parent(pvfs, req, name2, SEC_DIR_ADD_FILE); 626 627 NT_STATUS_NOT_OK_RETURN(status); 627 return pvfs_copy_file(pvfs, name1, name2 );628 return pvfs_copy_file(pvfs, name1, name2, name1->allow_override && name2->allow_override); 628 629 629 630 case RENAME_FLAG_MOVE_CLUSTER_INFORMATION: -
vendor/current/source4/ntvfs/posix/pvfs_resolve.c
r740 r988 519 519 (*name)->exists = false; 520 520 (*name)->stream_exists = false; 521 (*name)->allow_override = false; 521 522 522 523 if (!(pvfs->fs_attribs & FS_ATTR_NAMED_STREAMS)) { … … 525 526 526 527 /* SMB2 doesn't allow a leading slash */ 527 if (req->ctx->protocol == PROTOCOL_SMB2 &&528 if (req->ctx->protocol >= PROTOCOL_SMB2_02 && 528 529 *cifs_name == '\\') { 529 530 return NT_STATUS_INVALID_PARAMETER; … … 631 632 (*name)->stream_name = NULL; 632 633 (*name)->stream_id = 0; 634 (*name)->allow_override = false; 633 635 634 636 status = pvfs_fill_dos_info(pvfs, *name, flags, -1); … … 693 695 if (h->have_opendb_entry) { 694 696 struct odb_lock *lck; 695 c har *name = NULL;697 const char *name = NULL; 696 698 697 699 lck = odb_lock(h, h->pvfs->odb_context, &h->odb_locking_key); … … 704 706 } 705 707 706 status = odb_get_path(lck, (const char **)&name);708 status = odb_get_path(lck, &name); 707 709 if (NT_STATUS_IS_OK(status)) { 708 710 /* … … 718 720 char *new_orig; 719 721 char *delim; 722 char *full_name = discard_const_p(char, name); 720 723 721 724 delim = strrchr(name, '/'); … … 746 749 talloc_free(h->name->original_name); 747 750 talloc_free(h->name->full_name); 748 h->name->full_name = talloc_steal(h->name, name);751 h->name->full_name = talloc_steal(h->name, full_name); 749 752 h->name->original_name = new_orig; 750 753 } … … 816 819 (*name)->stream_name = NULL; 817 820 (*name)->stream_id = 0; 821 (*name)->allow_override = false; 818 822 819 823 status = pvfs_fill_dos_info(pvfs, *name, PVFS_RESOLVE_NO_OPENDB, -1); -
vendor/current/source4/ntvfs/posix/pvfs_search.c
r740 r988 62 62 if (search->handle == INVALID_SEARCH_HANDLE) return; 63 63 talloc_free(search->te); 64 search->te = event_add_timed(ev, search,64 search->te = tevent_add_timer(ev, search, 65 65 timeval_current_ofs(search->pvfs->search.inactivity_time, 0), 66 66 pvfs_search_timer, search); … … 222 222 223 223 case RAW_SEARCH_DATA_GENERIC: 224 break; 224 case RAW_SEARCH_DATA_UNIX_INFO: 225 case RAW_SEARCH_DATA_UNIX_INFO2: 226 return NT_STATUS_INVALID_LEVEL; 225 227 } 226 228 -
vendor/current/source4/ntvfs/posix/pvfs_setfileinfo.c
r740 r988 131 131 /* renames are only allowed within a directory */ 132 132 if (strchr_m(info->rename_information.in.new_name, '\\') && 133 (req->ctx->protocol != PROTOCOL_SMB2)) {133 (req->ctx->protocol < PROTOCOL_SMB2_02)) { 134 134 return NT_STATUS_NOT_SUPPORTED; 135 135 } … … 144 144 but I suspect it is just uninitialised memory */ 145 145 if (info->rename_information.in.root_fid != 0 && 146 (req->ctx->protocol != PROTOCOL_SMB2)) {146 (req->ctx->protocol < PROTOCOL_SMB2_02)) { 147 147 return NT_STATUS_INVALID_PARAMETER; 148 148 } 149 149 150 150 /* construct the fully qualified windows name for the new file name */ 151 if (req->ctx->protocol == PROTOCOL_SMB2) {151 if (req->ctx->protocol >= PROTOCOL_SMB2_02) { 152 152 /* SMB2 sends the full path of the new name */ 153 153 new_name = talloc_asprintf(req, "\\%s", info->rename_information.in.new_name); … … 368 368 369 369 case RAW_SFILEINFO_EA_SET: 370 return pvfs_setfileinfo_ea_set(pvfs, h->name, h->fd, 370 return pvfs_setfileinfo_ea_set(pvfs, h->name, h->fd, 371 371 info->ea_set.in.num_eas, 372 372 info->ea_set.in.eas); … … 420 420 h->position = info->position_information.in.position; 421 421 break; 422 423 case RAW_SFILEINFO_FULL_EA_INFORMATION: 424 return pvfs_setfileinfo_ea_set(pvfs, h->name, h->fd, 425 info->full_ea_information.in.eas.num_eas, 426 info->full_ea_information.in.eas.eas); 422 427 423 428 case RAW_SFILEINFO_MODE_INFORMATION: … … 535 540 mode = pvfs_fileperms(pvfs, newstats.dos.attrib); 536 541 if (!(h->name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY)) { 537 if (pvfs_sys_fchmod(pvfs, h->fd, mode ) == -1) {542 if (pvfs_sys_fchmod(pvfs, h->fd, mode, h->name->allow_override) == -1) { 538 543 return pvfs_map_errno(pvfs, errno); 539 544 } … … 860 865 if (newstats.dos.attrib != name->dos.attrib) { 861 866 mode_t mode = pvfs_fileperms(pvfs, newstats.dos.attrib); 862 if (pvfs_sys_chmod(pvfs, name->full_name, mode ) == -1) {867 if (pvfs_sys_chmod(pvfs, name->full_name, mode, name->allow_override) == -1) { 863 868 return pvfs_map_errno(pvfs, errno); 864 869 } -
vendor/current/source4/ntvfs/posix/pvfs_sys.c
r740 r988 197 197 return NULL; 198 198 } 199 199 200 ctx->old_wd = talloc_strdup(ctx, cwd); 201 free(cwd); 202 200 203 if (ctx->old_wd == NULL) { 201 free(cwd);202 204 talloc_free(ctx); 203 205 return NULL; … … 257 259 wrap open for system override 258 260 */ 259 int pvfs_sys_open(struct pvfs_state *pvfs, const char *filename, int flags, mode_t mode )261 int pvfs_sys_open(struct pvfs_state *pvfs, const char *filename, int flags, mode_t mode, bool allow_override) 260 262 { 261 263 int fd, ret; … … 268 270 fd = open(filename, flags, mode); 269 271 if (fd != -1 || 270 ! (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE)||272 !allow_override || 271 273 errno != EACCES) { 272 274 return fd; … … 367 369 wrap unlink for system override 368 370 */ 369 int pvfs_sys_unlink(struct pvfs_state *pvfs, const char *filename )371 int pvfs_sys_unlink(struct pvfs_state *pvfs, const char *filename, bool allow_override) 370 372 { 371 373 int ret; … … 377 379 ret = unlink(filename); 378 380 if (ret != -1 || 379 ! (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE)||381 !allow_override || 380 382 errno != EACCES) { 381 383 return ret; … … 406 408 { 407 409 int fd = open(path, PVFS_NOFOLLOW | O_RDONLY); 410 int posix_errno = errno; 408 411 if (fd != -1) { 409 412 close(fd); 410 413 return false; 411 414 } 412 return (errno == ELOOP); 415 416 #if defined(ENOTSUP) && defined(OSF1) 417 /* handle special Tru64 errno */ 418 if (errno == ENOTSUP) { 419 posix_errno = ELOOP; 420 } 421 #endif /* ENOTSUP */ 422 423 #ifdef EFTYPE 424 /* fix broken NetBSD errno */ 425 if (errno == EFTYPE) { 426 posix_errno = ELOOP; 427 } 428 #endif /* EFTYPE */ 429 430 /* fix broken FreeBSD errno */ 431 if (errno == EMLINK) { 432 posix_errno = ELOOP; 433 } 434 435 return (posix_errno == ELOOP); 413 436 } 414 437 … … 416 439 wrap rename for system override 417 440 */ 418 int pvfs_sys_rename(struct pvfs_state *pvfs, const char *name1, const char *name2 )441 int pvfs_sys_rename(struct pvfs_state *pvfs, const char *name1, const char *name2, bool allow_override) 419 442 { 420 443 int ret; … … 426 449 ret = rename(name1, name2); 427 450 if (ret != -1 || 428 ! (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE)||451 !allow_override || 429 452 errno != EACCES) { 430 453 return ret; … … 481 504 wrap mkdir for system override 482 505 */ 483 int pvfs_sys_mkdir(struct pvfs_state *pvfs, const char *dirname, mode_t mode )506 int pvfs_sys_mkdir(struct pvfs_state *pvfs, const char *dirname, mode_t mode, bool allow_override) 484 507 { 485 508 int ret; … … 491 514 ret = mkdir(dirname, mode); 492 515 if (ret != -1 || 493 ! (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE)||516 !allow_override || 494 517 errno != EACCES) { 495 518 return ret; … … 513 536 if (ret == -1) { 514 537 rmdir(dirname); 515 talloc_free(ctx);516 errno = saved_errno;517 return -1;518 }519 520 talloc_free(ctx);521 return ret;522 }523 524 525 /*526 wrap rmdir for system override527 */528 int pvfs_sys_rmdir(struct pvfs_state *pvfs, const char *dirname)529 {530 int ret;531 struct pvfs_sys_ctx *ctx;532 int saved_errno, orig_errno;533 534 orig_errno = errno;535 536 ret = rmdir(dirname);537 if (ret != -1 ||538 !(pvfs->flags & PVFS_FLAG_PERM_OVERRIDE) ||539 errno != EACCES) {540 return ret;541 }542 543 saved_errno = errno;544 545 ctx = pvfs_sys_pushdir(pvfs, &dirname);546 if (ctx == NULL) {547 errno = saved_errno;548 return -1;549 }550 551 ret = rmdir(dirname);552 if (ret == -1) {553 538 talloc_free(ctx); 554 539 errno = saved_errno; … … 561 546 } 562 547 563 /* 564 wrap fchmod for system override 565 */ 566 int pvfs_sys_fchmod(struct pvfs_state *pvfs, int fd, mode_t mode) 548 549 /* 550 wrap rmdir for system override 551 */ 552 int pvfs_sys_rmdir(struct pvfs_state *pvfs, const char *dirname, bool allow_override) 567 553 { 568 554 int ret; … … 572 558 orig_errno = errno; 573 559 574 ret = fchmod(fd, mode);560 ret = rmdir(dirname); 575 561 if (ret != -1 || 576 ! (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE)||562 !allow_override || 577 563 errno != EACCES) { 578 564 return ret; … … 581 567 saved_errno = errno; 582 568 583 ctx = pvfs_sys_pushdir(pvfs, NULL);584 if (ctx == NULL) { 585 errno = saved_errno; 586 return -1; 587 } 588 589 ret = fchmod(fd, mode);569 ctx = pvfs_sys_pushdir(pvfs, &dirname); 570 if (ctx == NULL) { 571 errno = saved_errno; 572 return -1; 573 } 574 575 ret = rmdir(dirname); 590 576 if (ret == -1) { 591 577 talloc_free(ctx); … … 599 585 } 600 586 601 602 /* 603 wrap chmod for system override 604 */ 605 int pvfs_sys_chmod(struct pvfs_state *pvfs, const char *filename, mode_t mode) 587 /* 588 wrap fchmod for system override 589 */ 590 int pvfs_sys_fchmod(struct pvfs_state *pvfs, int fd, mode_t mode, bool allow_override) 606 591 { 607 592 int ret; … … 611 596 orig_errno = errno; 612 597 613 ret = chmod(filename, mode);598 ret = fchmod(fd, mode); 614 599 if (ret != -1 || 615 ! (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE)||600 !allow_override || 616 601 errno != EACCES) { 617 602 return ret; … … 620 605 saved_errno = errno; 621 606 622 ctx = pvfs_sys_pushdir(pvfs, &filename);623 if (ctx == NULL) { 624 errno = saved_errno; 625 return -1; 626 } 627 628 ret = chmod(filename, mode);607 ctx = pvfs_sys_pushdir(pvfs, NULL); 608 if (ctx == NULL) { 609 errno = saved_errno; 610 return -1; 611 } 612 613 ret = fchmod(fd, mode); 629 614 if (ret == -1) { 630 615 talloc_free(ctx); … … 637 622 return ret; 638 623 } 624 625 626 /* 627 wrap chmod for system override 628 */ 629 int pvfs_sys_chmod(struct pvfs_state *pvfs, const char *filename, mode_t mode, bool allow_override) 630 { 631 int ret; 632 struct pvfs_sys_ctx *ctx; 633 int saved_errno, orig_errno; 634 635 orig_errno = errno; 636 637 ret = chmod(filename, mode); 638 if (ret != -1 || 639 !allow_override || 640 errno != EACCES) { 641 return ret; 642 } 643 644 saved_errno = errno; 645 646 ctx = pvfs_sys_pushdir(pvfs, &filename); 647 if (ctx == NULL) { 648 errno = saved_errno; 649 return -1; 650 } 651 652 ret = chmod(filename, mode); 653 if (ret == -1) { 654 talloc_free(ctx); 655 errno = saved_errno; 656 return -1; 657 } 658 659 talloc_free(ctx); 660 errno = orig_errno; 661 return ret; 662 } -
vendor/current/source4/ntvfs/posix/pvfs_unlink.c
r740 r988 124 124 125 125 /* finally try the actual unlink */ 126 if (pvfs_sys_unlink(pvfs, name->full_name ) == -1) {126 if (pvfs_sys_unlink(pvfs, name->full_name, name->allow_override) == -1) { 127 127 status = pvfs_map_errno(pvfs, errno); 128 128 } -
vendor/current/source4/ntvfs/posix/pvfs_util.c
r740 r988 41 41 { 42 42 NTSTATUS status; 43 status = map_nt_error_from_unix (unix_errno);43 status = map_nt_error_from_unix_common(unix_errno); 44 44 DEBUG(10,(__location__ " mapped unix errno %d -> %s\n", unix_errno, nt_errstr(status))); 45 45 return status; … … 91 91 NTSTATUS pvfs_copy_file(struct pvfs_state *pvfs, 92 92 struct pvfs_filename *name1, 93 struct pvfs_filename *name2) 93 struct pvfs_filename *name2, 94 bool allow_override) 94 95 { 95 96 int fd1, fd2; … … 103 104 } 104 105 105 fd1 = pvfs_sys_open(pvfs, name1->full_name, O_RDONLY, 0 );106 fd1 = pvfs_sys_open(pvfs, name1->full_name, O_RDONLY, 0, allow_override); 106 107 if (fd1 == -1) { 107 108 talloc_free(buf); … … 109 110 } 110 111 111 fd2 = pvfs_sys_open(pvfs, name2->full_name, O_CREAT|O_EXCL|O_WRONLY, 0 );112 fd2 = pvfs_sys_open(pvfs, name2->full_name, O_CREAT|O_EXCL|O_WRONLY, 0, allow_override); 112 113 if (fd2 == -1) { 113 114 close(fd1); … … 134 135 close(fd2); 135 136 talloc_free(buf); 136 pvfs_sys_unlink(pvfs, name2->full_name );137 pvfs_sys_unlink(pvfs, name2->full_name, allow_override); 137 138 if (ret2 == -1) { 138 139 return pvfs_map_errno(pvfs, errno); … … 146 147 147 148 mode = pvfs_fileperms(pvfs, name1->dos.attrib); 148 if (pvfs_sys_fchmod(pvfs, fd2, mode ) == -1) {149 if (pvfs_sys_fchmod(pvfs, fd2, mode, allow_override) == -1) { 149 150 status = pvfs_map_errno(pvfs, errno); 150 151 close(fd2); 151 pvfs_sys_unlink(pvfs, name2->full_name );152 pvfs_sys_unlink(pvfs, name2->full_name, allow_override); 152 153 return status; 153 154 } … … 159 160 if (!NT_STATUS_IS_OK(status)) { 160 161 close(fd2); 161 pvfs_sys_unlink(pvfs, name2->full_name );162 pvfs_sys_unlink(pvfs, name2->full_name, allow_override); 162 163 return status; 163 164 } -
vendor/current/source4/ntvfs/posix/pvfs_wait.c
r740 r988 34 34 void *private_data; 35 35 int msg_type; 36 struct messaging_context *msg_ctx;36 struct imessaging_context *msg_ctx; 37 37 struct tevent_context *ev; 38 38 struct ntvfs_request *req; … … 57 57 receive a completion message for a wait 58 58 */ 59 static void pvfs_wait_dispatch(struct messaging_context *msg,59 static void pvfs_wait_dispatch(struct imessaging_context *msg, 60 60 void *private_data, uint32_t msg_type, 61 61 struct server_id src, DATA_BLOB *data) … … 67 67 68 68 /* we need to check that this one is for us. See 69 messaging_send_ptr() for the other side of this.69 imessaging_send_ptr() for the other side of this. 70 70 */ 71 71 if (data->length == sizeof(void *)) { … … 117 117 { 118 118 if (pwait->msg_type != -1) { 119 messaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait);119 imessaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait); 120 120 } 121 121 DLIST_REMOVE(pwait->pvfs->wait_list, pwait); … … 157 157 if (!timeval_is_zero(&end_time)) { 158 158 /* setup a timer */ 159 event_add_timed(pwait->ev, pwait, end_time, pvfs_wait_timeout, pwait);159 tevent_add_timer(pwait->ev, pwait, end_time, pvfs_wait_timeout, pwait); 160 160 } 161 161 … … 163 163 type */ 164 164 if (msg_type != -1) { 165 messaging_register(pwait->msg_ctx,165 imessaging_register(pwait->msg_ctx, 166 166 pwait, 167 167 msg_type, -
vendor/current/source4/ntvfs/posix/pvfs_write.c
r414 r988 65 65 } 66 66 67 tv = timeval_current_ofs (0,pvfs->writetime_delay);67 tv = timeval_current_ofs_usec(pvfs->writetime_delay); 68 68 69 69 h->write_time.update_triggered = true; 70 70 h->write_time.update_on_close = true; 71 h->write_time.update_event = event_add_timed(pvfs->ntvfs->ctx->event_ctx,71 h->write_time.update_event = tevent_add_timer(pvfs->ntvfs->ctx->event_ctx, 72 72 h, tv, 73 73 pvfs_write_time_update_handler, 74 74 h); 75 75 if (!h->write_time.update_event) { 76 DEBUG(0,("Failed event_add_timed\n"));76 DEBUG(0,("Failed tevent_add_timer\n")); 77 77 } 78 78 } -
vendor/current/source4/ntvfs/posix/pvfs_xattr.c
r740 r988 25 25 #include "librpc/gen_ndr/ndr_xattr.h" 26 26 #include "param/param.h" 27 #include "ntvfs/posix/posix_eadb_proto.h" 27 28 28 29 /* … … 82 83 { 83 84 if (pvfs->ea_db) { 84 return delete_ xattr_tdb(pvfs, attr_name, fname, fd);85 return delete_posix_eadb(pvfs, attr_name, fname, fd); 85 86 } 86 87 return delete_xattr_system(pvfs, attr_name, fname, fd); … … 93 94 { 94 95 if (pvfs->ea_db) { 95 return unlink_ xattr_tdb(pvfs, fname);96 return unlink_posix_eadb(pvfs, fname); 96 97 } 97 98 return unlink_xattr_system(pvfs, fname); … … 284 285 NTSTATUS status; 285 286 ZERO_STRUCTP(eas); 287 288 if (name->stream_name) { 289 /* We don't support EAs on streams */ 290 return NT_STATUS_INVALID_PARAMETER; 291 } 292 286 293 if (!(pvfs->flags & PVFS_FLAG_XATTR_ENABLE)) { 287 294 return NT_STATUS_OK; -
vendor/current/source4/ntvfs/posix/python/pyxattr_native.c
r740 r988 22 22 #include "includes.h" 23 23 #include "librpc/ndr/libndr.h" 24 #include "lib/util/wrap_xattr.h" 24 #include "system/filesys.h" 25 26 void initxattr_native(void); 25 27 26 28 static PyObject *py_is_xattr_supported(PyObject *self) … … 37 39 char *filename, *attribute; 38 40 int ret = 0; 39 int blobsize;41 Py_ssize_t blobsize; 40 42 DATA_BLOB blob; 41 43 … … 45 47 46 48 blob.length = blobsize; 47 ret = wrap_setxattr(filename, attribute, blob.data, blob.length, 0);49 ret = setxattr(filename, attribute, blob.data, blob.length, 0); 48 50 if( ret < 0 ) { 49 51 if (errno == ENOTSUP) { … … 67 69 return NULL; 68 70 mem_ctx = talloc_new(NULL); 69 len = wrap_getxattr(filename,attribute,NULL,0);71 len = getxattr(filename,attribute,NULL,0); 70 72 if( len < 0 ) { 71 73 if (errno == ENOTSUP) { … … 79 81 /* check length ... */ 80 82 buf = talloc_zero_array(mem_ctx, char, len); 81 len = wrap_getxattr(filename, attribute, buf, len);83 len = getxattr(filename, attribute, buf, len); 82 84 if( len < 0 ) { 83 85 if (errno == ENOTSUP) { … … 97 99 { "wrap_getxattr", (PyCFunction)py_wrap_getxattr, METH_VARARGS, 98 100 "wrap_getxattr(filename,attribute) -> blob\n" 99 "Retr eive given attribute on the given file." },101 "Retrieve given attribute on the given file." }, 100 102 { "wrap_setxattr", (PyCFunction)py_wrap_setxattr, METH_VARARGS, 101 103 "wrap_setxattr(filename,attribute,value)\n" -
vendor/current/source4/ntvfs/posix/python/pyxattr_tdb.c
r740 r988 21 21 #include <Python.h> 22 22 #include "includes.h" 23 #include "system/filesys.h" 23 24 #include <tdb.h> 24 #include "lib/ util/tdb_wrap.h"25 #include "lib/tdb_wrap/tdb_wrap.h" 25 26 #include "librpc/ndr/libndr.h" 26 #include "lib/util/wrap_xattr.h" 27 #include "ntvfs/posix/vfs_posix.h" 27 #include "ntvfs/posix/posix_eadb.h" 28 28 #include "libcli/util/pyerrors.h" 29 #include "param/pyparam.h" 30 #include "lib/dbwrap/dbwrap.h" 31 #include "lib/dbwrap/dbwrap_open.h" 32 #include "lib/dbwrap/dbwrap_tdb.h" 33 #include "source3/lib/xattr_tdb.h" 34 35 void initxattr_tdb(void); 29 36 30 37 static PyObject *py_is_xattr_supported(PyObject *self) … … 37 44 char *filename, *attribute, *tdbname; 38 45 DATA_BLOB blob; 39 int blobsize;40 NTSTATUS status;46 Py_ssize_t blobsize; 47 int ret; 41 48 TALLOC_CTX *mem_ctx; 42 struct tdb_wrap *eadb; 49 struct loadparm_context *lp_ctx; 50 struct db_context *eadb = NULL; 51 struct file_id id; 52 struct stat sbuf; 43 53 44 54 if (!PyArg_ParseTuple(args, "ssss#", &tdbname, &filename, &attribute, … … 48 58 blob.length = blobsize; 49 59 mem_ctx = talloc_new(NULL); 50 eadb = tdb_wrap_open(mem_ctx, tdbname, 50000, 51 TDB_DEFAULT, O_RDWR|O_CREAT, 0600); 60 61 lp_ctx = py_default_loadparm_context(mem_ctx); 62 eadb = db_open_tdb(mem_ctx, tdbname, 50000, 63 lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT), 64 O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2, 65 DBWRAP_FLAG_NONE); 52 66 53 67 if (eadb == NULL) { … … 56 70 return NULL; 57 71 } 58 status = push_xattr_blob_tdb_raw(eadb, mem_ctx, attribute, filename, -1, 59 &blob); 60 if (!NT_STATUS_IS_OK(status)) { 61 PyErr_FromNTSTATUS(status); 72 73 ret = stat(filename, &sbuf); 74 if (ret < 0) { 75 PyErr_SetFromErrno(PyExc_IOError); 76 talloc_free(mem_ctx); 77 return NULL; 78 } 79 80 ZERO_STRUCT(id); 81 id.devid = sbuf.st_dev; 82 id.inode = sbuf.st_ino; 83 84 ret = xattr_tdb_setattr(eadb, &id, attribute, blob.data, blob.length, 0); 85 if (ret < 0) { 86 PyErr_SetFromErrno(PyExc_TypeError); 62 87 talloc_free(mem_ctx); 63 88 return NULL; … … 71 96 char *filename, *attribute, *tdbname; 72 97 TALLOC_CTX *mem_ctx; 98 struct loadparm_context *lp_ctx; 73 99 DATA_BLOB blob; 74 PyObject *ret; 75 NTSTATUS status; 76 struct tdb_wrap *eadb = NULL; 100 PyObject *ret_obj; 101 int ret; 102 ssize_t xattr_size; 103 struct db_context *eadb = NULL; 104 struct file_id id; 105 struct stat sbuf; 77 106 78 107 if (!PyArg_ParseTuple(args, "sss", &tdbname, &filename, &attribute)) … … 80 109 81 110 mem_ctx = talloc_new(NULL); 82 eadb = tdb_wrap_open(mem_ctx, tdbname, 50000, 83 TDB_DEFAULT, O_RDWR|O_CREAT, 0600); 111 112 lp_ctx = py_default_loadparm_context(mem_ctx); 113 eadb = db_open_tdb(mem_ctx, tdbname, 50000, 114 lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT), 115 O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2, 116 DBWRAP_FLAG_NONE); 117 84 118 if (eadb == NULL) { 85 119 PyErr_SetFromErrno(PyExc_IOError); … … 87 121 return NULL; 88 122 } 89 status = pull_xattr_blob_tdb_raw(eadb, mem_ctx, attribute, filename, 90 -1, 100, &blob);91 if ( !NT_STATUS_IS_OK(status) || blob.length< 0) {92 PyErr_ FromNTSTATUS(status);123 124 ret = stat(filename, &sbuf); 125 if (ret < 0) { 126 PyErr_SetFromErrno(PyExc_IOError); 93 127 talloc_free(mem_ctx); 94 128 return NULL; 95 129 } 96 ret = PyString_FromStringAndSize((char *)blob.data, blob.length); 130 131 ZERO_STRUCT(id); 132 id.devid = sbuf.st_dev; 133 id.inode = sbuf.st_ino; 134 135 xattr_size = xattr_tdb_getattr(eadb, mem_ctx, &id, attribute, &blob); 136 if (xattr_size < 0) { 137 PyErr_SetFromErrno(PyExc_TypeError); 138 talloc_free(mem_ctx); 139 return NULL; 140 } 141 ret_obj = PyString_FromStringAndSize((char *)blob.data, xattr_size); 97 142 talloc_free(mem_ctx); 98 return ret ;143 return ret_obj; 99 144 } 100 145 … … 102 147 { "wrap_getxattr", (PyCFunction)py_wrap_getxattr, METH_VARARGS, 103 148 "wrap_getxattr(filename,attribute) -> blob\n" 104 "Retr eive given attribute on the given file." },149 "Retrieve given attribute on the given file." }, 105 150 { "wrap_setxattr", (PyCFunction)py_wrap_setxattr, METH_VARARGS, 106 151 "wrap_setxattr(filename,attribute,value)\n" -
vendor/current/source4/ntvfs/posix/vfs_posix.c
r740 r988 28 28 #include "librpc/gen_ndr/security.h" 29 29 #include <tdb.h> 30 #include "lib/ util/tdb_wrap.h"30 #include "lib/tdb_wrap/tdb_wrap.h" 31 31 #include "libcli/security/security.h" 32 32 #include "lib/events/events.h" … … 39 39 { 40 40 struct share_config *scfg = pvfs->ntvfs->ctx->config; 41 const char *eadb; 41 char *eadb; 42 char *xattr_backend; 42 43 bool def_perm_override = false; 43 44 … … 114 115 FS_ATTR_CASE_SENSITIVE_SEARCH | 115 116 FS_ATTR_CASE_PRESERVED_NAMES | 116 FS_ATTR_UNICODE_ON_DISK | 117 FS_ATTR_SPARSE_FILES; 117 FS_ATTR_UNICODE_ON_DISK; 118 118 119 119 /* allow xattrs to be stored in a external tdb */ 120 eadb = share_string_option( scfg, PVFS_EADB, NULL);120 eadb = share_string_option(pvfs, scfg, PVFS_EADB, NULL); 121 121 if (eadb != NULL) { 122 pvfs->ea_db = tdb_wrap_open(pvfs, eadb, 50000, 123 TDB_DEFAULT, O_RDWR|O_CREAT, 0600); 122 pvfs->ea_db = tdb_wrap_open( 123 pvfs, eadb, 50000, 124 lpcfg_tdb_flags(pvfs->ntvfs->ctx->lp_ctx, TDB_DEFAULT), 125 O_RDWR|O_CREAT, 0600); 126 TALLOC_FREE(eadb); 124 127 if (pvfs->ea_db != NULL) { 125 128 pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; … … 147 150 148 151 /* enable an ACL backend */ 149 pvfs->acl_ops = pvfs_acl_backend_byname(share_string_option(scfg, PVFS_ACL, "xattr")); 152 xattr_backend = share_string_option(pvfs, scfg, PVFS_ACL, "xattr"); 153 pvfs->acl_ops = pvfs_acl_backend_byname(xattr_backend); 154 TALLOC_FREE(xattr_backend); 150 155 } 151 156 … … 213 218 * but currently we don't have a lp_ctx there 214 219 */ 215 status = pvfs_acl_init( ntvfs->ctx->lp_ctx);220 status = pvfs_acl_init(); 216 221 NT_STATUS_NOT_OK_RETURN(status); 217 222 … … 220 225 221 226 /* for simplicity of path construction, remove any trailing slash now */ 222 base_directory = talloc_strdup(pvfs, share_string_option(ntvfs->ctx->config, SHARE_PATH, ""));227 base_directory = share_string_option(pvfs, ntvfs->ctx->config, SHARE_PATH, ""); 223 228 NT_STATUS_HAVE_NO_MEMORY(base_directory); 224 229 if (strcmp(base_directory, "/") != 0) { … … 250 255 ntvfs->private_data = pvfs; 251 256 252 pvfs->brl_context = brl _init(pvfs,257 pvfs->brl_context = brlock_init(pvfs, 253 258 pvfs->ntvfs->ctx->server_id, 254 259 pvfs->ntvfs->ctx->lp_ctx, … … 271 276 pvfs->ntvfs->ctx->config); 272 277 273 pvfs->wbc_ctx = wbc_init(pvfs,274 pvfs->ntvfs->ctx->msg_ctx,275 pvfs->ntvfs->ctx->event_ctx);276 if (pvfs->wbc_ctx == NULL) {277 return NT_STATUS_INTERNAL_DB_CORRUPTION;278 }279 280 278 /* allocate the search handle -> ptr tree */ 281 279 pvfs->search.idtree = idr_init(pvfs); … … 373 371 374 372 /* fill in all the operations */ 375 ops.connect = pvfs_connect;376 ops.disconnect = pvfs_disconnect;377 ops.unlink = pvfs_unlink;378 ops.chkpath = pvfs_chkpath;379 ops.qpathinfo = pvfs_qpathinfo;380 ops.setpathinfo = pvfs_setpathinfo;381 ops.open = pvfs_open;382 ops.mkdir = pvfs_mkdir;383 ops.rmdir = pvfs_rmdir;384 ops.rename = pvfs_rename;385 ops.copy = pvfs_copy;386 ops.ioctl = pvfs_ioctl;387 ops.read = pvfs_read;388 ops.write = pvfs_write;389 ops.seek = pvfs_seek;390 ops.flush = pvfs_flush;391 ops.close = pvfs_close;392 ops.exit = pvfs_exit;393 ops.lock = pvfs_lock;394 ops.setfileinfo = pvfs_setfileinfo;395 ops.qfileinfo = pvfs_qfileinfo;396 ops.fsinfo = pvfs_fsinfo;397 ops.lpq = pvfs_lpq;398 ops.search_first = pvfs_search_first;399 ops.search_next = pvfs_search_next;400 ops.search_close = pvfs_search_close;401 ops.trans = pvfs_trans;402 ops.logoff = pvfs_logoff;403 ops.async_setup = pvfs_async_setup;404 ops.cancel = pvfs_cancel;405 ops.notify = pvfs_notify;373 ops.connect_fn = pvfs_connect; 374 ops.disconnect_fn = pvfs_disconnect; 375 ops.unlink_fn = pvfs_unlink; 376 ops.chkpath_fn = pvfs_chkpath; 377 ops.qpathinfo_fn = pvfs_qpathinfo; 378 ops.setpathinfo_fn = pvfs_setpathinfo; 379 ops.open_fn = pvfs_open; 380 ops.mkdir_fn = pvfs_mkdir; 381 ops.rmdir_fn = pvfs_rmdir; 382 ops.rename_fn = pvfs_rename; 383 ops.copy_fn = pvfs_copy; 384 ops.ioctl_fn = pvfs_ioctl; 385 ops.read_fn = pvfs_read; 386 ops.write_fn = pvfs_write; 387 ops.seek_fn = pvfs_seek; 388 ops.flush_fn = pvfs_flush; 389 ops.close_fn = pvfs_close; 390 ops.exit_fn = pvfs_exit; 391 ops.lock_fn = pvfs_lock; 392 ops.setfileinfo_fn = pvfs_setfileinfo; 393 ops.qfileinfo_fn = pvfs_qfileinfo; 394 ops.fsinfo_fn = pvfs_fsinfo; 395 ops.lpq_fn = pvfs_lpq; 396 ops.search_first_fn = pvfs_search_first; 397 ops.search_next_fn = pvfs_search_next; 398 ops.search_close_fn = pvfs_search_close; 399 ops.trans_fn = pvfs_trans; 400 ops.logoff_fn = pvfs_logoff; 401 ops.async_setup_fn = pvfs_async_setup; 402 ops.cancel_fn = pvfs_cancel; 403 ops.notify_fn = pvfs_notify; 406 404 407 405 /* register ourselves with the NTVFS subsystem. We register -
vendor/current/source4/ntvfs/posix/vfs_posix.h
r740 r988 48 48 struct odb_context *odb_context; 49 49 struct notify_context *notify_context; 50 struct wbc_context *wbc_ctx;51 50 52 51 /* a list of pending async requests. Needed to support … … 132 131 bool exists; /* true if the base filename exists */ 133 132 bool stream_exists; /* true if the stream exists */ 133 bool allow_override; 134 134 struct stat st; 135 135 struct pvfs_dos_fileinfo dos; … … 205 205 struct brl_handle *brl_handle; 206 206 207 /* a count of active locks - used to avoid calling brl _close on207 /* a count of active locks - used to avoid calling brlock_close on 208 208 file close */ 209 209 uint64_t lock_count; -
vendor/current/source4/ntvfs/posix/wscript_build
r740 r988 4 4 source='pvfs_acl.c', 5 5 autoproto='vfs_acl_proto.h', 6 deps='events ',6 deps='events samba-modules', 7 7 ) 8 8 … … 32 32 33 33 bld.SAMBA_MODULE('ntvfs_posix', 34 source='vfs_posix.c pvfs_util.c pvfs_search.c pvfs_dirlist.c pvfs_fileinfo.c pvfs_unlink.c pvfs_mkdir.c pvfs_open.c pvfs_read.c pvfs_flush.c pvfs_write.c pvfs_fsinfo.c pvfs_qfileinfo.c pvfs_setfileinfo.c pvfs_rename.c pvfs_resolve.c pvfs_shortname.c pvfs_lock.c pvfs_oplock.c pvfs_wait.c pvfs_seek.c pvfs_ioctl.c pvfs_xattr.c pvfs_streams.c pvfs_notify.c pvfs_sys.c xattr_system.c xattr_tdb.c',34 source='vfs_posix.c pvfs_util.c pvfs_search.c pvfs_dirlist.c pvfs_fileinfo.c pvfs_unlink.c pvfs_mkdir.c pvfs_open.c pvfs_read.c pvfs_flush.c pvfs_write.c pvfs_fsinfo.c pvfs_qfileinfo.c pvfs_setfileinfo.c pvfs_rename.c pvfs_resolve.c pvfs_shortname.c pvfs_lock.c pvfs_oplock.c pvfs_wait.c pvfs_seek.c pvfs_ioctl.c pvfs_xattr.c pvfs_streams.c pvfs_notify.c pvfs_sys.c xattr_system.c', 35 35 autoproto='vfs_posix_proto.h', 36 36 subsystem='ntvfs', 37 37 init_function='ntvfs_posix_init', 38 deps='NDR_XATTR wrap_xattr ntvfs_common MESSAGING LIBWBCLIENT_OLD pvfs_acl pvfs_aio',38 deps='NDR_XATTR attr ntvfs_common MESSAGING LIBWBCLIENT_OLD pvfs_acl pvfs_aio posix_eadb', 39 39 internal_module=True 40 40 ) … … 43 43 bld.SAMBA_PYTHON('python_xattr_native', 44 44 source='python/pyxattr_native.c', 45 deps='ndr ldb samdb credentials pyparam_util wrap_xattrattr',45 deps='ndr ldb samdb samba-credentials pyparam_util attr', 46 46 realname='samba/xattr_native.so' 47 47 ) 48 48 49 bld.SAMBA_LIBRARY('posix_eadb', 50 source='posix_eadb.c', 51 deps='tdb tdb-wrap samba-util', 52 autoproto='posix_eadb_proto.h', 53 private_library=True) 54 55 bld.SAMBA_PYTHON('python_posix_eadb', 56 source='python/pyposix_eadb.c', 57 deps='pyparam_util posix_eadb tdb', 58 realname='samba/posix_eadb.so' 59 ) 49 60 50 61 bld.SAMBA_PYTHON('python_xattr_tdb', 51 source='python/pyxattr_tdb.c xattr_tdb.c',52 deps=' ndr ldb pyparam_util share attr',62 source='python/pyxattr_tdb.c', 63 deps='pyparam_util xattr_tdb', 53 64 realname='samba/xattr_tdb.so' 54 65 ) -
vendor/current/source4/ntvfs/posix/xattr_system.c
r414 r988 22 22 #include "includes.h" 23 23 #include "vfs_posix.h" 24 #include "../lib/util/wrap_xattr.h"25 24 26 25 /* … … 44 43 again: 45 44 if (fd != -1) { 46 ret = wrap_fgetxattr(fd, attr_name, blob->data, estimated_size);45 ret = fgetxattr(fd, attr_name, blob->data, estimated_size); 47 46 } else { 48 ret = wrap_getxattr(fname, attr_name, blob->data, estimated_size);47 ret = getxattr(fname, attr_name, blob->data, estimated_size); 49 48 } 50 49 if (ret == -1 && errno == ERANGE) { … … 105 104 106 105 if (fd != -1) { 107 ret = wrap_fsetxattr(fd, attr_name, blob->data, blob->length, 0);106 ret = fsetxattr(fd, attr_name, blob->data, blob->length, 0); 108 107 } else { 109 ret = wrap_setxattr(fname, attr_name, blob->data, blob->length, 0);108 ret = setxattr(fname, attr_name, blob->data, blob->length, 0); 110 109 } 111 110 if (ret == -1) { … … 126 125 127 126 if (fd != -1) { 128 ret = wrap_fremovexattr(fd, attr_name);127 ret = fremovexattr(fd, attr_name); 129 128 } else { 130 ret = wrap_removexattr(fname, attr_name);129 ret = removexattr(fname, attr_name); 131 130 } 132 131 if (ret == -1) { -
vendor/current/source4/ntvfs/print/vfs_print.c
r740 r988 23 23 24 24 #include "includes.h" 25 #include " libcli/raw/ioctl.h"25 #include "../libcli/smb/smb_constants.h" 26 26 #include "ntvfs/ntvfs.h" 27 27 #include "param/param.h" 28 29 NTSTATUS ntvfs_print_init(void); 28 30 29 31 /* … … 114 116 115 117 /* fill in all the operations */ 116 ops.connect = print_connect;117 ops.disconnect = print_disconnect;118 ops.unlink = print_unlink;119 ops.ioctl = print_ioctl;118 ops.connect_fn = print_connect; 119 ops.disconnect_fn = print_disconnect; 120 ops.unlink_fn = print_unlink; 121 ops.ioctl_fn = print_ioctl; 120 122 121 123 /* register ourselves with the NTVFS subsystem. We register under the name 'default' -
vendor/current/source4/ntvfs/simple/svfs_util.c
r740 r988 39 39 struct svfs_private *p = ntvfs->private_data; 40 40 char *ret; 41 char *name_lower = strlower_talloc(p, name); 41 42 42 43 if (*name != '\\') { 43 ret = talloc_asprintf(req, "%s/%s", p->connectpath, name );44 ret = talloc_asprintf(req, "%s/%s", p->connectpath, name_lower); 44 45 } else { 45 ret = talloc_asprintf(req, "%s%s", p->connectpath, name );46 ret = talloc_asprintf(req, "%s%s", p->connectpath, name_lower); 46 47 } 47 48 all_string_sub(ret, "\\", "/", 0); 48 49 strlower(ret + strlen(p->connectpath)); 50 49 talloc_free(name_lower); 51 50 return ret; 52 51 } … … 83 82 mask = p+1; 84 83 85 low_mask = talloc_strdup(mem_ctx, mask);84 low_mask = strlower_talloc(mem_ctx, mask); 86 85 if (!low_mask) { return NULL; } 87 strlower(low_mask);88 86 89 87 odir = opendir(dir->unix_dir); … … 100 98 } 101 99 102 low_name = talloc_strdup(mem_ctx, dent->d_name);100 low_name = strlower_talloc(mem_ctx, dent->d_name); 103 101 if (!low_name) { continue; } 104 strlower(low_name);105 102 106 103 /* 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) { 108 105 continue; 109 106 } -
vendor/current/source4/ntvfs/simple/vfs_simple.c
r740 r988 81 81 p->ntvfs = ntvfs; 82 82 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, ""); 84 84 p->open_files = NULL; 85 85 p->search = NULL; … … 148 148 /* ignoring wildcards ... */ 149 149 if (unlink(unix_path) == -1) { 150 return map_nt_error_from_unix (errno);150 return map_nt_error_from_unix_common(errno); 151 151 } 152 152 … … 177 177 178 178 if (stat(unix_path, &st) == -1) { 179 return map_nt_error_from_unix (errno);179 return map_nt_error_from_unix_common(errno); 180 180 } 181 181 … … 292 292 if (stat(unix_path, &st) == -1) { 293 293 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); 295 295 } 296 296 DEBUG(19,("svfs_qpathinfo: file %s, stat done\n", unix_path)); … … 318 318 319 319 if (fstat(f->fd, &st) == -1) { 320 return map_nt_error_from_unix (errno);320 return map_nt_error_from_unix_common(errno); 321 321 } 322 322 … … 387 387 if (mkdir(unix_path, 0755) == -1) { 388 388 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); 390 390 } 391 391 break; … … 393 393 if (mkdir(unix_path, 0755) == -1 && errno != EEXIST) { 394 394 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); 396 396 } 397 397 break; … … 402 402 fd = open(unix_path, flags, 0644); 403 403 if (fd == -1) { 404 return map_nt_error_from_unix (errno);404 return map_nt_error_from_unix_common(errno); 405 405 } 406 406 … … 408 408 DEBUG(9,("svfs_open: fstat errno=%d\n", errno)); 409 409 close(fd); 410 return map_nt_error_from_unix (errno);410 return map_nt_error_from_unix_common(errno); 411 411 } 412 412 … … 415 415 416 416 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 } 418 421 f->fd = fd; 419 422 f->name = talloc_strdup(f, unix_path); … … 457 460 458 461 if (mkdir(unix_path, 0777) == -1) { 459 return map_nt_error_from_unix (errno);462 return map_nt_error_from_unix_common(errno); 460 463 } 461 464 … … 476 479 477 480 if (rmdir(unix_path) == -1) { 478 return map_nt_error_from_unix (errno);481 return map_nt_error_from_unix_common(errno); 479 482 } 480 483 … … 500 503 501 504 if (rename(unix_path1, unix_path2) == -1) { 502 return map_nt_error_from_unix (errno);505 return map_nt_error_from_unix_common(errno); 503 506 } 504 507 … … 539 542 rd->readx.in.offset); 540 543 if (ret == -1) { 541 return map_nt_error_from_unix (errno);544 return map_nt_error_from_unix_common(errno); 542 545 } 543 546 … … 575 578 wr->writex.in.offset); 576 579 if (ret == -1) { 577 return map_nt_error_from_unix (errno);580 return map_nt_error_from_unix_common(errno); 578 581 } 579 582 … … 646 649 647 650 if (close(f->fd) == -1) { 648 return map_nt_error_from_unix (errno);651 return map_nt_error_from_unix_common(errno); 649 652 } 650 653 … … 736 739 if (ftruncate(f->fd, 737 740 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); 739 742 } 740 743 break; … … 782 785 &fs->generic.out.blocks_free, 783 786 &fs->generic.out.blocks_total) == -1) { 784 return map_nt_error_from_unix (errno);787 return map_nt_error_from_unix_common(errno); 785 788 } 786 789 … … 822 825 823 826 if (stat(p->connectpath, &st) == -1) { 824 return map_nt_error_from_unix (errno);827 return map_nt_error_from_unix_common(errno); 825 828 } 826 829 … … 1059 1062 1060 1063 /* 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; 1091 1094 1092 1095 /* register ourselves with the NTVFS subsystem. We register -
vendor/current/source4/ntvfs/smb2/vfs_smb2.c
r740 r988 42 42 #include "libcli/smb2/smb2_calls.h" 43 43 44 NTSTATUS ntvfs_smb2_init(void); 45 44 46 struct cvfs_file { 45 47 struct cvfs_file *prev, *next; … … 99 101 along to the client 100 102 */ 103 #if 0 101 104 static bool oplock_handler(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *p_private) 102 105 { … … 122 125 return true; 123 126 } 127 #endif 124 128 125 129 /* … … 161 165 struct cvfs_private *p; 162 166 const char *host, *user, *pass, *domain, *remote_share, *sharename; 163 struct composite_context *creq;164 167 struct share_config *scfg = ntvfs->ctx->config; 165 168 struct smb2_tree *tree; … … 167 170 bool machine_account; 168 171 struct smbcli_options options; 172 TALLOC_CTX *tmp_ctx; 173 174 tmp_ctx = talloc_new(req); 175 if (tmp_ctx == NULL) { 176 return NT_STATUS_NO_MEMORY; 177 } 169 178 170 179 switch (tcon->generic.level) { … … 179 188 break; 180 189 default: 181 return NT_STATUS_INVALID_LEVEL; 190 status = NT_STATUS_INVALID_LEVEL; 191 goto out; 182 192 } 183 193 … … 191 201 /* Here we need to determine which server to connect to. 192 202 * For now we use parametric options, type cifs. 193 * Later we will use security=server and auth_server.c.194 203 */ 195 host = share_string_option( scfg, SMB2_SERVER, NULL);196 user = share_string_option( scfg, SMB2_USER, NULL);197 pass = share_string_option( scfg, SMB2_PASSWORD, NULL);198 domain = share_string_option( scfg, SMB2_DOMAIN, NULL);199 remote_share = share_string_option( scfg, SMB2_SHARE, NULL);204 host = share_string_option(tmp_ctx, scfg, SMB2_SERVER, NULL); 205 user = share_string_option(tmp_ctx, scfg, SMB2_USER, NULL); 206 pass = share_string_option(tmp_ctx, scfg, SMB2_PASSWORD, NULL); 207 domain = share_string_option(tmp_ctx, scfg, SMB2_DOMAIN, NULL); 208 remote_share = share_string_option(tmp_ctx, scfg, SMB2_SHARE, NULL); 200 209 if (!remote_share) { 201 210 remote_share = sharename; … … 206 215 p = talloc_zero(ntvfs, struct cvfs_private); 207 216 if (!p) { 208 return NT_STATUS_NO_MEMORY; 217 status = NT_STATUS_NO_MEMORY; 218 goto out; 209 219 } 210 220 … … 213 223 if (!host) { 214 224 DEBUG(1,("CIFS backend: You must supply server\n")); 215 return NT_STATUS_INVALID_PARAMETER; 225 status = NT_STATUS_INVALID_PARAMETER; 226 goto out; 216 227 } 217 228 … … 220 231 credentials = cli_credentials_init(p); 221 232 if (!credentials) { 222 return NT_STATUS_NO_MEMORY; 233 status = NT_STATUS_NO_MEMORY; 234 goto out; 223 235 } 224 236 cli_credentials_set_conf(credentials, ntvfs->ctx->lp_ctx); … … 237 249 status = cli_credentials_set_machine_account(credentials, ntvfs->ctx->lp_ctx); 238 250 if (!NT_STATUS_IS_OK(status)) { 239 return status;251 goto out; 240 252 } 241 253 } else if (req->session_info->credentials) { … … 244 256 } else { 245 257 DEBUG(1,("CIFS backend: NO delegated credentials found: You must supply server, user and password or the client must supply delegated credentials\n")); 246 return NT_STATUS_INVALID_PARAMETER; 258 status = NT_STATUS_INVALID_PARAMETER; 259 goto out; 247 260 } 248 261 249 262 lpcfg_smbcli_options(ntvfs->ctx->lp_ctx, &options); 250 263 251 creq = smb2_connect_send(p, host,264 status = smb2_connect(p, host, 252 265 lpcfg_parm_string_list(p, ntvfs->ctx->lp_ctx, NULL, "smb2", "ports", NULL), 253 remote_share,254 255 256 ntvfs->ctx->event_ctx, &options,257 lpcfg_socket_options(ntvfs->ctx->lp_ctx),258 lpcfg_gensec_settings(p, ntvfs->ctx->lp_ctx)259 260 261 status = smb2_connect_recv(creq, p, &tree);262 NT_STATUS_NOT_OK_RETURN(status);266 remote_share, 267 lpcfg_resolve_context(ntvfs->ctx->lp_ctx), 268 credentials, 269 &tree, 270 ntvfs->ctx->event_ctx, &options, 271 lpcfg_socket_options(ntvfs->ctx->lp_ctx), 272 lpcfg_gensec_settings(p, ntvfs->ctx->lp_ctx)); 273 if (!NT_STATUS_IS_OK(status)) { 274 goto out; 275 } 263 276 264 277 status = smb2_get_roothandle(tree, &p->roothandle); 265 NT_STATUS_NOT_OK_RETURN(status); 278 if (!NT_STATUS_IS_OK(status)) { 279 goto out; 280 } 266 281 267 282 p->tree = tree; … … 270 285 271 286 ntvfs->ctx->fs_type = talloc_strdup(ntvfs->ctx, "NTFS"); 272 NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->fs_type); 287 if (ntvfs->ctx->fs_type == NULL) { 288 status = NT_STATUS_NO_MEMORY; 289 goto out; 290 } 273 291 ntvfs->ctx->dev_type = talloc_strdup(ntvfs->ctx, "A:"); 274 NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->dev_type); 292 if (ntvfs->ctx->dev_type == NULL) { 293 status = NT_STATUS_NO_MEMORY; 294 goto out; 295 } 275 296 276 297 if (tcon->generic.level == RAW_TCON_TCONX) { … … 283 304 smbcli_oplock_handler(p->transport, oplock_handler, p); 284 305 */ 285 return NT_STATUS_OK; 306 307 status = NT_STATUS_OK; 308 309 out: 310 TALLOC_FREE(tmp_ctx); 311 return status; 286 312 } 287 313 … … 835 861 836 862 /* fill in all the operations */ 837 ops.connect = cvfs_connect;838 ops.disconnect = cvfs_disconnect;839 ops.unlink = cvfs_unlink;840 ops.chkpath = cvfs_chkpath;841 ops.qpathinfo = cvfs_qpathinfo;842 ops.setpathinfo = cvfs_setpathinfo;843 ops.open = cvfs_open;844 ops.mkdir = cvfs_mkdir;845 ops.rmdir = cvfs_rmdir;846 ops.rename = cvfs_rename;847 ops.copy = cvfs_copy;848 ops.ioctl = cvfs_ioctl;849 ops.read = cvfs_read;850 ops.write = cvfs_write;851 ops.seek = cvfs_seek;852 ops.flush = cvfs_flush;853 ops.close = cvfs_close;854 ops.exit = cvfs_exit;855 ops.lock = cvfs_lock;856 ops.setfileinfo = cvfs_setfileinfo;857 ops.qfileinfo = cvfs_qfileinfo;858 ops.fsinfo = cvfs_fsinfo;859 ops.lpq = cvfs_lpq;860 ops.search_first = cvfs_search_first;861 ops.search_next = cvfs_search_next;862 ops.search_close = cvfs_search_close;863 ops.trans = cvfs_trans;864 ops.logoff = cvfs_logoff;865 ops.async_setup = cvfs_async_setup;866 ops.cancel = cvfs_cancel;867 ops.notify = cvfs_notify;863 ops.connect_fn = cvfs_connect; 864 ops.disconnect_fn = cvfs_disconnect; 865 ops.unlink_fn = cvfs_unlink; 866 ops.chkpath_fn = cvfs_chkpath; 867 ops.qpathinfo_fn = cvfs_qpathinfo; 868 ops.setpathinfo_fn = cvfs_setpathinfo; 869 ops.open_fn = cvfs_open; 870 ops.mkdir_fn = cvfs_mkdir; 871 ops.rmdir_fn = cvfs_rmdir; 872 ops.rename_fn = cvfs_rename; 873 ops.copy_fn = cvfs_copy; 874 ops.ioctl_fn = cvfs_ioctl; 875 ops.read_fn = cvfs_read; 876 ops.write_fn = cvfs_write; 877 ops.seek_fn = cvfs_seek; 878 ops.flush_fn = cvfs_flush; 879 ops.close_fn = cvfs_close; 880 ops.exit_fn = cvfs_exit; 881 ops.lock_fn = cvfs_lock; 882 ops.setfileinfo_fn = cvfs_setfileinfo; 883 ops.qfileinfo_fn = cvfs_qfileinfo; 884 ops.fsinfo_fn = cvfs_fsinfo; 885 ops.lpq_fn = cvfs_lpq; 886 ops.search_first_fn = cvfs_search_first; 887 ops.search_next_fn = cvfs_search_next; 888 ops.search_close_fn = cvfs_search_close; 889 ops.trans_fn = cvfs_trans; 890 ops.logoff_fn = cvfs_logoff; 891 ops.async_setup_fn = cvfs_async_setup; 892 ops.cancel_fn = cvfs_cancel; 893 ops.notify_fn = cvfs_notify; 868 894 869 895 /* register ourselves with the NTVFS subsystem. We register -
vendor/current/source4/ntvfs/sysdep/inotify.c
r414 r988 30 30 #include "param/param.h" 31 31 32 #if HAVE_SYS_INOTIFY_H33 32 #include <sys/inotify.h> 34 #else 35 /* for older glibc varients - we can remove this eventually */ 36 #include <linux/inotify.h> 37 #include <asm/unistd.h> 38 39 #ifndef HAVE_INOTIFY_INIT 40 /* 41 glibc doesn't define these functions yet (as of March 2006) 42 */ 43 static int inotify_init(void) 44 { 45 return syscall(__NR_inotify_init); 46 } 47 48 static int inotify_add_watch(int fd, const char *path, __u32 mask) 49 { 50 return syscall(__NR_inotify_add_watch, fd, path, mask); 51 } 52 53 static int inotify_rm_watch(int fd, int wd) 54 { 55 return syscall(__NR_inotify_rm_watch, fd, wd); 56 } 57 #endif 58 #endif 59 60 61 /* older glibc headers don't have these defines either */ 33 34 /* glibc < 2.5 headers don't have these defines */ 62 35 #ifndef IN_ONLYDIR 63 36 #define IN_ONLYDIR 0x01000000 … … 172 145 next = w->next; 173 146 if (w->wd == e->wd && filter_match(w, e)) { 147 ne.dir = w->path; 174 148 w->callback(in->ctx, w->private_data, &ne); 175 149 } … … 191 165 if (w->wd == e->wd && filter_match(w, e) && 192 166 !(w->filter & FILE_NOTIFY_CHANGE_CREATION)) { 167 ne.dir = w->path; 193 168 w->callback(in->ctx, w->private_data, &ne); 194 169 } … … 259 234 DEBUG(0,("Failed to init inotify - %s\n", strerror(errno))); 260 235 talloc_free(in); 261 return map_nt_error_from_unix (errno);236 return map_nt_error_from_unix_common(errno); 262 237 } 263 238 in->ctx = ctx; … … 275 250 DEBUG(0,("Failed to tevent_add_fd() - %s\n", strerror(errno))); 276 251 talloc_free(in); 277 return map_nt_error_from_unix (errno);252 return map_nt_error_from_unix_common(errno); 278 253 } 279 254 … … 374 349 if (wd == -1) { 375 350 e->filter = filter; 376 return map_nt_error_from_unix (errno);351 return map_nt_error_from_unix_common(errno); 377 352 } 378 353 … … 416 391 initialialise the inotify module 417 392 */ 393 NTSTATUS sys_notify_inotify_init(void); 418 394 NTSTATUS sys_notify_inotify_init(void) 419 395 { -
vendor/current/source4/ntvfs/sysdep/sys_lease.c
r740 r988 28 28 #include "../lib/util/dlinklist.h" 29 29 #include "param/param.h" 30 #include "lib/util/samba_modules.h" 30 31 31 32 /* list of registered backends */ … … 41 42 TALLOC_CTX *mem_ctx, 42 43 struct tevent_context *ev, 43 struct messaging_context *msg,44 struct imessaging_context *msg, 44 45 sys_lease_send_break_fn break_send) 45 46 { … … 48 49 int i; 49 50 NTSTATUS status; 51 TALLOC_CTX * tmp_ctx; 50 52 51 53 if (num_backends == 0) { … … 62 64 } 63 65 66 tmp_ctx = talloc_new(ctx); 67 if (tmp_ctx == NULL) { 68 return NULL; 69 } 70 64 71 ctx->event_ctx = ev; 65 72 ctx->msg_ctx = msg; 66 73 ctx->break_send = break_send; 67 74 68 bname = share_string_option( scfg, LEASE_BACKEND, NULL);75 bname = share_string_option(tmp_ctx, scfg, LEASE_BACKEND, NULL); 69 76 if (!bname) { 70 77 talloc_free(ctx); … … 90 97 } 91 98 99 TALLOC_FREE(tmp_ctx); 92 100 return ctx; 93 101 } -
vendor/current/source4/ntvfs/sysdep/sys_lease.h
r414 r988 22 22 struct sys_lease_context; 23 23 struct opendb_entry; 24 struct messaging_context;24 struct imessaging_context; 25 25 struct tevent_context; 26 26 27 typedef NTSTATUS (*sys_lease_send_break_fn)(struct messaging_context *,27 typedef NTSTATUS (*sys_lease_send_break_fn)(struct imessaging_context *, 28 28 struct opendb_entry *, 29 29 uint8_t level); … … 42 42 struct sys_lease_context { 43 43 struct tevent_context *event_ctx; 44 struct messaging_context *msg_ctx;44 struct imessaging_context *msg_ctx; 45 45 sys_lease_send_break_fn break_send; 46 46 void *private_data; /* for use of backend */ … … 54 54 TALLOC_CTX *mem_ctx, 55 55 struct tevent_context *ev, 56 struct messaging_context *msg_ctx,56 struct imessaging_context *msg_ctx, 57 57 sys_lease_send_break_fn break_send); 58 58 -
vendor/current/source4/ntvfs/sysdep/sys_lease_linux.c
r414 r988 30 30 #include "../lib/util/dlinklist.h" 31 31 #include "cluster/cluster.h" 32 33 NTSTATUS sys_lease_linux_init(void); 32 34 33 35 #define LINUX_LEASE_RT_SIGNAL (SIGRTMIN+1) … … 130 132 if (ret == -1) { 131 133 talloc_free(p); 132 return map_nt_error_from_unix (errno);134 return map_nt_error_from_unix_common(errno); 133 135 } 134 136 … … 136 138 if (ret == -1) { 137 139 talloc_free(p); 138 return map_nt_error_from_unix (errno);140 return map_nt_error_from_unix_common(errno); 139 141 } 140 142 -
vendor/current/source4/ntvfs/sysdep/sys_notify.c
r740 r988 29 29 #include "../lib/util/dlinklist.h" 30 30 #include "param/param.h" 31 #include "lib/util/samba_modules.h" 31 32 32 33 /* list of registered backends */ … … 62 63 ctx->ev = ev; 63 64 64 bname = share_string_option( scfg, NOTIFY_BACKEND, NULL);65 bname = share_string_option(ctx, scfg, NOTIFY_BACKEND, NULL); 65 66 if (!bname) { 66 67 if (num_backends) { -
vendor/current/source4/ntvfs/sysdep/sys_notify.h
r740 r988 18 18 */ 19 19 20 #include "librpc/gen_ndr/ s4_notify.h"20 #include "librpc/gen_ndr/notify.h" 21 21 #include "param/share.h" 22 22 -
vendor/current/source4/ntvfs/sysdep/wscript_build
r740 r988 5 5 subsystem='sys_notify', 6 6 init_function='sys_notify_inotify_init', 7 deps='events ',7 deps='events inotify', 8 8 enabled = bld.CONFIG_SET('HAVE_LINUX_INOTIFY') 9 9 ) -
vendor/current/source4/ntvfs/sysdep/wscript_configure
r740 r988 1 1 #!/usr/bin/env python 2 2 3 conf.CHECK_HEADERS('linux/inotify.h asm/unistd.h sys/inotify.h', add_headers=False) 3 import sys 4 4 5 conf.CHECK_FUNCS('inotify_init') 5 # Check for inotify support (Skip if we are SunOS) 6 #NOTE: illumos provides sys/inotify.h but is not an exact match for linux 7 host_os = sys.platform 8 if host_os.rfind('sunos') == -1: 9 conf.CHECK_HEADERS('sys/inotify.h', add_headers=False) 10 if (conf.CONFIG_SET('HAVE_SYS_INOTIFY_H')): 11 conf.DEFINE('HAVE_LINUX_INOTIFY', 1) 6 12 7 conf.CHECK_VARIABLE('__NR_inotify_init')8 13 conf.CHECK_DECLS('F_SETLEASE', headers='linux/fcntl.h', reverse=True) 9 14 conf.CHECK_DECLS('SA_SIGINFO', headers='signal.h', reverse=True) 10 11 conf.CHECK_DECLS('__NR_inotify_init', reverse=True, headers='asm/unistd.h')12 13 if (conf.CONFIG_SET('HAVE___NR_INOTIFY_INIT') and14 (conf.CONFIG_SET('HAVE_LINUX_INOTIFY_H') or15 conf.CONFIG_SET('HAVE_SYS_INOTIFY_H'))):16 conf.DEFINE('HAVE_LINUX_INOTIFY', 1) -
vendor/current/source4/ntvfs/unixuid/vfs_unixuid.c
r740 r988 29 29 #define TEVENT_DEPRECATED 30 30 #include <tevent.h> 31 32 #if defined(UID_WRAPPER) 33 #if !defined(UID_WRAPPER_REPLACE) && !defined(UID_WRAPPER_NOT_REPLACE) 34 #define UID_WRAPPER_REPLACE 35 #include "../uid_wrapper/uid_wrapper.h" 36 #endif 37 #else 38 #define uwrap_enabled() 0 39 #endif 40 31 #include "../lib/util/setid.h" 32 33 NTSTATUS ntvfs_unixuid_init(void); 41 34 42 35 struct unixuid_private { 43 struct wbc_context *wbc_ctx; 44 struct unix_sec_ctx *last_sec_ctx; 36 struct security_unix_token *last_sec_ctx; 45 37 struct security_token *last_token; 46 38 }; 47 39 48 40 49 50 struct unix_sec_ctx { 51 uid_t uid; 52 gid_t gid; 53 unsigned int ngroups; 54 gid_t *groups; 55 }; 56 57 /* 58 pull the current security context into a unix_sec_ctx 59 */ 60 static struct unix_sec_ctx *save_unix_security(TALLOC_CTX *mem_ctx) 61 { 62 struct unix_sec_ctx *sec = talloc(mem_ctx, struct unix_sec_ctx); 41 /* 42 pull the current security context into a security_unix_token 43 */ 44 static struct security_unix_token *save_unix_security(TALLOC_CTX *mem_ctx) 45 { 46 struct security_unix_token *sec = talloc(mem_ctx, struct security_unix_token); 63 47 if (sec == NULL) { 64 48 return NULL; … … 86 70 87 71 /* 88 set the current security context from a unix_sec_ctx 89 */ 90 static NTSTATUS set_unix_security(struct unix_sec_ctx *sec) 91 { 92 seteuid(0); 93 94 if (setgroups(sec->ngroups, sec->groups) != 0) { 72 set the current security context from a security_unix_token 73 */ 74 static NTSTATUS set_unix_security(struct security_unix_token *sec) 75 { 76 samba_seteuid(0); 77 78 if (samba_setgroups(sec->ngroups, sec->groups) != 0) { 79 DBG_ERR("*** samba_setgroups failed\n"); 95 80 return NT_STATUS_ACCESS_DENIED; 96 81 } 97 if (setegid(sec->gid) != 0) { 82 if (samba_setegid(sec->gid) != 0) { 83 DBG_ERR("*** samba_setegid(%u) failed\n", sec->gid); 98 84 return NT_STATUS_ACCESS_DENIED; 99 85 } 100 if (seteuid(sec->uid) != 0) { 86 if (samba_seteuid(sec->uid) != 0) { 87 DBG_ERR("*** samba_seteuid(%u) failed\n", sec->uid); 101 88 return NT_STATUS_ACCESS_DENIED; 102 89 } … … 117 104 const char *location) 118 105 { 119 struct unix_sec_ctx*sec_ctx;106 struct security_unix_token *sec_ctx; 120 107 121 108 if (unixuid_nesting_level == 0) { … … 131 118 return -1; 132 119 } 133 *(struct unix_sec_ctx**)stack_ptr = sec_ctx;134 if (s eteuid(0) != 0 ||setegid(0) != 0) {120 *(struct security_unix_token **)stack_ptr = sec_ctx; 121 if (samba_seteuid(0) != 0 || samba_setegid(0) != 0) { 135 122 DEBUG(0,("%s: Failed to change to root\n", location)); 136 123 return -1; … … 140 127 NTSTATUS status; 141 128 142 sec_ctx = *(struct unix_sec_ctx**)stack_ptr;129 sec_ctx = *(struct security_unix_token **)stack_ptr; 143 130 if (sec_ctx == NULL) { 144 131 /* this happens the first time this function … … 148 135 } 149 136 150 sec_ctx = talloc_get_type_abort(sec_ctx, struct unix_sec_ctx);137 sec_ctx = talloc_get_type_abort(sec_ctx, struct security_unix_token); 151 138 status = set_unix_security(sec_ctx); 152 139 talloc_free(sec_ctx); … … 163 150 164 151 /* 165 form a unix_sec_ctxfrom the current security_token152 form a security_unix_token from the current security_token 166 153 */ 167 154 static NTSTATUS nt_token_to_unix_security(struct ntvfs_module_context *ntvfs, 168 155 struct ntvfs_request *req, 169 156 struct security_token *token, 170 struct unix_sec_ctx **sec) 171 { 172 struct unixuid_private *priv = ntvfs->private_data; 173 int i; 174 NTSTATUS status; 175 struct id_map *ids; 176 struct composite_context *ctx; 177 *sec = talloc(req, struct unix_sec_ctx); 178 179 /* we can't do unix security without a user and group */ 180 if (token->num_sids < 2) { 181 return NT_STATUS_ACCESS_DENIED; 182 } 183 184 ids = talloc_array(req, struct id_map, token->num_sids); 185 NT_STATUS_HAVE_NO_MEMORY(ids); 186 187 (*sec)->ngroups = token->num_sids - 2; 188 (*sec)->groups = talloc_array(*sec, gid_t, (*sec)->ngroups); 189 NT_STATUS_HAVE_NO_MEMORY((*sec)->groups); 190 191 for (i=0;i<token->num_sids;i++) { 192 ZERO_STRUCT(ids[i].xid); 193 ids[i].sid = &token->sids[i]; 194 ids[i].status = ID_UNKNOWN; 195 } 196 197 ctx = wbc_sids_to_xids_send(priv->wbc_ctx, ids, token->num_sids, ids); 198 NT_STATUS_HAVE_NO_MEMORY(ctx); 199 200 status = wbc_sids_to_xids_recv(ctx, &ids); 201 NT_STATUS_NOT_OK_RETURN(status); 202 203 if (ids[0].xid.type == ID_TYPE_BOTH || 204 ids[0].xid.type == ID_TYPE_UID) { 205 (*sec)->uid = ids[0].xid.id; 206 } else { 207 return NT_STATUS_INVALID_SID; 208 } 209 210 if (ids[1].xid.type == ID_TYPE_BOTH || 211 ids[1].xid.type == ID_TYPE_GID) { 212 (*sec)->gid = ids[1].xid.id; 213 } else { 214 return NT_STATUS_INVALID_SID; 215 } 216 217 for (i=0;i<(*sec)->ngroups;i++) { 218 if (ids[i+2].xid.type == ID_TYPE_BOTH || 219 ids[i+2].xid.type == ID_TYPE_GID) { 220 (*sec)->groups[i] = ids[i+2].xid.id; 221 } else { 222 return NT_STATUS_INVALID_SID; 223 } 224 } 225 226 return NT_STATUS_OK; 157 struct security_unix_token **sec) 158 { 159 return security_token_to_unix_token(req, 160 ntvfs->ctx->event_ctx, 161 token, sec); 227 162 } 228 163 … … 231 166 */ 232 167 static NTSTATUS unixuid_setup_security(struct ntvfs_module_context *ntvfs, 233 struct ntvfs_request *req, struct unix_sec_ctx**sec)168 struct ntvfs_request *req, struct security_unix_token **sec) 234 169 { 235 170 struct unixuid_private *priv = ntvfs->private_data; 236 171 struct security_token *token; 237 struct unix_sec_ctx*newsec;172 struct security_unix_token *newsec; 238 173 NTSTATUS status; 239 174 … … 282 217 #define PASS_THRU_REQ(ntvfs, req, op, args) do { \ 283 218 NTSTATUS status2; \ 284 struct unix_sec_ctx*sec; \219 struct security_unix_token *sec; \ 285 220 status = unixuid_setup_security(ntvfs, req, &sec); \ 286 221 NT_STATUS_NOT_OK_RETURN(status); \ … … 309 244 } 310 245 311 priv->wbc_ctx = wbc_init(priv, ntvfs->ctx->msg_ctx,312 ntvfs->ctx->event_ctx);313 if (priv->wbc_ctx == NULL) {314 talloc_free(priv);315 return NT_STATUS_INTERNAL_ERROR;316 }317 318 246 priv->last_sec_ctx = NULL; 319 247 priv->last_token = NULL; … … 747 675 748 676 /* fill in all the operations */ 749 ops.connect = unixuid_connect;750 ops.disconnect = unixuid_disconnect;751 ops.unlink = unixuid_unlink;752 ops.chkpath = unixuid_chkpath;753 ops.qpathinfo = unixuid_qpathinfo;754 ops.setpathinfo = unixuid_setpathinfo;755 ops.open = unixuid_open;756 ops.mkdir = unixuid_mkdir;757 ops.rmdir = unixuid_rmdir;758 ops.rename = unixuid_rename;759 ops.copy = unixuid_copy;760 ops.ioctl = unixuid_ioctl;761 ops.read = unixuid_read;762 ops.write = unixuid_write;763 ops.seek = unixuid_seek;764 ops.flush = unixuid_flush;765 ops.close = unixuid_close;766 ops.exit = unixuid_exit;767 ops.lock = unixuid_lock;768 ops.setfileinfo = unixuid_setfileinfo;769 ops.qfileinfo = unixuid_qfileinfo;770 ops.fsinfo = unixuid_fsinfo;771 ops.lpq = unixuid_lpq;772 ops.search_first = unixuid_search_first;773 ops.search_next = unixuid_search_next;774 ops.search_close = unixuid_search_close;775 ops.trans = unixuid_trans;776 ops.logoff = unixuid_logoff;777 ops.async_setup = unixuid_async_setup;778 ops.cancel = unixuid_cancel;779 ops.notify = unixuid_notify;677 ops.connect_fn = unixuid_connect; 678 ops.disconnect_fn = unixuid_disconnect; 679 ops.unlink_fn = unixuid_unlink; 680 ops.chkpath_fn = unixuid_chkpath; 681 ops.qpathinfo_fn = unixuid_qpathinfo; 682 ops.setpathinfo_fn = unixuid_setpathinfo; 683 ops.open_fn = unixuid_open; 684 ops.mkdir_fn = unixuid_mkdir; 685 ops.rmdir_fn = unixuid_rmdir; 686 ops.rename_fn = unixuid_rename; 687 ops.copy_fn = unixuid_copy; 688 ops.ioctl_fn = unixuid_ioctl; 689 ops.read_fn = unixuid_read; 690 ops.write_fn = unixuid_write; 691 ops.seek_fn = unixuid_seek; 692 ops.flush_fn = unixuid_flush; 693 ops.close_fn = unixuid_close; 694 ops.exit_fn = unixuid_exit; 695 ops.lock_fn = unixuid_lock; 696 ops.setfileinfo_fn = unixuid_setfileinfo; 697 ops.qfileinfo_fn = unixuid_qfileinfo; 698 ops.fsinfo_fn = unixuid_fsinfo; 699 ops.lpq_fn = unixuid_lpq; 700 ops.search_first_fn = unixuid_search_first; 701 ops.search_next_fn = unixuid_search_next; 702 ops.search_close_fn = unixuid_search_close; 703 ops.trans_fn = unixuid_trans; 704 ops.logoff_fn = unixuid_logoff; 705 ops.async_setup_fn = unixuid_async_setup; 706 ops.cancel_fn = unixuid_cancel; 707 ops.notify_fn = unixuid_notify; 780 708 781 709 ops.name = "unixuid"; -
vendor/current/source4/ntvfs/unixuid/wscript_build
r740 r988 5 5 subsystem='ntvfs', 6 6 init_function='ntvfs_unixuid_init', 7 deps=' samdb'7 deps='auth_unix_token talloc' 8 8 ) 9 9 -
vendor/current/source4/ntvfs/wscript_build
r740 r988 1 1 #!/usr/bin/env python 2 2 3 bld.RECURSE('posix') 4 bld.RECURSE('common') 5 bld.RECURSE('unixuid') 6 bld.RECURSE('sysdep') 3 bld.SAMBA_LIBRARY('ntvfs', 4 source='ntvfs_base.c ntvfs_generic.c ntvfs_interface.c ntvfs_util.c', 5 autoproto='ntvfs_proto.h', 6 deps='tevent samba-modules', 7 private_library=True, 8 enabled=bld.AD_DC_BUILD_IS_ENABLED() 9 ) 10 11 if bld.AD_DC_BUILD_IS_ENABLED(): 12 bld.RECURSE('posix') 13 bld.RECURSE('common') 14 bld.RECURSE('unixuid') 15 bld.RECURSE('sysdep') 7 16 8 17 bld.SAMBA_MODULE('ntvfs_cifs', … … 10 19 subsystem='ntvfs', 11 20 init_function='ntvfs_cifs_init', 12 deps='LIBCLI_SMB LIBCLI_RAW'21 deps='LIBCLI_SMB smbclient-raw param_options' 13 22 ) 14 23 … … 18 27 subsystem='ntvfs', 19 28 init_function='ntvfs_smb2_init', 20 deps='LIBCLI_SMB LIBCLI_RAW'29 deps='LIBCLI_SMB smbclient-raw param_options' 21 30 ) 22 31 … … 53 62 subsystem='ntvfs', 54 63 init_function='ntvfs_ipc_init', 55 deps='NDR_NAMED_PIPE_AUTH NAMED_PIPE_AUTH_TSTREAM gssapicredentials DCERPC_SHARE'64 deps='NDR_NAMED_PIPE_AUTH npa_tstream gssapi samba-credentials DCERPC_SHARE' 56 65 ) 57 66 … … 65 74 66 75 67 bld.SAMBA_LIBRARY('ntvfs',68 source='ntvfs_base.c ntvfs_generic.c ntvfs_interface.c ntvfs_util.c',69 autoproto='ntvfs_proto.h',70 deps='tevent',71 private_library=True72 )73
Note:
See TracChangeset
for help on using the changeset viewer.