Switch the default output format to LDIF

This commit is contained in:
Todd C. Miller
2018-01-28 19:36:16 -07:00
parent 7e5e1f6a6d
commit 4acaa9c74a
4 changed files with 10 additions and 11 deletions

View File

@@ -8,7 +8,7 @@ SSYYNNOOPPSSIISS
DDEESSCCRRIIPPTTIIOONN DDEESSCCRRIIPPTTIIOONN
ccvvttssuuddooeerrss can be used to convert a policy file in _s_u_d_o_e_r_s format to ccvvttssuuddooeerrss can be used to convert a policy file in _s_u_d_o_e_r_s format to
other formats. The default output format is JSON. other formats. The default output format is LDIF.
If no _s_u_d_o_e_r_s___f_i_l_e is specified, or if it is `-', the policy is read from If no _s_u_d_o_e_r_s___f_i_l_e is specified, or if it is `-', the policy is read from
the standard input. By default, the result is written to the standard the standard input. By default, the result is written to the standard
@@ -69,4 +69,4 @@ DDIISSCCLLAAIIMMEERR
file distributed with ssuuddoo or https://www.sudo.ws/license.html for file distributed with ssuuddoo or https://www.sudo.ws/license.html for
complete details. complete details.
Sudo 1.8.22 January 27, 2018 Sudo 1.8.22 Sudo 1.8.22 January 28, 2018 Sudo 1.8.22

View File

@@ -16,7 +16,7 @@
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.TH "CVTSUDOERS" "8" "January 27, 2018" "Sudo @PACKAGE_VERSION@" "System Manager's Manual" .TH "CVTSUDOERS" "8" "January 28, 2018" "Sudo @PACKAGE_VERSION@" "System Manager's Manual"
.nh .nh
.if n .ad l .if n .ad l
.SH "NAME" .SH "NAME"
@@ -34,7 +34,7 @@
can be used to convert a policy file in can be used to convert a policy file in
\fIsudoers\fR \fIsudoers\fR
format to other formats. format to other formats.
The default output format is JSON. The default output format is LDIF.
.PP .PP
If no If no
\fIsudoers_file\fR \fIsudoers_file\fR

View File

@@ -14,7 +14,7 @@
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.Dd January 27, 2018 .Dd January 28, 2018
.Dt CVTSUDOERS @mansectsu@ .Dt CVTSUDOERS @mansectsu@
.Os Sudo @PACKAGE_VERSION@ .Os Sudo @PACKAGE_VERSION@
.Sh NAME .Sh NAME
@@ -31,7 +31,7 @@
can be used to convert a policy file in can be used to convert a policy file in
.Em sudoers .Em sudoers
format to other formats. format to other formats.
The default output format is JSON. The default output format is LDIF.
.Pp .Pp
If no If no
.Ar sudoers_file .Ar sudoers_file

View File

@@ -15,8 +15,7 @@
*/ */
/* /*
* Convert from sudoers format to other formats. * Convert from the sudoers file format to LDIF or JSON format.
* Currently outputs to JSON
*/ */
#include <config.h> #include <config.h>
@@ -84,7 +83,7 @@ int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
int ch, exitcode = EXIT_FAILURE; int ch, exitcode = EXIT_FAILURE;
enum output_formats output_format = output_json; enum output_formats output_format = output_ldif;
const char *input_file = "-"; const char *input_file = "-";
const char *output_file = "-"; const char *output_file = "-";
debug_decl(main, SUDOERS_DEBUG_MAIN) debug_decl(main, SUDOERS_DEBUG_MAIN)
@@ -245,9 +244,9 @@ help(void)
(void) printf(_("%s - convert between sudoers file formats\n\n"), getprogname()); (void) printf(_("%s - convert between sudoers file formats\n\n"), getprogname());
usage(0); usage(0);
(void) puts(_("\nOptions:\n" (void) puts(_("\nOptions:\n"
" -f, --format=JSON specify output format\n" " -f, --format=JSON|LDIF specify output format (JSON or LDIF)\n"
" -h, --help display help message and exit\n" " -h, --help display help message and exit\n"
" -o, --output=output_file write sudoers in JSON format to output_file\n" " -o, --output=output_file write converted sudoers to output_file\n"
" -V, --version display version information and exit")); " -V, --version display version information and exit"));
exit(0); exit(0);
} }