Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
ea6fe0d5
Commit
ea6fe0d5
authored
Mar 03, 2003
by
Mark Andrews
Browse files
1451. [bug] rndc-confgen didn't exit with a error code for all
failures. [RT #5209]
parent
f6732ece
Changes
2
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
ea6fe0d5
1451. [bug] rndc-confgen didn't exit with a error code for all
failures. [RT #5209]
1450. [bug] Fetching expired glue failed under certian
circumstances. [RT #5124]
...
...
bin/rndc/rndc-confgen.c
View file @
ea6fe0d5
...
...
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rndc-confgen.c,v 1.1
5
200
1/11/30
0
1
:0
9:11 gson
Exp $ */
/* $Id: rndc-confgen.c,v 1.1
6
200
3/03/03
0
5
:0
8:56 marka
Exp $ */
#include
<config.h>
...
...
@@ -90,31 +90,21 @@ write_key_file(const char *keyfile, const char *user,
FILE
*
fd
;
fd
=
safe_create
(
keyfile
);
if
(
fd
==
NULL
)
{
fprintf
(
stderr
,
"unable to create
\"
%s
\"\n
"
,
keyfile
);
return
;
}
if
(
fd
==
NULL
)
fatal
(
"unable to create
\"
%s
\"\n
"
,
keyfile
);
if
(
user
!=
NULL
)
{
if
(
set_user
(
fd
,
user
)
==
-
1
)
{
fprintf
(
stderr
,
"unable to set file owner
\n
"
);
fclose
(
fd
);
return
;
}
if
(
set_user
(
fd
,
user
)
==
-
1
)
fatal
(
"unable to set file owner
\n
"
);
}
fprintf
(
fd
,
"key
\"
%s
\"
{
\n\t
algorithm hmac-md5;
\n
"
"
\t
secret
\"
%.*s
\"
;
\n
};
\n
"
,
keyname
,
(
int
)
isc_buffer_usedlength
(
secret
),
(
char
*
)
isc_buffer_base
(
secret
));
fflush
(
fd
);
if
(
ferror
(
fd
))
{
fprintf
(
stderr
,
"write to %s failed
\n
"
,
keyfile
);
fclose
(
fd
);
return
;
}
if
(
fclose
(
fd
))
{
fprintf
(
stderr
,
"fclose(%s) failed
\n
"
,
keyfile
);
return
;
}
if
(
ferror
(
fd
))
fatal
(
"write to %s failed
\n
"
,
keyfile
);
if
(
fclose
(
fd
))
fatal
(
"fclose(%s) failed
\n
"
,
keyfile
);
fprintf
(
stderr
,
"wrote key file
\"
%s
\"\n
"
,
keyfile
);
}
...
...
@@ -281,11 +271,8 @@ main(int argc, char **argv) {
char
*
buf
;
len
=
strlen
(
chrootdir
)
+
strlen
(
keyfile
)
+
2
;
buf
=
isc_mem_get
(
mctx
,
len
);
if
(
buf
==
NULL
)
{
fprintf
(
stderr
,
"isc_mem_get(%d) failed
\n
"
,
len
);
goto
cleanup
;
}
if
(
buf
==
NULL
)
fatal
(
"isc_mem_get(%d) failed
\n
"
,
len
);
snprintf
(
buf
,
len
,
"%s/%s"
,
chrootdir
,
keyfile
);
write_key_file
(
buf
,
user
,
keyname
,
&
key_txtbuffer
);
...
...
@@ -327,7 +314,6 @@ options {\n\
serveraddr
,
port
,
serveraddr
,
keyname
);
}
cleanup:
if
(
show_final_mem
)
isc_mem_stats
(
mctx
,
stderr
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment