r13212: r12414@cabra: derrell | 2006-01-28 17:52:17 -0500
[vlendec/samba-autobuild/.git] / source3 / utils / smbfilter.c
index 1a0d639f0254efdbef8a1476b5d1eec7e943c3c3..97d22230c4bb56c44086a2d5d4570fe25f04b0e6 100644 (file)
@@ -34,7 +34,7 @@
 static char *netbiosname;
 static char packet[BUFFER_SIZE];
 
-static void save_file(const char *fname, void *packet, size_t length)
+static void save_file(const char *fname, void *ppacket, size_t length)
 {
        int fd;
        fd = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0644);
@@ -42,12 +42,12 @@ static void save_file(const char *fname, void *packet, size_t length)
                perror(fname);
                return;
        }
-       if (write(fd, packet, length) != length) {
+       if (write(fd, ppacket, length) != length) {
                fprintf(stderr,"Failed to write %s\n", fname);
                return;
        }
        close(fd);
-       printf("Wrote %d bytes to %s\n", length, fname);
+       printf("Wrote %ld bytes to %s\n", (unsigned long)length, fname);
 }
 
 static void filter_reply(char *buf)
@@ -236,7 +236,7 @@ int main(int argc, char *argv[])
                netbiosname = argv[2];
        }
 
-       if (!lp_load(configfile,True,False,False)) {
+       if (!lp_load(configfile,True,False,False,True)) {
                d_printf("Unable to load config file\n");
        }