mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
configure: Changes for extra headers.
configure.in: Source for header changes. client/clitar.c: Fixed isXXX macros & debugs for gcc pedantic compile. include/config.h.in: Added MEMSET, BZERO, MEMORY, RPCSVC_YPCLNT, STRINGS headers. include/includes.h: Headers for the above. include/smb.h: Made SIGNAL_CAST POSIX by default void (*)(int). lib/access.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/charset.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/debug.c: Fixed signal functs. lib/kanji.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/smbrun.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/util.c: Fixed isXXX macros & debugs for gcc pedantic compile. libsmb/namequery.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem_sysv.c: Fixed error messages in sysV stuff. nmbd/asyncdns.c: Fixed signal functs. nmbd/nmbd.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/passdb.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/smbpassfile.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/chgpasswd.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/ipc.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/nttrans.c: Fixed fsp code path. smbd/password.c: fixed HAVE_YP_GET_DEFAULT_DOMAIN problem. smbd/printing.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/reply.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/server.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/trans2.c: Fixed core dump bug. smbd/uid.c: Fixed isXXX macros & debugs for gcc pedantic compile. Jeremy.
This commit is contained in:
@ -522,7 +522,7 @@ static long unoct(char *p, int ndgs)
|
|||||||
|
|
||||||
while (--ndgs)
|
while (--ndgs)
|
||||||
{
|
{
|
||||||
if (isdigit(*p))
|
if (isdigit((int)*p))
|
||||||
value = (value << 3) | (long) (*p - '0');
|
value = (value << 3) | (long) (*p - '0');
|
||||||
|
|
||||||
p++;
|
p++;
|
||||||
@ -1517,7 +1517,7 @@ static void unfixtarname(char *tptr, char *fp, int l, BOOL first)
|
|||||||
* dos \'s in path. Kill any absolute path names. But only if first!
|
* 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 (first) {
|
||||||
if (*fp == '.') {
|
if (*fp == '.') {
|
||||||
|
8
source/configure
vendored
8
source/configure
vendored
@ -1413,7 +1413,7 @@ else
|
|||||||
fi
|
fi
|
||||||
done
|
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
|
do
|
||||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||||
@ -1453,7 +1453,7 @@ else
|
|||||||
fi
|
fi
|
||||||
done
|
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
|
do
|
||||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||||
@ -1493,7 +1493,7 @@ else
|
|||||||
fi
|
fi
|
||||||
done
|
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
|
do
|
||||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||||
@ -3097,7 +3097,7 @@ else
|
|||||||
fi
|
fi
|
||||||
done
|
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
|
do
|
||||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||||
echo "configure:3104: checking for $ac_func" >&5
|
echo "configure:3104: checking for $ac_func" >&5
|
||||||
|
@ -28,9 +28,9 @@ AC_HEADER_DIRENT
|
|||||||
AC_HEADER_TIME
|
AC_HEADER_TIME
|
||||||
AC_HEADER_SYS_WAIT
|
AC_HEADER_SYS_WAIT
|
||||||
AC_CHECK_HEADERS(sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
|
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(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
|
||||||
AC_CHECK_HEADERS(compat.h sys/param.h ctype.h sys/wait.h sys/ioctl.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 stdlib.h sys/socket.h sys/mode.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/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(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_HEADERS(shadow.h netinet/tcp.h sys/security.h security/pam_appl.h)
|
||||||
@ -144,7 +144,7 @@ fi])
|
|||||||
|
|
||||||
|
|
||||||
AC_CHECK_FUNCS(waitpid getcwd strdup strerror chown chmod chroot)
|
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(memmove vsnprintf setsid glob strpbrk pipe crypt16 getauthuid)
|
||||||
AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr)
|
AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction innetgr)
|
||||||
AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf putprpwnam)
|
AC_CHECK_FUNCS(initgroups select rdchk getgrnam pathconf putprpwnam)
|
||||||
|
@ -127,6 +127,9 @@
|
|||||||
/* Define if you have the bigcrypt function. */
|
/* Define if you have the bigcrypt function. */
|
||||||
#undef HAVE_BIGCRYPT
|
#undef HAVE_BIGCRYPT
|
||||||
|
|
||||||
|
/* Define if you have the bzero function. */
|
||||||
|
#undef HAVE_BZERO
|
||||||
|
|
||||||
/* Define if you have the chmod function. */
|
/* Define if you have the chmod function. */
|
||||||
#undef HAVE_CHMOD
|
#undef HAVE_CHMOD
|
||||||
|
|
||||||
@ -190,6 +193,9 @@
|
|||||||
/* Define if you have the memmove function. */
|
/* Define if you have the memmove function. */
|
||||||
#undef HAVE_MEMMOVE
|
#undef HAVE_MEMMOVE
|
||||||
|
|
||||||
|
/* Define if you have the memset function. */
|
||||||
|
#undef HAVE_MEMSET
|
||||||
|
|
||||||
/* Define if you have the mktime function. */
|
/* Define if you have the mktime function. */
|
||||||
#undef HAVE_MKTIME
|
#undef HAVE_MKTIME
|
||||||
|
|
||||||
@ -286,6 +292,9 @@
|
|||||||
/* Define if you have the <limits.h> header file. */
|
/* Define if you have the <limits.h> header file. */
|
||||||
#undef HAVE_LIMITS_H
|
#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. */
|
/* Define if you have the <ndir.h> header file. */
|
||||||
#undef HAVE_NDIR_H
|
#undef HAVE_NDIR_H
|
||||||
|
|
||||||
@ -310,6 +319,9 @@
|
|||||||
/* Define if you have the <string.h> header file. */
|
/* Define if you have the <string.h> header file. */
|
||||||
#undef HAVE_STRING_H
|
#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. */
|
/* Define if you have the <sys/dir.h> header file. */
|
||||||
#undef HAVE_SYS_DIR_H
|
#undef HAVE_SYS_DIR_H
|
||||||
|
|
||||||
@ -346,6 +358,9 @@
|
|||||||
/* Define if you have the <sys/param.h> header file. */
|
/* Define if you have the <sys/param.h> header file. */
|
||||||
#undef HAVE_SYS_PARAM_H
|
#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. */
|
/* Define if you have the <sys/security.h> header file. */
|
||||||
#undef HAVE_SYS_SECURITY_H
|
#undef HAVE_SYS_SECURITY_H
|
||||||
|
|
||||||
|
@ -71,6 +71,14 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MEMORY_H
|
||||||
|
#include <memory.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_MALLOC_H
|
#ifdef HAVE_MALLOC_H
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
@ -241,6 +249,10 @@
|
|||||||
#include <compat.h>
|
#include <compat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_RPCSVC_YPCLNT_H
|
||||||
|
#include <rpcsvc/ypclnt.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef uchar
|
#ifndef uchar
|
||||||
#define uchar unsigned char
|
#define uchar unsigned char
|
||||||
#endif
|
#endif
|
||||||
@ -470,4 +482,8 @@ int setresuid(uid_t ruid, uid_t euid, uid_t suid);
|
|||||||
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
|
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(HAVE_BZERO) && defined(HAVE_MEMSET)
|
||||||
|
#define bzero(a,b) memset((a),'\0',(b))
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _INCLUDES_H */
|
#endif /* _INCLUDES_H */
|
||||||
|
@ -63,8 +63,8 @@ void add_char_string(char *s);
|
|||||||
|
|
||||||
/*The following definitions come from lib/debug.c */
|
/*The following definitions come from lib/debug.c */
|
||||||
|
|
||||||
int sig_usr2( void );
|
void sig_usr2( int sig );
|
||||||
int sig_usr1( void );
|
void sig_usr1( int sig );
|
||||||
void setup_logging( char *pname, BOOL interactive );
|
void setup_logging( char *pname, BOOL interactive );
|
||||||
void reopen_logs( void );
|
void reopen_logs( void );
|
||||||
void force_check_log_size( void );
|
void force_check_log_size( void );
|
||||||
|
@ -1274,7 +1274,7 @@ char *strdup(char *s);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SIGNAL_CAST
|
#ifndef SIGNAL_CAST
|
||||||
#define SIGNAL_CAST (RETSIGTYPE (*)())
|
#define SIGNAL_CAST (RETSIGTYPE (*)(int))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SELECT_CAST
|
#ifndef SELECT_CAST
|
||||||
|
@ -106,7 +106,7 @@ static int string_match(char *tok,char *s)
|
|||||||
if (strncmp(tok, s, tok_len) == 0)
|
if (strncmp(tok, s, tok_len) == 0)
|
||||||
return (True);
|
return (True);
|
||||||
} else if ((cut = strchr(tok, '/')) != 0) { /* netnumber/netmask */
|
} 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 (True);
|
||||||
}
|
}
|
||||||
return (False);
|
return (False);
|
||||||
|
@ -161,7 +161,7 @@ void charset_initialise(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i=0;i<=127;i++) {
|
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);
|
add_dos_char(i,False,0,False);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,8 +172,8 @@ void charset_initialise(void)
|
|||||||
/* Some systems have buggy isupper/islower for characters
|
/* Some systems have buggy isupper/islower for characters
|
||||||
above 127. Best not to rely on them. */
|
above 127. Best not to rely on them. */
|
||||||
if(i < 128) {
|
if(i < 128) {
|
||||||
if (isupper(c)) lower_char_map[i] = tolower(c);
|
if (isupper((int)c)) lower_char_map[i] = tolower(c);
|
||||||
if (islower(c)) upper_char_map[i] = toupper(c);
|
if (islower((int)c)) upper_char_map[i] = toupper(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ static int format_pos = 0;
|
|||||||
* catch a sigusr2 - decrease the debug log level.
|
* catch a sigusr2 - decrease the debug log level.
|
||||||
* ************************************************************************** **
|
* ************************************************************************** **
|
||||||
*/
|
*/
|
||||||
int sig_usr2( void )
|
void sig_usr2( int sig )
|
||||||
{
|
{
|
||||||
BlockSignals( True, SIGUSR2 );
|
BlockSignals( True, SIGUSR2 );
|
||||||
|
|
||||||
@ -125,7 +125,6 @@ int sig_usr2( void )
|
|||||||
BlockSignals( False, SIGUSR2 );
|
BlockSignals( False, SIGUSR2 );
|
||||||
CatchSignal( SIGUSR2, SIGNAL_CAST sig_usr2 );
|
CatchSignal( SIGUSR2, SIGNAL_CAST sig_usr2 );
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
} /* sig_usr2 */
|
} /* sig_usr2 */
|
||||||
#endif /* SIGUSR2 */
|
#endif /* SIGUSR2 */
|
||||||
|
|
||||||
@ -134,7 +133,7 @@ int sig_usr2( void )
|
|||||||
* catch a sigusr1 - increase the debug log level.
|
* catch a sigusr1 - increase the debug log level.
|
||||||
* ************************************************************************** **
|
* ************************************************************************** **
|
||||||
*/
|
*/
|
||||||
int sig_usr1( void )
|
void sig_usr1( int sig )
|
||||||
{
|
{
|
||||||
BlockSignals( True, SIGUSR1 );
|
BlockSignals( True, SIGUSR1 );
|
||||||
|
|
||||||
@ -148,7 +147,6 @@ int sig_usr1( void )
|
|||||||
BlockSignals( False, SIGUSR1 );
|
BlockSignals( False, SIGUSR1 );
|
||||||
CatchSignal( SIGUSR1, SIGNAL_CAST sig_usr1 );
|
CatchSignal( SIGUSR1, SIGNAL_CAST sig_usr1 );
|
||||||
|
|
||||||
return( 0 );
|
|
||||||
} /* sig_usr1 */
|
} /* sig_usr1 */
|
||||||
#endif /* SIGUSR1 */
|
#endif /* SIGUSR1 */
|
||||||
|
|
||||||
|
@ -856,7 +856,7 @@ static char *hex_to_sj(char *from, BOOL overwrite)
|
|||||||
sp = (char *) from;
|
sp = (char *) from;
|
||||||
dp = cvtbuf;
|
dp = cvtbuf;
|
||||||
while (*sp) {
|
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]));
|
*dp++ = (hex2bin (sp[1])<<4) | (hex2bin (sp[2]));
|
||||||
sp += 3;
|
sp += 3;
|
||||||
} else
|
} else
|
||||||
@ -924,7 +924,7 @@ static char *cap_to_sj(char *from, BOOL overwrite)
|
|||||||
* we only do the reverse (that's why the strchr is used rather than
|
* 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).
|
* 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]));
|
*dp++ = (hex2bin (sp[1])<<4) | (hex2bin (sp[2]));
|
||||||
sp += 3;
|
sp += 3;
|
||||||
} else
|
} else
|
||||||
|
@ -85,7 +85,6 @@ if shared is not set then open the file with O_EXCL set
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
int smbrun(char *cmd,char *outfile,BOOL shared)
|
int smbrun(char *cmd,char *outfile,BOOL shared)
|
||||||
{
|
{
|
||||||
extern struct current_user current_user;
|
|
||||||
int fd,pid;
|
int fd,pid;
|
||||||
int uid = current_user.uid;
|
int uid = current_user.uid;
|
||||||
int gid = current_user.gid;
|
int gid = current_user.gid;
|
||||||
|
@ -3636,7 +3636,7 @@ uint32 interpret_addr(char *str)
|
|||||||
if (strcmp(str,"255.255.255.255") == 0) return(0xFFFFFFFF);
|
if (strcmp(str,"255.255.255.255") == 0) return(0xFFFFFFFF);
|
||||||
|
|
||||||
for (i=0; pure_address && str[i]; i++)
|
for (i=0; pure_address && str[i]; i++)
|
||||||
if (!(isdigit(str[i]) || str[i] == '.'))
|
if (!(isdigit((int)str[i]) || str[i] == '.'))
|
||||||
pure_address = False;
|
pure_address = False;
|
||||||
|
|
||||||
/* if it's in the form of an IP address then get the lib to interpret it */
|
/* if it's in the form of an IP address then get the lib to interpret it */
|
||||||
@ -4608,7 +4608,7 @@ BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type)
|
|||||||
(lock.l_pid != 0) &&
|
(lock.l_pid != 0) &&
|
||||||
(lock.l_pid != getpid()))
|
(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);
|
return(True);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ static void _interpret_node_status(char *p, char *master,char *rname)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = strlen( qname) ; --i >= 0 ; ) {
|
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));
|
DEBUG(1,("\t%-15s <%02x> - %s\n",qname,type,flags));
|
||||||
p+=2;
|
p+=2;
|
||||||
@ -439,7 +439,7 @@ BOOL resolve_name(char *name, struct in_addr *return_ip)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i=0; pure_address && name[i]; i++)
|
for (i=0; pure_address && name[i]; i++)
|
||||||
if (!(isdigit(name[i]) || name[i] == '.'))
|
if (!(isdigit((int)name[i]) || name[i] == '.'))
|
||||||
pure_address = False;
|
pure_address = False;
|
||||||
|
|
||||||
/* if it's in the form of an IP address then get the lib to interpret it */
|
/* if it's in the form of an IP address then get the lib to interpret it */
|
||||||
|
@ -340,7 +340,7 @@ static BOOL smb_shm_register_process(char *processreg_file, pid_t pid, BOOL *oth
|
|||||||
{
|
{
|
||||||
/* erase old pid */
|
/* erase old pid */
|
||||||
DEBUG(5,("smb_shm_register_process : erasing stale record for pid %d (seek_back = %d)\n",
|
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;
|
other_pid = (pid_t)0;
|
||||||
erased_slot = lseek(smb_shm_processes_fd, seek_back, SEEK_CUR);
|
erased_slot = lseek(smb_shm_processes_fd, seek_back, SEEK_CUR);
|
||||||
write(smb_shm_processes_fd, &other_pid, sizeof(other_pid));
|
write(smb_shm_processes_fd, &other_pid, sizeof(other_pid));
|
||||||
@ -362,7 +362,8 @@ static BOOL smb_shm_register_process(char *processreg_file, pid_t pid, BOOL *oth
|
|||||||
if(free_slot < 0)
|
if(free_slot < 0)
|
||||||
free_slot = lseek(smb_shm_processes_fd, 0, SEEK_END);
|
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);
|
lseek(smb_shm_processes_fd, free_slot, SEEK_SET);
|
||||||
if(write(smb_shm_processes_fd, &pid, sizeof(pid)) < 0)
|
if(write(smb_shm_processes_fd, &pid, sizeof(pid)) < 0)
|
||||||
{
|
{
|
||||||
@ -395,12 +396,12 @@ static BOOL smb_shm_unregister_process(char *processreg_file, pid_t pid)
|
|||||||
|
|
||||||
while ((nb_read = read(smb_shm_processes_fd, &other_pid, sizeof(other_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)
|
if(other_pid == pid)
|
||||||
{
|
{
|
||||||
/* erase pid */
|
/* erase pid */
|
||||||
DEBUG(5,("smb_shm_unregister_process : erasing record for pid %d (seek_val = %d)\n",
|
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;
|
other_pid = (pid_t)0;
|
||||||
erased_slot = lseek(smb_shm_processes_fd, seek_back, SEEK_CUR);
|
erased_slot = lseek(smb_shm_processes_fd, seek_back, SEEK_CUR);
|
||||||
if(write(smb_shm_processes_fd, &other_pid, sizeof(other_pid)) < 0)
|
if(write(smb_shm_processes_fd, &other_pid, sizeof(other_pid)) < 0)
|
||||||
@ -423,7 +424,8 @@ static BOOL smb_shm_unregister_process(char *processreg_file, pid_t pid)
|
|||||||
|
|
||||||
if(!found)
|
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);
|
close(smb_shm_processes_fd);
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
@ -540,7 +542,8 @@ static BOOL smb_shm_close( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
smb_shm_global_lock();
|
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_unregister_process(smb_shm_processreg_name, getpid());
|
||||||
smb_shm_global_unlock();
|
smb_shm_global_unlock();
|
||||||
|
|
||||||
|
@ -564,8 +564,9 @@ struct shmem_ops *sysv_shm_open(int ronly)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sem_id == -1) {
|
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)));
|
strerror(errno)));
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sem_id != -1) {
|
if (sem_id != -1) {
|
||||||
@ -574,6 +575,7 @@ struct shmem_ops *sysv_shm_open(int ronly)
|
|||||||
if (semctl(sem_id, i, SETVAL, su) != 0) {
|
if (semctl(sem_id, i, SETVAL, su) != 0) {
|
||||||
DEBUG(1,("Failed to init semaphore %d. Error was %s\n",
|
DEBUG(1,("Failed to init semaphore %d. Error was %s\n",
|
||||||
i, strerror(errno)));
|
i, strerror(errno)));
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -582,7 +584,7 @@ struct shmem_ops *sysv_shm_open(int ronly)
|
|||||||
sem_id = semget(SEMAPHORE_KEY, 0, 0);
|
sem_id = semget(SEMAPHORE_KEY, 0, 0);
|
||||||
}
|
}
|
||||||
if (sem_id == -1) {
|
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)));
|
strerror(errno)));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -609,6 +611,7 @@ struct shmem_ops *sysv_shm_open(int ronly)
|
|||||||
if (semctl(sem_id, 0, SETVAL, su) != 0) {
|
if (semctl(sem_id, 0, SETVAL, su) != 0) {
|
||||||
DEBUG(0,("ERROR: Failed to clear global lock. Error was %s\n",
|
DEBUG(0,("ERROR: Failed to clear global lock. Error was %s\n",
|
||||||
strerror(errno)));
|
strerror(errno)));
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -616,6 +619,7 @@ struct shmem_ops *sysv_shm_open(int ronly)
|
|||||||
if (semctl(sem_id, 0, IPC_SET, su) != 0) {
|
if (semctl(sem_id, 0, IPC_SET, su) != 0) {
|
||||||
DEBUG(0,("ERROR shmctl : can't IPC_SET. Error was %s\n",
|
DEBUG(0,("ERROR shmctl : can't IPC_SET. Error was %s\n",
|
||||||
strerror(errno)));
|
strerror(errno)));
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -632,6 +636,8 @@ struct shmem_ops *sysv_shm_open(int ronly)
|
|||||||
if (semctl(sem_id, i, SETVAL, su) != 0) {
|
if (semctl(sem_id, i, SETVAL, su) != 0) {
|
||||||
DEBUG(0,("ERROR: Failed to clear IPC lock %d. Error was %s\n",
|
DEBUG(0,("ERROR: Failed to clear IPC lock %d. Error was %s\n",
|
||||||
i, strerror(errno)));
|
i, strerror(errno)));
|
||||||
|
global_unlock();
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -679,6 +685,8 @@ struct shmem_ops *sysv_shm_open(int ronly)
|
|||||||
mapping processes */
|
mapping processes */
|
||||||
if (shmctl(shm_id, IPC_STAT, &shm_ds) != 0) {
|
if (shmctl(shm_id, IPC_STAT, &shm_ds) != 0) {
|
||||||
DEBUG(0,("ERROR shmctl : can't IPC_STAT. Error was %s\n", strerror(errno)));
|
DEBUG(0,("ERROR shmctl : can't IPC_STAT. Error was %s\n", strerror(errno)));
|
||||||
|
global_unlock();
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!read_only) {
|
if (!read_only) {
|
||||||
|
@ -110,11 +110,9 @@ static void asyncdns_process(void)
|
|||||||
WINS db that our parent is going to write.
|
WINS db that our parent is going to write.
|
||||||
**************************************************************************** */
|
**************************************************************************** */
|
||||||
|
|
||||||
static int sig_term(void)
|
static void sig_term(int sig)
|
||||||
{
|
{
|
||||||
_exit(0);
|
_exit(0);
|
||||||
/* Keep compiler happy.. */
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
@ -61,7 +61,7 @@ extern struct in_addr ipzero;
|
|||||||
/**************************************************************************** **
|
/**************************************************************************** **
|
||||||
catch a sigterm
|
catch a sigterm
|
||||||
**************************************************************************** */
|
**************************************************************************** */
|
||||||
static int sig_term(void)
|
static void sig_term(int sig)
|
||||||
{
|
{
|
||||||
BlockSignals(True,SIGTERM);
|
BlockSignals(True,SIGTERM);
|
||||||
|
|
||||||
@ -81,14 +81,12 @@ static int sig_term(void)
|
|||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
/* Keep compiler happy.. */
|
|
||||||
return 0;
|
|
||||||
} /* sig_term */
|
} /* sig_term */
|
||||||
|
|
||||||
/**************************************************************************** **
|
/**************************************************************************** **
|
||||||
catch a sighup
|
catch a sighup
|
||||||
**************************************************************************** */
|
**************************************************************************** */
|
||||||
static int sig_hup(void)
|
static void sig_hup(int sig)
|
||||||
{
|
{
|
||||||
BlockSignals( True, SIGHUP );
|
BlockSignals( True, SIGHUP );
|
||||||
|
|
||||||
@ -103,13 +101,12 @@ static int sig_hup(void)
|
|||||||
|
|
||||||
BlockSignals(False,SIGHUP);
|
BlockSignals(False,SIGHUP);
|
||||||
|
|
||||||
return(0);
|
|
||||||
} /* sig_hup */
|
} /* sig_hup */
|
||||||
|
|
||||||
/**************************************************************************** **
|
/**************************************************************************** **
|
||||||
catch a sigpipe
|
catch a sigpipe
|
||||||
**************************************************************************** */
|
**************************************************************************** */
|
||||||
static int sig_pipe(void)
|
static void sig_pipe(int sig)
|
||||||
{
|
{
|
||||||
BlockSignals( True, SIGPIPE );
|
BlockSignals( True, SIGPIPE );
|
||||||
|
|
||||||
@ -117,7 +114,6 @@ static int sig_pipe(void)
|
|||||||
if ( !is_daemon )
|
if ( !is_daemon )
|
||||||
exit(1);
|
exit(1);
|
||||||
BlockSignals( False, SIGPIPE );
|
BlockSignals( False, SIGPIPE );
|
||||||
return(0);
|
|
||||||
} /* sig_pipe */
|
} /* sig_pipe */
|
||||||
|
|
||||||
#if DUMP_CORE
|
#if DUMP_CORE
|
||||||
@ -147,7 +143,7 @@ static BOOL dump_core(void)
|
|||||||
rlp.rlim_cur = MAX( 4*1024*1024, rlp.rlim_cur );
|
rlp.rlim_cur = MAX( 4*1024*1024, rlp.rlim_cur );
|
||||||
setrlimit( RLIMIT_CORE, &rlp );
|
setrlimit( RLIMIT_CORE, &rlp );
|
||||||
getrlimit( 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
|
||||||
#endif
|
#endif
|
||||||
|
@ -113,7 +113,7 @@ struct smb_passwd *iterate_getsmbpwuid(uid_t smb_userid)
|
|||||||
struct smb_passwd *pwd = NULL;
|
struct smb_passwd *pwd = NULL;
|
||||||
void *fp = 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. */
|
/* Open the smb password database - not for update. */
|
||||||
fp = startsmbpwent(False);
|
fp = startsmbpwent(False);
|
||||||
@ -129,7 +129,7 @@ struct smb_passwd *iterate_getsmbpwuid(uid_t smb_userid)
|
|||||||
|
|
||||||
if (pwd != NULL)
|
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);
|
endsmbpwent(fp);
|
||||||
@ -370,7 +370,7 @@ struct sam_passwd *iterate_getsam21pwuid(uid_t uid)
|
|||||||
struct sam_passwd *pwd = NULL;
|
struct sam_passwd *pwd = NULL;
|
||||||
void *fp = 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. */
|
/* Open the smb password file - not for update. */
|
||||||
fp = startsmbpwent(False);
|
fp = startsmbpwent(False);
|
||||||
@ -386,7 +386,7 @@ struct sam_passwd *iterate_getsam21pwuid(uid_t uid)
|
|||||||
|
|
||||||
if (pwd != NULL)
|
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);
|
endsmbpwent(fp);
|
||||||
@ -599,7 +599,7 @@ static time_t get_time_from_string(char *p)
|
|||||||
|
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
if (p[i] == '\0' || !isxdigit(p[i]))
|
if (p[i] == '\0' || !isxdigit((int)p[i]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == 8)
|
if (i == 8)
|
||||||
|
@ -268,7 +268,7 @@ BOOL get_trust_account_password( unsigned char *ret_pwd, time_t *pass_last_set_t
|
|||||||
p = &linebuf[37];
|
p = &linebuf[37];
|
||||||
|
|
||||||
for(i = 0; i < 8; i++) {
|
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"));
|
DEBUG(0,("get_trust_account_password: Malformed trust password file (no timestamp).\n"));
|
||||||
#ifdef DEBUG_PASSWORD
|
#ifdef DEBUG_PASSWORD
|
||||||
DEBUG(100,("get_trust_account_password: line = |%s|\n", linebuf));
|
DEBUG(100,("get_trust_account_password: line = |%s|\n", linebuf));
|
||||||
|
@ -235,7 +235,7 @@ static BOOL parse_lpq_bsd(char *line,print_queue_struct *buf,BOOL first)
|
|||||||
return(False);
|
return(False);
|
||||||
|
|
||||||
/* the Job and Total columns must be integer */
|
/* 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 the fname contains a space then use STDIN */
|
||||||
if (strchr(tok[FILETOK],' '))
|
if (strchr(tok[FILETOK],' '))
|
||||||
@ -405,7 +405,7 @@ A long spool-path will just waste significant chars of the file name.
|
|||||||
return(False);
|
return(False);
|
||||||
|
|
||||||
/* the Job and Total columns must be integer */
|
/* 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 */
|
/* if the fname contains a space then use STDIN */
|
||||||
/* I do not understand how this would be possible. Magnus. */
|
/* I do not understand how this would be possible. Magnus. */
|
||||||
@ -479,7 +479,7 @@ static BOOL parse_lpq_aix(char *line,print_queue_struct *buf,BOOL first)
|
|||||||
if ((count == 7) && ((strcmp(tok[0],"QUEUED") == 0) || (strcmp(tok[0],"HELD") == 0)))
|
if ((count == 7) && ((strcmp(tok[0],"QUEUED") == 0) || (strcmp(tok[0],"HELD") == 0)))
|
||||||
{
|
{
|
||||||
/* the 2nd and 5th columns must be integer */
|
/* 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;
|
buf->size = atoi(tok[4]) * 1024;
|
||||||
/* if the fname contains a space then use STDIN */
|
/* if the fname contains a space then use STDIN */
|
||||||
if (strchr(tok[2],' '))
|
if (strchr(tok[2],' '))
|
||||||
@ -513,7 +513,7 @@ static BOOL parse_lpq_aix(char *line,print_queue_struct *buf,BOOL first)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* the 4th and 9th columns must be integer */
|
/* 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;
|
buf->size = atoi(tok[8]) * 1024;
|
||||||
/* if the fname contains a space then use STDIN */
|
/* if the fname contains a space then use STDIN */
|
||||||
if (strchr(tok[4],' '))
|
if (strchr(tok[4],' '))
|
||||||
@ -590,7 +590,7 @@ static BOOL parse_lpq_hpux(char * line, print_queue_struct *buf, BOOL first)
|
|||||||
if (count < 2) return(False);
|
if (count < 2) return(False);
|
||||||
|
|
||||||
/* the 2nd column must be integer */
|
/* 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 the fname contains a space then use STDIN */
|
||||||
if (strchr(tok[0],' '))
|
if (strchr(tok[0],' '))
|
||||||
@ -628,7 +628,7 @@ static BOOL parse_lpq_hpux(char * line, print_queue_struct *buf, BOOL first)
|
|||||||
|
|
||||||
/* first token must be printer name (cannot check ?) */
|
/* first token must be printer name (cannot check ?) */
|
||||||
/* the 2nd, 5th & 7th column must be integer */
|
/* 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]);
|
jobid = atoi(tok[1]);
|
||||||
StrnCpy(jobuser,tok[2],sizeof(buf->user)-1);
|
StrnCpy(jobuser,tok[2],sizeof(buf->user)-1);
|
||||||
jobprio = atoi(tok[4]);
|
jobprio = atoi(tok[4]);
|
||||||
@ -678,8 +678,8 @@ static BOOL parse_lpq_sysv(char *line,print_queue_struct *buf,BOOL first)
|
|||||||
return(False);
|
return(False);
|
||||||
|
|
||||||
/* the 2nd and 4th, 6th columns must be integer */
|
/* the 2nd and 4th, 6th columns must be integer */
|
||||||
if (!isdigit(*tok[1]) || !isdigit(*tok[3])) return(False);
|
if (!isdigit((int)*tok[1]) || !isdigit((int)*tok[3])) return(False);
|
||||||
if (!isdigit(*tok[5])) return(False);
|
if (!isdigit((int)*tok[5])) return(False);
|
||||||
|
|
||||||
/* if the user contains a ! then trim the first part of it */
|
/* if the user contains a ! then trim the first part of it */
|
||||||
if ((p=strchr(tok[2],'!')))
|
if ((p=strchr(tok[2],'!')))
|
||||||
@ -742,7 +742,7 @@ static BOOL parse_lpq_qnx(char *line,print_queue_struct *buf,BOOL first)
|
|||||||
return(False);
|
return(False);
|
||||||
|
|
||||||
/* the 3rd and 5th columns must be integer */
|
/* 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 */
|
/* only take the last part of the filename */
|
||||||
{
|
{
|
||||||
@ -797,11 +797,11 @@ static BOOL parse_lpq_plp(char *line,print_queue_struct *buf,BOOL first)
|
|||||||
return(False);
|
return(False);
|
||||||
|
|
||||||
/* the first must be "active" or begin with an integer */
|
/* 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);
|
return(False);
|
||||||
|
|
||||||
/* the 5th and 8th must be integer */
|
/* 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);
|
return(False);
|
||||||
|
|
||||||
/* if the fname contains a space then use STDIN */
|
/* if the fname contains a space then use STDIN */
|
||||||
@ -865,20 +865,20 @@ static BOOL parse_lpq_softq(char *line,print_queue_struct *buf,BOOL first)
|
|||||||
return(False);
|
return(False);
|
||||||
|
|
||||||
/* the 1st and 7th columns must be integer */
|
/* 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
|
/* 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
|
* integer, else it's the 6th and 7th that must be
|
||||||
*/
|
*/
|
||||||
if (*tok[1] == 'H' || *tok[1] == '>')
|
if (*tok[1] == 'H' || *tok[1] == '>')
|
||||||
{
|
{
|
||||||
if (!isdigit(*tok[7]))
|
if (!isdigit((int)*tok[7]))
|
||||||
return(False);
|
return(False);
|
||||||
buf->status = *tok[1] == '>' ? LPQ_PRINTING : LPQ_PAUSED;
|
buf->status = *tok[1] == '>' ? LPQ_PRINTING : LPQ_PAUSED;
|
||||||
count = 1;
|
count = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!isdigit(*tok[5]))
|
if (!isdigit((int)*tok[5]))
|
||||||
return(False);
|
return(False);
|
||||||
buf->status = LPQ_QUEUED;
|
buf->status = LPQ_QUEUED;
|
||||||
count = 0;
|
count = 0;
|
||||||
|
@ -342,7 +342,7 @@ BOOL chat_with_program(char *passwordprogram,char *name,char *chatsequence, BOOL
|
|||||||
|
|
||||||
if(as_root)
|
if(as_root)
|
||||||
become_root(False);
|
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);
|
chstat = dochild(master, slavedev, name, passwordprogram, as_root);
|
||||||
|
|
||||||
if(as_root)
|
if(as_root)
|
||||||
@ -404,7 +404,7 @@ BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root)
|
|||||||
|
|
||||||
len = strlen(oldpass);
|
len = strlen(oldpass);
|
||||||
for(i = 0; i < len; i++) {
|
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"));
|
DEBUG(0,("chat_with_program: oldpass contains control characters (disallowed).\n"));
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
@ -412,7 +412,7 @@ BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root)
|
|||||||
|
|
||||||
len = strlen(newpass);
|
len = strlen(newpass);
|
||||||
for(i = 0; i < len; i++) {
|
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"));
|
DEBUG(0,("chat_with_program: newpass contains control characters (disallowed).\n"));
|
||||||
return False;
|
return False;
|
||||||
}
|
}
|
||||||
|
@ -274,7 +274,7 @@ static int get_counter(char** p)
|
|||||||
{
|
{
|
||||||
int i, n;
|
int i, n;
|
||||||
if (!p || !(*p)) return(1);
|
if (!p || !(*p)) return(1);
|
||||||
if (!isdigit(**p)) return 1;
|
if (!isdigit((int)**p)) return 1;
|
||||||
for (n = 0;;) {
|
for (n = 0;;) {
|
||||||
i = **p;
|
i = **p;
|
||||||
if (isdigit(i))
|
if (isdigit(i))
|
||||||
@ -1969,7 +1969,7 @@ static BOOL api_PrintJobInfo(connection_struct *conn,uint16 vuid,char *param,cha
|
|||||||
break;
|
break;
|
||||||
case 0xb: /* change print job name, data gives the name */
|
case 0xb: /* change print job name, data gives the name */
|
||||||
/* jobid, snum should be zero */
|
/* jobid, snum should be zero */
|
||||||
if (isalpha(*s))
|
if (isalpha((int)*s))
|
||||||
{
|
{
|
||||||
pstring name;
|
pstring name;
|
||||||
int l = 0;
|
int l = 0;
|
||||||
|
@ -452,6 +452,7 @@ int reply_ntcreate_and_X(connection_struct *conn,
|
|||||||
int ret = nt_open_pipe(fname, conn, inbuf, outbuf, &fnum);
|
int ret = nt_open_pipe(fname, conn, inbuf, outbuf, &fnum);
|
||||||
if(ret != 0)
|
if(ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
fsp = &Files[fnum];
|
||||||
smb_action = FILE_WAS_OPENED;
|
smb_action = FILE_WAS_OPENED;
|
||||||
} else {
|
} 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",
|
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);
|
return chain_reply(inbuf,outbuf,length,bufsize);
|
||||||
}
|
}
|
||||||
|
@ -829,7 +829,7 @@ static BOOL check_user_equiv(char *user, char *remote, char *equiv_file)
|
|||||||
{
|
{
|
||||||
BOOL host_ok = False;
|
BOOL host_ok = False;
|
||||||
|
|
||||||
#ifdef HAVE_NETGROUP
|
#if defined(HAVE_NETGROUP) && defined(HAVE_YP_GET_DEFAULT_DOMAIN)
|
||||||
if (is_group)
|
if (is_group)
|
||||||
{
|
{
|
||||||
static char *mydomain = NULL;
|
static char *mydomain = NULL;
|
||||||
|
@ -327,7 +327,6 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt
|
|||||||
pstrcpy(smb_buf(outbuf),devicename);
|
pstrcpy(smb_buf(outbuf),devicename);
|
||||||
} else {
|
} else {
|
||||||
char *fsname = FSTYPE_STRING;
|
char *fsname = FSTYPE_STRING;
|
||||||
char *p;
|
|
||||||
|
|
||||||
set_message(outbuf,3,3,True);
|
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( 2, ( "new file %s\n", fname ) );
|
||||||
DEBUG( 3, ( "mknew %s fd=%d fnum=%d dmode=%d umode=%o\n",
|
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);
|
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( 2, ( "created temp file %s\n", fname2 ) );
|
||||||
DEBUG( 3, ( "ctemp %s fd=%d fnum=%d dmode=%d umode=%o\n",
|
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);
|
return(outsize);
|
||||||
}
|
}
|
||||||
@ -2640,7 +2639,7 @@ int reply_printopen(connection_struct *conn,
|
|||||||
pstrcpy(s,smb_buf(inbuf)+1);
|
pstrcpy(s,smb_buf(inbuf)+1);
|
||||||
p = s;
|
p = s;
|
||||||
while (*p) {
|
while (*p) {
|
||||||
if (!(isalnum(*p) || strchr("._-",*p)))
|
if (!(isalnum((int)*p) || strchr("._-",*p)))
|
||||||
*p = 'X';
|
*p = 'X';
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
@ -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
|
this is called when the client exits abruptly
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
static int sig_pipe(void)
|
static void sig_pipe(int sig)
|
||||||
{
|
{
|
||||||
struct cli_state *cli;
|
struct cli_state *cli;
|
||||||
BlockSignals(True,SIGPIPE);
|
BlockSignals(True,SIGPIPE);
|
||||||
@ -2445,11 +2445,10 @@ static int sig_pipe(void)
|
|||||||
DEBUG(3,("lost connection to password server\n"));
|
DEBUG(3,("lost connection to password server\n"));
|
||||||
cli_shutdown(cli);
|
cli_shutdown(cli);
|
||||||
BlockSignals(False,SIGPIPE);
|
BlockSignals(False,SIGPIPE);
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
exit_server("Got sigpipe\n");
|
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);
|
oplock_port = ntohs(sock_name.sin_port);
|
||||||
|
|
||||||
DEBUG(3,("open_oplock ipc: pid = %d, oplock_port = %u\n",
|
DEBUG(3,("open_oplock ipc: pid = %d, oplock_port = %u\n",
|
||||||
getpid(), oplock_port));
|
(int)getpid(), oplock_port));
|
||||||
|
|
||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
@ -3420,7 +3419,7 @@ this prevents zombie child processes
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
static BOOL reload_after_sighup = False;
|
static BOOL reload_after_sighup = False;
|
||||||
|
|
||||||
static int sig_hup(void)
|
static void sig_hup(int sig)
|
||||||
{
|
{
|
||||||
BlockSignals(True,SIGHUP);
|
BlockSignals(True,SIGHUP);
|
||||||
DEBUG(0,("Got SIGHUP\n"));
|
DEBUG(0,("Got SIGHUP\n"));
|
||||||
@ -3433,7 +3432,6 @@ static int sig_hup(void)
|
|||||||
|
|
||||||
reload_after_sighup = True;
|
reload_after_sighup = True;
|
||||||
BlockSignals(False,SIGHUP);
|
BlockSignals(False,SIGHUP);
|
||||||
return(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -4377,7 +4375,7 @@ static BOOL dump_core(void)
|
|||||||
rlp.rlim_cur = MAX(4*1024*1024,rlp.rlim_cur);
|
rlp.rlim_cur = MAX(4*1024*1024,rlp.rlim_cur);
|
||||||
setrlimit(RLIMIT_CORE, &rlp);
|
setrlimit(RLIMIT_CORE, &rlp);
|
||||||
getrlimit(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
|
||||||
#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;
|
rlp.rlim_cur = (MAX_OPEN_FILES+10>rlp.rlim_max)? rlp.rlim_max:MAX_OPEN_FILES+10;
|
||||||
setrlimit(RLIMIT_NOFILE, &rlp);
|
setrlimit(RLIMIT_NOFILE, &rlp);
|
||||||
getrlimit(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
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
DEBUG(2,("uid=%d gid=%d euid=%d egid=%d\n",
|
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)
|
if (sizeof(uint16) < 2 || sizeof(uint32) < 4)
|
||||||
{
|
{
|
||||||
|
@ -940,7 +940,7 @@ resume_key = %d resume name = %s continue=%d level = %d\n",
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int current_pos, start_pos;
|
int current_pos, start_pos;
|
||||||
char *dname;
|
char *dname = NULL;
|
||||||
void *dirptr = conn->dirptr;
|
void *dirptr = conn->dirptr;
|
||||||
start_pos = TellDir(dirptr);
|
start_pos = TellDir(dirptr);
|
||||||
for(current_pos = start_pos; current_pos >= 0; current_pos--)
|
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.
|
* here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
name_map_mangle( dname, False, SNUM(conn));
|
if(dname != NULL)
|
||||||
|
name_map_mangle( dname, False, SNUM(conn));
|
||||||
|
|
||||||
if(dname && strcsequal( resume_name, dname))
|
if(dname && strcsequal( resume_name, dname))
|
||||||
{
|
{
|
||||||
@ -984,9 +985,10 @@ resume_key = %d resume name = %s continue=%d level = %d\n",
|
|||||||
* here.
|
* 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);
|
SeekDir(dirptr, current_pos+1);
|
||||||
DEBUG(7,("call_trans2findnext: got match at pos %d\n", current_pos+1 ));
|
DEBUG(7,("call_trans2findnext: got match at pos %d\n", current_pos+1 ));
|
||||||
|
@ -96,7 +96,7 @@ static BOOL become_uid(int uid)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
DEBUG(0,("Couldn't set uid %d currently set to (%d,%d)\n",
|
DEBUG(0,("Couldn't set uid %d currently set to (%d,%d)\n",
|
||||||
uid,getuid(), geteuid()));
|
uid,(int)getuid(), (int)geteuid()));
|
||||||
if (uid > 32000) {
|
if (uid > 32000) {
|
||||||
DEBUG(0,("Looks like your OS doesn't like high uid values - try using a different account\n"));
|
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
|
#endif
|
||||||
{
|
{
|
||||||
DEBUG(0,("Couldn't set gid %d currently set to (%d,%d)\n",
|
DEBUG(0,("Couldn't set gid %d currently set to (%d,%d)\n",
|
||||||
gid,getgid(),getegid()));
|
gid,(int)getgid(),(int)getegid()));
|
||||||
if (gid > 32000) {
|
if (gid > 32000) {
|
||||||
DEBUG(0,("Looks like your OS doesn't like high gid values - try using a different account\n"));
|
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;
|
current_user.vuid = vuid;
|
||||||
|
|
||||||
DEBUG(5,("become_user uid=(%d,%d) gid=(%d,%d)\n",
|
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);
|
return(True);
|
||||||
}
|
}
|
||||||
@ -340,7 +340,7 @@ BOOL unbecome_user(void )
|
|||||||
DEBUG( 0, ( "chdir(%s) failed in unbecome_user\n", OriginalDir ) );
|
DEBUG( 0, ( "chdir(%s) failed in unbecome_user\n", OriginalDir ) );
|
||||||
|
|
||||||
DEBUG(5,("unbecome_user now uid=(%d,%d) gid=(%d,%d)\n",
|
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.conn = NULL;
|
||||||
current_user.vuid = UID_FIELD_INVALID;
|
current_user.vuid = UID_FIELD_INVALID;
|
||||||
|
@ -127,7 +127,7 @@ BOOL parse_byte(char *buf, unsigned char *bp)
|
|||||||
|
|
||||||
BOOL parse_bool(char *buf, unsigned char *bp)
|
BOOL parse_bool(char *buf, unsigned char *bp)
|
||||||
{
|
{
|
||||||
if(isdigit(*buf))
|
if(isdigit((int)*buf))
|
||||||
{
|
{
|
||||||
char *endptr = NULL;
|
char *endptr = NULL;
|
||||||
|
|
||||||
|
@ -499,7 +499,7 @@ static void cgi_download(char *file)
|
|||||||
|
|
||||||
/* sanitise the filename */
|
/* sanitise the filename */
|
||||||
for (i=0;file[i];i++) {
|
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","",
|
cgi_setup_error("404 File Not Found","",
|
||||||
"Illegal character in filename");
|
"Illegal character in filename");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user