summaryrefslogtreecommitdiff
path: root/source/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source/utils')
-rw-r--r--source/utils/make_smbcodepage.c472
-rw-r--r--source/utils/nmblookup.c12
-rw-r--r--source/utils/smbpasswd.c53
-rw-r--r--source/utils/status.c61
-rw-r--r--source/utils/testparm.c2
5 files changed, 49 insertions, 551 deletions
diff --git a/source/utils/make_smbcodepage.c b/source/utils/make_smbcodepage.c
deleted file mode 100644
index b4cb1523349..00000000000
--- a/source/utils/make_smbcodepage.c
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- Unix SMB/Netbios implementation.
- Version 1.9.
- Create codepage files from codepage_def.XXX files.
-
- Copyright (C) Jeremy Allison 1997
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#include "includes.h"
-
-static char *prog_name = NULL;
-
-/*
- * Print program usage and die.
- */
-
-void codepage_usage(char *progname)
-{
- fprintf(stderr, "Usage is : %s [c|d] <codepage> <inputfile> <outputfile>\n",
- progname);
- exit(1);
-}
-
-/*
- * Read a line from a buffer into a line buffer. Ensure null
- * terminated.
- */
-
-void read_line( char **buf, char *line_buf, int size)
-{
- char *p = *buf;
- int num = 0;
-
- for(; *p && (*p != '\n'); p++)
- {
- if(num < (size - 1))
- line_buf[num++] = *p;
- }
- if(*p)
- p++; /* Go past the '\n' */
- line_buf[num] = '\0';
- *buf = p;
-}
-
-/*
- * Strip comment lines and blank lines from the data.
- * Copies into a new buffer and frees the old.
- * Returns the number of lines copied.
- */
-
-int clean_data( char **buf, uint32 *size)
-{
- char linebuf[512];
- char *p = *buf;
- int num_lines = 0;
- char *newbuf = (char *)malloc( *size + 1);
- char *newbuf_p = NULL;
-
- if(newbuf == NULL)
- {
- fprintf(stderr, "%s: malloc fail for size %d.\n", prog_name, *size + 1);
- exit(1);
- }
-
- newbuf_p = newbuf;
- *newbuf_p = '\0';
-
- while( *p )
- {
- char *cp;
-
- read_line( &p, linebuf, sizeof(linebuf));
- /* Null terminate after comment. */
- if((cp = strchr( linebuf, '#'))!= NULL)
- *cp = '\0';
-
- for(cp = linebuf;*cp && isspace(*cp); cp++)
- ;
-
- if(*cp == '\0')
- continue;
-
- strcpy(newbuf_p, cp);
- num_lines++;
- newbuf_p += (strlen(newbuf_p) + 1);
- }
-
- free(*buf);
- *buf = newbuf;
- return num_lines;
-}
-
-/*
- * Parse a byte from a codepage file.
- */
-
-BOOL parse_byte(char *buf, unsigned char *bp)
-{
- unsigned int b;
- char *endptr = NULL;
-
- b = (unsigned int)strtol(buf, &endptr, 0);
- if(endptr == buf || b > 255)
- return False;
-
- *bp = (unsigned char)b;
- return True;
-}
-
-/*
- * Parse a bool from a codepage file.
- */
-
-BOOL parse_bool(char *buf, unsigned char *bp)
-{
- if(isdigit(*buf))
- {
- char *endptr = NULL;
-
- *bp = (unsigned char)strtol(buf, &endptr, 0);
- if(endptr == buf )
- return False;
- if(*bp != 0)
- *bp = 1;
- } else {
- if(strcasecmp(buf, "True") && strcasecmp(buf, "False"))
- return False;
- if(strcasecmp(buf, "True")==0)
- *bp = 1;
- else
- *bp = 0;
- }
- return True;
-}
-
-/*
- * Print a parse error and exit.
- */
-
-void parse_error(char *buf, char *msg)
-{
- fprintf(stderr, "%s: %s whilst parsing line \n%s\n", prog_name,
- msg, buf);
- exit(1);
-}
-
-/*
- * Create a compiled codepage file from a codepage definition file.
- */
-
-int do_compile(int codepage, char *input_file, char *output_file)
-{
- FILE *fp = NULL;
- uint32 size = 0;
- char *buf = NULL;
- char output_buf[CODEPAGE_HEADER_SIZE + 512];
- int num_lines = 0;
- int i = 0;
- struct stat st;
-
- /* Get the size of the input file. Read the entire thing into memory. */
- if(stat((char *)input_file, &st)!= 0)
- {
- fprintf(stderr, "%s: failed to get the file size for file %s. Error was %s\n",
- prog_name, input_file, strerror(errno));
- exit(1);
- }
-
- size = (uint32)st.st_size;
-
- /* I don't believe these things should be bigger than 100k :-) */
- if(size > 100*1024)
- {
- fprintf(stderr, "%s: filesize %d is too large for a codepage definition file. \
-The maximum size I will believe is 100k.\n", prog_name, size);
- exit(1);
- }
-
- if((fp = fopen(input_file, "r")) == NULL)
- {
- fprintf(stderr, "%s: cannot open file %s for input.\n", prog_name, input_file);
- exit(1);
- }
-
- /* As we will be reading text, allocate one more byte for a '\0' */
- if((buf = (char *)malloc( size + 1 )) == NULL)
- {
- fprintf(stderr, "%s: malloc fail for size %d.\n", prog_name, size + 1);
- fclose(fp);
- exit(1);
- }
-
- if(fread( buf, 1, size, fp) != size)
- {
- fprintf(stderr, "%s: read failed for file %s. Error was %s.\n", prog_name,
- input_file, strerror(errno));
- free((char *)buf);
- fclose(fp);
- exit(1);
- }
-
- /* Null terminate the text read. */
- buf[size] = '\0';
-
- /* Go through the data line by line, strip out comments (anything
- after a '#' to end-of-line) and blank lines. The rest should be
- the codepage data.
- */
-
- num_lines = clean_data( &buf, &size);
-
- /* There can be a maximum of 128 lines. */
- if(num_lines > 128)
- {
- fprintf(stderr, "%s: There can be a maximum 128 lines of data in a codepage \
-definition file. File %s has %d.\n", prog_name, input_file, num_lines);
- exit(1);
- }
-
- /* Setup the output file header. */
- SSVAL(output_buf,CODEPAGE_VERSION_OFFSET,CODEPAGE_FILE_VERSION_ID);
- SSVAL(output_buf,CODEPAGE_CLIENT_CODEPAGE_OFFSET,(uint16)codepage);
- SIVAL(output_buf,CODEPAGE_LENGTH_OFFSET,(num_lines * 4));
-
- /* Now convert the lines into the compiled form. */
- for(i = 0; i < num_lines; i++)
- {
- char token_buf[512];
- char *p = buf;
- unsigned char b = 0;
-
- /* Get the 'lower' value. */
- if(!next_token(&p, token_buf, NULL))
- parse_error(buf, "cannot parse first value");
- if(!parse_byte( token_buf, &b))
- parse_error(buf, "first value doesn't resolve to a byte");
-
- /* Add this to the output buffer. */
- SCVAL(output_buf,CODEPAGE_HEADER_SIZE+(i*4),b);
-
- /* Get the 'upper' value. */
- if(!next_token(&p, token_buf, NULL))
- parse_error(buf, "cannot parse second value");
- if(!parse_byte( token_buf, &b))
- parse_error(buf, "second value doesn't resolve to a byte");
-
- /* Add this to the output buffer. */
- SCVAL(output_buf,CODEPAGE_HEADER_SIZE+(i*4) + 1,b);
-
- /* Get the 'upper to lower' value. */
- if(!next_token(&p, token_buf, NULL))
- parse_error(buf, "cannot parse third value");
- if(!parse_bool( token_buf, &b))
- parse_error(buf, "third value doesn't resolve to a boolean");
-
- /* Add this to the output buffer. */
- SCVAL(output_buf,CODEPAGE_HEADER_SIZE+(i*4) + 2,b);
-
- /* Get the 'lower to upper' value. */
- if(!next_token(&p, token_buf, NULL))
- parse_error(buf, "cannot parse fourth value");
- if(!parse_bool( token_buf, &b))
- parse_error(buf, "fourth value doesn't resolve to a boolean");
-
- /* Add this to the output buffer. */
- SCVAL(output_buf,CODEPAGE_HEADER_SIZE+(i*4) + 3,b);
-
- buf += (strlen(buf) + 1);
- }
-
- /* Now write out the output_buf. */
- if((fp = fopen(output_file, "w"))==NULL)
- {
- fprintf(stderr, "%s: Cannot open output file %s. Error was %s.\n",
- prog_name, output_file, strerror(errno));
- exit(1);
- }
-
- if(fwrite(output_buf, 1, CODEPAGE_HEADER_SIZE + (num_lines*4), fp) !=
- CODEPAGE_HEADER_SIZE + (num_lines*4))
- {
- fprintf(stderr, "%s: Cannot write output file %s. Error was %s.\n",
- prog_name, output_file, strerror(errno));
- exit(1);
- }
-
- fclose(fp);
-
- return 0;
-}
-
-/*
- * Placeholder for now.
- */
-
-int do_decompile( int codepage, char *input_file, char *output_file)
-{
- uint32 size = 0;
- struct stat st;
- char header_buf[CODEPAGE_HEADER_SIZE];
- char *buf = NULL;
- FILE *fp = NULL;
- int num_lines = 0;
- int i = 0;
-
- /* Get the size of the input file. Read the entire thing into memory. */
- if(stat((char *)input_file, &st)!= 0)
- {
- fprintf(stderr, "%s: failed to get the file size for file %s. Error was %s\n",
- prog_name, input_file, strerror(errno));
- exit(1);
- }
-
- size = (uint32)st.st_size;
-
- if( size < CODEPAGE_HEADER_SIZE || size > (CODEPAGE_HEADER_SIZE + 256))
- {
- fprintf(stderr, "%s: file %s is an incorrect size for a \
-code page file.\n", prog_name, input_file);
- exit(1);
- }
-
- /* Read the first 8 bytes of the codepage file - check
- the version number and code page number. All the data
- is held in little endian format.
- */
-
- if((fp = fopen( input_file, "r")) == NULL)
- {
- fprintf(stderr, "%s: cannot open file %s. Error was %s\n",
- prog_name, input_file, strerror(errno));
- exit(1);
- }
-
- if(fread( header_buf, 1, CODEPAGE_HEADER_SIZE, fp)!=CODEPAGE_HEADER_SIZE)
- {
- fprintf(stderr, "%s: cannot read header from file %s. Error was %s\n",
- prog_name, input_file, strerror(errno));
- exit(1);
- }
-
- /* Check the version value */
- if(SVAL(header_buf,CODEPAGE_VERSION_OFFSET) != CODEPAGE_FILE_VERSION_ID)
- {
- fprintf(stderr, "%s: filename %s has incorrect version id. \
-Needed %hu, got %hu.\n",
- prog_name, input_file, (uint16)CODEPAGE_FILE_VERSION_ID,
- SVAL(header_buf,CODEPAGE_VERSION_OFFSET));
- exit(1);
- }
-
- /* Check the codepage matches */
- if(SVAL(header_buf,CODEPAGE_CLIENT_CODEPAGE_OFFSET) != (uint16)codepage)
- {
- fprintf(stderr, "%s: filename %s has incorrect codepage. \
-Needed %hu, got %hu.\n",
- prog_name, input_file, (uint16)codepage,
- SVAL(header_buf,CODEPAGE_CLIENT_CODEPAGE_OFFSET));
- exit(1);
- }
-
- /* Check the length is correct. */
- if(IVAL(header_buf,CODEPAGE_LENGTH_OFFSET) !=
- (unsigned int)(size - CODEPAGE_HEADER_SIZE))
- {
- fprintf(stderr, "%s: filename %s has incorrect size headers. \
-Needed %u, got %u.\n", prog_name, input_file, size - CODEPAGE_HEADER_SIZE,
- IVAL(header_buf,CODEPAGE_LENGTH_OFFSET));
- exit(1);
- }
-
- size -= CODEPAGE_HEADER_SIZE; /* Remove header */
-
- /* Make sure the size is a multiple of 4. */
- if((size % 4 ) != 0)
- {
- fprintf(stderr, "%s: filename %s has a codepage size not a \
-multiple of 4.\n", prog_name, input_file);
- exit(1);
- }
-
- /* Allocate space for the code page file and read it all in. */
- if((buf = (char *)malloc( size )) == NULL)
- {
- fprintf (stderr, "%s: malloc fail for size %d.\n",
- prog_name, size );
- exit(1);
- }
-
- if(fread( buf, 1, size, fp)!=size)
- {
- fprintf(stderr, "%s: read fail on file %s. Error was %s.\n",
- prog_name, input_file, strerror(errno));
- exit(1);
- }
-
- fclose(fp);
-
- /* Now dump the codepage into an ascii file. */
- if((fp = fopen(output_file, "w")) == NULL)
- {
- fprintf(stderr, "%s: cannot open file %s. Error was %s\n",
- prog_name, output_file, strerror(errno));
- exit(1);
- }
-
- fprintf(fp, "#\n# Codepage definition file for IBM Code Page %d.\n#\n",
- codepage);
- fprintf(fp, "# This file was automatically generated.\n#\n");
- fprintf(fp, "# defines lower->upper mapping.\n");
- fprintf(fp, "#\n#The columns are :\n# lower\tupper\tu-t-l\tl-t-u\n#\n");
-
- num_lines = size / 4;
- for( i = 0; i < num_lines; i++)
- {
- fprintf(fp, "0x%02X\t0x%02X\t%s\t%s\n", CVAL(buf, (i*4)), CVAL(buf, (i*4)+1),
- CVAL(buf, (i*4)+2) ? "True" : "False",
- CVAL(buf, (i*4)+3) ? "True" : "False");
- }
- fclose(fp);
- return 0;
-}
-
-int main(int argc, char **argv)
-{
- int codepage = 0;
- char *input_file = NULL;
- char *output_file = NULL;
- BOOL compile = False;
-
- prog_name = argv[0];
-
- if(argc != 5)
- codepage_usage(prog_name);
-
- if(argv[1][0] != 'c' && argv[1][0] != 'C' && argv[1][0] != 'd' &&
- argv[1][0] != 'D')
- codepage_usage(prog_name);
-
- input_file = argv[3];
- output_file = argv[4];
-
- /* Are we compiling or decompiling. */
- if(argv[1][0] == 'c' || argv[1][0] == 'C')
- compile = True;
-
- /* Convert the second argument into a client codepage value. */
- if((codepage = atoi(argv[2])) == 0)
- {
- fprintf(stderr, "%s: %s is not a valid codepage.\n", prog_name, argv[2]);
- exit(1);
- }
-
- if(compile)
- return do_compile( codepage, input_file, output_file);
- else
- return do_decompile( codepage, input_file, output_file);
-}
diff --git a/source/utils/nmblookup.c b/source/utils/nmblookup.c
index 36905aa5ae3..aebbc4292ca 100644
--- a/source/utils/nmblookup.c
+++ b/source/utils/nmblookup.c
@@ -35,8 +35,6 @@ extern struct in_addr ipzero;
int ServerFD= -1;
-int RootPort = 0;
-
/****************************************************************************
open the socket communication
**************************************************************************/
@@ -51,10 +49,7 @@ static BOOL open_sockets(void)
return False;
}
- ServerFD = open_socket_in( SOCK_DGRAM,
- (RootPort ? 137 :0),
- 3,
- interpret_addr(lp_socket_address()) );
+ ServerFD = open_socket_in(SOCK_DGRAM, 0,3,interpret_addr(lp_socket_address()));
if (ServerFD == -1)
return(False);
@@ -118,7 +113,7 @@ int main(int argc,char *argv[])
charset_initialise();
- while ((opt = getopt(argc, argv, "d:B:i:s:SMrh")) != EOF)
+ while ((opt = getopt(argc, argv, "p:d:B:i:s:SMh")) != EOF)
switch (opt)
{
case 'B':
@@ -142,9 +137,6 @@ int main(int argc,char *argv[])
case 's':
pstrcpy(servicesf, optarg);
break;
- case 'r':
- RootPort = -1;
- break;
case 'h':
usage();
exit(0);
diff --git a/source/utils/smbpasswd.c b/source/utils/smbpasswd.c
index d20ff42c0e8..161555d52cc 100644
--- a/source/utils/smbpasswd.c
+++ b/source/utils/smbpasswd.c
@@ -1,3 +1,5 @@
+#ifdef SMB_PASSWD
+
/*
* Unix SMB/Netbios implementation. Version 1.9. smbpasswd module. Copyright
* (C) Jeremy Allison 1995-1997.
@@ -18,6 +20,7 @@
*/
#include "includes.h"
+#include "des.h"
/* Static buffers we will return. */
static struct smb_passwd pw_buf;
@@ -375,24 +378,14 @@ static void usage(char *name)
* Open the smbpaswd file XXXX - we need to parse smb.conf to get the
* filename
*/
- fp = fopen(pfile, "r+");
- if (!fp && errno == ENOENT) {
- fp = fopen(pfile, "w");
- if (fp) {
- fprintf(fp, "# Samba SMB password file\n");
- fclose(fp);
- fp = fopen(pfile, "r+");
- }
- }
- if (!fp) {
- err = errno;
- fprintf(stderr, "%s: Failed to open password file %s.\n",
- argv[0], pfile);
- errno = err;
- perror(argv[0]);
- exit(err);
+ if ((fp = fopen(pfile, "r+")) == NULL) {
+ err = errno;
+ fprintf(stderr, "%s: Failed to open password file %s.\n",
+ argv[0], pfile);
+ errno = err;
+ perror(argv[0]);
+ exit(err);
}
-
/* Set read buffer to 16k for effiecient reads */
setvbuf(fp, readbuf, _IOFBF, sizeof(readbuf));
@@ -424,8 +417,10 @@ static void usage(char *name)
/* Create a new smb passwd entry and set it to the given password. */
{
int fd;
+ int i;
int new_entry_length;
char *new_entry;
+ char *p;
long offpos;
/* The add user write needs to be atomic - so get the fd from
@@ -435,7 +430,7 @@ static void usage(char *name)
if((offpos = lseek(fd, 0, SEEK_END)) == -1) {
fprintf(stderr, "%s: Failed to add entry for user %s to file %s. \
-Error was %s\n", argv[0], pwd->pw_name, pfile, strerror(errno));
+Error was %d\n", argv[0], pwd->pw_name, pfile, errno);
fclose(fp);
pw_file_unlock(lockfd);
exit(1);
@@ -447,7 +442,7 @@ Error was %s\n", argv[0], pwd->pw_name, pfile, strerror(errno));
strlen(pwd->pw_shell) + 1;
if((new_entry = (char *)malloc( new_entry_length )) == 0) {
fprintf(stderr, "%s: Failed to add entry for user %s to file %s. \
-Error was %s\n", argv[0], pwd->pw_name, pfile, strerror(errno));
+Error was %d\n", argv[0], pwd->pw_name, pfile, errno);
fclose(fp);
pw_file_unlock(lockfd);
exit(1);
@@ -467,12 +462,12 @@ Error was %s\n", argv[0], pwd->pw_name, pfile, strerror(errno));
pwd->pw_dir, pwd->pw_shell);
if(write(fd, new_entry, strlen(new_entry)) != strlen(new_entry)) {
fprintf(stderr, "%s: Failed to add entry for user %s to file %s. \
-Error was %s\n", argv[0], pwd->pw_name, pfile, strerror(errno));
+Error was %d\n", argv[0], pwd->pw_name, pfile, errno);
/* Remove the entry we just wrote. */
if(ftruncate(fd, offpos) == -1) {
fprintf(stderr, "%s: ERROR failed to ftruncate file %s. \
-Error was %s. Password file may be corrupt ! Please examine by hand !\n",
- argv[0], pwd->pw_name, strerror(errno));
+Error was %d. Password file may be corrupt ! Please examine by hand !\n",
+ argv[0], pwd->pw_name, errno);
}
fclose(fp);
pw_file_unlock(lockfd);
@@ -483,9 +478,6 @@ Error was %s. Password file may be corrupt ! Please examine by hand !\n",
pw_file_unlock(lockfd);
exit(0);
}
- } else {
- /* the entry already existed */
- add_user = False;
}
/* If we are root or the password is 'NO PASSWORD' then
@@ -579,3 +571,14 @@ Error was %s. Password file may be corrupt ! Please examine by hand !\n",
return 0;
}
+#else
+
+#include "includes.h"
+
+int
+main(int argc, char **argv)
+{
+ printf("smb password encryption not selected in Makefile\n");
+ return 0;
+}
+#endif
diff --git a/source/utils/status.c b/source/utils/status.c
index 703105012ef..6fa85c0a630 100644
--- a/source/utils/status.c
+++ b/source/utils/status.c
@@ -98,10 +98,10 @@ for share file %s (%s)\n", progname, fname, strerror(errno));
return 0;
}
- if (IVAL(buf,SMF_VERSION_OFFSET) != LOCKING_VERSION) {
+ if (IVAL(buf,0) != LOCKING_VERSION) {
printf("%s: ERROR: read_share_file: share file %s has incorrect \
locking version (was %d, should be %d).\n",fname,
- progname, IVAL(buf,SMF_VERSION_OFFSET), LOCKING_VERSION);
+ progname, IVAL(buf,0), LOCKING_VERSION);
if(buf)
free(buf);
return 0;
@@ -109,13 +109,13 @@ locking version (was %d, should be %d).\n",fname,
/* Sanity check for file contents */
size = sb.st_size;
- size -= SMF_HEADER_LENGTH; /* Remove the header */
+ size -= 10; /* Remove the header */
/* Remove the filename component. */
- size -= SVAL(buf, SMF_FILENAME_LEN_OFFSET);
+ size -= SVAL(buf, 8);
- /* The remaining size must be a multiple of SMF_ENTRY_LENGTH - error if not. */
- if((size % SMF_ENTRY_LENGTH) != 0)
+ /* The remaining size must be a multiple of 16 - error if not. */
+ if((size % 16) != 0)
{
printf("%s: ERROR: read_share_file: share file %s is an incorrect length.\n",
progname, fname);
@@ -148,9 +148,6 @@ locking version (was %d, should be %d).\n",fname,
void *dir;
char *s;
#endif /* FAST_SHARE_MODES */
-#ifdef USE_OPLOCKS
- int oplock_type;
-#endif /* USE_OPLOCKS */
int i;
struct session_record *ptr;
@@ -347,10 +344,6 @@ locking version (was %d, should be %d).\n",fname,
t.tv_sec = entry_scanner_p->time.tv_sec;
t.tv_usec = entry_scanner_p->time.tv_usec;
strcpy(fname, file_scanner_p->file_name);
-#ifdef USE_OPLOCKS
- oplock_type = entry_scanner_p->op_type;
-#endif /* USE_OPLOCKS */
-
#else /* FAST_SHARE_MODES */
/* For slow share modes go through all the files in
@@ -401,19 +394,16 @@ locking version (was %d, should be %d).\n",fname,
strcpy( fname, &buf[10]);
close(fd);
- base = buf + SMF_HEADER_LENGTH + SVAL(buf,SMF_FILENAME_LEN_OFFSET);
- for( i = 0; i < IVAL(buf, SMF_NUM_ENTRIES_OFFSET); i++)
+ base = buf + 10 + SVAL(buf,8);
+ for( i = 0; i < IVAL(buf, 4); i++)
{
- char *p = base + (i*SMF_ENTRY_LENGTH);
+ char *p = base + (i*16);
struct timeval t;
- int pid = IVAL(p,SME_PID_OFFSET);
- int mode = IVAL(p,SME_SHAREMODE_OFFSET);
+ int pid = IVAL(p,12);
+ int mode = IVAL(p,8);
- t.tv_sec = IVAL(p,SME_SEC_OFFSET);
- t.tv_usec = IVAL(p,SME_USEC_OFFSET);
-#ifdef USE_OPLOCKS
- oplock_type = SVAL(p,SME_OPLOCK_TYPE_OFFSET);
-#endif /* USE_OPLOCKS */
+ t.tv_sec = IVAL(p,0);
+ t.tv_usec = IVAL(p,4);
#endif /* FAST_SHARE_MODES */
fname[sizeof(fname)-1] = 0;
@@ -421,13 +411,8 @@ locking version (was %d, should be %d).\n",fname,
if (firstopen) {
firstopen=False;
printf("Locked files:\n");
-#ifdef USE_OPLOCKS
- printf("Pid DenyMode R/W Oplock Name\n");
- printf("--------------------------------------------------\n");
-#else /* USE_OPLOCKS */
- printf("Pid DenyMode R/W Name\n");
- printf("----------------------------------\n");
-#endif /* USE_OPLOCKS */
+ printf("Pid DenyMode R/W Name\n");
+ printf("------------------------------\n");
}
@@ -442,20 +427,10 @@ locking version (was %d, should be %d).\n",fname,
}
switch (mode&0xF)
{
- case 0: printf("RDONLY "); break;
- case 1: printf("WRONLY "); break;
- case 2: printf("RDWR "); break;
+ case 0: printf("RDONLY "); break;
+ case 1: printf("WRONLY "); break;
+ case 2: printf("RDWR "); break;
}
-#ifdef USE_OPLOCKS
- if((oplock_type & (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) == (EXCLUSIVE_OPLOCK|BATCH_OPLOCK))
- printf("EXCLUSIVE+BATCH ");
- else if (oplock_type & EXCLUSIVE_OPLOCK)
- printf("EXCLUSIVE ");
- else if (oplock_type & BATCH_OPLOCK)
- printf("BATCH ");
- else
- printf("NONE ");
-#endif /* USE_OPLOCKS */
printf(" %s %s",fname,asctime(LocalTime((time_t *)&t.tv_sec)));
#ifdef FAST_SHARE_MODES
diff --git a/source/utils/testparm.c b/source/utils/testparm.c
index ca364cb8c94..81e69cd76fb 100644
--- a/source/utils/testparm.c
+++ b/source/utils/testparm.c
@@ -82,7 +82,7 @@ extern int DEBUGLEVEL;
printf("Press enter to see a dump of your service definitions\n");
fflush(stdout);
getc(stdin);
- lp_dump(stdout);
+ lp_dump();
}
if (argc == 4)