From 6b7e1ead37b8655cf3cfb52a421461cedb3d0c90 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Thu, 28 Jan 1999 21:11:15 +0000 Subject: rpcclient "Service Control Manager" svcenum [-i] command. (This used to be commit a022710f1e3996ecbe6bbe035e1df0bc4c050b34) --- source3/rpcclient/display.c | 56 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'source3/rpcclient/display.c') diff --git a/source3/rpcclient/display.c b/source3/rpcclient/display.c index 800b89e563..d37b7283f8 100644 --- a/source3/rpcclient/display.c +++ b/source3/rpcclient/display.c @@ -1535,6 +1535,62 @@ void display_reg_key_info(FILE *out_hnd, enum action_type action, } } +/**************************************************************************** +convert a security permissions into a string +****************************************************************************/ +char *get_svc_start_type_str(uint32 type) +{ + static fstring typestr; + + switch (type) + { + case 0x00: fstrcpy(typestr, "Boot" ); return typestr; + case 0x01: fstrcpy(typestr, "System" ); return typestr; + case 0x02: fstrcpy(typestr, "Auto" ); return typestr; + case 0x03: fstrcpy(typestr, "Manual" ); return typestr; + case 0x04: fstrcpy(typestr, "Disabled"); return typestr; + default : break; + } + slprintf(typestr, sizeof(typestr)-1, "[%d]", type); + return typestr; +} + + +/**************************************************************************** + display structure + ****************************************************************************/ +void display_query_svc_cfg(FILE *out_hnd, enum action_type action, + QUERY_SERVICE_CONFIG *cfg) +{ + switch (action) + { + case ACTION_HEADER: + { + fprintf(out_hnd, "\tService:\t%s\n", unistr2_to_str(&cfg->uni_display_name)); /* service name unicode string */ + fprintf(out_hnd, "\t-------\n"); + break; + } + case ACTION_ENUMERATE: + { + fprintf(out_hnd, "\tPath:\t%s\n" , unistr2_to_str(&cfg->uni_bin_path_name)); + fprintf(out_hnd, "\tLoad Order:\t%s\n" , unistr2_to_str(&cfg->uni_load_order_grp)); + fprintf(out_hnd, "\tDependencies:\t%s\n" , unistr2_to_str(&cfg->uni_dependencies)); + fprintf(out_hnd, "\tService Start:\t%s\n", unistr2_to_str(&cfg->uni_service_start_name)); + fprintf(out_hnd, "\tService Type:\t%d\n" , cfg->service_type); + fprintf(out_hnd, "\tStart Type:\t%s\n" , get_svc_start_type_str(cfg->start_type)); + fprintf(out_hnd, "\tError Control:\t%d\n" , cfg->error_control); + fprintf(out_hnd, "\tTag Id:\t%d\n" , cfg->tag_id); + break; + + } + case ACTION_FOOTER: + { + fprintf(out_hnd, "\n"); + break; + } + } +} + /**************************************************************************** display structure ****************************************************************************/ -- cgit