while (--ndgs)
{
- if (isdigit(*p))
+ if (isdigit((int)*p))
value = (value << 3) | (long) (*p - '0');
p++;
* dos \'s in path. Kill any absolute path names. But only if first!
*/
- DEBUG(5, ("firstb=%lX, secondb=%lX, len=%i\n", tptr, fp, l));
+ DEBUG(5, ("firstb=%lX, secondb=%lX, len=%i\n", (long)tptr, (long)fp, l));
if (first) {
if (*fp == '.') {
fi
done
-for ac_hdr in unistd.h utime.h grp.h sys/id.h limits.h net/if.h
+for ac_hdr in unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
fi
done
-for ac_hdr in compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h
+for ac_hdr in compat.h rpcsvc/ypclnt.h sys/param.h ctype.h sys/wait.h sys/ioctl.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
fi
done
-for ac_hdr in sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h
+for ac_hdr in sys/filio.h string.h strings.h stdlib.h sys/socket.h sys/mode.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
fi
done
-for ac_func in fstat strchr utime utimes getrlimit fsync execl
+for ac_func in fstat strchr utime utimes getrlimit fsync execl bzero memset
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3104: checking for $ac_func" >&5
AC_HEADER_TIME
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
-AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h net/if.h)
-AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.h)
-AC_CHECK_HEADERS(sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h)
+AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
+AC_CHECK_HEADERS(compat.h rpcsvc/ypclnt.h sys/param.h ctype.h sys/wait.h sys/ioctl.h)
+AC_CHECK_HEADERS(sys/filio.h string.h strings.h stdlib.h sys/socket.h sys/mode.h)
AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h)
AC_CHECK_HEADERS(sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
AC_CHECK_HEADERS(shadow.h netinet/tcp.h sys/security.h security/pam_appl.h)
AC_CHECK_FUNCS(waitpid getcwd strdup strerror chown chmod chroot)
-AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync execl)
+AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync execl bzero memset)
AC_CHECK_FUNCS(memmove vsnprintf setsid glob strpbrk pipe crypt16 getauthuid)
AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr)
AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf putprpwnam)
/* Define if you have the bigcrypt function. */
#undef HAVE_BIGCRYPT
+/* Define if you have the bzero function. */
+#undef HAVE_BZERO
+
/* Define if you have the chmod function. */
#undef HAVE_CHMOD
/* Define if you have the memmove function. */
#undef HAVE_MEMMOVE
+/* Define if you have the memset function. */
+#undef HAVE_MEMSET
+
/* Define if you have the mktime function. */
#undef HAVE_MKTIME
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
+/* Define if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
/* Define if you have the <ndir.h> header file. */
#undef HAVE_NDIR_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
/* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
+/* Define if you have the <rpcsvc/ypclnt.h> header file. */
+#undef HAVE_RPCSVC_YPCLNT_H
+
/* Define if you have the <sys/security.h> header file. */
#undef HAVE_SYS_SECURITY_H
#include <string.h>
#endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
+#endif
+
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#include <compat.h>
#endif
+#ifdef HAVE_RPCSVC_YPCLNT_H
+#include <rpcsvc/ypclnt.h>
+#endif
+
#ifndef uchar
#define uchar unsigned char
#endif
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
#endif
+#if !defined(HAVE_BZERO) && defined(HAVE_MEMSET)
+#define bzero(a,b) memset((a),'\0',(b))
+#endif
+
#endif /* _INCLUDES_H */
/*The following definitions come from lib/debug.c */
-int sig_usr2( void );
-int sig_usr1( void );
+void sig_usr2( int sig );
+void sig_usr1( int sig );
void setup_logging( char *pname, BOOL interactive );
void reopen_logs( void );
void force_check_log_size( void );
#endif
#ifndef SIGNAL_CAST
-#define SIGNAL_CAST (RETSIGTYPE (*)())
+#define SIGNAL_CAST (RETSIGTYPE (*)(int))
#endif
#ifndef SELECT_CAST
if (strncmp(tok, s, tok_len) == 0)
return (True);
} else if ((cut = strchr(tok, '/')) != 0) { /* netnumber/netmask */
- if (isdigit(s[0]) && masked_match(tok, cut, s))
+ if (isdigit((int)s[0]) && masked_match(tok, cut, s))
return (True);
}
return (False);
}
for (i=0;i<=127;i++) {
- if (isalnum((char)i) || strchr("._^$~!#%&-{}()@'`",(char)i))
+ if (isalnum(i) || strchr("._^$~!#%&-{}()@'`",(char)i))
add_dos_char(i,False,0,False);
}
/* Some systems have buggy isupper/islower for characters
above 127. Best not to rely on them. */
if(i < 128) {
- if (isupper(c)) lower_char_map[i] = tolower(c);
- if (islower(c)) upper_char_map[i] = toupper(c);
+ if (isupper((int)c)) lower_char_map[i] = tolower(c);
+ if (islower((int)c)) upper_char_map[i] = toupper(c);
}
}
}
* catch a sigusr2 - decrease the debug log level.
* ************************************************************************** **
*/
-int sig_usr2( void )
+void sig_usr2( int sig )
{
BlockSignals( True, SIGUSR2 );
BlockSignals( False, SIGUSR2 );
CatchSignal( SIGUSR2, SIGNAL_CAST sig_usr2 );
- return( 0 );
} /* sig_usr2 */
#endif /* SIGUSR2 */
* catch a sigusr1 - increase the debug log level.
* ************************************************************************** **
*/
-int sig_usr1( void )
+void sig_usr1( int sig )
{
BlockSignals( True, SIGUSR1 );
BlockSignals( False, SIGUSR1 );
CatchSignal( SIGUSR1, SIGNAL_CAST sig_usr1 );
- return( 0 );
} /* sig_usr1 */
#endif /* SIGUSR1 */
sp = (char *) from;
dp = cvtbuf;
while (*sp) {
- if (*sp == hex_tag && isxdigit (sp[1]) && isxdigit (sp[2])) {
+ if (*sp == hex_tag && isxdigit((int)sp[1]) && isxdigit((int)sp[2])) {
*dp++ = (hex2bin (sp[1])<<4) | (hex2bin (sp[2]));
sp += 3;
} else
* we only do the reverse (that's why the strchr is used rather than
* isxdigit. Based on fix from ado@elsie.nci.nih.gov (Arthur David Olson).
*/
- if (*sp == hex_tag && (strchr ("89abcdefABCDEF", sp[1]) != NULL) && isxdigit (sp[2])) {
+ if (*sp == hex_tag && (strchr ("89abcdefABCDEF", sp[1]) != NULL) && isxdigit((int)sp[2])) {
*dp++ = (hex2bin (sp[1])<<4) | (hex2bin (sp[2]));
sp += 3;
} else
****************************************************************************/
int smbrun(char *cmd,char *outfile,BOOL shared)
{
- extern struct current_user current_user;
int fd,pid;
int uid = current_user.uid;
int gid = current_user.gid;
if (strcmp(str,"255.255.255.255") == 0) return(0xFFFFFFFF);
for (i=0; pure_address && str[i]; i++)
- if (!(isdigit(str[i]) || str[i] == '.'))
+ if (!(isdigit((int)str[i]) || str[i] == '.'))
pure_address = False;
/* if it's in the form of an IP address then get the lib to interpret it */
(lock.l_pid != 0) &&
(lock.l_pid != getpid()))
{
- DEBUG(3,("fd %d is locked by pid %d\n",fd,lock.l_pid));
+ DEBUG(3,("fd %d is locked by pid %d\n",fd,(int)lock.l_pid));
return(True);
}
}
for (i = strlen( qname) ; --i >= 0 ; ) {
- if (!isprint(qname[i])) qname[i] = '.';
+ if (!isprint((int)qname[i])) qname[i] = '.';
}
DEBUG(1,("\t%-15s <%02x> - %s\n",qname,type,flags));
p+=2;
}
for (i=0; pure_address && name[i]; i++)
- if (!(isdigit(name[i]) || name[i] == '.'))
+ if (!(isdigit((int)name[i]) || name[i] == '.'))
pure_address = False;
/* if it's in the form of an IP address then get the lib to interpret it */
{
/* erase old pid */
DEBUG(5,("smb_shm_register_process : erasing stale record for pid %d (seek_back = %d)\n",
- other_pid, seek_back));
+ (int)other_pid, seek_back));
other_pid = (pid_t)0;
erased_slot = lseek(smb_shm_processes_fd, seek_back, SEEK_CUR);
write(smb_shm_processes_fd, &other_pid, sizeof(other_pid));
if(free_slot < 0)
free_slot = lseek(smb_shm_processes_fd, 0, SEEK_END);
- DEBUG(5,("smb_shm_register_process : writing record for pid %d at offset %d\n",pid,free_slot));
+ DEBUG(5,("smb_shm_register_process : writing record for pid %d at offset %d\n",
+ (int)pid,free_slot));
lseek(smb_shm_processes_fd, free_slot, SEEK_SET);
if(write(smb_shm_processes_fd, &pid, sizeof(pid)) < 0)
{
while ((nb_read = read(smb_shm_processes_fd, &other_pid, sizeof(other_pid))) > 0)
{
- DEBUG(5,("smb_shm_unregister_process : read record for pid %d\n",other_pid));
+ DEBUG(5,("smb_shm_unregister_process : read record for pid %d\n",(int)other_pid));
if(other_pid == pid)
{
/* erase pid */
DEBUG(5,("smb_shm_unregister_process : erasing record for pid %d (seek_val = %d)\n",
- other_pid, seek_back));
+ (int)other_pid, seek_back));
other_pid = (pid_t)0;
erased_slot = lseek(smb_shm_processes_fd, seek_back, SEEK_CUR);
if(write(smb_shm_processes_fd, &other_pid, sizeof(other_pid)) < 0)
if(!found)
{
- DEBUG(0,("ERROR smb_shm_unregister_process : couldn't find pid %d in file %s\n",pid,processreg_file));
+ DEBUG(0,("ERROR smb_shm_unregister_process : couldn't find pid %d in file %s\n",
+ (int)pid,processreg_file));
close(smb_shm_processes_fd);
return False;
}
}
smb_shm_global_lock();
- DEBUG(5,("calling smb_shm_unregister_process(%s, %d)\n", smb_shm_processreg_name, getpid()));
+ DEBUG(5,("calling smb_shm_unregister_process(%s, %d)\n",
+ smb_shm_processreg_name, (int)getpid()));
smb_shm_unregister_process(smb_shm_processreg_name, getpid());
smb_shm_global_unlock();
}
if (sem_id == -1) {
- DEBUG(0,("Can't create or use semaphore %s\n",
+ DEBUG(0,("Can't create or use semaphore [1]. Error was %s\n",
strerror(errno)));
+ return NULL;
}
if (sem_id != -1) {
if (semctl(sem_id, i, SETVAL, su) != 0) {
DEBUG(1,("Failed to init semaphore %d. Error was %s\n",
i, strerror(errno)));
+ return NULL;
}
}
}
sem_id = semget(SEMAPHORE_KEY, 0, 0);
}
if (sem_id == -1) {
- DEBUG(0,("Can't create or use semaphore.Error was %s\n",
+ DEBUG(0,("Can't create or use semaphore [2]. Error was %s\n",
strerror(errno)));
return NULL;
}
if (semctl(sem_id, 0, SETVAL, su) != 0) {
DEBUG(0,("ERROR: Failed to clear global lock. Error was %s\n",
strerror(errno)));
+ return NULL;
}
}
if (semctl(sem_id, 0, IPC_SET, su) != 0) {
DEBUG(0,("ERROR shmctl : can't IPC_SET. Error was %s\n",
strerror(errno)));
+ return NULL;
}
}
if (semctl(sem_id, i, SETVAL, su) != 0) {
DEBUG(0,("ERROR: Failed to clear IPC lock %d. Error was %s\n",
i, strerror(errno)));
+ global_unlock();
+ return NULL;
}
}
}
mapping processes */
if (shmctl(shm_id, IPC_STAT, &shm_ds) != 0) {
DEBUG(0,("ERROR shmctl : can't IPC_STAT. Error was %s\n", strerror(errno)));
+ global_unlock();
+ return NULL;
}
if (!read_only) {
WINS db that our parent is going to write.
**************************************************************************** */
-static int sig_term(void)
+static void sig_term(int sig)
{
_exit(0);
- /* Keep compiler happy.. */
- return 0;
}
/***************************************************************************
/**************************************************************************** **
catch a sigterm
**************************************************************************** */
-static int sig_term(void)
+static void sig_term(int sig)
{
BlockSignals(True,SIGTERM);
exit(0);
- /* Keep compiler happy.. */
- return 0;
} /* sig_term */
/**************************************************************************** **
catch a sighup
**************************************************************************** */
-static int sig_hup(void)
+static void sig_hup(int sig)
{
BlockSignals( True, SIGHUP );
BlockSignals(False,SIGHUP);
- return(0);
} /* sig_hup */
/**************************************************************************** **
catch a sigpipe
**************************************************************************** */
-static int sig_pipe(void)
+static void sig_pipe(int sig)
{
BlockSignals( True, SIGPIPE );
if ( !is_daemon )
exit(1);
BlockSignals( False, SIGPIPE );
- return(0);
} /* sig_pipe */
#if DUMP_CORE
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
struct smb_passwd *pwd = NULL;
void *fp = NULL;
- DEBUG(10, ("iterate_getsmbpwuid: search by smb_userid: %x\n", smb_userid));
+ DEBUG(10, ("iterate_getsmbpwuid: search by smb_userid: %x\n", (int)smb_userid));
/* Open the smb password database - not for update. */
fp = startsmbpwent(False);
if (pwd != NULL)
{
- DEBUG(10, ("iterate_getsmbpwuid: found by smb_userid: %x\n", smb_userid));
+ DEBUG(10, ("iterate_getsmbpwuid: found by smb_userid: %x\n", (int)smb_userid));
}
endsmbpwent(fp);
struct sam_passwd *pwd = NULL;
void *fp = NULL;
- DEBUG(10, ("iterate_getsam21pwuid: search by uid: %x\n", uid));
+ DEBUG(10, ("iterate_getsam21pwuid: search by uid: %x\n", (int)uid));
/* Open the smb password file - not for update. */
fp = startsmbpwent(False);
if (pwd != NULL)
{
- DEBUG(10, ("iterate_getsam21pwuid: found by smb_userid: %x\n", uid));
+ DEBUG(10, ("iterate_getsam21pwuid: found by smb_userid: %x\n", (int)uid));
}
endsmbpwent(fp);
for (i = 0; i < 8; i++)
{
- if (p[i] == '\0' || !isxdigit(p[i]))
+ if (p[i] == '\0' || !isxdigit((int)p[i]))
break;
}
if (i == 8)
p = &linebuf[37];
for(i = 0; i < 8; i++) {
- if(p[i] == '\0' || !isxdigit(p[i])) {
+ if(p[i] == '\0' || !isxdigit((int)p[i])) {
DEBUG(0,("get_trust_account_password: Malformed trust password file (no timestamp).\n"));
#ifdef DEBUG_PASSWORD
DEBUG(100,("get_trust_account_password: line = |%s|\n", linebuf));
return(False);
/* the Job and Total columns must be integer */
- if (!isdigit(*tok[JOBTOK]) || !isdigit(*tok[TOTALTOK])) return(False);
+ if (!isdigit((int)*tok[JOBTOK]) || !isdigit((int)*tok[TOTALTOK])) return(False);
/* if the fname contains a space then use STDIN */
if (strchr(tok[FILETOK],' '))
return(False);
/* the Job and Total columns must be integer */
- if (!isdigit(*tok[LPRNG_JOBTOK]) || !isdigit(*tok[LPRNG_TOTALTOK])) return(False);
+ if (!isdigit((int)*tok[LPRNG_JOBTOK]) || !isdigit((int)*tok[LPRNG_TOTALTOK])) return(False);
/* if the fname contains a space then use STDIN */
/* I do not understand how this would be possible. Magnus. */
if ((count == 7) && ((strcmp(tok[0],"QUEUED") == 0) || (strcmp(tok[0],"HELD") == 0)))
{
/* the 2nd and 5th columns must be integer */
- if (!isdigit(*tok[1]) || !isdigit(*tok[4])) return(False);
+ if (!isdigit((int)*tok[1]) || !isdigit((int)*tok[4])) return(False);
buf->size = atoi(tok[4]) * 1024;
/* if the fname contains a space then use STDIN */
if (strchr(tok[2],' '))
else
{
/* the 4th and 9th columns must be integer */
- if (!isdigit(*tok[3]) || !isdigit(*tok[8])) return(False);
+ if (!isdigit((int)*tok[3]) || !isdigit((int)*tok[8])) return(False);
buf->size = atoi(tok[8]) * 1024;
/* if the fname contains a space then use STDIN */
if (strchr(tok[4],' '))
if (count < 2) return(False);
/* the 2nd column must be integer */
- if (!isdigit(*tok[1])) return(False);
+ if (!isdigit((int)*tok[1])) return(False);
/* if the fname contains a space then use STDIN */
if (strchr(tok[0],' '))
/* first token must be printer name (cannot check ?) */
/* the 2nd, 5th & 7th column must be integer */
- if (!isdigit(*tok[1]) || !isdigit(*tok[4]) || !isdigit(*tok[6])) return(False);
+ if (!isdigit((int)*tok[1]) || !isdigit((int)*tok[4]) || !isdigit((int)*tok[6])) return(False);
jobid = atoi(tok[1]);
StrnCpy(jobuser,tok[2],sizeof(buf->user)-1);
jobprio = atoi(tok[4]);
return(False);
/* the 2nd and 4th, 6th columns must be integer */
- if (!isdigit(*tok[1]) || !isdigit(*tok[3])) return(False);
- if (!isdigit(*tok[5])) return(False);
+ if (!isdigit((int)*tok[1]) || !isdigit((int)*tok[3])) return(False);
+ if (!isdigit((int)*tok[5])) return(False);
/* if the user contains a ! then trim the first part of it */
if ((p=strchr(tok[2],'!')))
return(False);
/* the 3rd and 5th columns must be integer */
- if (!isdigit(*tok[2]) || !isdigit(*tok[4])) return(False);
+ if (!isdigit((int)*tok[2]) || !isdigit((int)*tok[4])) return(False);
/* only take the last part of the filename */
{
return(False);
/* the first must be "active" or begin with an integer */
- if (strcmp(tok[0],"active") && !isdigit(tok[0][0]))
+ if (strcmp(tok[0],"active") && !isdigit((int)tok[0][0]))
return(False);
/* the 5th and 8th must be integer */
- if (!isdigit(*tok[4]) || !isdigit(*tok[7]))
+ if (!isdigit((int)*tok[4]) || !isdigit((int)*tok[7]))
return(False);
/* if the fname contains a space then use STDIN */
return(False);
/* the 1st and 7th columns must be integer */
- if (!isdigit(*tok[0]) || !isdigit(*tok[6])) return(False);
+ if (!isdigit((int)*tok[0]) || !isdigit((int)*tok[6])) return(False);
/* if the 2nd column is either '>' or 'H' then the 7th and 8th must be
* integer, else it's the 6th and 7th that must be
*/
if (*tok[1] == 'H' || *tok[1] == '>')
{
- if (!isdigit(*tok[7]))
+ if (!isdigit((int)*tok[7]))
return(False);
buf->status = *tok[1] == '>' ? LPQ_PRINTING : LPQ_PAUSED;
count = 1;
}
else
{
- if (!isdigit(*tok[5]))
+ if (!isdigit((int)*tok[5]))
return(False);
buf->status = LPQ_QUEUED;
count = 0;
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)
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;
}
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;
}
{
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))
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;
int ret = nt_open_pipe(fname, conn, inbuf, outbuf, &fnum);
if(ret != 0)
return ret;
+ fsp = &Files[fnum];
smb_action = FILE_WAS_OPENED;
} else {
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);
}
{
BOOL host_ok = False;
-#ifdef HAVE_NETGROUP
+#if defined(HAVE_NETGROUP) && defined(HAVE_YP_GET_DEFAULT_DOMAIN)
if (is_group)
{
static char *mydomain = NULL;
pstrcpy(smb_buf(outbuf),devicename);
} else {
char *fsname = FSTYPE_STRING;
- char *p;
set_message(outbuf,3,3,True);
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);
}
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);
}
pstrcpy(s,smb_buf(inbuf)+1);
p = s;
while (*p) {
- if (!(isalnum(*p) || strchr("._-",*p)))
+ if (!(isalnum((int)*p) || strchr("._-",*p)))
*p = 'X';
p++;
}
/****************************************************************************
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);
DEBUG(3,("lost connection to password server\n"));
cli_shutdown(cli);
BlockSignals(False,SIGPIPE);
- return 0;
+ return;
}
exit_server("Got sigpipe\n");
- return(0);
}
/****************************************************************************
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;
}
****************************************************************************/
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"));
reload_after_sighup = True;
BlockSignals(False,SIGHUP);
- return(0);
}
/****************************************************************************
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
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)
{
*/
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--)
* here.
*/
- name_map_mangle( dname, False, SNUM(conn));
+ if(dname != NULL)
+ name_map_mangle( dname, False, SNUM(conn));
if(dname && strcsequal( resume_name, dname))
{
* 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 ));
#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"));
}
#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"));
}
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);
}
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;
BOOL parse_bool(char *buf, unsigned char *bp)
{
- if(isdigit(*buf))
+ if(isdigit((int)*buf))
{
char *endptr = NULL;
/* sanitise the filename */
for (i=0;file[i];i++) {
- if (!isalnum(file[i]) && !strchr("/.-_", file[i])) {
+ if (!isalnum((int)file[i]) && !strchr("/.-_", file[i])) {
cgi_setup_error("404 File Not Found","",
"Illegal character in filename");
}