mirror of
https://github.com/samba-team/samba.git
synced 2025-03-10 12:58:35 +03:00
update testparm with -s option so it doesn't require a carriage return
also allow specifying [host hostip] without [configfile] updated man page
This commit is contained in:
parent
5ad77769be
commit
85fbd40102
@ -24,7 +24,7 @@
|
|||||||
<p><br><a name="SYNOPSIS"></a>
|
<p><br><a name="SYNOPSIS"></a>
|
||||||
<h2>SYNOPSIS</h2>
|
<h2>SYNOPSIS</h2>
|
||||||
|
|
||||||
<p><br><strong>testparm</strong> [<a href="testparm.1.html#configfilename">configfilename</a> [<a href="testparm.1.html#hostname">hostname</a> <a href="testparm.1.html#hostIP">hostIP</a>] ]
|
<p><br><strong>testparm</strong> [<a href="testparm.1.html#minuss">-s</a>] [<a href="testparm.1.html#configfilename">configfilename</a>] [<a href="testparm.1.html#hostname">hostname</a> <a href="testparm.1.html#hostIP">hostIP</a>]
|
||||||
<p><br><a name="DESCRIPTION"></a>
|
<p><br><a name="DESCRIPTION"></a>
|
||||||
<h2>DESCRIPTION</h2>
|
<h2>DESCRIPTION</h2>
|
||||||
|
|
||||||
@ -43,6 +43,10 @@ reporting whether the specified host has access to each service.
|
|||||||
<h2>OPTIONS</h2>
|
<h2>OPTIONS</h2>
|
||||||
|
|
||||||
<p><br><ul>
|
<p><br><ul>
|
||||||
|
<p><br><a name="minuss"></a>
|
||||||
|
<li><strong><strong>-s</strong></strong> Without this option, <strong>testparm</strong> will prompt for a
|
||||||
|
carriage return after printing the service names and before dumping
|
||||||
|
the service definitions.
|
||||||
<p><br><a name="configfilename"></a>
|
<p><br><a name="configfilename"></a>
|
||||||
<li><strong><strong>configfilename</strong></strong> This is the name of the configuration file to
|
<li><strong><strong>configfilename</strong></strong> This is the name of the configuration file to
|
||||||
check. If this parameter is not present then the default
|
check. If this parameter is not present then the default
|
||||||
|
@ -5,7 +5,7 @@ testparm \- check an smb\&.conf configuration file for internal correctness
|
|||||||
.PP
|
.PP
|
||||||
.SH "SYNOPSIS"
|
.SH "SYNOPSIS"
|
||||||
.PP
|
.PP
|
||||||
\fBtestparm\fP [configfilename [hostname hostIP] ]
|
\fBtestparm\fP [-s] [configfilename] [hostname hostIP]
|
||||||
.PP
|
.PP
|
||||||
.SH "DESCRIPTION"
|
.SH "DESCRIPTION"
|
||||||
.PP
|
.PP
|
||||||
@ -27,6 +27,11 @@ reporting whether the specified host has access to each service\&.
|
|||||||
.SH "OPTIONS"
|
.SH "OPTIONS"
|
||||||
.PP
|
.PP
|
||||||
.IP
|
.IP
|
||||||
|
.IP "\fB-s\fP"
|
||||||
|
Without this option, \fBtestparm\fP will prompt for a
|
||||||
|
carriage return after printing the service names and before dumping
|
||||||
|
the service definitions\&.
|
||||||
|
.IP
|
||||||
.IP "\fBconfigfilename\fP"
|
.IP "\fBconfigfilename\fP"
|
||||||
This is the name of the configuration file to
|
This is the name of the configuration file to
|
||||||
check\&. If this parameter is not present then the default
|
check\&. If this parameter is not present then the default
|
||||||
|
@ -8,7 +8,7 @@ manpagename(testparm)(check an smb.conf configuration file for internal correctn
|
|||||||
label(SYNOPSIS)
|
label(SYNOPSIS)
|
||||||
manpagesynopsis()
|
manpagesynopsis()
|
||||||
|
|
||||||
bf(testparm) [link(configfilename)(configfilename) [link(hostname)(hostname) link(hostIP)(hostIP)] ]
|
bf(testparm) [link(-s)(minuss)] [link(configfilename)(configfilename)] [link(hostname)(hostname) link(hostIP)(hostIP)]
|
||||||
|
|
||||||
label(DESCRIPTION)
|
label(DESCRIPTION)
|
||||||
manpagedescription()
|
manpagedescription()
|
||||||
@ -33,6 +33,11 @@ manpageoptions()
|
|||||||
|
|
||||||
startdit()
|
startdit()
|
||||||
|
|
||||||
|
label(minuss)
|
||||||
|
dit(bf(-s)) Without this option, bf(testparm) will prompt for a
|
||||||
|
carriage return after printing the service names and before dumping
|
||||||
|
the service definitions.
|
||||||
|
|
||||||
label(configfilename)
|
label(configfilename)
|
||||||
dit(bf(configfilename)) This is the name of the configuration file to
|
dit(bf(configfilename)) This is the name of the configuration file to
|
||||||
check. If this parameter is not present then the default
|
check. If this parameter is not present then the default
|
||||||
|
@ -72,8 +72,12 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n");
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
extern char *optarg;
|
||||||
|
extern int optind;
|
||||||
pstring configfile;
|
pstring configfile;
|
||||||
|
int opt;
|
||||||
int s;
|
int s;
|
||||||
|
BOOL silent_mode = False;
|
||||||
|
|
||||||
TimeInit();
|
TimeInit();
|
||||||
|
|
||||||
@ -81,10 +85,20 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n");
|
|||||||
|
|
||||||
charset_initialise();
|
charset_initialise();
|
||||||
|
|
||||||
if (argc < 2)
|
while ((opt = getopt(argc, argv,"s")) != EOF) {
|
||||||
|
switch (opt) {
|
||||||
|
case 's':
|
||||||
|
silent_mode = True;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
argc += (1 - optind);
|
||||||
|
|
||||||
|
if ((argc == 1) || (argc == 3))
|
||||||
pstrcpy(configfile,CONFIGFILE);
|
pstrcpy(configfile,CONFIGFILE);
|
||||||
else
|
else if ((argc == 2) || (argc == 4))
|
||||||
pstrcpy(configfile,argv[1]);
|
pstrcpy(configfile,argv[optind]);
|
||||||
|
|
||||||
dbf = stdout;
|
dbf = stdout;
|
||||||
DEBUGLEVEL = 2;
|
DEBUGLEVEL = 2;
|
||||||
@ -116,19 +130,29 @@ cannot be set in the smb.conf file. nmbd will abort with this setting.\n");
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc < 4)
|
if (argc < 3)
|
||||||
{
|
{
|
||||||
printf("Press enter to see a dump of your service definitions\n");
|
if (!silent_mode) {
|
||||||
fflush(stdout);
|
printf("Press enter to see a dump of your service definitions\n");
|
||||||
getc(stdin);
|
fflush(stdout);
|
||||||
|
getc(stdin);
|
||||||
|
}
|
||||||
lp_dump(stdout,True);
|
lp_dump(stdout,True);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc == 4)
|
if (argc >= 3)
|
||||||
{
|
{
|
||||||
char *cname = argv[2];
|
char *cname;
|
||||||
char *caddr = argv[3];
|
char *caddr;
|
||||||
|
|
||||||
|
if (argc == 3) {
|
||||||
|
cname = argv[optind];
|
||||||
|
caddr = argv[optind+1];
|
||||||
|
} else if (argc == 4) {
|
||||||
|
cname = argv[optind+1];
|
||||||
|
caddr = argv[optind+2];
|
||||||
|
}
|
||||||
|
|
||||||
/* this is totally ugly, a real `quick' hack */
|
/* this is totally ugly, a real `quick' hack */
|
||||||
for (s=0;s<1000;s++)
|
for (s=0;s<1000;s++)
|
||||||
if (VALID_SNUM(s))
|
if (VALID_SNUM(s))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user