From 1f6a410ec7d8017eb0174357540bf334fe6bbe59 Mon Sep 17 00:00:00 2001 From: Fedor Date: Wed, 12 May 2010 17:50:21 -0400 Subject: [PATCH] Samba 3: reduce logging, shorten log messages --- release/src/router/samba3/source/lib/util.c | 26 ++--- release/src/router/samba3/source/lib/util_sock.c | 70 ++++++------- release/src/router/samba3/source/libsmb/nmblib.c | 4 +- release/src/router/samba3/source/nmbd/asyncdns.c | 2 +- release/src/router/samba3/source/nmbd/nmbd.c | 8 +- .../router/samba3/source/nmbd/nmbd_become_dmb.c | 22 ++-- .../router/samba3/source/nmbd/nmbd_become_lmb.c | 26 ++--- .../samba3/source/nmbd/nmbd_incomingrequests.c | 9 +- .../router/samba3/source/nmbd/nmbd_workgroupdb.c | 2 +- .../router/samba3/source/passdb/pdb_smbpasswd.c | 116 ++++++++++----------- .../src/router/samba3/source/rpc_server/srv_pipe.c | 2 +- release/src/router/samba3/source/smbd/connection.c | 8 +- release/src/router/samba3/source/smbd/dir.c | 14 +-- release/src/router/samba3/source/smbd/nttrans.c | 2 +- release/src/router/samba3/source/smbd/open.c | 28 ++--- release/src/router/samba3/source/smbd/server.c | 32 +++--- release/src/router/samba3/source/smbd/service.c | 34 +++--- release/src/router/samba3/source/utils/net.c | 16 +-- release/src/router/samba3/source/utils/smbpasswd.c | 6 +- release/src/router/samba3/source/utils/smbtree.c | 2 +- 20 files changed, 210 insertions(+), 219 deletions(-) diff --git a/release/src/router/samba3/source/lib/util.c b/release/src/router/samba3/source/lib/util.c index f46aaafc21..9fae1162a6 100644 --- a/release/src/router/samba3/source/lib/util.c +++ b/release/src/router/samba3/source/lib/util.c @@ -673,11 +673,11 @@ void close_low_fds(BOOL stderr_too) if (fd < 0) fd = sys_open("/dev/null",O_WRONLY,0); if (fd < 0) { - DEBUG(0,("Can't open /dev/null\n")); + DEBUG(1,("Can't open /dev/null\n")); return; } if (fd != i) { - DEBUG(0,("Didn't get file descriptor %d\n",i)); + DEBUG(1,("Didn't get file descriptor %d\n",i)); return; } } @@ -703,7 +703,7 @@ ssize_t write_data_at_offset(int fd, const char *buffer, size_t N, SMB_OFF_T pos return write_data(fd, buffer + total,N - total); } if (ret == -1) { - DEBUG(0,("write_data_at_offset: write failure. Error = %s\n", strerror(errno) )); + DEBUG(1,("write_data_at_offset: write failure. Error = %s\n", strerror(errno) )); return -1; } if (ret == 0) { @@ -780,7 +780,7 @@ ssize_t transfer_file_internal(int infd, int outfd, size_t n, ssize_t (*read_fn) read_ret = (*read_fn)(infd, buf, num_to_read_thistime); if (read_ret == -1) { - DEBUG(0,("transfer_file_internal: read failure. Error = %s\n", strerror(errno) )); + DEBUG(1,("transfer_file_internal: read failure. Error = %s\n", strerror(errno) )); SAFE_FREE(buf); return -1; } @@ -793,7 +793,7 @@ ssize_t transfer_file_internal(int infd, int outfd, size_t n, ssize_t (*read_fn) write_ret = (*write_fn)(outfd,buf + num_written, read_ret - num_written); if (write_ret == -1) { - DEBUG(0,("transfer_file_internal: write failure. Error = %s\n", strerror(errno) )); + DEBUG(1,("transfer_file_internal: write failure. Error = %s\n", strerror(errno) )); SAFE_FREE(buf); return -1; } @@ -1169,7 +1169,7 @@ BOOL get_myname(char *my_name) /* get my host name */ if (gethostname(hostname, sizeof(hostname)) == -1) { - DEBUG(0,("gethostname failed\n")); + DEBUG(1,("gethostname failed\n")); return False; } @@ -1202,7 +1202,7 @@ BOOL get_mydnsfullname(fstring my_dnsname) /* get my host name */ if (gethostname(dnshostname, sizeof(dnshostname)) == -1) { *dnshostname = '\0'; - DEBUG(0,("gethostname failed\n")); + DEBUG(1,("gethostname failed\n")); return False; } @@ -2352,7 +2352,7 @@ int set_maxfiles(int requested_max) int saved_current_limit; if(getrlimit(RLIMIT_NOFILE, &rlp)) { - DEBUG(0,("set_maxfiles: getrlimit (1) for RLIMIT_NOFILE failed with error %s\n", + DEBUG(1,("set_maxfiles: getrlimit (1) for RLIMIT_NOFILE failed with error %s\n", strerror(errno) )); /* just guess... */ return requested_max; @@ -2394,14 +2394,14 @@ int set_maxfiles(int requested_max) saved_current_limit = rlp.rlim_cur = MIN(requested_max,rlp.rlim_max); if(setrlimit(RLIMIT_NOFILE, &rlp)) { - DEBUG(0,("set_maxfiles: setrlimit for RLIMIT_NOFILE for %d files failed with error %s\n", + DEBUG(1,("set_maxfiles: setrlimit for RLIMIT_NOFILE for %d files failed with error %s\n", (int)rlp.rlim_cur, strerror(errno) )); /* just guess... */ return saved_current_limit; } if(getrlimit(RLIMIT_NOFILE, &rlp)) { - DEBUG(0,("set_maxfiles: getrlimit (2) for RLIMIT_NOFILE failed with error %s\n", + DEBUG(1,("set_maxfiles: getrlimit (2) for RLIMIT_NOFILE failed with error %s\n", strerror(errno) )); /* just guess... */ return saved_current_limit; @@ -2455,7 +2455,7 @@ void *smb_xmalloc_array(size_t size, unsigned int count) smb_panic("smb_xmalloc: alloc size too large.\n"); } if ((p = SMB_MALLOC(size*count)) == NULL) { - DEBUG(0, ("smb_xmalloc_array failed to allocate %lu * %lu bytes\n", + DEBUG(1, ("smb_xmalloc_array failed to allocate %lu * %lu bytes\n", (unsigned long)size, (unsigned long)count)); smb_panic("smb_xmalloc_array: malloc fail.\n"); } @@ -2976,9 +2976,9 @@ void *talloc_check_name_abort(const void *ptr, const char *name) if (result != NULL) return result; - DEBUG(0, ("Talloc type mismatch, expected %s, got %s\n", + DEBUG(1, ("Talloc type mismatch, expected %s, got %s\n", name, talloc_get_name(ptr))); - smb_panic("aborting"); + smb_panic("Talloc type mismatch, aborting"); /* Keep the compiler happy */ return NULL; } diff --git a/release/src/router/samba3/source/lib/util_sock.c b/release/src/router/samba3/source/lib/util_sock.c index 4715ca7dcb..40eafb5964 100644 --- a/release/src/router/samba3/source/lib/util_sock.c +++ b/release/src/router/samba3/source/lib/util_sock.c @@ -49,7 +49,7 @@ static char *get_socket_addr(int fd) } if (getsockname(fd, &sa, &length) < 0) { - DEBUG(0,("getsockname failed. Error was %s\n", strerror(errno) )); + DEBUG(1,("getsockname failed. Error was %s\n", strerror(errno) )); return addr_buf; } @@ -68,7 +68,7 @@ static int get_socket_port(int fd) return -1; if (getsockname(fd, &sa, &length) < 0) { - DEBUG(0,("getpeername failed. Error was %s\n", strerror(errno) )); + DEBUG(1,("getpeername failed. Error was %s\n", strerror(errno) )); return -1; } @@ -101,7 +101,7 @@ struct in_addr *client_inaddr(struct sockaddr *sa) socklen_t length = sizeof(*sa); if (getpeername(client_fd, sa, &length) < 0) { - DEBUG(0,("getpeername failed. Error was %s\n", strerror(errno) )); + DEBUG(1,("getpeername failed. Error was %s\n", strerror(errno) )); return NULL; } @@ -353,7 +353,7 @@ ssize_t read_data_until(int fd,char *buffer,size_t N, const struct timeval *endt selrtn = sys_select_intr(fd+1, &r_fds, NULL, NULL, &timeout); if (selrtn == -1) { /* something is wrong. Maybe the socket is dead? */ - DEBUG(0,("read_data_until: select error = %s.\n", strerror(errno) )); + DEBUG(1,("read_data_until: select error = %s.\n", strerror(errno) )); smb_read_error = READ_ERROR; return -1; } @@ -379,7 +379,7 @@ ssize_t read_data_until(int fd,char *buffer,size_t N, const struct timeval *endt /* Non-blocking socket with no data available. Try select again. */ continue; } - DEBUG(0,("read_data_until: read failure for %d. Error = %s\n", (int)(N - total), strerror(errno) )); + DEBUG(1,("read_data_until: read failure for %d. Error = %s\n", (int)(N - total), strerror(errno) )); smb_read_error = READ_ERROR; return -1; } @@ -428,10 +428,10 @@ ssize_t read_socket_with_timeout(int fd,char *buf,size_t mincnt,size_t maxcnt,un if (readret == -1) { if (fd == client_fd) { /* Try and give an error message saying what client failed. */ - DEBUG(0,("read_socket_with_timeout: client %s read error = %s.\n", + DEBUG(1,("read_socket_with_timeout: client %s read error = %s.\n", client_ip_string, strerror(errno) )); } else { - DEBUG(0,("read_socket_with_timeout: read error = %s.\n", strerror(errno) )); + DEBUG(1,("read_socket_with_timeout: read error = %s.\n", strerror(errno) )); } smb_read_error = READ_ERROR; return -1; @@ -462,10 +462,10 @@ ssize_t read_socket_with_timeout(int fd,char *buf,size_t mincnt,size_t maxcnt,un /* something is wrong. Maybe the socket is dead? */ if (fd == client_fd) { /* Try and give an error message saying what client failed. */ - DEBUG(0,("read_socket_with_timeout: timeout read for client %s. select error = %s.\n", + DEBUG(1,("read_socket_with_timeout: timeout read for client %s. select error = %s.\n", client_ip_string, strerror(errno) )); } else { - DEBUG(0,("read_socket_with_timeout: timeout read. select error = %s.\n", strerror(errno) )); + DEBUG(1,("read_socket_with_timeout: timeout read. select error = %s.\n", strerror(errno) )); } smb_read_error = READ_ERROR; return -1; @@ -491,10 +491,10 @@ ssize_t read_socket_with_timeout(int fd,char *buf,size_t mincnt,size_t maxcnt,un /* the descriptor is probably dead */ if (fd == client_fd) { /* Try and give an error message saying what client failed. */ - DEBUG(0,("read_socket_with_timeout: timeout read to client %s. read error = %s.\n", + DEBUG(1,("read_socket_with_timeout: timeout read to client %s. read error = %s.\n", client_ip_string, strerror(errno) )); } else { - DEBUG(0,("read_socket_with_timeout: timeout read. read error = %s.\n", strerror(errno) )); + DEBUG(1,("read_socket_with_timeout: timeout read. read error = %s.\n", strerror(errno) )); } smb_read_error = READ_ERROR; return -1; @@ -530,10 +530,10 @@ ssize_t read_data(int fd,char *buffer,size_t N) if (ret == -1) { if (fd == client_fd) { /* Try and give an error message saying what client failed. */ - DEBUG(0,("read_data: read failure for %d bytes to client %s. Error = %s\n", + DEBUG(1,("read_data: read failure for %d bytes to client %s. Error = %s\n", (int)(N - total), client_ip_string, strerror(errno) )); } else { - DEBUG(0,("read_data: read failure for %d. Error = %s\n", (int)(N - total), strerror(errno) )); + DEBUG(1,("read_data: read failure for %d. Error = %s\n", (int)(N - total), strerror(errno) )); } smb_read_error = READ_ERROR; return -1; @@ -558,10 +558,10 @@ ssize_t write_data(int fd, const char *buffer, size_t N) if (ret == -1) { if (fd == client_fd) { /* Try and give an error message saying what client failed. */ - DEBUG(0,("write_data: write failure in writing to client %s. Error %s\n", + DEBUG(1,("write_data: write failure in writing to client %s. Error %s\n", client_ip_string, strerror(errno) )); } else { - DEBUG(0,("write_data: write failure. Error = %s\n", strerror(errno) )); + DEBUG(1,("write_data: write failure. Error = %s\n", strerror(errno) )); } return -1; } @@ -682,7 +682,7 @@ BOOL receive_smb_raw(int fd, char *buffer, size_t buflen, unsigned int timeout) } if (len > buflen) { - DEBUG(0,("Invalid packet length! (%lu bytes).\n",(unsigned long)len)); + DEBUG(1,("Invalid packet length! (%lu bytes).\n",(unsigned long)len)); /* * smb_read_error may have already been @@ -730,7 +730,7 @@ BOOL receive_smb(int fd, char *buffer, size_t buflen, unsigned int timeout) /* Check the incoming SMB signature. */ if (!srv_check_sign_mac(buffer, True)) { - DEBUG(0, ("receive_smb: SMB Signature verification failed on incoming packet!\n")); + DEBUG(1, ("receive_smb: SMB Signature verification failed on incoming packet!\n")); if (smb_read_error == 0) smb_read_error = READ_BAD_SIG; return False; @@ -757,7 +757,7 @@ BOOL send_smb(int fd, char *buffer) while (nwritten < len) { ret = write_data(fd,buffer+nwritten,len - nwritten); if (ret <= 0) { - DEBUG(0,("Error writing %d bytes to client. %d. (%s)\n", + DEBUG(1,("Error writing %d bytes to client. %d. (%s)\n", (int)len,(int)ret, strerror(errno) )); return False; } @@ -787,7 +787,7 @@ int open_socket_in( int type, int port, int dlevel, uint32 socket_addr, BOOL reb res = socket( AF_INET, type, 0 ); if( res == -1 ) { - if( DEBUGLVL(0) ) { + if( DEBUGLVL(1) ) { dbgtext( "open_socket_in(): socket() call failed: " ); dbgtext( "%s\n", strerror( errno ) ); } @@ -798,7 +798,7 @@ int open_socket_in( int type, int port, int dlevel, uint32 socket_addr, BOOL reb { int val = rebind ? 1 : 0; if( setsockopt(res,SOL_SOCKET,SO_REUSEADDR,(char *)&val,sizeof(val)) == -1 ) { - if( DEBUGLVL( dlevel ) ) { + if( DEBUGLVL( 1 ) ) { dbgtext( "open_socket_in(): setsockopt: " ); dbgtext( "SO_REUSEADDR = %s ", val?"True":"False" ); dbgtext( "on port %d failed ", port ); @@ -807,7 +807,7 @@ int open_socket_in( int type, int port, int dlevel, uint32 socket_addr, BOOL reb } #ifdef SO_REUSEPORT if( setsockopt(res,SOL_SOCKET,SO_REUSEPORT,(char *)&val,sizeof(val)) == -1 ) { - if( DEBUGLVL( dlevel ) ) { + if( DEBUGLVL( 1 ) ) { dbgtext( "open_socket_in(): setsockopt: "); dbgtext( "SO_REUSEPORT = %s ", val?"True":"False" ); dbgtext( "on port %d failed ", port ); @@ -819,7 +819,7 @@ int open_socket_in( int type, int port, int dlevel, uint32 socket_addr, BOOL reb /* now we've got a socket - we need to bind it */ if( bind( res, (struct sockaddr *)&sock, sizeof(sock) ) == -1 ) { - if( DEBUGLVL(dlevel) && (port == SMB_PORT1 || port == SMB_PORT2 || port == NMB_PORT) ) { + if( DEBUGLVL(1) && (port == SMB_PORT1 || port == SMB_PORT2 || port == NMB_PORT) ) { dbgtext( "bind failed on port %d ", port ); dbgtext( "socket_addr = %s.\n", inet_ntoa( sock.sin_addr ) ); dbgtext( "Error = %s\n", strerror(errno) ); @@ -847,7 +847,7 @@ int open_socket_out(int type, struct in_addr *addr, int port ,int timeout) /* create a socket to write to */ res = socket(PF_INET, type, 0); if (res == -1) { - DEBUG(0,("socket error (%s)\n", strerror(errno))); + DEBUG(1,("socket error (%s)\n", strerror(errno))); return -1; } @@ -1107,7 +1107,7 @@ static BOOL matchname(char *remotehost,struct in_addr addr) int i; if ((hp = sys_gethostbyname(remotehost)) == 0) { - DEBUG(0,("sys_gethostbyname(%s): lookup failure.\n", remotehost)); + DEBUG(1,("sys_gethostbyname(%s): lookup failure.\n", remotehost)); return False; } @@ -1121,7 +1121,7 @@ static BOOL matchname(char *remotehost,struct in_addr addr) if (!strequal(remotehost, hp->h_name) && !strequal(remotehost, "localhost")) { - DEBUG(0,("host name/name mismatch: %s != %s\n", + DEBUG(1,("host name/name mismatch: %s != %s\n", remotehost, hp->h_name)); return False; } @@ -1138,7 +1138,7 @@ static BOOL matchname(char *remotehost,struct in_addr addr) * it, but that could be dangerous, too. */ - DEBUG(0,("host name/address mismatch: %s != %s\n", + DEBUG(1,("host name/address mismatch: %s != %s\n", inet_ntoa(addr), hp->h_name)); return False; } @@ -1185,7 +1185,7 @@ char *get_peer_name(int fd, BOOL force_lookup) } else { pstrcpy(name_buf,(char *)hp->h_name); if (!matchname(name_buf, addr)) { - DEBUG(0,("Matchname failed on %s %s\n",name_buf,p)); + DEBUG(1,("Matchname failed on %s %s\n",name_buf,p)); pstrcpy(name_buf,"UNKNOWN"); } } @@ -1221,7 +1221,7 @@ char *get_peer_addr(int fd) } if (getpeername(fd, &sa, &length) < 0) { - DEBUG(0,("getpeername failed. Error was %s\n", strerror(errno) )); + DEBUG(1,("getpeername failed. Error was %s\n", strerror(errno) )); return addr_buf; } @@ -1257,26 +1257,26 @@ int create_pipe_sock(const char *socket_dir, if (errno == ENOENT) { /* Create directory */ if (mkdir(socket_dir, dir_perms) == -1) { - DEBUG(0, ("error creating socket directory " + DEBUG(1, ("error creating socket directory " "%s: %s\n", socket_dir, strerror(errno))); goto out_umask; } } else { - DEBUG(0, ("lstat failed on socket directory %s: %s\n", + DEBUG(1, ("lstat failed on socket directory %s: %s\n", socket_dir, strerror(errno))); goto out_umask; } } else { /* Check ownership and permission on existing directory */ if (!S_ISDIR(st.st_mode)) { - DEBUG(0, ("socket directory %s isn't a directory\n", + DEBUG(1, ("socket directory %s isn't a directory\n", socket_dir)); goto out_umask; } if ((st.st_uid != sec_initial_uid()) || ((st.st_mode & 0777) != dir_perms)) { - DEBUG(0, ("invalid permissions on socket directory " + DEBUG(1, ("invalid permissions on socket directory " "%s\n", socket_dir)); goto out_umask; } @@ -1299,13 +1299,13 @@ int create_pipe_sock(const char *socket_dir, safe_strcpy(sunaddr.sun_path, path, sizeof(sunaddr.sun_path)-1); if (bind(sock, (struct sockaddr *)&sunaddr, sizeof(sunaddr)) == -1) { - DEBUG(0, ("bind failed on pipe socket %s: %s\n", path, + DEBUG(1, ("bind failed on pipe socket %s: %s\n", path, strerror(errno))); goto out_close; } if (listen(sock, 5) == -1) { - DEBUG(0, ("listen failed on pipe socket %s: %s\n", path, + DEBUG(1, ("listen failed on pipe socket %s: %s\n", path, strerror(errno))); goto out_close; } @@ -1321,7 +1321,7 @@ out_umask: return -1; #else - DEBUG(0, ("create_pipe_sock: No Unix sockets on this system\n")); + DEBUG(1, ("create_pipe_sock: No Unix sockets on this system\n")); return -1; #endif /* HAVE_UNIXSOCKET */ } diff --git a/release/src/router/samba3/source/libsmb/nmblib.c b/release/src/router/samba3/source/libsmb/nmblib.c index 641473bea1..3a9609c465 100644 --- a/release/src/router/samba3/source/libsmb/nmblib.c +++ b/release/src/router/samba3/source/libsmb/nmblib.c @@ -789,7 +789,7 @@ static BOOL send_udp(int fd,char *buf,int len,struct in_addr ip,int port) } if (!ret) - DEBUG(0,("Packet send failed to %s(%d) ERRNO=%s\n", + DEBUG(1,("Packet send failed to %s(%d) ERRNO=%s\n", inet_ntoa(ip),port,strerror(errno))); if (ret) @@ -1018,7 +1018,7 @@ struct packet_struct *receive_packet(int fd,enum packet_type type,int t) if ((ret = sys_select_intr(fd+1,&fds,NULL,NULL,&timeout)) == -1) { /* errno should be EBADF or EINVAL. */ - DEBUG(0,("select returned -1, errno = %s (%d)\n", strerror(errno), errno)); + DEBUG(1,("select returned -1, errno = %s (%d)\n", strerror(errno), errno)); return NULL; } diff --git a/release/src/router/samba3/source/nmbd/asyncdns.c b/release/src/router/samba3/source/nmbd/asyncdns.c index 0c7a1e50b7..7826069914 100644 --- a/release/src/router/samba3/source/nmbd/asyncdns.c +++ b/release/src/router/samba3/source/nmbd/asyncdns.c @@ -148,7 +148,7 @@ void start_async_dns(void) fd_out = fd2[1]; close(fd1[1]); close(fd2[0]); - DEBUG(0,("started asyncdns process %d\n", (int)child_pid)); + DEBUG(1,("started asyncdns process %d\n", (int)child_pid)); return; } diff --git a/release/src/router/samba3/source/nmbd/nmbd.c b/release/src/router/samba3/source/nmbd/nmbd.c index 5ecbcb6908..e3d60e869b 100644 --- a/release/src/router/samba3/source/nmbd/nmbd.c +++ b/release/src/router/samba3/source/nmbd/nmbd.c @@ -55,7 +55,7 @@ time_t StartupTime = 0; static void terminate(void) { - DEBUG(0,("Got SIGTERM: going down...\n")); + DEBUG(1,("Got SIGTERM: going down...\n")); /* Write out wins.dat file if samba is a WINS server */ wins_write_database(0,False); @@ -585,7 +585,7 @@ static void process(void) */ if(reload_after_sighup) { - DEBUG( 0, ( "Got SIGHUP dumping debug info.\n" ) ); + DEBUG( 1, ( "Got SIGHUP dumping debug info.\n" ) ); msg_reload_nmbd_services(MSG_SMB_CONF_UPDATED, pid_to_procid(0), NULL, 0, NULL); reload_after_sighup = 0; @@ -720,8 +720,8 @@ static BOOL open_sockets(BOOL isdaemon, int port) reopen_logs(); - DEBUG( 0, ( "Netbios nameserver version %s started.\n", SAMBA_VERSION_STRING) ); - DEBUGADD( 0, ( "%s\n", COPYRIGHT_STARTUP_MESSAGE ) ); + DEBUG( 1, ( "Netbios nameserver version %s started.\n%s\n", + SAMBA_VERSION_STRING, COPYRIGHT_STARTUP_MESSAGE ) ); if ( !reload_nmbd_services(False) ) return(-1); diff --git a/release/src/router/samba3/source/nmbd/nmbd_become_dmb.c b/release/src/router/samba3/source/nmbd/nmbd_become_dmb.c index 523ec6cabf..7bf4b4312b 100644 --- a/release/src/router/samba3/source/nmbd/nmbd_become_dmb.c +++ b/release/src/router/samba3/source/nmbd/nmbd_become_dmb.c @@ -111,10 +111,9 @@ in workgroup %s on subnet %s\n", subrec->work_changed = True; if( DEBUGLVL( 0 ) ) { - dbgtext( "*****\n\nSamba server %s ", global_myname() ); - dbgtext( "is now a domain master browser for " ); - dbgtext( "workgroup %s ", work->work_group ); - dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name ); + dbgtext( "Samba server %s is now a domain master browser for " + "workgroup %s on subnet %s\n", + global_myname(), work->work_group, subrec->subnet_name ); } if( subrec == unicast_subnet ) { @@ -231,10 +230,9 @@ static void become_domain_master_query_success(struct subnet_record *subrec, become_domain_master_stage1(subrec, name); } else { if( DEBUGLVL( 0 ) ) { - dbgtext( "become_domain_master_query_success:\n" ); - dbgtext( "There is already a domain master browser at " ); - dbgtext( "IP %s for workgroup %s ", inet_ntoa(ip), name ); - dbgtext( "registered on subnet %s.\n", subrec->subnet_name ); + dbgtext( "There is already a domain master browser at " + "IP %s for workgroup %s registered on subnet %s.\n", + inet_ntoa(ip), name, subrec->subnet_name ); } } } @@ -287,7 +285,7 @@ static void become_domain_master_browser_bcast(const char *workgroup_name) */ if (find_name_on_subnet(subrec, &nmbname, FIND_SELF_NAME) == NULL) { - if( DEBUGLVL( 0 ) ) { + if( DEBUGLVL( 1 ) ) { dbgtext( "become_domain_master_browser_bcast:\n" ); dbgtext( "Attempting to become domain master browser on " ); dbgtext( "workgroup %s on subnet %s\n", @@ -299,7 +297,7 @@ static void become_domain_master_browser_bcast(const char *workgroup_name) we can become a domain controller. */ - DEBUG(0,("become_domain_master_browser_bcast: querying subnet %s \ + DEBUG(1,("become_domain_master_browser_bcast: querying subnet %s \ for domain master browser on workgroup %s\n", subrec->subnet_name, workgroup_name)); query_name(subrec, workgroup_name, nmbname.name_type, @@ -332,7 +330,7 @@ static void become_domain_master_browser_wins(const char *workgroup_name) */ if (find_name_on_subnet(unicast_subnet, &nmbname, FIND_SELF_NAME) == NULL) { - if( DEBUGLVL( 0 ) ) { + if( DEBUGLVL( 1 ) ) { dbgtext( "become_domain_master_browser_wins:\n" ); dbgtext( "Attempting to become domain master browser " ); dbgtext( "on workgroup %s, subnet %s.\n", @@ -344,7 +342,7 @@ static void become_domain_master_browser_wins(const char *workgroup_name) we can become a domain master browser. */ - DEBUG(0,("become_domain_master_browser_wins: querying WINS server from IP %s \ + DEBUG(1,("become_domain_master_browser_wins: querying WINS server from IP %s \ for domain master browser name %s on workgroup %s\n", inet_ntoa(unicast_subnet->myip), nmb_namestr(&nmbname), workgroup_name)); diff --git a/release/src/router/samba3/source/nmbd/nmbd_become_lmb.c b/release/src/router/samba3/source/nmbd/nmbd_become_lmb.c index b928a8a7c5..d08d956c8a 100644 --- a/release/src/router/samba3/source/nmbd/nmbd_become_lmb.c +++ b/release/src/router/samba3/source/nmbd/nmbd_become_lmb.c @@ -147,11 +147,9 @@ static void unbecome_local_master_success(struct subnet_record *subrec, reset_workgroup_state( subrec, relname, force_new_election ); if( DEBUGLVL( 0 ) ) { - dbgtext( "*****\n\n" ); - dbgtext( "Samba name server %s ", global_myname() ); - dbgtext( "has stopped being a local master browser " ); - dbgtext( "for workgroup %s ", relname ); - dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name ); + dbgtext( "Samba name server %s has stopped being a local master browser " + "for workgroup %s on subnet %s\n", + global_myname(), relname, subrec->subnet_name ); } } @@ -183,11 +181,9 @@ Removing from namelist anyway.\n", nmb_namestr(fail_name))); reset_workgroup_state( subrec, failname, force_new_election ); if( DEBUGLVL( 0 ) ) { - dbgtext( "*****\n\n" ); - dbgtext( "Samba name server %s ", global_myname() ); - dbgtext( "has stopped being a local master browser " ); - dbgtext( "for workgroup %s ", failname ); - dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name ); + dbgtext( "Samba name server %s has stopped being a local master browser " + "for workgroup %s on subnet %s\n", + global_myname(), failname, subrec->subnet_name ); } } @@ -394,11 +390,9 @@ on subnet %s\n", work->work_group, subrec->subnet_name)); reset_announce_timer(); if( DEBUGLVL( 0 ) ) { - dbgtext( "*****\n\n" ); - dbgtext( "Samba name server %s ", global_myname() ); - dbgtext( "is now a local master browser " ); - dbgtext( "for workgroup %s ", work->work_group ); - dbgtext( "on subnet %s\n\n*****\n", subrec->subnet_name ); + dbgtext( "Samba name server %s is now a local master browser " + "for workgroup %s on subnet %s\n", + global_myname(), work->work_group, subrec->subnet_name ); } } @@ -516,7 +510,7 @@ void become_local_master_browser(struct subnet_record *subrec, struct work_recor /* Sanity check. */ if (!lp_local_master()) { - DEBUG(0,("become_local_master_browser: Samba not configured as a local master browser.\n")); + DEBUG(1,("become_local_master_browser: Samba not configured as a local master browser.\n")); return; } diff --git a/release/src/router/samba3/source/nmbd/nmbd_incomingrequests.c b/release/src/router/samba3/source/nmbd/nmbd_incomingrequests.c index eaef7097b4..f22a967e56 100644 --- a/release/src/router/samba3/source/nmbd/nmbd_incomingrequests.c +++ b/release/src/router/samba3/source/nmbd/nmbd_incomingrequests.c @@ -75,7 +75,7 @@ void process_name_release_request(struct subnet_record *subrec, the request was malformed. Either way, log an error here. and send an error reply back. */ - DEBUG(0,("process_name_release_request: unicast name release request \ + DEBUG(1,("process_name_release_request: unicast name release request \ received for name %s from IP %s on subnet %s. Error - should be sent to WINS server\n", nmb_namestr(question), inet_ntoa(owner_ip), subrec->subnet_name)); @@ -167,10 +167,9 @@ void process_name_refresh_request(struct subnet_record *subrec, the request was malformed. Either way, log an error here. and send an error reply back. */ - DEBUG(0,("process_name_refresh_request: unicast name registration request \ -received for name %s from IP %s on subnet %s.\n", + DEBUG(1,("process_name_refresh_request: unicast name registration request \ +received for name %s from IP %s on subnet %s. Error - should be sent to WINS server\n", nmb_namestr(question), inet_ntoa(from_ip), subrec->subnet_name)); - DEBUG(0,("Error - should be sent to WINS server\n")); send_name_registration_response(FMT_ERR, 0, p); return; @@ -208,7 +207,7 @@ void process_name_registration_request(struct subnet_record *subrec, the request was malformed. Either way, log an error here. and send an error reply back. */ - DEBUG(0,("process_name_registration_request: unicast name registration request \ + DEBUG(1,("process_name_registration_request: unicast name registration request \ received for name %s from IP %s on subnet %s. Error - should be sent to WINS server\n", nmb_namestr(question), inet_ntoa(from_ip), subrec->subnet_name)); diff --git a/release/src/router/samba3/source/nmbd/nmbd_workgroupdb.c b/release/src/router/samba3/source/nmbd/nmbd_workgroupdb.c index ca665bdf4f..6071a8c29a 100644 --- a/release/src/router/samba3/source/nmbd/nmbd_workgroupdb.c +++ b/release/src/router/samba3/source/nmbd/nmbd_workgroupdb.c @@ -273,7 +273,7 @@ on subnet %s\n", name, subrec->subnet_name)); void dump_workgroups(BOOL force_write) { struct subnet_record *subrec; - int debuglevel = force_write ? 0 : 4; + int debuglevel = force_write ? 1 : 4; for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) { if (subrec->workgrouplist) { diff --git a/release/src/router/samba3/source/passdb/pdb_smbpasswd.c b/release/src/router/samba3/source/passdb/pdb_smbpasswd.c index 18fbe88859..fe69ad2317 100644 --- a/release/src/router/samba3/source/passdb/pdb_smbpasswd.c +++ b/release/src/router/samba3/source/passdb/pdb_smbpasswd.c @@ -188,7 +188,7 @@ static FILE *startsmbfilepwent(const char *pfile, enum pwf_access_type type, int int lock_type = F_RDLCK; if (!*pfile) { - DEBUG(0, ("startsmbfilepwent: No SMB password file set\n")); + DEBUG(1, ("startsmbfilepwent: No SMB password file set\n")); return (NULL); } @@ -215,7 +215,7 @@ static FILE *startsmbfilepwent(const char *pfile, enum pwf_access_type type, int sys_usleep(200); /* Spin, spin... */ } if(fd == -1) { - DEBUG(0,("startsmbfilepwent_internal: too many race conditions \ + DEBUG(1,("startsmbfilepwent_internal: too many race conditions \ creating file %s\n", pfile)); return NULL; } @@ -237,23 +237,23 @@ creating file %s\n", pfile)); */ if (errno == ENOENT) { if ((fp = sys_fopen(pfile, "a+")) != NULL) { - DEBUG(0, ("startsmbfilepwent_internal: file %s did not \ + DEBUG(1, ("startsmbfilepwent_internal: file %s did not \ exist. File successfully created.\n", pfile)); } else { - DEBUG(0, ("startsmbfilepwent_internal: file %s did not \ + DEBUG(1, ("startsmbfilepwent_internal: file %s did not \ exist. Couldn't create new one. Error was: %s", pfile, strerror(errno))); return NULL; } } else { - DEBUG(0, ("startsmbfilepwent_internal: unable to open file %s. \ + DEBUG(1, ("startsmbfilepwent_internal: unable to open file %s. \ Error was: %s\n", pfile, strerror(errno))); return NULL; } } if (!pw_file_lock(fileno(fp), lock_type, 5, lock_depth)) { - DEBUG(0, ("startsmbfilepwent_internal: unable to lock file %s. \ + DEBUG(1, ("startsmbfilepwent_internal: unable to lock file %s. \ Error was %s\n", pfile, strerror(errno) )); fclose(fp); return NULL; @@ -278,7 +278,7 @@ Error was %s\n", pfile, strerror(errno) )); */ if (sys_stat(pfile,&sbuf1) != 0) { - DEBUG(0, ("startsmbfilepwent_internal: unable to stat file %s. \ + DEBUG(1, ("startsmbfilepwent_internal: unable to stat file %s. \ Error was %s\n", pfile, strerror(errno))); pw_file_unlock(fileno(fp), lock_depth); fclose(fp); @@ -286,7 +286,7 @@ Error was %s\n", pfile, strerror(errno))); } if (sys_fstat(fileno(fp),&sbuf2) != 0) { - DEBUG(0, ("startsmbfilepwent_internal: unable to fstat file %s. \ + DEBUG(1, ("startsmbfilepwent_internal: unable to fstat file %s. \ Error was %s\n", pfile, strerror(errno))); pw_file_unlock(fileno(fp), lock_depth); fclose(fp); @@ -308,7 +308,7 @@ Error was %s\n", pfile, strerror(errno))); } if(race_loop == 5) { - DEBUG(0, ("startsmbfilepwent_internal: too many race conditions opening file %s\n", pfile)); + DEBUG(1, ("startsmbfilepwent_internal: too many race conditions opening file %s\n", pfile)); return NULL; } @@ -321,7 +321,7 @@ Error was %s\n", pfile, strerror(errno))); #else if(chmod(pfile, S_IRUSR|S_IWUSR) == -1) { #endif - DEBUG(0, ("startsmbfilepwent_internal: failed to set 0600 permissions on password file %s. \ + DEBUG(1, ("startsmbfilepwent_internal: failed to set 0600 permissions on password file %s. \ Error was %s\n.", pfile, strerror(errno) )); pw_file_unlock(fileno(fp), lock_depth); fclose(fp); @@ -366,7 +366,7 @@ static struct smb_passwd *getsmbfilepwent(struct smbpasswd_privates *smbpasswd_s char *status; if(fp == NULL) { - DEBUG(0,("getsmbfilepwent: Bad password file pointer.\n")); + DEBUG(1,("getsmbfilepwent: Bad password file pointer.\n")); return NULL; } @@ -434,7 +434,7 @@ static struct smb_passwd *getsmbfilepwent(struct smbpasswd_privates *smbpasswd_s } p = (unsigned char *) strchr_m(linebuf, ':'); if (p == NULL) { - DEBUG(0, ("getsmbfilepwent: malformed password entry (no :)\n")); + DEBUG(1, ("getsmbfilepwent: malformed password entry (no :)\n")); continue; } @@ -452,12 +452,12 @@ static struct smb_passwd *getsmbfilepwent(struct smbpasswd_privates *smbpasswd_s p++; /* Go past ':' */ if(*p == '-') { - DEBUG(0, ("getsmbfilepwent: user name %s has a negative uid.\n", user_name)); + DEBUG(1, ("getsmbfilepwent: user name %s has a negative uid.\n", user_name)); continue; } if (!isdigit(*p)) { - DEBUG(0, ("getsmbfilepwent: malformed password entry for user %s (uid not number)\n", + DEBUG(1, ("getsmbfilepwent: malformed password entry for user %s (uid not number)\n", user_name)); continue; } @@ -469,7 +469,7 @@ static struct smb_passwd *getsmbfilepwent(struct smbpasswd_privates *smbpasswd_s } if (*p != ':') { - DEBUG(0, ("getsmbfilepwent: malformed password entry for user %s (no : after uid)\n", + DEBUG(1, ("getsmbfilepwent: malformed password entry for user %s (no : after uid)\n", user_name)); continue; } @@ -487,13 +487,13 @@ static struct smb_passwd *getsmbfilepwent(struct smbpasswd_privates *smbpasswd_s p++; if (linebuf_len < (PTR_DIFF(p, linebuf) + 33)) { - DEBUG(0, ("getsmbfilepwent: malformed password entry for user %s (passwd too short)\n", + DEBUG(1, ("getsmbfilepwent: malformed password entry for user %s (passwd too short)\n", user_name )); continue; } if (p[32] != ':') { - DEBUG(0, ("getsmbfilepwent: malformed password entry for user %s (no terminating :)\n", + DEBUG(1, ("getsmbfilepwent: malformed password entry for user %s (no terminating :)\n", user_name)); continue; } @@ -510,7 +510,7 @@ static struct smb_passwd *getsmbfilepwent(struct smbpasswd_privates *smbpasswd_s pw_buf->smb_passwd = smbpwd; } else { pw_buf->smb_passwd = NULL; - DEBUG(0, ("getsmbfilepwent: Malformed Lanman password entry for user %s \ + DEBUG(1, ("getsmbfilepwent: Malformed Lanman password entry for user %s \ (non hex chars)\n", user_name)); } } @@ -600,7 +600,7 @@ static char *format_new_smbpasswd_entry(const struct smb_passwd *newpwd) NEW_PW_FORMAT_SPACE_PADDED_LEN + 1 + 13 + 2; if((new_entry = (char *)SMB_MALLOC( new_entry_length )) == NULL) { - DEBUG(0, ("format_new_smbpasswd_entry: Malloc failed adding entry for user %s.\n", + DEBUG(1, ("format_new_smbpasswd_entry: Malloc failed adding entry for user %s.\n", newpwd->smb_name )); return NULL; } @@ -651,7 +651,7 @@ static NTSTATUS add_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, } if (fp == NULL) { - DEBUG(0, ("add_smbfilepwd_entry: unable to open file.\n")); + DEBUG(1, ("add_smbfilepwd_entry: unable to open file.\n")); return map_nt_error_from_unix(errno); } @@ -661,7 +661,7 @@ static NTSTATUS add_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, while ((pwd = getsmbfilepwent(smbpasswd_state, fp)) != NULL) { if (strequal(newpwd->smb_name, pwd->smb_name)) { - DEBUG(0, ("add_smbfilepwd_entry: entry with name %s already exists\n", pwd->smb_name)); + DEBUG(1, ("add_smbfilepwd_entry: entry with name %s already exists\n", pwd->smb_name)); endsmbfilepwent(fp, &smbpasswd_state->pw_file_lock_depth); return NT_STATUS_USER_EXISTS; } @@ -678,14 +678,14 @@ static NTSTATUS add_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, if((offpos = sys_lseek(fd, 0, SEEK_END)) == -1) { NTSTATUS result = map_nt_error_from_unix(errno); - DEBUG(0, ("add_smbfilepwd_entry(sys_lseek): Failed to add entry for user %s to file %s. \ + DEBUG(1, ("add_smbfilepwd_entry(sys_lseek): Failed to add entry for user %s to file %s. \ Error was %s\n", newpwd->smb_name, pfile, strerror(errno))); endsmbfilepwent(fp, &smbpasswd_state->pw_file_lock_depth); return result; } if((new_entry = format_new_smbpasswd_entry(newpwd)) == NULL) { - DEBUG(0, ("add_smbfilepwd_entry(malloc): Failed to add entry for user %s to file %s. \ + DEBUG(1, ("add_smbfilepwd_entry(malloc): Failed to add entry for user %s to file %s. \ Error was %s\n", newpwd->smb_name, pfile, strerror(errno))); endsmbfilepwent(fp, &smbpasswd_state->pw_file_lock_depth); return NT_STATUS_NO_MEMORY; @@ -700,12 +700,12 @@ Error was %s\n", newpwd->smb_name, pfile, strerror(errno))); if ((wr_len = write(fd, new_entry, new_entry_length)) != new_entry_length) { NTSTATUS result = map_nt_error_from_unix(errno); - DEBUG(0, ("add_smbfilepwd_entry(write): %d Failed to add entry for user %s to file %s. \ + DEBUG(1, ("add_smbfilepwd_entry(write): %d Failed to add entry for user %s to file %s. \ Error was %s\n", wr_len, newpwd->smb_name, pfile, strerror(errno))); /* Remove the entry we just wrote. */ if(sys_ftruncate(fd, offpos) == -1) { - DEBUG(0, ("add_smbfilepwd_entry: ERROR failed to ftruncate file %s. \ + DEBUG(1, ("add_smbfilepwd_entry: ERROR failed to ftruncate file %s. \ Error was %s. Password file may be corrupt ! Please examine by hand !\n", newpwd->smb_name, strerror(errno))); } @@ -755,7 +755,7 @@ static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con int fd; if (!*pfile) { - DEBUG(0, ("No SMB password file set\n")); + DEBUG(1, ("No SMB password file set\n")); return False; } DEBUG(10, ("mod_smbfilepwd_entry: opening file %s\n", pfile)); @@ -763,7 +763,7 @@ static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con fp = sys_fopen(pfile, "r+"); if (fp == NULL) { - DEBUG(0, ("mod_smbfilepwd_entry: unable to open file %s\n", pfile)); + DEBUG(1, ("mod_smbfilepwd_entry: unable to open file %s\n", pfile)); return False; } /* Set a buffer to do more efficient reads */ @@ -772,7 +772,7 @@ static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con lockfd = fileno(fp); if (!pw_file_lock(lockfd, F_WRLCK, 5, &smbpasswd_state->pw_file_lock_depth)) { - DEBUG(0, ("mod_smbfilepwd_entry: unable to lock file %s\n", pfile)); + DEBUG(1, ("mod_smbfilepwd_entry: unable to lock file %s\n", pfile)); fclose(fp); return False; } @@ -844,7 +844,7 @@ static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con p = (unsigned char *) strchr_m(linebuf, ':'); if (p == NULL) { - DEBUG(0, ("mod_smbfilepwd_entry: malformed password entry (no :)\n")); + DEBUG(1, ("mod_smbfilepwd_entry: malformed password entry (no :)\n")); continue; } @@ -878,7 +878,7 @@ static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con p++; /* Go past ':' */ if (!isdigit(*p)) { - DEBUG(0, ("mod_smbfilepwd_entry: malformed password entry for user %s (uid not number)\n", + DEBUG(1, ("mod_smbfilepwd_entry: malformed password entry for user %s (uid not number)\n", pwd->smb_name)); pw_file_unlock(lockfd, &smbpasswd_state->pw_file_lock_depth); fclose(fp); @@ -889,7 +889,7 @@ static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con p++; } if (*p != ':') { - DEBUG(0, ("mod_smbfilepwd_entry: malformed password entry for user %s (no : after uid)\n", + DEBUG(1, ("mod_smbfilepwd_entry: malformed password entry for user %s (no : after uid)\n", pwd->smb_name)); pw_file_unlock(lockfd, &smbpasswd_state->pw_file_lock_depth); fclose(fp); @@ -907,7 +907,7 @@ static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con pwd_seekpos += PTR_DIFF(p, linebuf); if (linebuf_len < (PTR_DIFF(p, linebuf) + 33)) { - DEBUG(0, ("mod_smbfilepwd_entry: malformed password entry for user %s (passwd too short)\n", + DEBUG(1, ("mod_smbfilepwd_entry: malformed password entry for user %s (passwd too short)\n", pwd->smb_name)); pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth); fclose(fp); @@ -915,7 +915,7 @@ static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con } if (p[32] != ':') { - DEBUG(0, ("mod_smbfilepwd_entry: malformed password entry for user %s (no terminating :)\n", + DEBUG(1, ("mod_smbfilepwd_entry: malformed password entry for user %s (no terminating :)\n", pwd->smb_name)); pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth); fclose(fp); @@ -925,7 +925,7 @@ static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con /* Now check if the NT compatible password is available. */ p += 33; /* Move to the first character of the line after the lanman password. */ if (linebuf_len < (PTR_DIFF(p, linebuf) + 33)) { - DEBUG(0, ("mod_smbfilepwd_entry: malformed password entry for user %s (passwd too short)\n", + DEBUG(1, ("mod_smbfilepwd_entry: malformed password entry for user %s (passwd too short)\n", pwd->smb_name)); pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth); fclose(fp); @@ -933,7 +933,7 @@ static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con } if (p[32] != ':') { - DEBUG(0, ("mod_smbfilepwd_entry: malformed password entry for user %s (no terminating :)\n", + DEBUG(1, ("mod_smbfilepwd_entry: malformed password entry for user %s (no terminating :)\n", pwd->smb_name)); pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth); fclose(fp); @@ -964,9 +964,9 @@ static BOOL mod_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con */ fstrcpy(encode_bits, pdb_encode_acct_ctrl(pwd->acct_ctrl, NEW_PW_FORMAT_SPACE_PADDED_LEN)); } else { - DEBUG(0,("mod_smbfilepwd_entry: Using old smbpasswd format for user %s. \ + DEBUG(1,("mod_smbfilepwd_entry: Using old smbpasswd format for user %s. \ This is no longer supported.!\n", pwd->smb_name)); - DEBUG(0,("mod_smbfilepwd_entry: No changes made, failing.!\n")); + DEBUG(1,("mod_smbfilepwd_entry: No changes made, failing.!\n")); pw_file_unlock(lockfd, &smbpasswd_state->pw_file_lock_depth); fclose(fp); return False; @@ -1027,7 +1027,7 @@ This is no longer supported.!\n", pwd->smb_name)); #endif if(wr_len > sizeof(linebuf)) { - DEBUG(0, ("mod_smbfilepwd_entry: line to write (%d) is too long.\n", wr_len+1)); + DEBUG(1, ("mod_smbfilepwd_entry: line to write (%d) is too long.\n", wr_len+1)); pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth); fclose(fp); return (False); @@ -1045,7 +1045,7 @@ This is no longer supported.!\n", pwd->smb_name)); fd = fileno(fp); if (sys_lseek(fd, pwd_seekpos - 1, SEEK_SET) != pwd_seekpos - 1) { - DEBUG(0, ("mod_smbfilepwd_entry: seek fail on file %s.\n", pfile)); + DEBUG(1, ("mod_smbfilepwd_entry: seek fail on file %s.\n", pfile)); pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth); fclose(fp); return False; @@ -1053,28 +1053,28 @@ This is no longer supported.!\n", pwd->smb_name)); /* Sanity check - ensure the areas we are writing are framed by ':' */ if (read(fd, linebuf, wr_len+1) != wr_len+1) { - DEBUG(0, ("mod_smbfilepwd_entry: read fail on file %s.\n", pfile)); + DEBUG(1, ("mod_smbfilepwd_entry: read fail on file %s.\n", pfile)); pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth); fclose(fp); return False; } if ((linebuf[0] != ':') || (linebuf[wr_len] != ':')) { - DEBUG(0, ("mod_smbfilepwd_entry: check on passwd file %s failed.\n", pfile)); + DEBUG(1, ("mod_smbfilepwd_entry: check on passwd file %s failed.\n", pfile)); pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth); fclose(fp); return False; } if (sys_lseek(fd, pwd_seekpos, SEEK_SET) != pwd_seekpos) { - DEBUG(0, ("mod_smbfilepwd_entry: seek fail on file %s.\n", pfile)); + DEBUG(1, ("mod_smbfilepwd_entry: seek fail on file %s.\n", pfile)); pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth); fclose(fp); return False; } if (write(fd, ascii_p16, wr_len) != wr_len) { - DEBUG(0, ("mod_smbfilepwd_entry: write failed in passwd file %s\n", pfile)); + DEBUG(1, ("mod_smbfilepwd_entry: write failed in passwd file %s\n", pfile)); pw_file_unlock(lockfd,&smbpasswd_state->pw_file_lock_depth); fclose(fp); return False; @@ -1107,7 +1107,7 @@ static BOOL del_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con */ if((fp = startsmbfilepwent(pfile, PWF_UPDATE, &smbpasswd_state->pw_file_lock_depth)) == NULL) { - DEBUG(0, ("del_smbfilepwd_entry: unable to open file %s.\n", pfile)); + DEBUG(1, ("del_smbfilepwd_entry: unable to open file %s.\n", pfile)); return False; } @@ -1115,7 +1115,7 @@ static BOOL del_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con * Create the replacement password file. */ if((fp_write = startsmbfilepwent(pfile2, PWF_CREATE, &pfile2_lockdepth)) == NULL) { - DEBUG(0, ("del_smbfilepwd_entry: unable to open file %s.\n", pfile)); + DEBUG(1, ("del_smbfilepwd_entry: unable to open file %s.\n", pfile)); endsmbfilepwent(fp, &smbpasswd_state->pw_file_lock_depth); return False; } @@ -1139,7 +1139,7 @@ static BOOL del_smbfilepwd_entry(struct smbpasswd_privates *smbpasswd_state, con */ if((new_entry = format_new_smbpasswd_entry(pwd)) == NULL) { - DEBUG(0, ("del_smbfilepwd_entry(malloc): Failed to copy entry for user %s to file %s. \ + DEBUG(1, ("del_smbfilepwd_entry(malloc): Failed to copy entry for user %s to file %s. \ Error was %s\n", pwd->smb_name, pfile2, strerror(errno))); unlink(pfile2); endsmbfilepwent(fp, &smbpasswd_state->pw_file_lock_depth); @@ -1150,7 +1150,7 @@ Error was %s\n", pwd->smb_name, pfile2, strerror(errno))); new_entry_length = strlen(new_entry); if(fwrite(new_entry, 1, new_entry_length, fp_write) != new_entry_length) { - DEBUG(0, ("del_smbfilepwd_entry(write): Failed to copy entry for user %s to file %s. \ + DEBUG(1, ("del_smbfilepwd_entry(write): Failed to copy entry for user %s to file %s. \ Error was %s\n", pwd->smb_name, pfile2, strerror(errno))); unlink(pfile2); endsmbfilepwent(fp, &smbpasswd_state->pw_file_lock_depth); @@ -1167,7 +1167,7 @@ Error was %s\n", pwd->smb_name, pfile2, strerror(errno))); */ if(fflush(fp_write) != 0) { - DEBUG(0, ("del_smbfilepwd_entry: Failed to flush file %s. Error was %s\n", pfile2, strerror(errno))); + DEBUG(1, ("del_smbfilepwd_entry: Failed to flush file %s. Error was %s\n", pfile2, strerror(errno))); endsmbfilepwent(fp, &smbpasswd_state->pw_file_lock_depth); endsmbfilepwent(fp_write,&pfile2_lockdepth); return False; @@ -1207,7 +1207,7 @@ static BOOL build_smb_pass (struct smb_passwd *smb_pw, const struct samu *sampas if (rid == DOMAIN_USER_RID_GUEST) { struct passwd *passwd = getpwnam_alloc(NULL, lp_guestaccount()); if (!passwd) { - DEBUG(0, ("Could not find guest account via getpwnam()! (%s)\n", lp_guestaccount())); + DEBUG(1, ("Could not find guest account via getpwnam()! (%s)\n", lp_guestaccount())); return False; } smb_pw->smb_userid=passwd->pw_uid; @@ -1215,7 +1215,7 @@ static BOOL build_smb_pass (struct smb_passwd *smb_pw, const struct samu *sampas } else if (algorithmic_pdb_rid_is_user(rid)) { smb_pw->smb_userid=algorithmic_pdb_user_rid_to_uid(rid); } else { - DEBUG(0,("build_sam_pass: Failing attempt to store user with non-uid based user RID. \n")); + DEBUG(1,("build_sam_pass: Failing attempt to store user with non-uid based user RID. \n")); return False; } } @@ -1248,7 +1248,7 @@ static BOOL build_sam_account(struct smbpasswd_privates *smbpasswd_state, /* verify the user account exists */ if ( !(pwfile = Get_Pwnam_alloc(NULL, pw_buf->smb_name )) ) { - DEBUG(0,("build_sam_account: smbpasswd database is corrupt! username %s with uid " + DEBUG(1,("build_sam_account: smbpasswd database is corrupt! username %s with uid " "%u is not in unix passwd database!\n", pw_buf->smb_name, pw_buf->smb_userid)); return False; } @@ -1286,7 +1286,7 @@ static NTSTATUS smbpasswd_setsampwent (struct pdb_methods *my_methods, BOOL upda FILE *fp; /* slprintf(msg_str,msg_str_len-1, "smbpasswd file did not exist - attempting to create it.\n"); */ - DEBUG(0,("smbpasswd file did not exist - attempting to create it.\n")); + DEBUG(1,("smbpasswd file did not exist - attempting to create it.\n")); fp = sys_fopen(smbpasswd_state->smbpasswd_file, "w"); if (fp) { fprintf(fp, "# Samba SMB password file\n"); @@ -1368,7 +1368,7 @@ static NTSTATUS smbpasswd_getsampwnam(struct pdb_methods *my_methods, fp = startsmbfilepwent(smbpasswd_state->smbpasswd_file, PWF_READ, &(smbpasswd_state->pw_file_lock_depth)); if (fp == NULL) { - DEBUG(0, ("Unable to open passdb database.\n")); + DEBUG(1, ("Unable to open passdb database.\n")); return nt_status; } @@ -1425,7 +1425,7 @@ static NTSTATUS smbpasswd_getsampwsid(struct pdb_methods *my_methods, struct sam fp = startsmbfilepwent(smbpasswd_state->smbpasswd_file, PWF_READ, &(smbpasswd_state->pw_file_lock_depth)); if (fp == NULL) { - DEBUG(0, ("Unable to open passdb database.\n")); + DEBUG(1, ("Unable to open passdb database.\n")); return nt_status; } @@ -1483,13 +1483,13 @@ static NTSTATUS smbpasswd_update_sam_account(struct pdb_methods *my_methods, str /* convert the struct samu */ if (!build_smb_pass(&smb_pw, sampass)) { - DEBUG(0, ("smbpasswd_update_sam_account: build_smb_pass failed!\n")); + DEBUG(1, ("smbpasswd_update_sam_account: build_smb_pass failed!\n")); return NT_STATUS_UNSUCCESSFUL; } /* update the entry */ if(!mod_smbfilepwd_entry(smbpasswd_state, &smb_pw)) { - DEBUG(0, ("smbpasswd_update_sam_account: mod_smbfilepwd_entry failed!\n")); + DEBUG(1, ("smbpasswd_update_sam_account: mod_smbfilepwd_entry failed!\n")); return NT_STATUS_UNSUCCESSFUL; } @@ -1616,7 +1616,7 @@ static NTSTATUS pdb_init_smbpasswd( struct pdb_methods **pdb_method, const char /* Setup private data and free function */ if ( !(privates = TALLOC_ZERO_P( *pdb_method, struct smbpasswd_privates )) ) { - DEBUG(0, ("talloc() failed for smbpasswd private_data!\n")); + DEBUG(1, ("talloc() failed for smbpasswd private_data!\n")); return NT_STATUS_NO_MEMORY; } @@ -1629,7 +1629,7 @@ static NTSTATUS pdb_init_smbpasswd( struct pdb_methods **pdb_method, const char } if (!privates->smbpasswd_file) { - DEBUG(0, ("talloc_strdp() failed for storing smbpasswd location!\n")); + DEBUG(1, ("talloc_strdp() failed for storing smbpasswd location!\n")); return NT_STATUS_NO_MEMORY; } diff --git a/release/src/router/samba3/source/rpc_server/srv_pipe.c b/release/src/router/samba3/source/rpc_server/srv_pipe.c index ce8c912a07..0e86da09c5 100644 --- a/release/src/router/samba3/source/rpc_server/srv_pipe.c +++ b/release/src/router/samba3/source/rpc_server/srv_pipe.c @@ -2382,7 +2382,7 @@ void get_pipe_fns( int idx, struct api_struct **fns, int *n_fns ) break; #endif default: - DEBUG(0,("get_pipe_fns: Unknown pipe index! [%d]\n", idx)); + DEBUG(1,("get_pipe_fns: Unknown pipe index! [%d]\n", idx)); } *fns = cmds; diff --git a/release/src/router/samba3/source/smbd/connection.c b/release/src/router/samba3/source/smbd/connection.c index 325d4a58c6..4ca25ce639 100644 --- a/release/src/router/samba3/source/smbd/connection.c +++ b/release/src/router/samba3/source/smbd/connection.c @@ -110,7 +110,7 @@ static int count_fn( TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *u DEBUG(2,("pid %s doesn't exist - deleting connections %d [%s]\n", procid_str_static(&crec.pid), crec.cnum, crec.servicename)); if (tdb_delete(the_tdb, kbuf) != 0) - DEBUG(0,("count_fn: tdb_delete failed with error %s\n", tdb_errorstr(tdb) )); + DEBUG(1,("count_fn: tdb_delete failed with error %s\n", tdb_errorstr(tdb) )); return 0; } @@ -204,7 +204,7 @@ BOOL claim_connection(connection_struct *conn, const char *name,int max_connecti dbuf.dsize = sizeof(crec); if (tdb_store(tdb, kbuf, dbuf, TDB_REPLACE) != 0) { - DEBUG(0,("claim_connection: tdb_store failed with error %s.\n", + DEBUG(1,("claim_connection: tdb_store failed with error %s.\n", tdb_errorstr(tdb) )); return False; } @@ -229,7 +229,7 @@ BOOL register_message_flags(BOOL doreg, uint32 msg_flags) dbuf = tdb_fetch(tdb, kbuf); if (!dbuf.dptr) { - DEBUG(0,("register_message_flags: tdb_fetch failed: %s\n", + DEBUG(1,("register_message_flags: tdb_fetch failed: %s\n", tdb_errorstr(tdb))); return False; } @@ -241,7 +241,7 @@ BOOL register_message_flags(BOOL doreg, uint32 msg_flags) pcrec->bcast_msg_flags &= ~msg_flags; if (tdb_store(tdb, kbuf, dbuf, TDB_REPLACE) != 0) { - DEBUG(0,("register_message_flags: tdb_store failed: %s.\n", + DEBUG(1,("register_message_flags: tdb_store failed: %s.\n", tdb_errorstr(tdb) )); SAFE_FREE(dbuf.dptr); return False; diff --git a/release/src/router/samba3/source/smbd/dir.c b/release/src/router/samba3/source/smbd/dir.c index 57ed1df6ac..9bbc874027 100644 --- a/release/src/router/samba3/source/smbd/dir.c +++ b/release/src/router/samba3/source/smbd/dir.c @@ -150,7 +150,7 @@ static void dptr_idleoldest(void) ; if(!dptr) { - DEBUG(0,("No dptrs available to idle ?\n")); + DEBUG(1,("No dptrs available to idle ?\n")); return; } @@ -245,7 +245,7 @@ static void dptr_close_internal(struct dptr_struct *dptr) */ if(bitmap_query( dptr_bmap, dptr->dnum - 1) != True) { - DEBUG(0,("dptr_close_internal : Error - closing dnum = %d and bitmap not set !\n", + DEBUG(1,("dptr_close_internal : Error - closing dnum = %d and bitmap not set !\n", dptr->dnum )); } @@ -286,7 +286,7 @@ void dptr_close(int *key) dptr = dptr_get(*key, True); if (!dptr) { - DEBUG(0,("Invalid key %d given to dptr_close\n", *key)); + DEBUG(1,("Invalid key %d given to dptr_close\n", *key)); return; } @@ -353,7 +353,7 @@ static void dptr_close_oldest(BOOL old) ; if(!dptr) { - DEBUG(0,("No old dptrs available to close oldest ?\n")); + DEBUG(1,("No old dptrs available to close oldest ?\n")); return; } @@ -418,7 +418,7 @@ NTSTATUS dptr_create(connection_struct *conn, pstring path, BOOL old_handle, BOO dptr = SMB_MALLOC_P(struct dptr_struct); if(!dptr) { - DEBUG(0,("malloc fail in dptr_create.\n")); + DEBUG(1,("malloc fail in dptr_create.\n")); CloseDir(dir_hnd); return NT_STATUS_NO_MEMORY; } @@ -447,7 +447,7 @@ NTSTATUS dptr_create(connection_struct *conn, pstring path, BOOL old_handle, BOO /* Now try again... */ dptr->dnum = bitmap_find(dptr_bmap, 0); if(dptr->dnum == -1 || dptr->dnum > 254) { - DEBUG(0,("dptr_create: returned %d: Error - all old dirptrs in use ?\n", dptr->dnum)); + DEBUG(1,("dptr_create: returned %d: Error - all old dirptrs in use ?\n", dptr->dnum)); SAFE_FREE(dptr); CloseDir(dir_hnd); return NT_STATUS_TOO_MANY_OPENED_FILES; @@ -477,7 +477,7 @@ NTSTATUS dptr_create(connection_struct *conn, pstring path, BOOL old_handle, BOO dptr->dnum = bitmap_find(dptr_bmap, 255); if(dptr->dnum == -1 || dptr->dnum < 255) { - DEBUG(0,("dptr_create: returned %d: Error - all new dirptrs in use ?\n", dptr->dnum)); + DEBUG(1,("dptr_create: returned %d: Error - all new dirptrs in use ?\n", dptr->dnum)); SAFE_FREE(dptr); CloseDir(dir_hnd); return NT_STATUS_TOO_MANY_OPENED_FILES; diff --git a/release/src/router/samba3/source/smbd/nttrans.c b/release/src/router/samba3/source/smbd/nttrans.c index 2b9d5daa4f..303da4ee2f 100644 --- a/release/src/router/samba3/source/smbd/nttrans.c +++ b/release/src/router/samba3/source/smbd/nttrans.c @@ -2459,7 +2459,7 @@ static int call_nt_transact_ioctl(connection_struct *conn, char *inbuf, char *ou default: if (!logged_message) { logged_message = True; /* Only print this once... */ - DEBUG(0,("call_nt_transact_ioctl(0x%x): Currently not implemented.\n", + DEBUG(1,("call_nt_transact_ioctl(0x%x): Currently not implemented.\n", function)); } } diff --git a/release/src/router/samba3/source/smbd/open.c b/release/src/router/samba3/source/smbd/open.c index 04f8b521d9..06a834cb2a 100644 --- a/release/src/router/samba3/source/smbd/open.c +++ b/release/src/router/samba3/source/smbd/open.c @@ -98,7 +98,7 @@ static void change_file_owner_to_parent(connection_struct *conn, ret = SMB_VFS_STAT(conn, inherit_from_dir, &parent_st); if (ret == -1) { - DEBUG(0,("change_file_owner_to_parent: failed to stat parent " + DEBUG(1,("change_file_owner_to_parent: failed to stat parent " "directory %s. Error was %s\n", inherit_from_dir, strerror(errno) )); return; @@ -108,7 +108,7 @@ static void change_file_owner_to_parent(connection_struct *conn, ret = SMB_VFS_FCHOWN(fsp, fsp->fh->fd, parent_st.st_uid, (gid_t)-1); unbecome_root(); if (ret == -1) { - DEBUG(0,("change_file_owner_to_parent: failed to fchown " + DEBUG(1,("change_file_owner_to_parent: failed to fchown " "file %s to parent directory uid %u. Error " "was %s\n", fsp->fsp_name, (unsigned int)parent_st.st_uid, @@ -132,7 +132,7 @@ static void change_dir_owner_to_parent(connection_struct *conn, ret = SMB_VFS_STAT(conn, inherit_from_dir, &parent_st); if (ret == -1) { - DEBUG(0,("change_dir_owner_to_parent: failed to stat parent " + DEBUG(1,("change_dir_owner_to_parent: failed to stat parent " "directory %s. Error was %s\n", inherit_from_dir, strerror(errno) )); return; @@ -146,7 +146,7 @@ static void change_dir_owner_to_parent(connection_struct *conn, */ if (!vfs_GetWd(conn,saved_dir)) { - DEBUG(0,("change_dir_owner_to_parent: failed to get " + DEBUG(1,("change_dir_owner_to_parent: failed to get " "current working directory\n")); return; } @@ -333,7 +333,7 @@ static NTSTATUS open_file(files_struct *fsp, ret = SMB_VFS_FSTAT(fsp,fsp->fh->fd,psbuf); /* If we have an fd, this stat should succeed. */ if (ret == -1) { - DEBUG(0,("Error doing fstat on open file %s " + DEBUG(1,("Error doing fstat on open file %s " "(%s)\n", path,strerror(errno) )); } } @@ -520,7 +520,7 @@ static void validate_my_share_entries(int num, fsp = file_find_dif(share_entry->dev, share_entry->inode, share_entry->share_file_id); if (!fsp) { - DEBUG(0,("validate_my_share_entries: PANIC : %s\n", + DEBUG(1,("validate_my_share_entries: PANIC : %s\n", share_mode_str(num, share_entry) )); smb_panic("validate_my_share_entries: Cannot match a " "share entry with an open file\n"); @@ -547,7 +547,7 @@ static void validate_my_share_entries(int num, panic: { pstring str; - DEBUG(0,("validate_my_share_entries: PANIC : %s\n", + DEBUG(1,("validate_my_share_entries: PANIC : %s\n", share_mode_str(num, share_entry) )); slprintf(str, sizeof(str)-1, "validate_my_share_entries: " "file %s, oplock_type = 0x%x, op_type = 0x%x\n", @@ -787,7 +787,7 @@ static void defer_open(struct share_mode_lock *lck, } if (procid_is_me(&e->pid) && (e->op_mid == mid)) { - DEBUG(0, ("Trying to defer an already deferred " + DEBUG(1, ("Trying to defer an already deferred " "request: mid=%d, exiting\n", mid)); exit_server("attempt to defer a deferred request"); } @@ -1199,7 +1199,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn, /* Remove the deferred open entry under lock. */ lck = get_share_mode_lock(NULL, state->dev, state->inode, NULL, NULL); if (lck == NULL) { - DEBUG(0, ("could not get share mode lock\n")); + DEBUG(1, ("could not get share mode lock\n")); } else { del_deferred_open_entry(lck, mid); TALLOC_FREE(lck); @@ -1435,7 +1435,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn, if (lck == NULL) { file_free(fsp); - DEBUG(0, ("Could not get share mode lock\n")); + DEBUG(1, ("Could not get share mode lock\n")); return NT_STATUS_SHARING_VIOLATION; } @@ -1648,7 +1648,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn, fname); if (lck == NULL) { - DEBUG(0, ("open_file_ntcreate: Could not get share " + DEBUG(1, ("open_file_ntcreate: Could not get share " "mode lock for %s\n", fname)); fd_close(conn, fsp); file_free(fsp); @@ -2060,7 +2060,7 @@ NTSTATUS open_directory(connection_struct *conn, (unsigned int)file_attributes)); if (is_ntfs_stream_name(fname)) { - DEBUG(0,("open_directory: %s is a stream name!\n", fname )); + DEBUG(1,("open_directory: %s is a stream name!\n", fname )); return NT_STATUS_NOT_A_DIRECTORY; } @@ -2175,7 +2175,7 @@ NTSTATUS open_directory(connection_struct *conn, fname); if (lck == NULL) { - DEBUG(0, ("open_directory: Could not get share mode lock for %s\n", fname)); + DEBUG(1, ("open_directory: Could not get share mode lock for %s\n", fname)); file_free(fsp); return NT_STATUS_SHARING_VIOLATION; } @@ -2314,7 +2314,7 @@ void msg_file_was_renamed(int msg_type, struct process_id src, size_t sp_len; if (buf == NULL || len < MSG_FILE_RENAMED_MIN_SIZE + 2) { - DEBUG(0, ("msg_file_was_renamed: Got invalid msg len %d\n", (int)len)); + DEBUG(1, ("msg_file_was_renamed: Got invalid msg len %d\n", (int)len)); return; } diff --git a/release/src/router/samba3/source/smbd/server.c b/release/src/router/samba3/source/smbd/server.c index ceb706d582..baff004792 100644 --- a/release/src/router/samba3/source/smbd/server.c +++ b/release/src/router/samba3/source/smbd/server.c @@ -361,7 +361,7 @@ static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_ const char *ptr; if(ifip == NULL) { - DEBUG(0,("open_sockets_smbd: interface %d has NULL IP address !\n", i)); + DEBUG(1,("open_sockets_smbd: interface %d has NULL IP address !\n", i)); continue; } @@ -382,7 +382,7 @@ static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_ set_blocking(s,False); if (listen(s, SMBD_LISTEN_BACKLOG) == -1) { - DEBUG(0,("listen: %s\n",strerror(errno))); + DEBUG(1,("listen: %s\n",strerror(errno))); close(s); return False; } @@ -391,7 +391,7 @@ static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_ num_sockets++; if (num_sockets >= FD_SETSIZE) { - DEBUG(0,("open_sockets_smbd: Too many sockets to bind to\n")); + DEBUG(1,("open_sockets_smbd: Too many sockets to bind to\n")); return False; } } @@ -422,7 +422,7 @@ static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_ set_blocking(s,False); if (listen(s, SMBD_LISTEN_BACKLOG) == -1) { - DEBUG(0,("open_sockets_smbd: listen: %s\n", + DEBUG(1,("open_sockets_smbd: listen: %s\n", strerror(errno))); close(s); return False; @@ -435,7 +435,7 @@ static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_ num_sockets++; if (num_sockets >= FD_SETSIZE) { - DEBUG(0,("open_sockets_smbd: Too many sockets to bind to\n")); + DEBUG(1,("open_sockets_smbd: Too many sockets to bind to\n")); return False; } } @@ -527,7 +527,7 @@ static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_ continue; if (smbd_server_fd() == -1) { - DEBUG(0,("open_sockets_smbd: accept: %s\n", + DEBUG(1,("open_sockets_smbd: accept: %s\n", strerror(errno))); continue; } @@ -567,7 +567,7 @@ static BOOL open_sockets_smbd(BOOL is_daemon, BOOL interactive, const char *smb_ if (!reinit_after_fork(smbd_messaging_context(), smbd_event_context(), true)) { - DEBUG(0, ("reinit_after_fork failed.\n")); + DEBUG(1, ("reinit_after_fork failed.\n")); smb_panic("reinit_after_fork failed.\n"); } @@ -917,7 +917,7 @@ extern void build_options(BOOL screen); } if (log_stdout && Fork) { - DEBUG(0,("ERROR: Can't log to stdout (-S) unless daemon is in foreground (-F) or interactive (-i)\n")); + DEBUG(1,("ERROR: Can't log to stdout (-S) unless daemon is in foreground (-F) or interactive (-i)\n")); exit(1); } @@ -966,8 +966,8 @@ extern void build_options(BOOL screen); reopen_logs(); - DEBUG(0,( "smbd version %s started.\n", SAMBA_VERSION_STRING)); - DEBUGADD( 0, ( "%s\n", COPYRIGHT_STARTUP_MESSAGE ) ); + DEBUG(1,( "smbd version %s started.\n%s\n", + SAMBA_VERSION_STRING, COPYRIGHT_STARTUP_MESSAGE )); DEBUG(2,("uid=%d gid=%d euid=%d egid=%d\n", (int)getuid(),(int)getgid(),(int)geteuid(),(int)getegid())); @@ -978,7 +978,7 @@ extern void build_options(BOOL screen); #endif if (sizeof(uint16) < 2 || sizeof(uint32) < 4) { - DEBUG(0,("ERROR: Samba is not configured correctly for the word size on your machine\n")); + DEBUG(1,("ERROR: Samba is not configured correctly for the word size on your machine\n")); exit(1); } @@ -1010,7 +1010,7 @@ extern void build_options(BOOL screen); if (!is_daemon && !is_a_socket(0)) { if (!interactive) - DEBUG(0,("standard input is not a socket, assuming -D option\n")); + DEBUG(1,("standard input is not a socket, assuming -D option\n")); /* * Setting is_daemon here prevents us from eventually calling @@ -1051,12 +1051,12 @@ extern void build_options(BOOL screen); exit(1); if (!secrets_init()) { - DEBUG(0, ("ERROR: smbd can not open secrets.tdb\n")); + DEBUG(1, ("ERROR: smbd can not open secrets.tdb\n")); exit(1); } if(!get_global_sam_sid()) { - DEBUG(0,("ERROR: Samba cannot create a SAM SID.\n")); + DEBUG(1,("ERROR: Samba cannot create a SAM SID.\n")); exit(1); } @@ -1087,7 +1087,7 @@ extern void build_options(BOOL screen); #endif if (!init_guest_info()) { - DEBUG(0,("ERROR: failed to setup guest info.\n")); + DEBUG(1,("ERROR: failed to setup guest info.\n")); return -1; } @@ -1138,7 +1138,7 @@ extern void build_options(BOOL screen); } if (!init_account_policy()) { - DEBUG(0,("Could not open account policy tdb.\n")); + DEBUG(1,("Could not open account policy tdb.\n")); exit(1); } diff --git a/release/src/router/samba3/source/smbd/service.c b/release/src/router/samba3/source/smbd/service.c index fbb3f3f5b0..151d80a641 100644 --- a/release/src/router/samba3/source/smbd/service.c +++ b/release/src/router/samba3/source/smbd/service.c @@ -180,7 +180,7 @@ BOOL set_current_service(connection_struct *conn, uint16 flags, BOOL do_chdir) if (do_chdir && vfs_ChDir(conn,conn->connectpath) != 0 && vfs_ChDir(conn,conn->origpath) != 0) { - DEBUG(0,("chdir (%s) failed\n", + DEBUG(1,("chdir (%s) failed\n", conn->connectpath)); return(False); } @@ -351,7 +351,7 @@ int find_service(fstring service) if (iService >= 0) { if (!VALID_SNUM(iService)) { - DEBUG(0,("Invalid snum %d for %s\n",iService, service)); + DEBUG(1,("Invalid snum %d for %s\n",iService, service)); iService = -1; } } @@ -461,7 +461,7 @@ static NTSTATUS find_forced_group(BOOL force_user, mem_ctx = talloc_new(NULL); if (mem_ctx == NULL) { - DEBUG(0, ("talloc_new failed\n")); + DEBUG(1, ("talloc_new failed\n")); return NT_STATUS_NO_MEMORY; } @@ -515,7 +515,7 @@ static NTSTATUS find_forced_group(BOOL force_user, DEBUG(3,("Forced group %s for member %s\n", groupname, username)); } else { - DEBUG(0,("find_forced_group: forced user %s is not a member " + DEBUG(1,("find_forced_group: forced user %s is not a member " "of forced group %s. Disallowing access.\n", username, groupname )); result = NT_STATUS_MEMBER_NOT_IN_GROUP; @@ -561,7 +561,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, conn = conn_new(); if (!conn) { - DEBUG(0,("Couldn't find free connection.\n")); + DEBUG(1,("Couldn't find free connection.\n")); *status = NT_STATUS_INSUFFICIENT_RESOURCES; return NULL; } @@ -577,7 +577,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, guest = True; pass = getpwnam_alloc(NULL, guestname); if (!pass) { - DEBUG(0,("make_connection_snum: Invalid guest " + DEBUG(1,("make_connection_snum: Invalid guest " "account %s??\n",guestname)); conn_free(conn); *status = NT_STATUS_NO_SUCH_USER; @@ -657,7 +657,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, TALLOC_FREE(found_username); conn->force_user = True; } else { - DEBUG(0, ("invalid VUID (vuser) but not in security=share\n")); + DEBUG(1, ("invalid VUID (vuser) but not in security=share\n")); conn_free(conn); *status = NT_STATUS_ACCESS_DENIED; return NULL; @@ -745,7 +745,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, conn->nt_user_token = dup_nt_token( NULL, vuser->nt_user_token); if (conn->nt_user_token == NULL) { - DEBUG(0, ("dup_nt_token failed\n")); + DEBUG(1, ("dup_nt_token failed\n")); conn_free(conn); *status = NT_STATUS_NO_MEMORY; return NULL; @@ -855,7 +855,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, lp_servicename(snum), FILE_READ_DATA)) { /* No access, read or write. */ - DEBUG(0,("make_connection: connection to %s " + DEBUG(1,("make_connection: connection to %s " "denied due to security " "descriptor.\n", lp_servicename(snum))); @@ -870,7 +870,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, /* Initialise VFS function pointers */ if (!smbd_vfs_init(conn)) { - DEBUG(0, ("vfs_init failed for service %s\n", + DEBUG(1, ("vfs_init failed for service %s\n", lp_servicename(snum))); conn_free(conn); *status = NT_STATUS_BAD_NETWORK_NAME; @@ -936,7 +936,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, /* USER Activites: */ if (!change_to_user(conn, conn->vuid)) { /* No point continuing if they fail the basic checks */ - DEBUG(0,("Can't become connected user!\n")); + DEBUG(1,("Can't become connected user!\n")); yield_connection(conn, lp_servicename(snum)); conn_free(conn); *status = NT_STATUS_LOGON_FAILURE; @@ -988,7 +988,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, themselves. */ if (SMB_VFS_CONNECT(conn, lp_servicename(snum), user) < 0) { - DEBUG(0,("make_connection: VFS make connection failed!\n")); + DEBUG(1,("make_connection: VFS make connection failed!\n")); change_to_root_user(); yield_connection(conn, lp_servicename(snum)); conn_free(conn); @@ -1004,11 +1004,11 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, if ((ret = SMB_VFS_STAT(conn, conn->connectpath, &st)) != 0 || !S_ISDIR(st.st_mode)) { if (ret == 0 && !S_ISDIR(st.st_mode)) { - DEBUG(0,("'%s' is not a directory, when connecting to " + DEBUG(1,("'%s' is not a directory, when connecting to " "[%s]\n", conn->connectpath, lp_servicename(snum))); } else { - DEBUG(0,("'%s' does not exist or permission denied " + DEBUG(1,("'%s' does not exist or permission denied " "when connecting to [%s] Error was %s\n", conn->connectpath, lp_servicename(snum), strerror(errno) )); @@ -1076,7 +1076,7 @@ connection_struct *make_connection_with_chdir(const char *service_in, */ if ( conn && vfs_ChDir(conn,conn->connectpath) != 0 ) { - DEBUG(0,("move_driver_to_download_area: Can't change " + DEBUG(1,("move_driver_to_download_area: Can't change " "directory to %s for [print$] (%s)\n", conn->connectpath,strerror(errno))); yield_connection(conn, lp_servicename(SNUM(conn))); @@ -1109,7 +1109,7 @@ connection_struct *make_connection(const char *service_in, DATA_BLOB password, /* This must ONLY BE CALLED AS ROOT. As it exits this function as * root. */ if (!non_root_mode() && (euid = geteuid()) != 0) { - DEBUG(0,("make_connection: PANIC ERROR. Called as nonroot " + DEBUG(1,("make_connection: PANIC ERROR. Called as nonroot " "(%u)\n", (unsigned int)euid )); smb_panic("make_connection: PANIC ERROR. Called as nonroot\n"); } @@ -1198,7 +1198,7 @@ connection_struct *make_connection(const char *service_in, DATA_BLOB password, return NULL; } - DEBUG(0,("%s (%s) couldn't find service %s\n", + DEBUG(1,("%s (%s) couldn't find service %s\n", get_remote_machine_name(), client_addr(), service)); *status = NT_STATUS_BAD_NETWORK_NAME; return NULL; diff --git a/release/src/router/samba3/source/utils/net.c b/release/src/router/samba3/source/utils/net.c index 38ebaf6c26..aced50472d 100644 --- a/release/src/router/samba3/source/utils/net.c +++ b/release/src/router/samba3/source/utils/net.c @@ -335,7 +335,7 @@ NTSTATUS connect_dst_pipe(struct cli_state **cli_dst, struct rpc_pipe_client **p pipe_hnd = cli_rpc_pipe_open_noauth(cli_tmp, pipe_num, &nt_status); if (!pipe_hnd) { - DEBUG(0, ("couldn't not initialize pipe\n")); + DEBUG(1, ("couldn't not initialize pipe\n")); cli_shutdown(cli_tmp); SAFE_FREE(server_name); return nt_status; @@ -632,7 +632,7 @@ static int net_getlocalsid(int argc, const char **argv) } if(!initialize_password_db(False)) { - DEBUG(0, ("WARNING: Could not open passdb - local sid may not reflect passdb\n" + DEBUG(1, ("WARNING: Could not open passdb - local sid may not reflect passdb\n" "backend knowlege (such as the sid stored in LDAP)\n")); } @@ -648,7 +648,7 @@ static int net_getlocalsid(int argc, const char **argv) get_global_sam_sid(); if (!secrets_fetch_domain_sid(name, &sid)) { - DEBUG(0, ("Can't fetch domain SID for name: %s\n", name)); + DEBUG(1, ("Can't fetch domain SID for name: %s\n", name)); return 1; } sid_to_string(sid_str, &sid); @@ -669,7 +669,7 @@ static int net_setlocalsid(int argc, const char **argv) } if (!secrets_store_domain_sid(global_myname(), &sid)) { - DEBUG(0,("Can't store domain SID as a pdc/bdc.\n")); + DEBUG(1,("Can't store domain SID as a pdc/bdc.\n")); return 1; } @@ -689,7 +689,7 @@ static int net_setdomainsid(int argc, const char **argv) } if (!secrets_store_domain_sid(lp_workgroup(), &sid)) { - DEBUG(0,("Can't store domain SID.\n")); + DEBUG(1,("Can't store domain SID.\n")); return 1; } @@ -702,7 +702,7 @@ static int net_getdomainsid(int argc, const char **argv) fstring sid_str; if(!initialize_password_db(False)) { - DEBUG(0, ("WARNING: Could not open passdb - domain sid may not reflect passdb\n" + DEBUG(1, ("WARNING: Could not open passdb - domain sid may not reflect passdb\n" "backend knowlege (such as the sid stored in LDAP)\n")); } @@ -859,12 +859,12 @@ static int net_maxrid(int argc, const char **argv) uint32 rid; if (argc != 0) { - DEBUG(0, ("usage: net maxrid\n")); + DEBUG(1, ("usage: net maxrid\n")); return 1; } if ((rid = get_maxrid()) == 0) { - DEBUG(0, ("can't get current maximum rid\n")); + DEBUG(1, ("can't get current maximum rid\n")); return 1; } diff --git a/release/src/router/samba3/source/utils/smbpasswd.c b/release/src/router/samba3/source/utils/smbpasswd.c index ef4e20bb7f..7f7f21a5bc 100644 --- a/release/src/router/samba3/source/utils/smbpasswd.c +++ b/release/src/router/samba3/source/utils/smbpasswd.c @@ -295,7 +295,7 @@ static int process_root(int local_flags) if (local_flags & LOCAL_SET_LDAP_ADMIN_PW) { char *ldap_admin_dn = lp_ldap_admin_dn(); if ( ! *ldap_admin_dn ) { - DEBUG(0,("ERROR: 'ldap admin dn' not defined! Please check your smb.conf\n")); + DEBUG(1,("ERROR: 'ldap admin dn' not defined! Please check your smb.conf\n")); goto done; } @@ -305,14 +305,14 @@ static int process_root(int local_flags) fstrcpy(ldap_secret, new_passwd); } if (!store_ldap_admin_pw(ldap_secret)) { - DEBUG(0,("ERROR: Failed to store the ldap admin password!\n")); + DEBUG(1,("ERROR: Failed to store the ldap admin password!\n")); } goto done; } /* Ensure passdb startup(). */ if(!initialize_password_db(False)) { - DEBUG(0, ("Failed to open passdb!\n")); + DEBUG(1, ("Failed to open passdb!\n")); exit(1); } diff --git a/release/src/router/samba3/source/utils/smbtree.c b/release/src/router/samba3/source/utils/smbtree.c index 40da1d623e..0c8e27f443 100644 --- a/release/src/router/samba3/source/utils/smbtree.c +++ b/release/src/router/samba3/source/utils/smbtree.c @@ -141,7 +141,7 @@ static BOOL get_rpc_shares(struct cli_state *cli, mem_ctx = talloc_new(NULL); if (mem_ctx == NULL) { - DEBUG(0, ("talloc_new failed\n")); + DEBUG(1, ("talloc_new failed\n")); return False; } -- 2.11.4.GIT