includes.h: Added FreeBSD 3.x fixes. Added HPUX10.x fixes.
authorJeremy Allison <jra@samba.org>
Wed, 7 Jan 1998 06:21:56 +0000 (06:21 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 7 Jan 1998 06:21:56 +0000 (06:21 +0000)
interface.c: Added netmask fix.
nmbd_nameregister.c: Fixed unitialised variable warnings.
nmbd_winsproxy.c: Fixed unitialised variable warnings.
nmbd_winsserver.c: Fixed DEC warnings.
print_svid.c: Fixed DEC warnings.
printing.c: Added LPRng fixes.
Jeremy.
(This used to be commit 28aff043c4a3693a0c20e87c7ce11eb4bf285b78)

source3/include/includes.h
source3/lib/interface.c
source3/nmbd/nmbd_nameregister.c
source3/nmbd/nmbd_winsproxy.c
source3/nmbd/nmbd_winsserver.c
source3/printing/print_svid.c
source3/printing/printing.c

index c99880cad3c1b8f0f538aaf08914c9875e109b7f..3dbe6780a58b8675f774e36c4f7b20d174aa2118 100644 (file)
@@ -510,12 +510,16 @@ char *mktemp(char *); /* No standard include */
 #include <netinet/tcp.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
+#if __FreeBSD__ >= 3
+#include <dirent.h>
+#else
+#define USE_DIRECT
+#endif
 #define SIGNAL_CAST (void (*)())
 #define USE_SETVBUF
 #define USE_SETSID
 #define USE_GETCWD
 #define USE_WAITPID
-#define USE_DIRECT
 #define HAVE_MEMMOVE
 #define HAVE_BZERO
 #define HAVE_GETTIMEOFDAY
@@ -568,6 +572,7 @@ char *mktemp(char *); /* No standard include */
 #include <sys/types.h>
 #include <sys/termios.h>
 #include <netinet/tcp.h>
+#include <arpa/inet.h>                /* needed for inet_ntoa proto */
 #ifdef HPUX_10_TRUSTED
 #include <hpsecurity.h>
 #include <prot.h>
index 7ae97e91190ec55c9738158ef05f74b069d4b349..ff7c6ee816f15f00375683b7c89cbe10933198c8 100644 (file)
@@ -48,11 +48,15 @@ static void default_netmask(struct in_addr *inm, struct in_addr *iad)
        ** Guess a netmask based on the class of the IP address given.
        */
        switch((ntohl(iad->s_addr) & 0xE0000000)) {
-       case 0:         /* Class A addr */
+        case 0x00000000:     /* Class A addr */
+        case 0x20000000:
+        case 0x40000000:
+        case 0x60000000:
                inm->s_addr = htonl(0xFF000000);
                break;
                
        case 0x80000000:        /* Class B addr */
+        case 0xA0000000:
                inm->s_addr = htonl(0xFFFF0000);
                break;
                
index cdaef1a767c72376fc41388e6de4d05cbdb9135d..3223159ace610c2c07ea11877d4b2d6737b1180d 100644 (file)
@@ -47,8 +47,8 @@ static void register_name_response(struct subnet_record *subrec,
   BOOL success = True;
   struct nmb_name *question_name = &rrec->packet->packet.nmb.question.question_name;
   struct nmb_name *answer_name = &nmb->answers->rr_name;
-  int ttl;
-  uint16 nb_flags;
+  int ttl = 0;
+  uint16 nb_flags = 0;
   struct in_addr registered_ip;
 
   /* Sanity check. Ensure that the answer name in the incoming packet is the
@@ -169,8 +169,8 @@ static void register_name_timeout_response(struct subnet_record *subrec,
   BOOL bcast = sent_nmb->header.nm_flags.bcast;
   BOOL success = False;
   struct nmb_name *question_name = &sent_nmb->question.question_name;
-  uint16 nb_flags;
-  int ttl;
+  uint16 nb_flags = 0;
+  int ttl = 0;
   struct in_addr registered_ip;
 
   if(bcast)
index 4f2326795d555cff5f85fb966d91f90b694ec0cd..36b9e7843ce508c6824a6978e5c7332782cad7cc 100644 (file)
@@ -39,7 +39,7 @@ static void wins_proxy_name_query_request_success( struct subnet_record *subrec,
   uint16 nb_flags;
   int num_ips;
   int i;
-  int ttl;
+  int ttl = 3600; /* By default one hour in the cache. */
   struct in_addr *iplist;
 
   /* Extract the original packet and the original broadcast subnet from
index 725e6e3747a6c6219038a1a7311817b73e51c662..4a631a79b713fd1e5f00908e4a3100c8b3806ca6 100644 (file)
@@ -784,7 +784,7 @@ is one of our (WINS server) names. Denying registration.\n", namestr(question) )
   if(namerec != NULL)
   {
     char ud[sizeof(struct userdata_struct) + sizeof(struct packet_struct *)];
-    struct userdata_struct *userdata = (struct userdata_struct *)&ud;
+    struct userdata_struct *userdata = (struct userdata_struct *)ud;
 
     /*
      * First send a WACK to the registering machine.
@@ -1059,7 +1059,7 @@ is one of our (WINS server) names. Denying registration.\n", namestr(question) )
   if(namerec != NULL)
   {
     char ud[sizeof(struct userdata_struct) + sizeof(struct packet_struct *)];
-    struct userdata_struct *userdata = (struct userdata_struct *)&ud;
+    struct userdata_struct *userdata = (struct userdata_struct *)ud;
 
     /*
      * First send a WACK to the registering machine.
@@ -1202,7 +1202,7 @@ void send_wins_name_query_response(int rcode, struct packet_struct *p,
 
   if(rcode == 0)
   {
-    int same_net_index;
+    int same_net_index = -1;
 
     ttl = (namerec->death_time != PERMANENT_TTL) ?
              namerec->death_time - p->timestamp : lp_max_wins_ttl();
@@ -1229,7 +1229,6 @@ void send_wins_name_query_response(int rcode, struct packet_struct *p,
        * ones we know the netmask for.
        */
 
-      same_net_index = -1;
       i = 0;
 
       if(is_local_net(p->ip))
index 5b98036e08e675b559542b27217ae314882caeca..bf48954ec23c62bd1bfe7000366388e52005e1b6 100644 (file)
@@ -64,11 +64,11 @@ static void populate_printers()
 
                        /* truncate the ": ..." */
                        if ((tmp = strchr(name, ':')) != NULL)
-                               *tmp = NULL;
+                               *tmp = '\0';
 
                        /* add it to the cache */
                        if ((ptmp = malloc(sizeof (*ptmp))) != NULL) {
-                               memset(ptmp, NULL, sizeof (*ptmp));
+                               memset(ptmp, '\0', sizeof (*ptmp));
                                ptmp->name = strdup(name);
                                ptmp->next = printers;
                                printers = ptmp;
index ccca91a25319dff2a170e5b9126fb593ddc2b9f5..76b962606b77adf16c0508a22f20c42097cd00a5 100644 (file)
@@ -320,6 +320,23 @@ Printer: humprn@hum-fak (printing disabled)
   Status: finished operations at Fri Jun 21 10:10:32 1996
  Rank  Owner           Class Job Files                           Size Time
 1      magnus@hum-fak      A 387 /var/spool/smb/netbudget.xls    21230 10:50:53
+
+******************************************************************************
+
+NEW FOR LPRng-3.3.5 !
+
+<reinelt@eunet.at> 
+This will not happen anymore: with LPRng-3.3.5 there is always a blank between
+the filename and the size, and the format has changed:
+
+Printer: lj6@lizard  'HP LaserJet 6P'
+ Queue: 2 printable jobs
+ Server: pid 11941 active
+ Unspooler: pid 11942 active
+ Status: printed all 1818 bytes at 19:49:59
+ Rank   Owner/ID                   Class Job  Files               Size Time
+active  root@lizard+937                A  937 (stdin)            1818 19:49:58
+2       root@lizard+969                A  969 junk.txt           2170 19:50:12
  
 ****************************************************************************/
 static BOOL parse_lpq_lprng(char *line,print_queue_struct *buf,BOOL first)
@@ -367,6 +384,12 @@ LPRng source changes.  This is from version 2.3.0.  Magnus  */
   string tok[LPRNG_NTOK];
   int count=0;
 
+#ifdef OLD_LPRNG
+/* We only need this bugfix for older versions of lprng - current
+   information is that version 3.3.5 must not have this line
+   in order to work correctly.
+*/
+
 /* 
 Need to insert one space in front of the size, to be able to use
 next_token() unchanged.  I would have liked to be able to insert a
@@ -378,6 +401,7 @@ A long spool-path will just waste significant chars of the file name.
 */
 
   line[JOBSIZE_POS-1]=' ';
+#endif /* OLD_LPRNG */
 
   /* handle the case of "(stdin)" as a filename */
   string_sub(line,"stdin","STDIN");