[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2043-g53f0071
The branch, master has been updated via 53f007193fab325c2b27567db01679f87baf4f9a (commit) via c8d63d47cd3837e603540580ec4ab6f4d5d3bb0e (commit) from fcc7372975757d19e9e4366a26396bf210bdf86a (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 53f007193fab325c2b27567db01679f87baf4f9a Author: Volker Lendecke Date: Fri Jun 5 10:11:35 2009 +0200 Fix a couple of warnings in log2pcaphex.c commit c8d63d47cd3837e603540580ec4ab6f4d5d3bb0e Author: Volker Lendecke Date: Fri Jun 5 10:07:17 2009 +0200 Fix bug 6392: Exit log2pcaphex if a requested output file can't be opened Thanks to Slava Semushin for reporting! --- Summary of changes: source3/utils/log2pcaphex.c | 21 + 1 files changed, 13 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/utils/log2pcaphex.c b/source3/utils/log2pcaphex.c index b1a8a27..5b94691 100644 --- a/source3/utils/log2pcaphex.c +++ b/source3/utils/log2pcaphex.c @@ -118,7 +118,7 @@ typedef struct { static hdr_tcp_t HDR_TCP = {139, 139, 0, 0, 0x50, 0, 0, 0, 0}; -void print_pcap_header(FILE *out) +static void print_pcap_header(FILE *out) { struct tcpdump_file_header h; h.magic = TCPDUMP_MAGIC; @@ -131,7 +131,8 @@ void print_pcap_header(FILE *out) fwrite(&h, sizeof(struct tcpdump_file_header), 1, out); } -void print_pcap_packet(FILE *out, unsigned char *data, long length, long caplen) +static void print_pcap_packet(FILE *out, unsigned char *data, long length, + long caplen) { static int i = 0; struct tcpdump_packet p; @@ -144,7 +145,7 @@ void print_pcap_packet(FILE *out, unsigned char *data, long length, long caplen) fwrite(data, sizeof(unsigned char), caplen, out); } -void print_hex_packet(FILE *out, unsigned char *data, long length) +static void print_hex_packet(FILE *out, unsigned char *data, long length) { long i,cur = 0; while(cur < length) { @@ -158,13 +159,14 @@ void print_hex_packet(FILE *out, unsigned char *data, long length) } } -void print_netbios_packet(FILE *out, unsigned char *data, long length, long actual_length) +static void print_netbios_packet(FILE *out, unsigned char *data, long length, +long actual_length) { unsigned char *newdata; long offset = 0; long newlen; newlen = length+sizeof(HDR_IP)+sizeof(HDR_TCP); - newdata = malloc(newlen); + newdata = (unsigned char *)malloc(newlen); HDR_IP.packet_length = htons(newlen); HDR_TCP.window = htons(0x2000); @@ -206,12 +208,14 @@ long line_num = 0; * smb_vwv[ 2]=1 (0x1) * smb_bcc=87 */ -void read_log_msg(FILE *in, unsigned char **_buffer, unsigned short *buffersize, long *data_offset, long *data_length) +static void read_log_msg(FILE *in, unsigned char **_buffer, +unsigned short *buffersize, long *data_offset, +long *data_length) { unsigned char *buffer; int tmp; long i; assert(fscanf(in, " size=%hu\n", buffersize)); line_num++; - buffer = malloc(*buffersize+4); /* +4 for NBSS Header */ + buffer = (unsigned char *)malloc(*buffersize+4); /* +4 for NBSS Header */ memset(buffer, 0, *buffersize+4); /* NetBIOS Session Service */ buffer[0] = 0x00; @@ -256,7 +260,7 @@ void read_log_msg(FILE *in, unsigned char **_buffer, unsigned short *buffersize, * [040] 00 34 00 2E 00 30 00 00 00 49 00 53 00 49 00 4C .4...0.. .I.S.I.L * [050] 00 4F 00 4E 00 00 00 .O.N... */ -long read_log_data(FILE *in, unsigned char *buffer, long data_length) +static long read_log_data(FILE *in, unsigned char *buffer, long data_length) { long i, addr; char real[2][16]; int ret; unsigned int tmp; @@ -337,6 +341,7 @@ int main (int argc, char **argv) if(!out) { perror("fopen"); fprintf(stderr, "Can't find %s, using stdout...\n", outfile); + return 1; } } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2044-gecd1fe2
The branch, master has been updated via ecd1fe2456acb1c700d7bf91eb0ec76103e7db93 (commit) from 53f007193fab325c2b27567db01679f87baf4f9a (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit ecd1fe2456acb1c700d7bf91eb0ec76103e7db93 Author: Slava Semushin Date: Mon May 25 23:59:05 2009 +0700 source3/torture/vfstest.c(process_file): fixed file descriptor leak. Found by cppcheck: [./source3/torture/vfstest.c:400]: (error) Resource leak: file --- Summary of changes: source3/torture/vfstest.c |4 1 files changed, 4 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c index de68a0b..2a191c2 100644 --- a/source3/torture/vfstest.c +++ b/source3/torture/vfstest.c @@ -397,6 +397,10 @@ static void process_file(struct vfs_state *pvfs, char *filename) { while (fgets(command, 3 * PATH_MAX, file) != NULL) { process_cmd(pvfs, command); } + + if (file != stdin) { + fclose(file); + } } void exit_server(const char *reason) -- Samba Shared Repository
[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-5281-gf9ea09b
The branch, v3-3-test has been updated via f9ea09b61a46136fc55314e2e1cd2e9cfb362802 (commit) via f586b209b0216150f07bcc998c0d57e0d179b8ee (commit) from de156e6ee292ad7fc683d681d7c4b44edba67626 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test - Log - commit f9ea09b61a46136fc55314e2e1cd2e9cfb362802 Author: Jeremy Allison Date: Sat May 30 11:30:16 2009 +0200 Simplify the dropbox patch commit f586b209b0216150f07bcc998c0d57e0d179b8ee Author: Volker Lendecke Date: Wed May 13 15:46:35 2009 +0200 Re-Add the "dropbox" functionality with -wx rights on a directory --- Summary of changes: source/smbd/filename.c | 13 + 1 files changed, 9 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/source/smbd/filename.c b/source/smbd/filename.c index d404b90..5ea5cb2 100644 --- a/source/smbd/filename.c +++ b/source/smbd/filename.c @@ -497,8 +497,14 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx, goto fail; } - /* ENOENT is the only valid error here. */ - if ((errno != 0) && (errno != ENOENT)) { + /* +* ENOENT/EACCESS are the only valid errors +* here. EACCESS needs handling here for +* "dropboxes", i.e. directories where users +* can only put stuff with permission -wx. +*/ + if ((errno != 0) && (errno != ENOENT) + && (errno != EACCES)) { /* * ENOTDIR and ELOOP both map to * NT_STATUS_OBJECT_PATH_NOT_FOUND @@ -508,8 +514,7 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx, errno == ELOOP) { result = NT_STATUS_OBJECT_PATH_NOT_FOUND; - } - else { + } else { result = map_nt_error_from_unix(errno); } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2045-g96de876
The branch, master has been updated via 96de8766fc80881c4398ea11ce65cccbb9b7c83b (commit) from ecd1fe2456acb1c700d7bf91eb0ec76103e7db93 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 96de8766fc80881c4398ea11ce65cccbb9b7c83b Author: Stefan Metzmacher Date: Tue Jun 2 16:07:53 2009 +0200 s3:smbd: add support for printers to SMB2 Create This is not tested, but the code looks like the for SMB1, so it's likely to work:-) metze --- Summary of changes: source3/smbd/smb2_create.c | 79 +++- 1 files changed, 41 insertions(+), 38 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 0f955a4..8979073 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -213,47 +213,50 @@ static NTSTATUS smbd_smb2_create(struct smbd_smb2_request *req, return NT_STATUS_NO_MEMORY; } - /* If it's an IPC, pass off the pipe handler. */ - if (IS_IPC(req->tcon->compat_conn)) { + if (IS_IPC(smbreq->conn)) { return NT_STATUS_NOT_IMPLEMENTED; - } - - if (CAN_PRINT(req->tcon->compat_conn)) { - return NT_STATUS_NOT_IMPLEMENTED; - } + } else if (CAN_PRINT(smbreq->conn)) { + status = file_new(smbreq, smbreq->conn, &result); + if(!NT_STATUS_IS_OK(status)) { + return status; + } - switch (in_oplock_level) { - case SMB2_OPLOCK_LEVEL_BATCH: - break; - case SMB2_OPLOCK_LEVEL_EXCLUSIVE: - break; - default: - break; - } - - /* these are ignored for SMB2 */ - in_create_options &= ~(0x10);/* NTCREATEX_OPTIONS_SYNC_ALERT */ - in_create_options &= ~(0x20);/* NTCREATEX_OPTIONS_ASYNC_ALERT */ + status = print_fsp_open(smbreq, + smbreq->conn, + in_name, + smbreq->vuid, + result, + &sbuf); + if (!NT_STATUS_IS_OK(status)) { + file_free(smbreq, result); + return status; + } + info = FILE_WAS_CREATED; + } else { + /* these are ignored for SMB2 */ + in_create_options &= ~(0x10);/* NTCREATEX_OPTIONS_SYNC_ALERT */ + in_create_options &= ~(0x20);/* NTCREATEX_OPTIONS_ASYNC_ALERT */ - status = SMB_VFS_CREATE_FILE(req->tcon->compat_conn, -smbreq, -0, /* root_dir_fid */ -in_name, -CFF_DOS_PATH, /* create_file_flags */ -in_desired_access, -in_share_access, -in_create_disposition, -in_create_options, -in_file_attributes, -0, /* oplock_request */ -0, /* allocation_size */ -NULL, /* security_descriptor */ -NULL, /* ea_list */ -&result, -&info, -&sbuf); - if (!NT_STATUS_IS_OK(status)) { - return status; + status = SMB_VFS_CREATE_FILE(req->tcon->compat_conn, +smbreq, +0, /* root_dir_fid */ +in_name, +CFF_DOS_PATH, /* create_file_flags */ +in_desired_access, +in_share_access, +in_create_disposition, +in_create_options, +in_file_attributes, +0, /* oplock_request */ +0, /* allocation_size */ +NULL, /* security_descriptor */ +NULL, /* ea_list */ +&result, +&info, +&sbuf); + if (!NT_STATUS_IS_OK(status)) { + return status; +
[SCM] Samba Shared Repository - branch v3-4-test updated - release-4-0-0alpha7-1115-g50f362e
The branch, v3-4-test has been updated via 50f362e294d5a507d03fd54d1d976f40a935288f (commit) via 2e14ccc5c6be9dd7e7b98dc60c89d54ba3772344 (commit) from 747068ff4688000287ace009f3dc58e12eefa615 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test - Log - commit 50f362e294d5a507d03fd54d1d976f40a935288f Author: Björn Jacke Date: Wed Jun 3 17:39:50 2009 +0200 s3:torture: fix password timestamp checks on NetBSD The Open Group says: "The useconds argument [of usleep] must be less than 1,000,000." NetBSD takes this seriously. usleep of more than 99 are effectless. (cherry picked from commit b3491df2f9db2c550845243975ddbf0a2f9658e6) commit 2e14ccc5c6be9dd7e7b98dc60c89d54ba3772344 Author: Björn Jacke Date: Wed Jun 3 18:03:36 2009 +0200 s3: correct check for usleep value boundaries (cherry picked from commit 7cdad30b9640cc876e8ca59cd67455039107a5df) --- Summary of changes: source3/lib/system.c |2 +- source4/torture/rpc/samr.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/lib/system.c b/source3/lib/system.c index 10b55f6..e815766 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -94,7 +94,7 @@ int sys_usleep(long usecs) * is not SPEC1170 complient... grumble... JRA. */ - if(usecs < 0 || usecs > 100) { + if(usecs < 0 || usecs > 99) { errno = EINVAL; return -1; } diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index c8177d7..d7d6773 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -2910,7 +2910,7 @@ static bool test_SetPassword_pwdlastset(struct dcerpc_pipe *p, struct dcerpc_pipe *np = NULL; if (torture_setting_bool(tctx, "samba3", false)) { - delay = 100; + delay = 99; printf("Samba3 has second granularity, setting delay to: %d\n", delay); } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2047-g1b806d8
The branch, master has been updated via 1b806d83b723216e3e16778ce33ae710fab2c011 (commit) via 160ead46dc13e908903e70e372bdafc2ba8f4615 (commit) from 96de8766fc80881c4398ea11ce65cccbb9b7c83b (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 1b806d83b723216e3e16778ce33ae710fab2c011 Author: Stefan Metzmacher Date: Tue Jun 2 16:07:08 2009 +0200 s3:smbd: make smbd_server_connection_terminate() a macro metze commit 160ead46dc13e908903e70e372bdafc2ba8f4615 Author: Stefan Metzmacher Date: Fri Jun 5 11:05:03 2009 +0200 s3:smbd: implement smbd_smb2_request_error/done() as macros on top of the _ex() function metze --- Summary of changes: source3/include/smb_macros.h |3 --- source3/smbd/globals.h| 22 -- source3/smbd/smb2_server.c| 39 --- source3/smbd/smb2_sesssetup.c |3 ++- 4 files changed, 34 insertions(+), 33 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 6dd9cab..7528883 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -339,7 +339,4 @@ extern const char toupper_ascii_fast_table[]; #define toupper_ascii_fast(c) toupper_ascii_fast_table[(unsigned int)(c)]; #endif -#define smbd_smb2_request_error(req, status) \ - smbd_smb2_request_error_((req), (status), __location__) - #endif /* _SMB_MACROS_H */ diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 4c90e8f..26e63f1 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -170,20 +170,30 @@ NTSTATUS smb2_signing_check_pdu(DATA_BLOB session_key, const struct iovec *vector, int count); +void smbd_server_connection_terminate_ex(struct smbd_server_connection *sconn, +const char *reason, +const char *location); +#define smbd_server_connection_terminate(sconn, reason) \ + smbd_server_connection_terminate_ex(sconn, reason, __location__) + bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size); void reply_smb2002(struct smb_request *req, uint16_t choice); void smbd_smb2_first_negprot(struct smbd_server_connection *conn, const uint8_t *inbuf, size_t size); -NTSTATUS smbd_smb2_request_error_(struct smbd_smb2_request *req, -NTSTATUS status, -const char *wherestr); +NTSTATUS smbd_smb2_request_error_ex(struct smbd_smb2_request *req, + NTSTATUS status, + DATA_BLOB *info, + const char *location); +#define smbd_smb2_request_error(req, status) \ + smbd_smb2_request_error_ex(req, status, NULL, __location__) NTSTATUS smbd_smb2_request_done_ex(struct smbd_smb2_request *req, NTSTATUS status, - DATA_BLOB body, DATA_BLOB *dyn); -NTSTATUS smbd_smb2_request_done(struct smbd_smb2_request *req, - DATA_BLOB body, DATA_BLOB *dyn); + DATA_BLOB body, DATA_BLOB *dyn, + const char *location); +#define smbd_smb2_request_done(req, body, dyn) \ + smbd_smb2_request_done_ex(req, NT_STATUS_OK, body, dyn, __location__) NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req); NTSTATUS smbd_smb2_request_check_tcon(struct smbd_smb2_request *req); diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 5c4bdca..e797bdd 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -277,10 +277,12 @@ static NTSTATUS smbd_smb2_request_setup_out(struct smbd_smb2_request *req) return NT_STATUS_OK; } -static void smbd_server_connection_terminate(struct smbd_server_connection *conn, -const char *reason) +void smbd_server_connection_terminate_ex(struct smbd_server_connection *sconn, +const char *reason, +const char *location) { - DEBUG(10,("smbd_server_connection_terminate: reason[%s]\n", reason)); + DEBUG(10,("smbd_server_connection_terminate_ex: reason[%s] at %s\n", + reason, location)); exit_server_cleanly(reason); } @@ -583,17 +585,18 @@ static void smbd_smb2_request_writev_done(struct tevent_req *subreq) talloc_free(mem_pool); } -static NTSTATUS smbd_smb2_request_error_ex(struct smbd_smb2_request *req, +NTSTATUS smbd_smb2_request_error_ex(struct smbd_smb2_request *req,
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2049-g360c3c4
The branch, master has been updated via 360c3c4a80e1fcf84abd4e620c95f003779b1f1f (commit) via 7a0895b8e8e78e3b0fda8eef9169405f1573030a (commit) from 1b806d83b723216e3e16778ce33ae710fab2c011 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 360c3c4a80e1fcf84abd4e620c95f003779b1f1f Author: Stefan Metzmacher Date: Tue Jun 2 17:34:46 2009 +0200 s3:smbd: split smbd_smb2_write() into tevent_req based *_send()/_recv() functions metze commit 7a0895b8e8e78e3b0fda8eef9169405f1573030a Author: Stefan Metzmacher Date: Fri Jun 5 12:26:19 2009 +0200 s3:smbd: split smbd_smb2_read() into tevent_req based *_send()/_recv() functions metze --- Summary of changes: source3/smbd/smb2_read.c | 209 - source3/smbd/smb2_write.c | 176 -- 2 files changed, 277 insertions(+), 108 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/smb2_read.c b/source3/smbd/smb2_read.c index 9db77dc..88668ab 100644 --- a/source3/smbd/smb2_read.c +++ b/source3/smbd/smb2_read.c @@ -22,24 +22,26 @@ #include "smbd/globals.h" #include "../source4/libcli/smb2/smb2_constants.h" -static NTSTATUS smbd_smb2_read(struct smbd_smb2_request *req, - uint32_t in_smbpid, - uint64_t in_file_id_volatile, - uint32_t in_length, - uint64_t in_offset, - uint32_t in_minimum, - uint32_t in_remaining, - DATA_BLOB *out_data_buffer, - uint32_t *out_remaining); - +static struct tevent_req *smbd_smb2_read_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct smbd_smb2_request *smb2req, + uint32_t in_smbpid, + uint64_t in_file_id_volatile, + uint32_t in_length, + uint64_t in_offset, + uint32_t in_minimum, + uint32_t in_remaining); +static NTSTATUS smbd_smb2_read_recv(struct tevent_req *req, + TALLOC_CTX *mem_ctx, + DATA_BLOB *out_data, + uint32_t *out_remaining); + +static void smbd_smb2_request_read_done(struct tevent_req *subreq); NTSTATUS smbd_smb2_request_process_read(struct smbd_smb2_request *req) { const uint8_t *inhdr; const uint8_t *inbody; int i = req->current_idx; - uint8_t *outhdr; - DATA_BLOB outbody; - DATA_BLOB outdyn; size_t expected_body_size = 0x31; size_t body_size; uint32_t in_smbpid; @@ -49,10 +51,7 @@ NTSTATUS smbd_smb2_request_process_read(struct smbd_smb2_request *req) uint64_t in_file_id_volatile; uint32_t in_minimum_count; uint32_t in_remaining_bytes; - uint8_t out_data_offset; - DATA_BLOB out_data_buffer; - uint32_t out_data_remaining; - NTSTATUS status; + struct tevent_req *subreq; inhdr = (const uint8_t *)req->in.vector[i+0].iov_base; if (req->in.vector[i+1].iov_len != (expected_body_size & 0xFFFE)) { @@ -86,17 +85,48 @@ NTSTATUS smbd_smb2_request_process_read(struct smbd_smb2_request *req) return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED); } - status = smbd_smb2_read(req, - in_smbpid, - in_file_id_volatile, - in_length, - in_offset, - in_minimum_count, - in_remaining_bytes, - &out_data_buffer, - &out_data_remaining); + subreq = smbd_smb2_read_send(req, +req->conn->smb2.event_ctx, +req, +in_smbpid, +in_file_id_volatile, +in_length, +in_offset, +in_minimum_count, +in_remaining_bytes); + if (subreq == NULL) { + return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); + } + tevent_req_set_callback(subreq, smbd_smb2_request_read_done, req); + return NT_STATUS_OK; +} + +static void smbd_smb2_reques
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2050-g34014f8
The branch, master has been updated via 34014f8aa6456a002e88b139774dd5a58533247b (commit) from 360c3c4a80e1fcf84abd4e620c95f003779b1f1f (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 34014f8aa6456a002e88b139774dd5a58533247b Author: Günther Deschner Date: Thu Jun 4 23:49:02 2009 +0200 nss_wrapper: add more coherency checks for user and group enumeration. Guenther --- Summary of changes: lib/nss_wrapper/testsuite.c |8 1 files changed, 8 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/nss_wrapper/testsuite.c b/lib/nss_wrapper/testsuite.c index e3ba5bf..c1b6e9e 100644 --- a/lib/nss_wrapper/testsuite.c +++ b/lib/nss_wrapper/testsuite.c @@ -235,8 +235,12 @@ static bool test_nwrap_passwd(struct torture_context *tctx) for (i=0; i < num_pwd; i++) { torture_assert(tctx, test_nwrap_getpwnam(tctx, pwd[i].pw_name, &pwd1), "failed to call getpwnam for enumerated user"); + torture_assert_passwd_equal(tctx, &pwd[i], &pwd1, + "getpwent and getpwnam gave different results"); torture_assert(tctx, test_nwrap_getpwuid(tctx, pwd[i].pw_uid, &pwd2), "failed to call getpwuid for enumerated user"); + torture_assert_passwd_equal(tctx, &pwd[i], &pwd2, + "getpwent and getpwuid gave different results"); torture_assert_passwd_equal(tctx, &pwd1, &pwd2, "getpwnam and getpwuid gave different results"); } @@ -317,8 +321,12 @@ static bool test_nwrap_group(struct torture_context *tctx) for (i=0; i < num_grp; i++) { torture_assert(tctx, test_nwrap_getgrnam(tctx, grp[i].gr_name, &grp1), "failed to call getgrnam for enumerated user"); + torture_assert_group_equal(tctx, &grp[i], &grp1, + "getgrent and getgrnam gave different results"); torture_assert(tctx, test_nwrap_getgrgid(tctx, grp[i].gr_gid, &grp2), "failed to call getgrgid for enumerated user"); + torture_assert_group_equal(tctx, &grp[i], &grp2, + "getgrent and getgruid gave different results"); torture_assert_group_equal(tctx, &grp1, &grp2, "getgrnam and getgrgid gave different results"); } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2051-g5e0f122
The branch, master has been updated via 5e0f122f7c00c7ba76a5f550c67ca31e5bea9aae (commit) from 34014f8aa6456a002e88b139774dd5a58533247b (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 5e0f122f7c00c7ba76a5f550c67ca31e5bea9aae Author: Günther Deschner Date: Fri Jun 5 12:13:25 2009 +0200 nss_wrapper: rename test_nwrap_env to test_nwrap_enumeration in testsuite. Guenther --- Summary of changes: lib/nss_wrapper/testsuite.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/nss_wrapper/testsuite.c b/lib/nss_wrapper/testsuite.c index c1b6e9e..57c61f6 100644 --- a/lib/nss_wrapper/testsuite.c +++ b/lib/nss_wrapper/testsuite.c @@ -471,7 +471,7 @@ static bool test_nwrap_membership(struct torture_context *tctx) return true; } -static bool test_nwrap_env(struct torture_context *tctx) +static bool test_nwrap_enumeration(struct torture_context *tctx) { const char *old_pwd = getenv("NSS_WRAPPER_PASSWD"); const char *old_group = getenv("NSS_WRAPPER_GROUP"); @@ -493,7 +493,7 @@ struct torture_suite *torture_local_nss_wrapper(TALLOC_CTX *mem_ctx) { struct torture_suite *suite = torture_suite_create(mem_ctx, "NSS-WRAPPER"); - torture_suite_add_simple_test(suite, "env", test_nwrap_env); + torture_suite_add_simple_test(suite, "enumeration", test_nwrap_enumeration); torture_suite_add_simple_test(suite, "membership", test_nwrap_membership); return suite; -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2053-gd960057
The branch, master has been updated via d9600573120e79c73e30d588cffb17586df312c1 (commit) via f40b9ed8e9cda6397b272b055bad1cc9d8b32fe2 (commit) from 5e0f122f7c00c7ba76a5f550c67ca31e5bea9aae (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit d9600573120e79c73e30d588cffb17586df312c1 Author: Stefan Metzmacher Date: Fri Jun 5 14:32:27 2009 +0200 s3:smbd: add missing return statements to the SMB2 write error cases metze commit f40b9ed8e9cda6397b272b055bad1cc9d8b32fe2 Author: Stefan Metzmacher Date: Fri Jun 5 14:31:41 2009 +0200 s3:smbd: add missing return statements to the SMB2 read error cases metze --- Summary of changes: source3/smbd/smb2_read.c |2 ++ source3/smbd/smb2_write.c |2 ++ 2 files changed, 4 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/smb2_read.c b/source3/smbd/smb2_read.c index 88668ab..7a51cef 100644 --- a/source3/smbd/smb2_read.c +++ b/source3/smbd/smb2_read.c @@ -127,6 +127,7 @@ static void smbd_smb2_request_read_done(struct tevent_req *subreq) nt_errstr(error)); return; } + return; } out_data_offset = SMB2_HDR_BODY + 0x10; @@ -141,6 +142,7 @@ static void smbd_smb2_request_read_done(struct tevent_req *subreq) nt_errstr(error)); return; } + return; } SSVAL(outbody.data, 0x00, 0x10 + 1);/* struct size */ diff --git a/source3/smbd/smb2_write.c b/source3/smbd/smb2_write.c index 78b63dc..1f19a66 100644 --- a/source3/smbd/smb2_write.c +++ b/source3/smbd/smb2_write.c @@ -130,6 +130,7 @@ static void smbd_smb2_request_write_done(struct tevent_req *subreq) nt_errstr(error)); return; } + return; } outhdr = (uint8_t *)req->out.vector[i].iov_base; @@ -142,6 +143,7 @@ static void smbd_smb2_request_write_done(struct tevent_req *subreq) nt_errstr(error)); return; } + return; } SSVAL(outbody.data, 0x00, 0x10 + 1);/* struct size */ -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2054-g613c8ac
The branch, master has been updated via 613c8acbdd93210b40ec6fa48cbbf297a061b3cc (commit) from d9600573120e79c73e30d588cffb17586df312c1 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 613c8acbdd93210b40ec6fa48cbbf297a061b3cc Author: Karolin Seeger Date: Fri Jun 5 15:35:05 2009 +0200 s3/docs: Fix typo. Karolin --- Summary of changes: docs-xml/smbdotconf/protocol/unixextensions.xml |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/docs-xml/smbdotconf/protocol/unixextensions.xml b/docs-xml/smbdotconf/protocol/unixextensions.xml index 5b4a36a..da9ad10 100644 --- a/docs-xml/smbdotconf/protocol/unixextensions.xml +++ b/docs-xml/smbdotconf/protocol/unixextensions.xml @@ -4,8 +4,8 @@ advanced="1" developer="1" xmlns:samba="http://www.samba.org/samba/DTD/samba-doc";> -This boolean parameter controls whether Samba -implments the CIFS UNIX extensions, as defined by HP. +This boolean parameter controls whether Samba +implements the CIFS UNIX extensions, as defined by HP. These extensions enable Samba to better serve UNIX CIFS clients by supporting features such as symbolic links, hard links, etc... These extensions require a similarly enabled client, and are of -- Samba Shared Repository
[SCM] Samba Shared Repository - branch v3-4-test updated - release-4-0-0alpha7-1116-gc84f1c7
The branch, v3-4-test has been updated via c84f1c7ac9da7e26f28cb233efe45614f0cedea3 (commit) from 50f362e294d5a507d03fd54d1d976f40a935288f (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test - Log - commit c84f1c7ac9da7e26f28cb233efe45614f0cedea3 Author: Karolin Seeger Date: Fri Jun 5 15:35:05 2009 +0200 s3/docs: Fix typo. Karolin (cherry picked from commit 613c8acbdd93210b40ec6fa48cbbf297a061b3cc) --- Summary of changes: docs-xml/smbdotconf/protocol/unixextensions.xml |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/docs-xml/smbdotconf/protocol/unixextensions.xml b/docs-xml/smbdotconf/protocol/unixextensions.xml index 5b4a36a..da9ad10 100644 --- a/docs-xml/smbdotconf/protocol/unixextensions.xml +++ b/docs-xml/smbdotconf/protocol/unixextensions.xml @@ -4,8 +4,8 @@ advanced="1" developer="1" xmlns:samba="http://www.samba.org/samba/DTD/samba-doc";> -This boolean parameter controls whether Samba -implments the CIFS UNIX extensions, as defined by HP. +This boolean parameter controls whether Samba +implements the CIFS UNIX extensions, as defined by HP. These extensions enable Samba to better serve UNIX CIFS clients by supporting features such as symbolic links, hard links, etc... These extensions require a similarly enabled client, and are of -- Samba Shared Repository
[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-5282-g8878670
The branch, v3-3-test has been updated via 8878670414bd2607ad238b4fb61a109d5f430538 (commit) from f9ea09b61a46136fc55314e2e1cd2e9cfb362802 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test - Log - commit 8878670414bd2607ad238b4fb61a109d5f430538 Author: Karolin Seeger Date: Fri Jun 5 15:35:05 2009 +0200 s3/docs: Fix typo. Karolin (cherry picked from commit 613c8acbdd93210b40ec6fa48cbbf297a061b3cc) (cherry picked from commit c84f1c7ac9da7e26f28cb233efe45614f0cedea3) --- Summary of changes: docs-xml/smbdotconf/protocol/unixextensions.xml |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/docs-xml/smbdotconf/protocol/unixextensions.xml b/docs-xml/smbdotconf/protocol/unixextensions.xml index 5b4a36a..da9ad10 100644 --- a/docs-xml/smbdotconf/protocol/unixextensions.xml +++ b/docs-xml/smbdotconf/protocol/unixextensions.xml @@ -4,8 +4,8 @@ advanced="1" developer="1" xmlns:samba="http://www.samba.org/samba/DTD/samba-doc";> -This boolean parameter controls whether Samba -implments the CIFS UNIX extensions, as defined by HP. +This boolean parameter controls whether Samba +implements the CIFS UNIX extensions, as defined by HP. These extensions enable Samba to better serve UNIX CIFS clients by supporting features such as symbolic links, hard links, etc... These extensions require a similarly enabled client, and are of -- Samba Shared Repository
[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-3598-g6da23f8
The branch, v3-2-test has been updated via 6da23f8f0d4d045095d965ff62b7892c645fa139 (commit) from 2fb6b4c592ae3e855019a604e0e7ada6ad816e00 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test - Log - commit 6da23f8f0d4d045095d965ff62b7892c645fa139 Author: Karolin Seeger Date: Fri Jun 5 15:35:05 2009 +0200 s3/docs: Fix typo. Karolin (cherry picked from commit 613c8acbdd93210b40ec6fa48cbbf297a061b3cc) (cherry picked from commit c84f1c7ac9da7e26f28cb233efe45614f0cedea3) (cherry picked from commit 8878670414bd2607ad238b4fb61a109d5f430538) --- Summary of changes: docs-xml/smbdotconf/protocol/unixextensions.xml |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/docs-xml/smbdotconf/protocol/unixextensions.xml b/docs-xml/smbdotconf/protocol/unixextensions.xml index 5b4a36a..da9ad10 100644 --- a/docs-xml/smbdotconf/protocol/unixextensions.xml +++ b/docs-xml/smbdotconf/protocol/unixextensions.xml @@ -4,8 +4,8 @@ advanced="1" developer="1" xmlns:samba="http://www.samba.org/samba/DTD/samba-doc";> -This boolean parameter controls whether Samba -implments the CIFS UNIX extensions, as defined by HP. +This boolean parameter controls whether Samba +implements the CIFS UNIX extensions, as defined by HP. These extensions enable Samba to better serve UNIX CIFS clients by supporting features such as symbolic links, hard links, etc... These extensions require a similarly enabled client, and are of -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2055-gc110e66
The branch, master has been updated via c110e664af9449e8fac24f4ed6e973d98d4fd268 (commit) from 613c8acbdd93210b40ec6fa48cbbf297a061b3cc (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit c110e664af9449e8fac24f4ed6e973d98d4fd268 Author: Stefan Metzmacher Date: Fri Jun 5 15:41:46 2009 +0200 nss_wrapper: fix segfault in nwrap_gr_copy_r() metze --- Summary of changes: lib/nss_wrapper/nss_wrapper.c | 11 --- 1 files changed, 8 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index 7b67e69..317c251 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -816,7 +816,7 @@ static int nwrap_gr_copy_r(const struct group *src, struct group *dst, { char *first; char **lastm; - char *last; + char *last = NULL; off_t ofsb; off_t ofsm; off_t ofs; @@ -825,9 +825,14 @@ static int nwrap_gr_copy_r(const struct group *src, struct group *dst, first = src->gr_name; lastm = src->gr_mem; - while (*lastm) lastm++; + while (*lastm) { + last = *lastm; + lastm++; + } - last = *lastm; + if (last == NULL) { + last = src->gr_passwd; + } while (*last) last++; ofsb = PTR_DIFF(last + 1, first); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2058-g61cf117
The branch, master has been updated via 61cf117f86f803b839539db0f806c1c413f664de (commit) via 59ee0a1e8a35c1ced97e67a2c7bf5da67a55c2a0 (commit) via af0b586c7452dd897e5d75c20ce5b929db86e34a (commit) from c110e664af9449e8fac24f4ed6e973d98d4fd268 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 61cf117f86f803b839539db0f806c1c413f664de Author: Günther Deschner Date: Fri Jun 5 00:33:14 2009 +0200 nss_wrapper: add cross checking test to testsuite. Guenther commit 59ee0a1e8a35c1ced97e67a2c7bf5da67a55c2a0 Author: Günther Deschner Date: Thu Jun 4 23:57:43 2009 +0200 nss_wrapper: add tests for getgrent_r to testsuite. Guenther commit af0b586c7452dd897e5d75c20ce5b929db86e34a Author: Günther Deschner Date: Thu Jun 4 22:52:03 2009 +0200 nss_wrapper: add tests for getpwent_r to testsuite. Guenther --- Summary of changes: lib/nss_wrapper/testsuite.c | 362 +++ 1 files changed, 362 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/nss_wrapper/testsuite.c b/lib/nss_wrapper/testsuite.c index 57c61f6..e4047cf 100644 --- a/lib/nss_wrapper/testsuite.c +++ b/lib/nss_wrapper/testsuite.c @@ -72,6 +72,33 @@ static bool test_nwrap_getpwnam(struct torture_context *tctx, return pwd ? true : false; } +static bool test_nwrap_getpwnam_r(struct torture_context *tctx, + const char *name, + struct passwd *pwd_p) +{ + struct passwd pwd, *pwdp; + char buffer[4096]; + int ret; + + torture_comment(tctx, "Testing getpwnam_r: %s\n", name); + + ret = getpwnam_r(name, &pwd, buffer, sizeof(buffer), &pwdp); + if (ret != 0) { + if (ret != ENOENT) { + torture_comment(tctx, "got %d return code\n", ret); + } + return false; + } + + print_passwd(&pwd); + + if (pwd_p) { + copy_passwd(tctx, &pwd, pwd_p); + } + + return true; +} + static bool test_nwrap_getpwuid(struct torture_context *tctx, uid_t uid, struct passwd *pwd_p) @@ -92,6 +119,34 @@ static bool test_nwrap_getpwuid(struct torture_context *tctx, return pwd ? true : false; } +static bool test_nwrap_getpwuid_r(struct torture_context *tctx, + uid_t uid, + struct passwd *pwd_p) +{ + struct passwd pwd, *pwdp; + char buffer[4096]; + int ret; + + torture_comment(tctx, "Testing getpwuid_r: %lu\n", (unsigned long)uid); + + ret = getpwuid_r(uid, &pwd, buffer, sizeof(buffer), &pwdp); + if (ret != 0) { + if (ret != ENOENT) { + torture_comment(tctx, "got %d return code\n", ret); + } + return false; + } + + print_passwd(&pwd); + + if (pwd_p) { + copy_passwd(tctx, &pwd, pwd_p); + } + + return true; +} + + static bool copy_group(struct torture_context *tctx, const struct group *grp, struct group *g) @@ -151,6 +206,34 @@ static bool test_nwrap_getgrnam(struct torture_context *tctx, return grp ? true : false; } +static bool test_nwrap_getgrnam_r(struct torture_context *tctx, + const char *name, + struct group *grp_p) +{ + struct group grp, *grpp; + char buffer[4096]; + int ret; + + torture_comment(tctx, "Testing getgrnam_r: %s\n", name); + + ret = getgrnam_r(name, &grp, buffer, sizeof(buffer), &grpp); + if (ret != 0) { + if (ret != ENOENT) { + torture_comment(tctx, "got %d return code\n", ret); + } + return false; + } + + print_group(&grp); + + if (grp_p) { + copy_group(tctx, &grp, grp_p); + } + + return true; +} + + static bool test_nwrap_getgrgid(struct torture_context *tctx, gid_t gid, struct group *grp_p) @@ -171,6 +254,33 @@ static bool test_nwrap_getgrgid(struct torture_context *tctx, return grp ? true : false; } +static bool test_nwrap_getgrgid_r(struct torture_context *tctx, + gid_t gid, + struct group *grp_p) +{ + struct group grp, *grpp; + char buffer[4096]; + int ret; + + torture_comment(tctx, "Testing getgrgid_r: %lu\n", (unsigned long)gid); + + ret = getgrgid_r(gid, &grp, buffer, sizeof(buffer), &grpp); + if (ret != 0) { + if (ret !=
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2063-ga3e3288
The branch, master has been updated via a3e328859b0004b974d38f0feae8ca6894c9b014 (commit) via 4a64df164acfbcf9aad9d7b639b1dcbd5f7fb376 (commit) via fb750d8bcba58919f82adec305d928b3dafb8b7a (commit) via f6cc5db0f201029789c0deac13d3f5e1f7c6efac (commit) via fabdebdcf4479fe85db41577c7acfa08378bd425 (commit) from 61cf117f86f803b839539db0f806c1c413f664de (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit a3e328859b0004b974d38f0feae8ca6894c9b014 Author: Stefan Metzmacher Date: Fri Jun 5 17:48:28 2009 +0200 s3:smbd: add support for SMB2 Ioctl FSCTL_PIPE_TRANSCEIVE on IPC$ metze commit 4a64df164acfbcf9aad9d7b639b1dcbd5f7fb376 Author: Stefan Metzmacher Date: Fri Jun 5 12:58:26 2009 +0200 s3:smbd: add support for SMB2 Read on IPC$ metze commit fb750d8bcba58919f82adec305d928b3dafb8b7a Author: Stefan Metzmacher Date: Fri Jun 5 12:54:22 2009 +0200 s3:smbd: add support for SMB2 Write on IPC$ metze commit f6cc5db0f201029789c0deac13d3f5e1f7c6efac Author: Stefan Metzmacher Date: Fri Jun 5 10:46:30 2009 +0200 s3:smbd: add support for SMB2 Create on IPC$ metze commit fabdebdcf4479fe85db41577c7acfa08378bd425 Author: Stefan Metzmacher Date: Fri Jun 5 17:32:58 2009 +0200 s3:smbd: add support for SMB2 Ioctl We don't implement any level yet. metze --- Summary of changes: source3/Makefile.in| 11 +- source3/smbd/globals.h |1 + source3/smbd/smb2_create.c | 18 ++- source3/smbd/smb2_ioctl.c | 363 source3/smbd/smb2_read.c | 58 +++- source3/smbd/smb2_server.c |2 +- source3/smbd/smb2_write.c | 54 ++- 7 files changed, 491 insertions(+), 16 deletions(-) create mode 100644 source3/smbd/smb2_ioctl.c Changeset truncated at 500 lines: diff --git a/source3/Makefile.in b/source3/Makefile.in index 689f715..7229cea 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -750,14 +750,19 @@ SMBD_OBJ_SRV = smbd/files.o smbd/chgpasswd.o smbd/connection.o \ smbd/dmapi.o smbd/signing.o \ smbd/file_access.o \ smbd/dnsregister.o smbd/globals.o \ - smbd/smb2_server.o smbd/smb2_negprot.o \ - smbd/smb2_sesssetup.o smbd/smb2_tcon.o smbd/smb2_glue.o \ + smbd/smb2_server.o \ + smbd/smb2_signing.o \ + smbd/smb2_glue.o \ + smbd/smb2_negprot.o \ + smbd/smb2_sesssetup.o \ + smbd/smb2_tcon.o \ smbd/smb2_create.o \ smbd/smb2_close.o \ smbd/smb2_flush.o \ smbd/smb2_read.o \ smbd/smb2_write.o \ - smbd/smb2_keepalive.o smbd/smb2_signing.o \ + smbd/smb2_ioctl.o \ + smbd/smb2_keepalive.o \ $(MANGLE_OBJ) @VFS_STATIC@ SMBD_OBJ_BASE = $(PARAM_WITHOUT_REG_OBJ) $(SMBD_OBJ_SRV) $(LIBSMB_OBJ) \ diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index 26e63f1..db19a3a 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -210,6 +210,7 @@ NTSTATUS smbd_smb2_request_process_close(struct smbd_smb2_request *req); NTSTATUS smbd_smb2_request_process_flush(struct smbd_smb2_request *req); NTSTATUS smbd_smb2_request_process_read(struct smbd_smb2_request *req); NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req); +NTSTATUS smbd_smb2_request_process_ioctl(struct smbd_smb2_request *req); NTSTATUS smbd_smb2_request_process_keepalive(struct smbd_smb2_request *req); struct smbd_smb2_request { diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 8979073..5d379ec 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -214,7 +214,23 @@ static NTSTATUS smbd_smb2_create(struct smbd_smb2_request *req, } if (IS_IPC(smbreq->conn)) { - return NT_STATUS_NOT_IMPLEMENTED; + const char *pipe_name = in_name; + + if (!lp_nt_pipe_support()) { + return NT_STATUS_ACCESS_DENIED; + } + + /* Strip \\ off the name. */ + if (pipe_name[0] == '\\') { + pipe_name++; + } + + status = open_np_file(smbreq, pipe_name, &result); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + info = 0; + ZERO_STRUCT(sbuf); } else if (CAN_PRINT(smbreq->conn)) { status = file_new(smbreq, smbreq->conn, &result); if(!NT_STATUS_IS_OK(status)) { diff --git a/source3/smbd/smb2_ioctl.c b/source3/smbd/smb2_ioctl.c new file mode 100644 index 000..e7a3d35 --- /dev/null +++ b
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2068-g140fe78
The branch, master has been updated via 140fe782a9f249f58c93e56753e6e8646783d19b (commit) via d1db140a73e6d443fb2f82ea6a02479c98e97e67 (commit) via 76acd7bfad6b1853d73d27f62396aa6ce541f269 (commit) via ee83d1aead1a166af9554709d5e1c522d9c147cb (commit) via 014ee5d0c21cd18d6c408c8e49331f0aa8611211 (commit) from a3e328859b0004b974d38f0feae8ca6894c9b014 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 140fe782a9f249f58c93e56753e6e8646783d19b Author: Stefan Metzmacher Date: Fri Jun 5 18:38:20 2009 +0200 s3:smbd: add support for SMB2 Ioctl FSCTL_DFS_GET_REFERRALS metze commit d1db140a73e6d443fb2f82ea6a02479c98e97e67 Author: Stefan Metzmacher Date: Fri Jun 5 20:14:17 2009 +0200 s3:smbd: add support for STATUS_BUFFER_OVERFLOW to SMB2 Ioctl metze commit 76acd7bfad6b1853d73d27f62396aa6ce541f269 Author: Stefan Metzmacher Date: Fri Jun 5 20:02:21 2009 +0200 s3:smbd: keep the chain_fsp for SMB2 requests metze commit ee83d1aead1a166af9554709d5e1c522d9c147cb Author: Stefan Metzmacher Date: Fri Jun 5 19:49:40 2009 +0200 s3:smbd: fix the logic for compounded requests metze commit 014ee5d0c21cd18d6c408c8e49331f0aa8611211 Author: Stefan Metzmacher Date: Fri Jun 5 19:46:27 2009 +0200 s3:smbd: only setup the dyn iovec if a a dyn blob is given Otherwise leave the default in there, which takes care of padding for compounded requests. metze --- Summary of changes: source3/smbd/globals.h |2 + source3/smbd/smb2_create.c |2 + source3/smbd/smb2_glue.c |1 + source3/smbd/smb2_ioctl.c | 89 +-- source3/smbd/smb2_server.c |5 +- 5 files changed, 91 insertions(+), 8 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index db19a3a..581e5b1 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -227,6 +227,8 @@ struct smbd_smb2_request { int current_idx; bool do_signing; + struct files_struct *compat_chain_fsp; + struct { /* the NBT header is not allocated */ uint8_t nbt_hdr[4]; diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 5d379ec..d1472d5 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -275,6 +275,8 @@ static NTSTATUS smbd_smb2_create(struct smbd_smb2_request *req, } } + req->compat_chain_fsp = smbreq->chain_fsp; + *out_oplock_level = 0; if ((in_create_disposition == FILE_SUPERSEDE) && (info == FILE_WAS_OVERWRITTEN)) { diff --git a/source3/smbd/smb2_glue.c b/source3/smbd/smb2_glue.c index c3c3854..5fa3bd2 100644 --- a/source3/smbd/smb2_glue.c +++ b/source3/smbd/smb2_glue.c @@ -46,6 +46,7 @@ struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req) if (IVAL(inhdr, SMB2_HDR_FLAGS) & SMB2_HDR_FLAG_DFS) { smbreq->flags2 |= FLAGS2_DFS_PATHNAMES; } + smbreq->chain_fsp = req->compat_chain_fsp; return smbreq; } diff --git a/source3/smbd/smb2_ioctl.c b/source3/smbd/smb2_ioctl.c index e7a3d35..4a00e9d 100644 --- a/source3/smbd/smb2_ioctl.c +++ b/source3/smbd/smb2_ioctl.c @@ -120,7 +120,9 @@ static void smbd_smb2_request_ioctl_done(struct tevent_req *subreq) status = smbd_smb2_ioctl_recv(subreq, req, &out_output_buffer); TALLOC_FREE(subreq); - if (!NT_STATUS_IS_OK(status)) { + if (NT_STATUS_EQUAL(status, STATUS_BUFFER_OVERFLOW)) { + /* also ok */ + } else if (!NT_STATUS_IS_OK(status)) { error = smbd_smb2_request_error(req, status); if (!NT_STATUS_IS_OK(error)) { smbd_server_connection_terminate(req->conn, @@ -166,7 +168,8 @@ static void smbd_smb2_request_ioctl_done(struct tevent_req *subreq) */ outdyn = out_output_buffer; - error = smbd_smb2_request_done(req, outbody, &outdyn); + error = smbd_smb2_request_done_ex(req, status, outbody, &outdyn, + __location__); if (!NT_STATUS_IS_OK(error)) { smbd_server_connection_terminate(req->conn, nt_errstr(error)); @@ -240,6 +243,80 @@ static struct tevent_req *smbd_smb2_ioctl_send(TALLOC_CTX *mem_ctx, } switch (in_ctl_code) { + case 0x00060194: /* FSCTL_DFS_GET_REFERRALS */ + { + uint16_t in_max_referral_level; + DATA_BLOB in_file_name_buffer; + char *in_file_name_string; + size_t in_file_name_string_size; + bool ok; + bool overflow = false; +
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2069-gb25227a
The branch, master has been updated via b25227a1776fa59baafdd7f71f5f93cda17409fd (commit) from 140fe782a9f249f58c93e56753e6e8646783d19b (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit b25227a1776fa59baafdd7f71f5f93cda17409fd Author: Stefan Metzmacher Date: Fri Jun 5 21:04:37 2009 +0200 s3:smbd: fix the build in smb2_ioctl.c metze --- Summary of changes: source3/smbd/smb2_ioctl.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/smb2_ioctl.c b/source3/smbd/smb2_ioctl.c index 4a00e9d..bc69ba3 100644 --- a/source3/smbd/smb2_ioctl.c +++ b/source3/smbd/smb2_ioctl.c @@ -311,7 +311,7 @@ static struct tevent_req *smbd_smb2_ioctl_send(TALLOC_CTX *mem_ctx, } if (overflow) { - tevent_req_nterror(STATUS_BUFFER_OVERFLOW); + tevent_req_nterror(req, STATUS_BUFFER_OVERFLOW); } else { tevent_req_done(req); } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2070-gd5e4463
The branch, master has been updated via d5e4463266ab30324d0b46d181f51c0d6f680b82 (commit) from b25227a1776fa59baafdd7f71f5f93cda17409fd (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit d5e4463266ab30324d0b46d181f51c0d6f680b82 Author: Stefan Metzmacher Date: Fri Jun 5 21:06:27 2009 +0200 s3:smbd: split smbd_smb2_create() into a tevent_req based _send()/_recv() pair metze --- Summary of changes: source3/smbd/smb2_create.c | 298 +--- 1 files changed, 199 insertions(+), 99 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index d1472d5..e264afa 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -22,33 +22,34 @@ #include "smbd/globals.h" #include "../source4/libcli/smb2/smb2_constants.h" -static NTSTATUS smbd_smb2_create(struct smbd_smb2_request *req, -uint8_t in_oplock_level, -uint32_t in_impersonation_level, -uint32_t in_desired_access, -uint32_t in_file_attributes, -uint32_t in_share_access, -uint32_t in_create_disposition, -uint32_t in_create_options, -const char *in_name, -uint8_t *out_oplock_level, -uint32_t *out_create_action, -NTTIME *out_creation_time, -NTTIME *out_last_access_time, -NTTIME *out_last_write_time, -NTTIME *out_change_time, -uint64_t *out_allocation_size, -uint64_t *out_end_of_file, -uint32_t *out_file_attributes, -uint64_t *out_file_id_volatile); - +static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct smbd_smb2_request *smb2req, + uint8_t in_oplock_level, + uint32_t in_impersonation_level, + uint32_t in_desired_access, + uint32_t in_file_attributes, + uint32_t in_share_access, + uint32_t in_create_disposition, + uint32_t in_create_options, + const char *in_name); +static NTSTATUS smbd_smb2_create_recv(struct tevent_req *req, + uint8_t *out_oplock_level, + uint32_t *out_create_action, + NTTIME *out_creation_time, + NTTIME *out_last_access_time, + NTTIME *out_last_write_time, + NTTIME *out_change_time, + uint64_t *out_allocation_size, + uint64_t *out_end_of_file, + uint32_t *out_file_attributes, + uint64_t *out_file_id_volatile); + +static void smbd_smb2_request_create_done(struct tevent_req *subreq); NTSTATUS smbd_smb2_request_process_create(struct smbd_smb2_request *req) { const uint8_t *inbody; int i = req->current_idx; - uint8_t *outhdr; - DATA_BLOB outbody; - DATA_BLOB outdyn; size_t expected_body_size = 0x39; size_t body_size; uint8_t in_oplock_level; @@ -63,18 +64,8 @@ NTSTATUS smbd_smb2_request_process_create(struct smbd_smb2_request *req) DATA_BLOB in_name_buffer; char *in_name_string; size_t in_name_string_size; - uint8_t out_oplock_level; - uint32_t out_create_action; - NTTIME out_creation_time; - NTTIME out_last_access_time; - NTTIME out_last_write_time; - NTTIME out_change_time; - uint64_t out_allocation_size; - uint64_t out_end_of_file; - uint32_t out_file_attributes; - uint64_t out_file_id_volatile; - NTSTATUS status; bool ok; + struct tevent_req *subreq; if (req->in.vector[i+1].iov_len != (expected_body_size & 0xFFFE)) { return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); @@ -117,34 +108,78 @@ NTSTATUS smbd_s
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2071-g4f56d87
The branch, master has been updated via 4f56d87cc8848acd856d24603901714de655b61d (commit) from d5e4463266ab30324d0b46d181f51c0d6f680b82 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 4f56d87cc8848acd856d24603901714de655b61d Author: Stefan Metzmacher Date: Fri Jun 5 21:38:10 2009 +0200 s3:smbd: split smbd_smb2_flush() into a tevent_req based _send()/_recv() pair metze --- Summary of changes: source3/smbd/smb2_flush.c | 122 +++- 1 files changed, 97 insertions(+), 25 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/smb2_flush.c b/source3/smbd/smb2_flush.c index 5164d1b..37a8309 100644 --- a/source3/smbd/smb2_flush.c +++ b/source3/smbd/smb2_flush.c @@ -22,20 +22,23 @@ #include "smbd/globals.h" #include "../source4/libcli/smb2/smb2_constants.h" -static NTSTATUS smbd_smb2_flush(struct smbd_smb2_request *req, - uint64_t in_file_id_volatile); +static struct tevent_req *smbd_smb2_flush_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct smbd_smb2_request *smb2req, + uint64_t in_file_id_volatile); +static NTSTATUS smbd_smb2_flush_recv(struct tevent_req *req); +static void smbd_smb2_request_flush_done(struct tevent_req *subreq); NTSTATUS smbd_smb2_request_process_flush(struct smbd_smb2_request *req) { const uint8_t *inhdr; const uint8_t *inbody; int i = req->current_idx; - DATA_BLOB outbody; size_t expected_body_size = 0x18; size_t body_size; uint64_t in_file_id_persistent; uint64_t in_file_id_volatile; - NTSTATUS status; + struct tevent_req *subreq; inhdr = (const uint8_t *)req->in.vector[i+0].iov_base; if (req->in.vector[i+1].iov_len != (expected_body_size & 0xFFFE)) { @@ -56,65 +59,134 @@ NTSTATUS smbd_smb2_request_process_flush(struct smbd_smb2_request *req) return smbd_smb2_request_error(req, NT_STATUS_FILE_CLOSED); } - status = smbd_smb2_flush(req, -in_file_id_volatile); + subreq = smbd_smb2_flush_send(req, + req->conn->smb2.event_ctx, + req, + in_file_id_volatile); + if (subreq == NULL) { + return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); + } + tevent_req_set_callback(subreq, smbd_smb2_request_flush_done, req); + return NT_STATUS_OK; +} + +static void smbd_smb2_request_flush_done(struct tevent_req *subreq) +{ + struct smbd_smb2_request *req = tevent_req_callback_data(subreq, + struct smbd_smb2_request); + DATA_BLOB outbody; + NTSTATUS status; + NTSTATUS error; /* transport error */ + + status = smbd_smb2_flush_recv(subreq); + TALLOC_FREE(subreq); if (!NT_STATUS_IS_OK(status)) { - return smbd_smb2_request_error(req, status); + error = smbd_smb2_request_error(req, status); + if (!NT_STATUS_IS_OK(error)) { + smbd_server_connection_terminate(req->conn, +nt_errstr(error)); + return; + } + return; } outbody = data_blob_talloc(req->out.vector, NULL, 0x10); if (outbody.data == NULL) { - return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); + error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY); + if (!NT_STATUS_IS_OK(error)) { + smbd_server_connection_terminate(req->conn, +nt_errstr(error)); + return; + } + return; } SSVAL(outbody.data, 0x00, 0x04);/* struct size */ SSVAL(outbody.data, 0x02, 0); /* reserved */ - return smbd_smb2_request_done(req, outbody, NULL); + error = smbd_smb2_request_done(req, outbody, NULL); + if (!NT_STATUS_IS_OK(error)) { + smbd_server_connection_terminate(req->conn, +nt_errstr(error)); + return; + } } -static NTSTATUS smbd_smb2_flush(struct smbd_smb2_request *req, - uint64_t in_file_id_volatile) +struct smbd_smb2_flush_state { + struct smbd_smb2_request *smb2req; +}; + +static struct tevent_req *smbd_smb2_flush_send(TALLOC_CTX *mem_ctx, + struct teven
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2072-g47b5a55
The branch, master has been updated via 47b5a55239fe21e24d47ce56e752a0ee328b697f (commit) from 4f56d87cc8848acd856d24603901714de655b61d (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 47b5a55239fe21e24d47ce56e752a0ee328b697f Author: Günther Deschner Date: Wed Jun 3 11:10:13 2009 +0200 nss_wrapper: add struct nwrap_backend. Guenther --- Summary of changes: lib/nss_wrapper/nss_wrapper.c | 405 - 1 files changed, 320 insertions(+), 85 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index 317c251..cffa044 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -139,59 +139,87 @@ #define NWRAP_VERBOSE(args) #endif -struct nwrap_ops { +struct nwrap_backend { const char *name; - struct passwd * (*nw_getpwnam)(const char *name); - int (*nw_getpwnam_r)(const char *name, struct passwd *pwdst, - char *buf, size_t buflen, struct passwd **pwdstp); - struct passwd * (*nw_getpwuid)(uid_t uid); - int (*nw_getpwuid_r)(uid_t uid, struct passwd *pwdst, - char *buf, size_t buflen, struct passwd **pwdstp); - void(*nw_setpwent)(void); - struct passwd * (*nw_getpwent)(void); - int (*nw_getpwent_r)(struct passwd *pwdst, char *buf, - size_t buflen, struct passwd **pwdstp); - void(*nw_endpwent)(void); - int (*nw_initgroups)(const char *user, gid_t group); - struct group * (*nw_getgrnam)(const char *name); - int (*nw_getgrnam_r)(const char *name, struct group *grdst, - char *buf, size_t buflen, struct group **grdstp); - struct group * (*nw_getgrgid)(gid_t gid); - int (*nw_getgrgid_r)(gid_t gid, struct group *grdst, - char *buf, size_t buflen, struct group **grdstp); - void(*nw_setgrent)(void); - struct group * (*nw_getgrent)(void); - int (*nw_getgrent_r)(struct group *grdst, char *buf, - size_t buflen, struct group **grdstp); - void(*nw_endgrent)(void); + struct nwrap_ops *ops; }; -static struct passwd *nwrap_files_getpwnam(const char *name); -static int nwrap_files_getpwnam_r(const char *name, struct passwd *pwdst, +struct nwrap_ops { + struct passwd * (*nw_getpwnam)(struct nwrap_backend *b, + const char *name); + int (*nw_getpwnam_r)(struct nwrap_backend *b, +const char *name, struct passwd *pwdst, +char *buf, size_t buflen, struct passwd **pwdstp); + struct passwd * (*nw_getpwuid)(struct nwrap_backend *b, + uid_t uid); + int (*nw_getpwuid_r)(struct nwrap_backend *b, +uid_t uid, struct passwd *pwdst, +char *buf, size_t buflen, struct passwd **pwdstp); + void(*nw_setpwent)(struct nwrap_backend *b); + struct passwd * (*nw_getpwent)(struct nwrap_backend *b); + int (*nw_getpwent_r)(struct nwrap_backend *b, +struct passwd *pwdst, char *buf, +size_t buflen, struct passwd **pwdstp); + void(*nw_endpwent)(struct nwrap_backend *b); + int (*nw_initgroups)(struct nwrap_backend *b, +const char *user, gid_t group); + struct group * (*nw_getgrnam)(struct nwrap_backend *b, + const char *name); + int (*nw_getgrnam_r)(struct nwrap_backend *b, +const char *name, struct group *grdst, +char *buf, size_t buflen, struct group **grdstp); + struct group * (*nw_getgrgid)(struct nwrap_backend *b, + gid_t gid); + int (*nw_getgrgid_r)(struct nwrap_backend *b, +gid_t gid, struct group *grdst, +char *buf, size_t buflen, struct group **grdstp); + void(*nw_setgrent)(struct nwrap_backend *b); + struct group * (*nw_getgrent)(struct nwrap_backend *b); + int (*nw_getgrent_r)(struct nwrap_backend *b, +struct group *grdst, c
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2074-gf3aa2a2
The branch, master has been updated via f3aa2a2b73e3ece1d3b57698303980a26083b08d (commit) via 6985f3995f74d081cb8f2256a1c6fc2d80166713 (commit) from 47b5a55239fe21e24d47ce56e752a0ee328b697f (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f3aa2a2b73e3ece1d3b57698303980a26083b08d Author: Günther Deschner Date: Thu Jun 4 12:17:39 2009 +0200 nss_wrapper: add skeleton for module nwrap_backend. Guenther commit 6985f3995f74d081cb8f2256a1c6fc2d80166713 Author: Günther Deschner Date: Thu Jun 4 11:59:32 2009 +0200 nss_wrapper: add capability to load nss modules. Guenther --- Summary of changes: lib/nss_wrapper/nss_wrapper.c | 275 - 1 files changed, 274 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index cffa044..862bb89 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -37,6 +37,7 @@ #include "../replace/replace.h" #include "system/passwd.h" #include "system/filesys.h" +#include "../nsswitch/nsstest.h" #else /* _SAMBA_BUILD_ */ @@ -139,9 +140,33 @@ #define NWRAP_VERBOSE(args) #endif +struct nwrap_module_nss_fns { + NSS_STATUS (*_nss_getpwnam_r)(const char *name, struct passwd *result, char *buffer, + size_t buflen, int *errnop); + NSS_STATUS (*_nss_getpwuid_r)(uid_t uid, struct passwd *result, char *buffer, + size_t buflen, int *errnop); + NSS_STATUS (*_nss_setpwent)(void); + NSS_STATUS (*_nss_getpwent_r)(struct passwd *result, char *buffer, + size_t buflen, int *errnop); + NSS_STATUS (*_nss_endpwent)(void); + NSS_STATUS (*_nss_initgroups)(const char *user, gid_t group, long int *start, + long int *size, gid_t **groups, long int limit, int *errnop); + NSS_STATUS (*_nss_getgrnam_r)(const char *name, struct group *result, char *buffer, + size_t buflen, int *errnop); + NSS_STATUS (*_nss_getgrgid_r)(gid_t gid, struct group *result, char *buffer, + size_t buflen, int *errnop); + NSS_STATUS (*_nss_setgrent)(void); + NSS_STATUS (*_nss_getgrent_r)(struct group *result, char *buffer, + size_t buflen, int *errnop); + NSS_STATUS (*_nss_endgrent)(void); +}; + struct nwrap_backend { const char *name; + const char *so_path; + void *so_handle; struct nwrap_ops *ops; + struct nwrap_module_nss_fns *fns; }; struct nwrap_ops { @@ -219,6 +244,43 @@ static int nwrap_files_getgrent_r(struct nwrap_backend *b, size_t buflen, struct group **grdstp); static void nwrap_files_endgrent(struct nwrap_backend *b); +/* protoypes for module backend */ + +static struct passwd *nwrap_module_getpwent(struct nwrap_backend *b); +static int nwrap_module_getpwent_r(struct nwrap_backend *b, + struct passwd *pwdst, char *buf, + size_t buflen, struct passwd **pwdstp); +static struct passwd *nwrap_module_getpwnam(struct nwrap_backend *b, + const char *name); +static int nwrap_module_getpwnam_r(struct nwrap_backend *b, + const char *name, struct passwd *pwdst, + char *buf, size_t buflen, struct passwd **pwdstp); +static struct passwd *nwrap_module_getpwuid(struct nwrap_backend *b, + uid_t uid); +static int nwrap_module_getpwuid_r(struct nwrap_backend *b, + uid_t uid, struct passwd *pwdst, + char *buf, size_t buflen, struct passwd **pwdstp); +static void nwrap_module_setpwent(struct nwrap_backend *b); +static void nwrap_module_endpwent(struct nwrap_backend *b); +static struct group *nwrap_module_getgrent(struct nwrap_backend *b); +static int nwrap_module_getgrent_r(struct nwrap_backend *b, + struct group *grdst, char *buf, + size_t buflen, struct group **grdstp); +static struct group *nwrap_module_getgrnam(struct nwrap_backend *b, + const char *name); +static int nwrap_module_getgrnam_r(struct nwrap_backend *b, + const char *name, struct group *grdst, + char *buf, size_t buflen, struct group **grdstp); +static struct group *nwrap_module_getgrgid(struct nwrap_backend *b, + gid
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2075-g2e78bc7
The branch, master has been updated via 2e78bc7b539ee298ca695ec9e0d650f99a266282 (commit) from f3aa2a2b73e3ece1d3b57698303980a26083b08d (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 2e78bc7b539ee298ca695ec9e0d650f99a266282 Author: Günther Deschner Date: Fri Jun 5 23:10:58 2009 +0200 nss_wrapper: add missing return in nwrap_module_init(). Guenther --- Summary of changes: lib/nss_wrapper/nss_wrapper.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index 862bb89..0e02e05 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -464,6 +464,7 @@ static bool nwrap_module_init(const char *name, if (!*backends) { NWRAP_ERROR(("%s: out of memory\n", __location__)); + return false; } (*backends)[*num_backends].name = name; -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2076-ga845cb5
The branch, master has been updated via a845cb5ed38b6267f3b6fb6a44db7e5d4a7196dd (commit) from 2e78bc7b539ee298ca695ec9e0d650f99a266282 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit a845cb5ed38b6267f3b6fb6a44db7e5d4a7196dd Author: Günther Deschner Date: Thu Jun 4 12:25:14 2009 +0200 nss_wrapper: fill in module nwrap_backend. Guenther --- Summary of changes: lib/nss_wrapper/nss_wrapper.c | 345 +++-- 1 files changed, 332 insertions(+), 13 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index 0e02e05..4f98b68 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -1376,102 +1376,421 @@ static void nwrap_files_endgrent(struct nwrap_backend *b) * module backend */ +#ifndef SAFE_FREE +#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); (x)=NULL;} } while(0) +#endif + static struct passwd *nwrap_module_getpwnam(struct nwrap_backend *b, const char *name) { - return NULL; + static struct passwd pwd; + static char buf[1000]; + NSS_STATUS status; + + if (!b->fns->_nss_getpwnam_r) { + return NULL; + } + + status = b->fns->_nss_getpwnam_r(name, &pwd, buf, sizeof(buf), &errno); + if (status == NSS_STATUS_NOTFOUND) { + return NULL; + } + if (status != NSS_STATUS_SUCCESS) { + return NULL; + } + return &pwd; } static int nwrap_module_getpwnam_r(struct nwrap_backend *b, const char *name, struct passwd *pwdst, char *buf, size_t buflen, struct passwd **pwdstp) { - return ENOENT; + int ret; + + if (!b->fns->_nss_getpwnam_r) { + return NSS_STATUS_NOTFOUND; + } + + ret = b->fns->_nss_getpwnam_r(name, pwdst, buf, buflen, &errno); + switch (ret) { + case NSS_STATUS_SUCCESS: + return 0; + case NSS_STATUS_NOTFOUND: + if (errno != 0) { + return errno; + } + return ENOENT; + case NSS_STATUS_TRYAGAIN: + if (errno != 0) { + return errno; + } + return ERANGE; + default: + if (errno != 0) { + return errno; + } + return ret; + } } static struct passwd *nwrap_module_getpwuid(struct nwrap_backend *b, uid_t uid) { - return NULL; + static struct passwd pwd; + static char buf[1000]; + NSS_STATUS status; + + if (!b->fns->_nss_getpwuid_r) { + return NULL; + } + + status = b->fns->_nss_getpwuid_r(uid, &pwd, buf, sizeof(buf), &errno); + if (status == NSS_STATUS_NOTFOUND) { + return NULL; + } + if (status != NSS_STATUS_SUCCESS) { + return NULL; + } + return &pwd; } static int nwrap_module_getpwuid_r(struct nwrap_backend *b, uid_t uid, struct passwd *pwdst, char *buf, size_t buflen, struct passwd **pwdstp) { - return ENOENT; + int ret; + + if (!b->fns->_nss_getpwuid_r) { + return ENOENT; + } + + ret = b->fns->_nss_getpwuid_r(uid, pwdst, buf, buflen, &errno); + switch (ret) { + case NSS_STATUS_SUCCESS: + return 0; + case NSS_STATUS_NOTFOUND: + if (errno != 0) { + return errno; + } + return ENOENT; + case NSS_STATUS_TRYAGAIN: + if (errno != 0) { + return errno; + } + return ERANGE; + default: + if (errno != 0) { + return errno; + } + return ret; + } } static void nwrap_module_setpwent(struct nwrap_backend *b) { + if (!b->fns->_nss_setpwent) { + return; + } + + b->fns->_nss_setpwent(); } static struct passwd *nwrap_module_getpwent(struct nwrap_backend *b) { - return NULL; + static struct passwd pwd; + static char buf[1000]; + NSS_STATUS status; + + if (!b->fns->_nss_getpwent_r) { + return NULL; + } + + status = b->fns->_nss_getpwent_r(&pwd, buf, sizeof(buf), &errno); + if (status == NSS_STATUS_NOTFOUND) { + return NULL; + } + if (status != NSS_STATUS_SUCCESS) { + return NULL; + } + return &pwd; } static int nwrap_module_
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2077-g68a1ef2
The branch, master has been updated via 68a1ef21971b5c15db5d0a82acc89791ffceaee0 (commit) from a845cb5ed38b6267f3b6fb6a44db7e5d4a7196dd (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 68a1ef21971b5c15db5d0a82acc89791ffceaee0 Author: Günther Deschner Date: Thu Jun 4 12:26:55 2009 +0200 nss_wrapper: add support for loading nss_winbind.so via WINBIND_SO_PATH env. Guenther --- Summary of changes: lib/nss_wrapper/nss_wrapper.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index 4f98b68..73ca6eb 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -480,6 +480,8 @@ static bool nwrap_module_init(const char *name, static void nwrap_backend_init(struct nwrap_main *r) { + const char *winbind_so_path = getenv("NSS_WRAPPER_WINBIND_SO_PATH"); + r->num_backends = 0; r->backends = NULL; @@ -490,6 +492,16 @@ static void nwrap_backend_init(struct nwrap_main *r) __location__)); return; } + + if (winbind_so_path && strlen(winbind_so_path)) { + if (!nwrap_module_init("winbind", &nwrap_module_ops, winbind_so_path, + &r->num_backends, + &r->backends)) { + NWRAP_ERROR(("%s: failed to initialize 'winbind' backend\n", +__location__)); + return; + } + } } static void nwrap_init(void) -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2078-g64a1f17
The branch, master has been updated via 64a1f17aff1d17b74398fb270aac5768fd312cf6 (commit) from 68a1ef21971b5c15db5d0a82acc89791ffceaee0 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 64a1f17aff1d17b74398fb270aac5768fd312cf6 Author: Jeremy Allison Date: Fri Jun 5 16:06:05 2009 -0700 Make cli_ftruncate async. Also add a simple test. Jeremy. --- Summary of changes: source3/include/proto.h |8 ++- source3/libsmb/clifile.c | 188 ++ source3/libsmb/libsmb_file.c |2 +- source3/torture/torture.c| 24 ++ 4 files changed, 148 insertions(+), 74 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/proto.h b/source3/include/proto.h index 961b3e0..19314e0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2494,7 +2494,13 @@ struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx, struct cli_state *cli, uint16_t fnum); NTSTATUS cli_close_recv(struct tevent_req *req); NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum); -bool cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size); +struct tevent_req *cli_ftruncate_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct cli_state *cli, + uint16_t fnum, + uint64_t size); +NTSTATUS cli_ftruncate_recv(struct tevent_req *req); +NTSTATUS cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size); NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len, int timeout, unsigned char locktype); diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 693d976..a2f089c 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -1981,45 +1981,6 @@ NTSTATUS cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag) return status; } -#if 0 -int cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag) -{ - unsigned int data_len = 1; - unsigned int param_len = 6; - uint16_t setup = TRANSACT2_SETFILEINFO; - char param[6]; - unsigned char data; - char *rparam=NULL, *rdata=NULL; - - memset(param, 0, param_len); - SSVAL(param,0,fnum); - SSVAL(param,2,SMB_SET_FILE_DISPOSITION_INFO); - - data = flag ? 1 : 0; - - if (!cli_send_trans(cli, SMBtrans2, - NULL,/* name */ - -1, 0, /* fid, flags */ - &setup, 1, 0, /* setup, length, max */ - param, param_len, 2,/* param, length, max */ - (char *)&data, data_len, cli->max_xmit /* data, length, max */ - )) { - return false; - } - - if (!cli_receive_trans(cli, SMBtrans2, - &rparam, ¶m_len, - &rdata, &data_len)) { - return false; - } - - SAFE_FREE(rdata); - SAFE_FREE(rparam); - - return true; -} -#endif - struct cli_ntcreate_state { uint16_t vwv[24]; uint16_t fnum; @@ -2506,50 +2467,133 @@ NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum) Truncate a file to a specified size / -bool cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size) +struct ftrunc_state { + uint16_t setup; + uint8_t param[6]; + uint8_t data[8]; +}; + +static void cli_ftruncate_done(struct tevent_req *subreq) { - unsigned int param_len = 6; - unsigned int data_len = 8; - uint16_t setup = TRANSACT2_SETFILEINFO; - char param[6]; - unsigned char data[8]; - char *rparam=NULL, *rdata=NULL; - int saved_timeout = cli->timeout; + struct tevent_req *req = tevent_req_callback_data( + subreq, struct tevent_req); + struct ftrunc_state *state = tevent_req_data(req, struct ftrunc_state); + NTSTATUS status; - SSVAL(param,0,fnum); - SSVAL(param,2,SMB_SET_FILE_END_OF_FILE_INFO); - SSVAL(param,4,0); + status = cli_trans_recv(subreq, state, NULL, NULL, NULL, NULL, NULL, NULL); + TALLOC_FREE(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return; + } + tevent_req_done(req); +} -SBVAL(data, 0, size); +struct tevent_req *cli_ftruncate_send(TALLOC_CTX *mem_ctx, + struct event_context *ev,
Build status as of Sat Jun 6 00:00:01 2009
URL: http://build.samba.org/ --- /home/build/master/cache/broken_results.txt.old 2009-06-05 00:00:29.0 + +++ /home/build/master/cache/broken_results.txt 2009-06-06 00:00:21.0 + @@ -1,4 +1,4 @@ -Build status as of Fri Jun 5 00:00:02 2009 +Build status as of Sat Jun 6 00:00:01 2009 Build counts: Tree Total Broken Panic @@ -8,13 +8,13 @@ ldb 32 32 0 libreplace 31 12 0 lorikeet 0 0 0 -pidl 22 20 0 +pidl 22 3 0 ppp 14 0 0 -rsync32 11 0 +rsync32 10 0 samba-docs 0 0 0 samba-web0 0 0 -samba_3_current 28 18 0 -samba_3_master 31 29 2 +samba_3_current 30 20 0 +samba_3_master 31 30 2 samba_3_next 31 30 1 samba_4_0_test 32 30 0 talloc 31 31 0
[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-2080-gf19c914
The branch, master has been updated via f19c9147a5fce8c21d8e194ac7de1a0a196f (commit) via 0bf56f5cb31accabb6a3ba81c18217ae24793218 (commit) from 64a1f17aff1d17b74398fb270aac5768fd312cf6 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f19c9147a5fce8c21d8e194ac7de1a0a196f Author: Günther Deschner Date: Sat Jun 6 01:50:17 2009 +0200 s3-winbindd: add some debug statements while tracking down a bug. Guenther commit 0bf56f5cb31accabb6a3ba81c18217ae24793218 Author: Günther Deschner Date: Sat Jun 6 01:14:04 2009 +0200 nss_wrapper: rename nwrap_cache_{re,un}load as per metzes request. Guenther --- Summary of changes: lib/nss_wrapper/nss_wrapper.c | 20 ++-- source3/winbindd/winbindd_group.c | 16 ++-- source3/winbindd/winbindd_passdb.c |6 ++ 3 files changed, 30 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index 73ca6eb..ad0d8ba 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -632,7 +632,7 @@ failed: return false; } -static void nwrap_cache_unload(struct nwrap_cache *nwrap) +static void nwrap_files_cache_unload(struct nwrap_cache *nwrap) { nwrap->unload(nwrap); @@ -641,7 +641,7 @@ static void nwrap_cache_unload(struct nwrap_cache *nwrap) nwrap->buf = NULL; } -static void nwrap_cache_reload(struct nwrap_cache *nwrap) +static void nwrap_files_cache_reload(struct nwrap_cache *nwrap) { struct stat st; int ret; @@ -692,13 +692,13 @@ reopen: nwrap->st = st; - nwrap_cache_unload(nwrap); + nwrap_files_cache_unload(nwrap); ok = nwrap_parse_file(nwrap); if (!ok) { NWRAP_ERROR(("%s: failed to reload %s\n", __location__, nwrap->path)); - nwrap_cache_unload(nwrap); + nwrap_files_cache_unload(nwrap); } NWRAP_DEBUG(("%s: reloaded %s\n", __location__, nwrap->path)); @@ -1118,7 +1118,7 @@ static struct passwd *nwrap_files_getpwnam(struct nwrap_backend *b, { int i; - nwrap_cache_reload(nwrap_pw_global.cache); + nwrap_files_cache_reload(nwrap_pw_global.cache); for (i=0; i= nwrap_pw_global.num) { @@ -1258,7 +1258,7 @@ static struct group *nwrap_files_getgrnam(struct nwrap_backend *b, { int i; - nwrap_cache_reload(nwrap_gr_global.cache); + nwrap_files_cache_reload(nwrap_gr_global.cache); for (i=0; i= nwrap_gr_global.num) { diff --git a/source3/winbindd/winbindd_group.c b/source3/winbindd/winbindd_group.c index 3273a28..913f631 100644 --- a/source3/winbindd/winbindd_group.c +++ b/source3/winbindd/winbindd_group.c @@ -460,6 +460,8 @@ static NTSTATUS expand_groups( TALLOC_CTX *ctx, *new_glist = NULL; *n_new_glist = 0; + DEBUG(10,("expand_groups:\n")); + for ( i=0; iname, + sid_string_dbg(group_sid))); + *num_names = 0; *sid_mem = NULL; *names = NULL; @@ -571,6 +574,9 @@ static NTSTATUS sam_lookup_groupmem(struct winbindd_domain *domain, struct lsa_name_info *lsa_names; TALLOC_CTX *tmp_ctx; + DEBUG(10,("passdb: lookup_groupmem (sam) %s sid=%s\n", domain->name, + sid_string_dbg(group_sid))); + if (!sid_check_is_in_our_domain(group_sid)) { /* There's no groups, only aliases in BUILTIN */ return NT_STATUS_NO_SUCH_GROUP; -- Samba Shared Repository