diff options
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/chgpasswd.c | 6 | ||||
-rw-r--r-- | source3/smbd/ipc.c | 4 | ||||
-rw-r--r-- | source3/smbd/nttrans.c | 3 | ||||
-rw-r--r-- | source3/smbd/password.c | 2 | ||||
-rw-r--r-- | source3/smbd/reply.c | 7 | ||||
-rw-r--r-- | source3/smbd/server.c | 16 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 10 | ||||
-rw-r--r-- | source3/smbd/uid.c | 8 |
8 files changed, 28 insertions, 28 deletions
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c index 6594c5f48c..bd7d28b11f 100644 --- a/source3/smbd/chgpasswd.c +++ b/source3/smbd/chgpasswd.c @@ -342,7 +342,7 @@ BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL if(as_root) become_root(False); - DEBUG(3,("Dochild for user %s (uid=%d,gid=%d)\n",name,getuid(),getgid())); + DEBUG(3,("Dochild for user %s (uid=%d,gid=%d)\n",name,(int)getuid(),(int)getgid())); chstat = dochild(master, slavedev, name, passwordprogram, as_root); if(as_root) @@ -404,7 +404,7 @@ BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root) len = strlen(oldpass); for(i = 0; i < len; i++) { - if(iscntrl(oldpass[i])) { + if(iscntrl((int)oldpass[i])) { DEBUG(0,("chat_with_program: oldpass contains control characters (disallowed).\n")); return False; } @@ -412,7 +412,7 @@ BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root) len = strlen(newpass); for(i = 0; i < len; i++) { - if(iscntrl(newpass[i])) { + if(iscntrl((int)newpass[i])) { DEBUG(0,("chat_with_program: newpass contains control characters (disallowed).\n")); return False; } diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index a72b442735..63495f0479 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -274,7 +274,7 @@ static int get_counter(char** p) { int i, n; if (!p || !(*p)) return(1); - if (!isdigit(**p)) return 1; + if (!isdigit((int)**p)) return 1; for (n = 0;;) { i = **p; if (isdigit(i)) @@ -1969,7 +1969,7 @@ static BOOL api_PrintJobInfo(connection_struct *conn,uint16 vuid,char *param,cha break; case 0xb: /* change print job name, data gives the name */ /* jobid, snum should be zero */ - if (isalpha(*s)) + if (isalpha((int)*s)) { pstring name; int l = 0; diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index bff61b6736..94ecbfea49 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -452,6 +452,7 @@ int reply_ntcreate_and_X(connection_struct *conn, int ret = nt_open_pipe(fname, conn, inbuf, outbuf, &fnum); if(ret != 0) return ret; + fsp = &Files[fnum]; smb_action = FILE_WAS_OPENED; } else { @@ -667,7 +668,7 @@ int reply_ntcreate_and_X(connection_struct *conn, DEBUG(5,("reply_ntcreate_and_X: open fnum = %d, name = %s\n", - fnum, fsp?fsp->fsp_name:"NULL")); + fnum, fsp->fsp_name)); return chain_reply(inbuf,outbuf,length,bufsize); } diff --git a/source3/smbd/password.c b/source3/smbd/password.c index 118251ffd6..121ebb7f00 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -829,7 +829,7 @@ static BOOL check_user_equiv(char *user, char *remote, char *equiv_file) { BOOL host_ok = False; -#ifdef HAVE_NETGROUP +#if defined(HAVE_NETGROUP) && defined(HAVE_YP_GET_DEFAULT_DOMAIN) if (is_group) { static char *mydomain = NULL; diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 66d1dd2839..626d2e9617 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -327,7 +327,6 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt pstrcpy(smb_buf(outbuf),devicename); } else { char *fsname = FSTYPE_STRING; - char *p; set_message(outbuf,3,3,True); @@ -1565,7 +1564,7 @@ int reply_mknew(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, DEBUG( 2, ( "new file %s\n", fname ) ); DEBUG( 3, ( "mknew %s fd=%d fnum=%d dmode=%d umode=%o\n", - fname, fsp->fd_ptr->fd, fnum, createmode, unixmode ) ); + fname, fsp->fd_ptr->fd, fnum, createmode, (int)unixmode ) ); return(outsize); } @@ -1642,7 +1641,7 @@ int reply_ctemp(connection_struct *conn, char *inbuf,char *outbuf, int dum_size, DEBUG( 2, ( "created temp file %s\n", fname2 ) ); DEBUG( 3, ( "ctemp %s fd=%d fnum=%d dmode=%d umode=%o\n", - fname2, fsp->fd_ptr->fd, fnum, createmode, unixmode ) ); + fname2, fsp->fd_ptr->fd, fnum, createmode, (int)unixmode ) ); return(outsize); } @@ -2640,7 +2639,7 @@ int reply_printopen(connection_struct *conn, pstrcpy(s,smb_buf(inbuf)+1); p = s; while (*p) { - if (!(isalnum(*p) || strchr("._-",*p))) + if (!(isalnum((int)*p) || strchr("._-",*p))) *p = 'X'; p++; } diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 9c7bafd9dd..ba93ceaa16 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -2436,7 +2436,7 @@ int error_packet(char *inbuf,char *outbuf,int error_class,uint32 error_code,int /**************************************************************************** this is called when the client exits abruptly **************************************************************************/ -static int sig_pipe(void) +static void sig_pipe(int sig) { struct cli_state *cli; BlockSignals(True,SIGPIPE); @@ -2445,11 +2445,10 @@ static int sig_pipe(void) DEBUG(3,("lost connection to password server\n")); cli_shutdown(cli); BlockSignals(False,SIGPIPE); - return 0; + return; } exit_server("Got sigpipe\n"); - return(0); } /**************************************************************************** @@ -2756,7 +2755,7 @@ address %x. Error was %s\n", htonl(INADDR_LOOPBACK), strerror(errno))); oplock_port = ntohs(sock_name.sin_port); DEBUG(3,("open_oplock ipc: pid = %d, oplock_port = %u\n", - getpid(), oplock_port)); + (int)getpid(), oplock_port)); return True; } @@ -3420,7 +3419,7 @@ this prevents zombie child processes ****************************************************************************/ static BOOL reload_after_sighup = False; -static int sig_hup(void) +static void sig_hup(int sig) { BlockSignals(True,SIGHUP); DEBUG(0,("Got SIGHUP\n")); @@ -3433,7 +3432,6 @@ static int sig_hup(void) reload_after_sighup = True; BlockSignals(False,SIGHUP); - return(0); } /**************************************************************************** @@ -4377,7 +4375,7 @@ static BOOL dump_core(void) rlp.rlim_cur = MAX(4*1024*1024,rlp.rlim_cur); setrlimit(RLIMIT_CORE, &rlp); getrlimit(RLIMIT_CORE, &rlp); - DEBUG(3,("Core limits now %d %d\n",rlp.rlim_cur,rlp.rlim_max)); + DEBUG(3,("Core limits now %d %d\n",(int)rlp.rlim_cur,(int)rlp.rlim_max)); } #endif #endif @@ -5312,14 +5310,14 @@ static void usage(char *pname) rlp.rlim_cur = (MAX_OPEN_FILES+10>rlp.rlim_max)? rlp.rlim_max:MAX_OPEN_FILES+10; setrlimit(RLIMIT_NOFILE, &rlp); getrlimit(RLIMIT_NOFILE, &rlp); - DEBUG(3,("Maximum number of open files per session is %d\n",rlp.rlim_cur)); + DEBUG(3,("Maximum number of open files per session is %d\n",(int)rlp.rlim_cur)); } #endif #endif DEBUG(2,("uid=%d gid=%d euid=%d egid=%d\n", - getuid(),getgid(),geteuid(),getegid())); + (int)getuid(),(int)getgid(),(int)geteuid(),(int)getegid())); if (sizeof(uint16) < 2 || sizeof(uint32) < 4) { diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 07f0316c22..992d8cd616 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -940,7 +940,7 @@ resume_key = %d resume name = %s continue=%d level = %d\n", */ int current_pos, start_pos; - char *dname; + char *dname = NULL; void *dirptr = conn->dirptr; start_pos = TellDir(dirptr); for(current_pos = start_pos; current_pos >= 0; current_pos--) @@ -957,7 +957,8 @@ resume_key = %d resume name = %s continue=%d level = %d\n", * here. */ - name_map_mangle( dname, False, SNUM(conn)); + if(dname != NULL) + name_map_mangle( dname, False, SNUM(conn)); if(dname && strcsequal( resume_name, dname)) { @@ -984,9 +985,10 @@ resume_key = %d resume name = %s continue=%d level = %d\n", * here. */ - name_map_mangle( dname, False, SNUM(conn)); + if(dname != NULL) + name_map_mangle( dname, False, SNUM(conn)); - if(strcsequal( resume_name, dname)) + if(dname && strcsequal( resume_name, dname)) { SeekDir(dirptr, current_pos+1); DEBUG(7,("call_trans2findnext: got match at pos %d\n", current_pos+1 )); diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 1276eeaaac..08a3952b3a 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -96,7 +96,7 @@ static BOOL become_uid(int uid) #endif { DEBUG(0,("Couldn't set uid %d currently set to (%d,%d)\n", - uid,getuid(), geteuid())); + uid,(int)getuid(), (int)geteuid())); if (uid > 32000) { DEBUG(0,("Looks like your OS doesn't like high uid values - try using a different account\n")); } @@ -133,7 +133,7 @@ static BOOL become_gid(int gid) #endif { DEBUG(0,("Couldn't set gid %d currently set to (%d,%d)\n", - gid,getgid(),getegid())); + gid,(int)getgid(),(int)getegid())); if (gid > 32000) { DEBUG(0,("Looks like your OS doesn't like high gid values - try using a different account\n")); } @@ -290,7 +290,7 @@ BOOL become_user(connection_struct *conn, uint16 vuid) current_user.vuid = vuid; DEBUG(5,("become_user uid=(%d,%d) gid=(%d,%d)\n", - getuid(),geteuid(),getgid(),getegid())); + (int)getuid(),(int)geteuid(),(int)getgid(),(int)getegid())); return(True); } @@ -340,7 +340,7 @@ BOOL unbecome_user(void ) DEBUG( 0, ( "chdir(%s) failed in unbecome_user\n", OriginalDir ) ); DEBUG(5,("unbecome_user now uid=(%d,%d) gid=(%d,%d)\n", - getuid(),geteuid(),getgid(),getegid())); + (int)getuid(),(int)geteuid(),(int)getgid(),(int)getegid())); current_user.conn = NULL; current_user.vuid = UID_FIELD_INVALID; |