The branch, v3-6-test has been updated via 28cba27 libcli/: Fix prototypes for all functions.(cherry picked from commit fa387825e2a4563ff85267848d8e9d206bf6db96) via 62a6ded More const compiler warning fixes. (cherry picked from commit 9efea96d16a9f9526669e7d9288902a15d0ee549) via 37a05cb s3-net: fix potential crash bug in display_print_driver3(). from 5ad20f6 s3: Fix return check in nss_wins
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test - Log ----------------------------------------------------------------- commit 28cba271e61245b166d002745737c5fedae80c0c Author: Jelmer Vernooij <jel...@samba.org> Date: Sat Mar 19 00:45:56 2011 +0100 libcli/: Fix prototypes for all functions.(cherry picked from commit fa387825e2a4563ff85267848d8e9d206bf6db96) commit 62a6ded441247daeb61a36fddc3d7eac8114df9f Author: Jeremy Allison <j...@samba.org> Date: Thu May 5 11:29:01 2011 -0700 More const compiler warning fixes. (cherry picked from commit 9efea96d16a9f9526669e7d9288902a15d0ee549) commit 37a05cbd6d00690542a08556ffc55bf5a3afe7d5 Author: Günther Deschner <g...@samba.org> Date: Fri May 13 15:03:59 2011 +0200 s3-net: fix potential crash bug in display_print_driver3(). Guenther Autobuild-User: Günther Deschner <g...@samba.org> Autobuild-Date: Fri May 13 18:49:06 CEST 2011 on sn-devel-104 (cherry picked from commit 3d100216b84f4f25c3e761741eda2cc134957e96) ----------------------------------------------------------------------- Summary of changes: libcli/echo/tests/echo.c | 2 ++ libcli/nbt/dns_hosts_file.c | 1 + libcli/security/pysecurity.c | 2 ++ libcli/security/secacl.c | 1 + libcli/util/error.h | 2 ++ source3/lib/util_sid.c | 2 +- source3/nmbd/nmbd_elections.c | 2 +- source3/nmbd/nmbd_incomingdgrams.c | 20 ++++++++++---------- source3/nmbd/nmbd_packets.c | 10 +++++----- source3/nmbd/nmbd_processlogon.c | 2 +- source3/nmbd/nmbd_proto.h | 22 +++++++++++----------- source3/utils/net_rpc_printer.c | 2 +- 12 files changed, 38 insertions(+), 30 deletions(-) Changeset truncated at 500 lines: diff --git a/libcli/echo/tests/echo.c b/libcli/echo/tests/echo.c index 77a7dfa..c47b7d0 100644 --- a/libcli/echo/tests/echo.c +++ b/libcli/echo/tests/echo.c @@ -26,6 +26,8 @@ #include "libcli/util/ntstatus.h" #include "libcli/echo/libecho.h" +NTSTATUS torture_libcli_echo_init(void); + /* Basic test function that sends an echo request and checks the reply */ static bool echo_udp_basic(struct torture_context *tctx, const char *address) { diff --git a/libcli/nbt/dns_hosts_file.c b/libcli/nbt/dns_hosts_file.c index 810e4eb..c6491a9 100644 --- a/libcli/nbt/dns_hosts_file.c +++ b/libcli/nbt/dns_hosts_file.c @@ -28,6 +28,7 @@ #include "lib/util/util_net.h" #include "system/filesys.h" #include "system/network.h" +#include "libcli/nbt/libnbt.h" /******************************************************** Start parsing the dns_hosts_file file. diff --git a/libcli/security/pysecurity.c b/libcli/security/pysecurity.c index 56bdd69..87134bf 100644 --- a/libcli/security/pysecurity.c +++ b/libcli/security/pysecurity.c @@ -23,6 +23,8 @@ #include "libcli/security/security.h" #include "pytalloc.h" +void initsecurity(void); + static PyObject *py_se_access_check(PyObject *module, PyObject *args, PyObject *kwargs) { NTSTATUS nt_status; diff --git a/libcli/security/secacl.c b/libcli/security/secacl.c index 9c04df8..47184ae 100644 --- a/libcli/security/secacl.c +++ b/libcli/security/secacl.c @@ -23,6 +23,7 @@ #include "includes.h" #include "librpc/gen_ndr/ndr_security.h" #include "libcli/security/secace.h" +#include "libcli/security/secacl.h" #define SEC_ACL_HEADER_SIZE (2 * sizeof(uint16_t) + sizeof(uint32_t)) diff --git a/libcli/util/error.h b/libcli/util/error.h index 77a2f5a..7b7de6c 100644 --- a/libcli/util/error.h +++ b/libcli/util/error.h @@ -51,4 +51,6 @@ convert a Unix error code to a WERROR *********************************************************************/ WERROR unix_to_werror(int unix_error); +NTSTATUS nt_status_squash(NTSTATUS nt_status); + #endif /* _SAMBA_ERROR_H */ diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c index ef46a38..f080d3d 100644 --- a/source3/lib/util_sid.c +++ b/source3/lib/util_sid.c @@ -121,7 +121,7 @@ char *sid_binstring_hex(const struct dom_sid *sid) if (!buf) return NULL; sid_linearize(buf, len, sid); - hex_encode(buf, len, &s); + hex_encode((const unsigned char *)buf, len, &s); free(buf); return s; } diff --git a/source3/nmbd/nmbd_elections.c b/source3/nmbd/nmbd_elections.c index 899c273..a7b240f 100644 --- a/source3/nmbd/nmbd_elections.c +++ b/source3/nmbd/nmbd_elections.c @@ -258,7 +258,7 @@ static bool win_election(struct work_record *work, int version, Process an incoming election datagram packet. ******************************************************************/ -void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf) +void process_election(struct subnet_record *subrec, struct packet_struct *p, const char *buf) { struct dgram_packet *dgram = &p->packet.dgram; int version = CVAL(buf,0); diff --git a/source3/nmbd/nmbd_incomingdgrams.c b/source3/nmbd/nmbd_incomingdgrams.c index 6993e18..0b90b2a 100644 --- a/source3/nmbd/nmbd_incomingdgrams.c +++ b/source3/nmbd/nmbd_incomingdgrams.c @@ -95,7 +95,7 @@ void tell_become_backup(void) Process an incoming host announcement packet. *******************************************************************/ -void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf) +void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, const char *buf) { struct dgram_packet *dgram = &p->packet.dgram; int ttl = IVAL(buf,1)/1000; @@ -195,7 +195,7 @@ done: Process an incoming WORKGROUP announcement packet. *******************************************************************/ -void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf) +void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, const char *buf) { struct dgram_packet *dgram = &p->packet.dgram; int ttl = IVAL(buf,1)/1000; @@ -252,7 +252,7 @@ done: Process an incoming local master browser announcement packet. *******************************************************************/ -void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf) +void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, const char *buf) { struct dgram_packet *dgram = &p->packet.dgram; int ttl = IVAL(buf,1)/1000; @@ -367,7 +367,7 @@ done: ******************************************************************/ void process_master_browser_announce(struct subnet_record *subrec, - struct packet_struct *p,char *buf) + struct packet_struct *p,const char *buf) { unstring local_master_name; struct work_record *work; @@ -418,7 +418,7 @@ done: Process an incoming LanMan host announcement packet. *******************************************************************/ -void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf, int len) +void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, const char *buf, int len) { struct dgram_packet *dgram = &p->packet.dgram; uint32 servertype = IVAL(buf,1); @@ -431,7 +431,7 @@ void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct unstring work_name; unstring source_name; fstring comment; - char *s = get_safe_str_ptr(buf,len,buf,9); + char *s = get_safe_str_ptr(buf,len,discard_const_p(char, buf),9); START_PROFILE(lm_host_announce); if (!s) { @@ -641,7 +641,7 @@ static void send_backup_list_response(struct subnet_record *subrec, ********************************************************************/ void process_get_backup_list_request(struct subnet_record *subrec, - struct packet_struct *p,char *buf) + struct packet_struct *p,const char *buf) { struct dgram_packet *dgram = &p->packet.dgram; struct work_record *work; @@ -724,7 +724,7 @@ done: ******************************************************************/ void process_reset_browser(struct subnet_record *subrec, - struct packet_struct *p,char *buf) + struct packet_struct *p,const char *buf) { struct dgram_packet *dgram = &p->packet.dgram; int state = CVAL(buf,0); @@ -776,7 +776,7 @@ request from %s IP %s state=0x%X\n", announcement is needed soon. ******************************************************************/ -void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf) +void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, const char *buf) { struct dgram_packet *dgram = &p->packet.dgram; struct work_record *work; @@ -817,7 +817,7 @@ done: through the "lm announce" parameter in smb.conf) ******************************************************************/ -void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf, int len) +void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, const char *buf, int len) { struct dgram_packet *dgram = &p->packet.dgram; unstring workgroup_name; diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c index 36dacfb..68b62d9 100644 --- a/source3/nmbd/nmbd_packets.c +++ b/source3/nmbd/nmbd_packets.c @@ -108,7 +108,7 @@ void set_nb_flags(char *buf, uint16 nb_flags) Dumps out the browse packet data. **************************************************************************/ -static void debug_browse_data(char *outbuf, int len) +static void debug_browse_data(const char *outbuf, int len) { int i,j; @@ -1062,7 +1062,7 @@ static struct subnet_record *find_subnet_for_dgram_browse_packet(struct packet_s Dispatch a browse frame from port 138 to the correct processing function. ****************************************************************************/ -static void process_browse_packet(struct packet_struct *p, char *buf,int len) +static void process_browse_packet(struct packet_struct *p, const char *buf,int len) { struct dgram_packet *dgram = &p->packet.dgram; int command = CVAL(buf,0); @@ -1149,7 +1149,7 @@ command code %d from %s IP %s to %s\n", subrec->subnet_name, command, nmb_namest Dispatch a LanMan browse frame from port 138 to the correct processing function. ****************************************************************************/ -static void process_lanman_packet(struct packet_struct *p, char *buf,int len) +static void process_lanman_packet(struct packet_struct *p, const char *buf,int len) { struct dgram_packet *dgram = &p->packet.dgram; int command = SVAL(buf,0); @@ -1216,8 +1216,8 @@ static bool listening(struct packet_struct *p,struct nmb_name *nbname) static void process_dgram(struct packet_struct *p) { - char *buf; - char *buf2; + const char *buf; + const char *buf2; int len; struct dgram_packet *dgram = &p->packet.dgram; diff --git a/source3/nmbd/nmbd_processlogon.c b/source3/nmbd/nmbd_processlogon.c index 7976817..9bb1252 100644 --- a/source3/nmbd/nmbd_processlogon.c +++ b/source3/nmbd/nmbd_processlogon.c @@ -304,7 +304,7 @@ static void nmbd_proxy_logon_done(struct tevent_req *subreq) Process a domain logon packet **************************************************************************/ -void process_logon_packet(struct packet_struct *p, char *buf,int len, +void process_logon_packet(struct packet_struct *p, const char *buf,int len, const char *mailslot) { fstring source_name; diff --git a/source3/nmbd/nmbd_proto.h b/source3/nmbd/nmbd_proto.h index b58ca41..1c6ec0c 100644 --- a/source3/nmbd/nmbd_proto.h +++ b/source3/nmbd/nmbd_proto.h @@ -48,7 +48,7 @@ void sync_all_dmbs(time_t t); void check_master_browser_exists(time_t t); void run_elections(time_t t); -void process_election(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_election(struct subnet_record *subrec, struct packet_struct *p, const char *buf); bool check_elections(void); void nmbd_message_election(struct messaging_context *msg, void *private_data, @@ -59,18 +59,18 @@ void nmbd_message_election(struct messaging_context *msg, /* The following definitions come from nmbd/nmbd_incomingdgrams.c */ void tell_become_backup(void); -void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf); +void process_host_announce(struct subnet_record *subrec, struct packet_struct *p, const char *buf); +void process_workgroup_announce(struct subnet_record *subrec, struct packet_struct *p, const char *buf); +void process_local_master_announce(struct subnet_record *subrec, struct packet_struct *p, const char *buf); void process_master_browser_announce(struct subnet_record *subrec, - struct packet_struct *p,char *buf); -void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, char *buf, int len); + struct packet_struct *p,const char *buf); +void process_lm_host_announce(struct subnet_record *subrec, struct packet_struct *p, const char *buf, int len); void process_get_backup_list_request(struct subnet_record *subrec, - struct packet_struct *p,char *buf); + struct packet_struct *p,const char *buf); void process_reset_browser(struct subnet_record *subrec, - struct packet_struct *p,char *buf); -void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf); -void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, char *buf, int len); + struct packet_struct *p,const char *buf); +void process_announce_request(struct subnet_record *subrec, struct packet_struct *p, const char *buf); +void process_lm_announce_request(struct subnet_record *subrec, struct packet_struct *p, const char *buf, int len); /* The following definitions come from nmbd/nmbd_incomingrequests.c */ @@ -250,7 +250,7 @@ bool send_mailslot(bool unique, const char *mailslot,char *buf, size_t len, bool initialize_nmbd_proxy_logon(void); -void process_logon_packet(struct packet_struct *p, char *buf,int len, +void process_logon_packet(struct packet_struct *p, const char *buf,int len, const char *mailslot); /* The following definitions come from nmbd/nmbd_responserecordsdb.c */ diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 0602364..304f2b4 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -70,7 +70,7 @@ static void display_print_driver3(struct spoolss_DriverInfo3 *r) printf(_("\tConfigfile: [%s]\n\n"), r->config_file); printf(_("\tHelpfile: [%s]\n\n"), r->help_file); - for (i=0; r->dependent_files[i] != NULL; i++) { + for (i=0; r->dependent_files && r->dependent_files[i] != NULL; i++) { printf(_("\tDependentfiles: [%s]\n"), r->dependent_files[i]); } -- Samba Shared Repository