configure: Changes for extra headers.
authorJeremy Allison <jra@samba.org>
Sat, 15 Aug 1998 01:19:26 +0000 (01:19 +0000)
committerJeremy Allison <jra@samba.org>
Sat, 15 Aug 1998 01:19:26 +0000 (01:19 +0000)
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 used to be commit 1b9cbcd02e575dc0a95fa589f720df30a4acc46b)

31 files changed:
source3/client/clitar.c
source3/configure
source3/configure.in
source3/include/config.h.in
source3/include/includes.h
source3/include/proto.h
source3/include/smb.h
source3/lib/access.c
source3/lib/charset.c
source3/lib/debug.c
source3/lib/kanji.c
source3/lib/smbrun.c
source3/lib/util.c
source3/libsmb/namequery.c
source3/locking/shmem.c
source3/locking/shmem_sysv.c
source3/nmbd/asyncdns.c
source3/nmbd/nmbd.c
source3/passdb/passdb.c
source3/passdb/smbpassfile.c
source3/printing/printing.c
source3/smbd/chgpasswd.c
source3/smbd/ipc.c
source3/smbd/nttrans.c
source3/smbd/password.c
source3/smbd/reply.c
source3/smbd/server.c
source3/smbd/trans2.c
source3/smbd/uid.c
source3/utils/make_smbcodepage.c
source3/web/cgi.c

index 035e4f7607c22b5695f88e0f61fa1e942dc6753b..395f31edcf70327b1489ae7e78fa9b3d5d1aa322 100644 (file)
@@ -522,7 +522,7 @@ static long unoct(char *p, int ndgs)
 
   while (--ndgs)
     {
-      if (isdigit(*p))
+      if (isdigit((int)*p))
         value = (value << 3) | (long) (*p - '0');
 
       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!
    */
 
-  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 == '.') {
index 11e36f6562cfbaa48ab6cd3ac3f0be94913a2a7d..b770f95376b18d499e01144d7adc93f39f68bdbc 100755 (executable)
@@ -1413,7 +1413,7 @@ else
 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
@@ -1453,7 +1453,7 @@ else
 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
@@ -1493,7 +1493,7 @@ else
 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
@@ -3097,7 +3097,7 @@ else
 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
index af5d9200c90713c9a950685d77749385500ad1a8..c2793baf2c084eb65d6135a2171ca7da7b456c21 100644 (file)
@@ -28,9 +28,9 @@ AC_HEADER_DIRENT
 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)
@@ -144,7 +144,7 @@ fi])
 
 
 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)
index ced68aa7627755b5903ed9109f3c23c7b24cdb91..d3968452c3ddb81c817a2f40386f33e073b9d35c 100644 (file)
 /* 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
 
index 237251209a8d995af59156e19dce4a71432716f1..42ec579692256d8b9ee85502779dc3a075df839d 100644 (file)
 #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
@@ -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);
 #endif
 
+#if !defined(HAVE_BZERO) && defined(HAVE_MEMSET)
+#define bzero(a,b) memset((a),'\0',(b))
+#endif
+
 #endif /* _INCLUDES_H */
index 1cab9c5e9d43dba46f157f4214ebce5b5770c09f..74e240cfa39db91f0d97051d9558157fad1856ad 100644 (file)
@@ -63,8 +63,8 @@ void add_char_string(char *s);
 
 /*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 );
index b060134d8e097ea326b67ae243898b7bc580497c..fa5d496ceb805b5afe3e77e2a0ea9a55085ad551 100644 (file)
@@ -1274,7 +1274,7 @@ char *strdup(char *s);
 #endif
 
 #ifndef SIGNAL_CAST
-#define SIGNAL_CAST (RETSIGTYPE (*)())
+#define SIGNAL_CAST (RETSIGTYPE (*)(int))
 #endif
 
 #ifndef SELECT_CAST
index d2286e2515ee09f3cd22d8f540013189b9ef756a..2e1eb8df556a86ba9af7ef20269e3f07fd64027f 100644 (file)
@@ -106,7 +106,7 @@ static int string_match(char *tok,char *s)
                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);
index 5e9481f9bbf41dcff66f15acd60dc346b53fd678..abfa6fe7878cff1d028b278d3c1e03e2442a5039 100644 (file)
@@ -161,7 +161,7 @@ void charset_initialise(void)
   }
 
   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);
   }
 
@@ -172,8 +172,8 @@ void charset_initialise(void)
     /* 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);
     }
   }
 }
index 24f508c0b40fb7b24570eebdee2de6431d63face..1303d0433b709447cd8cb617c52cf9b701e35a65 100644 (file)
@@ -112,7 +112,7 @@ static int     format_pos     = 0;
  * catch a sigusr2 - decrease the debug log level.
  * ************************************************************************** **
  */
-int sig_usr2( void )
+void sig_usr2( int sig )
   {
   BlockSignals( True, SIGUSR2 );
 
@@ -125,7 +125,6 @@ int sig_usr2( void )
   BlockSignals( False, SIGUSR2 );
   CatchSignal( SIGUSR2, SIGNAL_CAST sig_usr2 );
 
-  return( 0 );
   } /* sig_usr2 */
 #endif /* SIGUSR2 */
 
@@ -134,7 +133,7 @@ int sig_usr2( void )
  * catch a sigusr1 - increase the debug log level. 
  * ************************************************************************** **
  */
-int sig_usr1( void )
+void sig_usr1( int sig )
   {
   BlockSignals( True, SIGUSR1 );
 
@@ -148,7 +147,6 @@ int sig_usr1( void )
   BlockSignals( False, SIGUSR1 );
   CatchSignal( SIGUSR1, SIGNAL_CAST sig_usr1 );
 
-  return( 0 );
   } /* sig_usr1 */
 #endif /* SIGUSR1 */
 
index 523eb178e25e63181bf86b0dbb3c3fd048a14e1c..4ca5984d806e745a62980583699988bba1fc5b07 100644 (file)
@@ -856,7 +856,7 @@ static char *hex_to_sj(char *from, BOOL overwrite)
     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
@@ -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
          * 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
index 0388b3f1bd8639c7b03aed184b5e4cb9a55b1ba2..fcb14378a00c37e193fe0a829edef33c380b9296 100644 (file)
@@ -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)
 {
-       extern struct current_user current_user;
        int fd,pid;
        int uid = current_user.uid;
        int gid = current_user.gid;
index 863e2d94af9e1ee8bd41d3325f62382066f09be2..c1eb7cc8798be6e0f2cda9e776ab0608c4567b16 100644 (file)
@@ -3636,7 +3636,7 @@ uint32 interpret_addr(char *str)
   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 */
@@ -4608,7 +4608,7 @@ BOOL fcntl_lock(int fd,int op,uint32 offset,uint32 count,int type)
          (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);
        }
 
index 344806083a5c2d8a2c94ad6a2d6a8103c1be1d6a..8b0d68ce6a4a464fd8514106113879f0d6aaddb9 100644 (file)
@@ -72,7 +72,7 @@ static void _interpret_node_status(char *p, char *master,char *rname)
       }
       
       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;
@@ -439,7 +439,7 @@ BOOL resolve_name(char *name, struct in_addr *return_ip)
   }
    
   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 */
index dd97d5c76cdf00fcba1b5049a664b89bc6ec9835..be8e22108aa41c6bedbcc7fa6ef104679aa47332 100644 (file)
@@ -340,7 +340,7 @@ static BOOL smb_shm_register_process(char *processreg_file, pid_t pid, BOOL *oth
         {
            /* 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));
@@ -362,7 +362,8 @@ static BOOL smb_shm_register_process(char *processreg_file, pid_t pid, BOOL *oth
    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)
    {
@@ -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)
    {
-      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)
@@ -423,7 +424,8 @@ static BOOL smb_shm_unregister_process(char *processreg_file, pid_t pid)
    
    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;
    }
@@ -540,7 +542,8 @@ static BOOL smb_shm_close( void )
    }
 
    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();
    
index b8b9c2cb45654f2b383d74ce8096989f9546ee78..192ed32344c9a357202938a9887f6899a8b81523 100644 (file)
@@ -564,8 +564,9 @@ struct shmem_ops *sysv_shm_open(int ronly)
                }
 
                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) {
@@ -574,6 +575,7 @@ struct shmem_ops *sysv_shm_open(int ronly)
                                if (semctl(sem_id, i, SETVAL, su) != 0) {
                                        DEBUG(1,("Failed to init semaphore %d. Error was %s\n",
                           i, strerror(errno)));
+                    return NULL;
                                }
                        }
                }
@@ -582,7 +584,7 @@ struct shmem_ops *sysv_shm_open(int ronly)
                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;
        }   
@@ -609,6 +611,7 @@ struct shmem_ops *sysv_shm_open(int ronly)
                        if (semctl(sem_id, 0, SETVAL, su) != 0) {
                                DEBUG(0,("ERROR: Failed to clear global lock. Error was %s\n",
                       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) {
                        DEBUG(0,("ERROR shmctl : can't IPC_SET. Error was %s\n",
                   strerror(errno)));
+            return NULL;
                }
        }
 
@@ -632,6 +636,8 @@ struct shmem_ops *sysv_shm_open(int ronly)
                        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;
                        }
                }
        }
@@ -679,6 +685,8 @@ struct shmem_ops *sysv_shm_open(int ronly)
           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) {
index 89be2b0ce0208f868b7f87be74142e83b63912f6..9926045d82153b3e3531a85a58142e6d980ce69d 100644 (file)
@@ -110,11 +110,9 @@ static void asyncdns_process(void)
   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;
 }
 
 /***************************************************************************
index 24f4951612c43cc277dc063a27c91dcd349b94c2..9eae3b0e9879c9310286e8a05ac6aca4ef8cff41 100644 (file)
@@ -61,7 +61,7 @@ extern struct in_addr ipzero;
 /**************************************************************************** **
   catch a sigterm
  **************************************************************************** */
-static int sig_term(void)
+static void sig_term(int sig)
 {
   BlockSignals(True,SIGTERM);
   
@@ -81,14 +81,12 @@ static int sig_term(void)
 
   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 );
 
@@ -103,13 +101,12 @@ static int sig_hup(void)
 
   BlockSignals(False,SIGHUP);
 
-  return(0);
 } /* sig_hup */
 
 /**************************************************************************** **
  catch a sigpipe
  **************************************************************************** */
-static int sig_pipe(void)
+static void sig_pipe(int sig)
 {
   BlockSignals( True, SIGPIPE );
 
@@ -117,7 +114,6 @@ static int sig_pipe(void)
   if ( !is_daemon )
     exit(1);
   BlockSignals( False, SIGPIPE );
-  return(0);
 } /* sig_pipe */
 
 #if DUMP_CORE
@@ -147,7 +143,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
index 0ca71dda9434b3c2fa48d7770ee19b31e82ab86c..0d806fccf734f9155176767529dc5c98c0d708c4 100644 (file)
@@ -113,7 +113,7 @@ struct smb_passwd *iterate_getsmbpwuid(uid_t smb_userid)
        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);
@@ -129,7 +129,7 @@ struct smb_passwd *iterate_getsmbpwuid(uid_t smb_userid)
 
        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);
@@ -370,7 +370,7 @@ struct sam_passwd *iterate_getsam21pwuid(uid_t uid)
        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);
@@ -386,7 +386,7 @@ struct sam_passwd *iterate_getsam21pwuid(uid_t uid)
 
        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);
@@ -599,7 +599,7 @@ static time_t get_time_from_string(char *p)
 
        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)
index efbbbd78bf6da52215cf024c1040ed4544ef774c..49cf194cc652bac6e0f7ae27f0be8cab8f410a01 100644 (file)
@@ -268,7 +268,7 @@ BOOL get_trust_account_password( unsigned char *ret_pwd, time_t *pass_last_set_t
   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));
index 00ff869278fe8c4345c688345e4a2bc364d461ae..2c7197f9db5513c29a5056af244182287eac8dfc 100644 (file)
@@ -235,7 +235,7 @@ static BOOL parse_lpq_bsd(char *line,print_queue_struct *buf,BOOL first)
     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],' '))
@@ -405,7 +405,7 @@ A long spool-path will just waste significant chars of the file name.
     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. */
@@ -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)))
       {
           /* 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],' '))
@@ -513,7 +513,7 @@ static BOOL parse_lpq_aix(char *line,print_queue_struct *buf,BOOL first)
   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],' '))
@@ -590,7 +590,7 @@ static BOOL parse_lpq_hpux(char * line, print_queue_struct *buf, BOOL first)
     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],' '))
@@ -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 ?) */
     /* 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]);
@@ -678,8 +678,8 @@ static BOOL parse_lpq_sysv(char *line,print_queue_struct *buf,BOOL first)
     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],'!')))
@@ -742,7 +742,7 @@ static BOOL parse_lpq_qnx(char *line,print_queue_struct *buf,BOOL first)
     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 */
   {
@@ -797,11 +797,11 @@ static BOOL parse_lpq_plp(char *line,print_queue_struct *buf,BOOL first)
     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 */
@@ -865,20 +865,20 @@ static BOOL parse_lpq_softq(char *line,print_queue_struct *buf,BOOL first)
     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;
index 6594c5f48c5cc62dd51076070569a2999ca71e1a..bd7d28b11f2aa7995ecfccba01911300c9ed8e53 100644 (file)
@@ -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;
     }
index a72b44273546fb3388277984a6fd9b83b5032642..63495f0479bbfca6e3e5a5741fbb074f272b32ea 100644 (file)
@@ -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;
index bff61b6736b51768a80de5b6838ddd24066a6a8a..94ecbfea4945a41df101ae8183b2c3d77412faf0 100644 (file)
@@ -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);
 }
index 118251ffd6ac683b5ea6b0377271d61a3c07424b..121ebb7f0030477054ddb592ab794d622060ba27 100644 (file)
@@ -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;
index 66d1dd2839524377944fe0dcd9d1e189cfa41fc5..626d2e9617db8301929ddccbdd0d9d8a0299fc84 100644 (file)
@@ -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++;
                }
index 9c7bafd9dd8c1816829804010a84d47bf724952d..ba93ceaa16f526822d2e7219a0f90de1f2faf3a9 100644 (file)
@@ -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)
     {
index 07f0316c2245c44509174a63ead2c1334dce6474..992d8cd61659259c2ab961454f10bfbad832b836 100644 (file)
@@ -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 ));
index 1276eeaaac1b54097bfc492e4bcd57f1e3b6df25..08a3952b3afcc808680eb9fe5a9c9db89e438d47 100644 (file)
@@ -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;
index b0970a7d25136db75de0f00e78f72db85c02642a..86c9df3a18adae4d13e918f0586a6173c4bb933c 100644 (file)
@@ -127,7 +127,7 @@ BOOL parse_byte(char *buf, unsigned char *bp)
 
 BOOL parse_bool(char *buf, unsigned char *bp)
 {
-  if(isdigit(*buf))
+  if(isdigit((int)*buf))
   {
     char *endptr = NULL;
 
index 1a9d34d0047dc4497857bca8ef3f2c29c609ec45..20337e04599778797abca28d9816890e0e2d814d 100644 (file)
@@ -499,7 +499,7 @@ static void cgi_download(char *file)
 
        /* 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");
                }