summaryrefslogtreecommitdiffstats
path: root/source/rpcclient/display.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-01-28 21:11:15 +0000
committerLuke Leighton <lkcl@samba.org>1999-01-28 21:11:15 +0000
commita022710f1e3996ecbe6bbe035e1df0bc4c050b34 (patch)
tree88a736d685661bec08b6dcadede80b7f680a31f6 /source/rpcclient/display.c
parent61c40982d6fde34729dc6850cf3372482392f4c9 (diff)
downloadsamba-a022710f1e3996ecbe6bbe035e1df0bc4c050b34.tar.gz
samba-a022710f1e3996ecbe6bbe035e1df0bc4c050b34.tar.xz
samba-a022710f1e3996ecbe6bbe035e1df0bc4c050b34.zip
rpcclient "Service Control Manager" svcenum [-i] command.
Diffstat (limited to 'source/rpcclient/display.c')
-rw-r--r--source/rpcclient/display.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/source/rpcclient/display.c b/source/rpcclient/display.c
index 800b89e563b..d37b7283f8f 100644
--- a/source/rpcclient/display.c
+++ b/source/rpcclient/display.c
@@ -1536,6 +1536,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
****************************************************************************/
void display_svc_info(FILE *out_hnd, enum action_type action, ENUM_SRVC_STATUS *svc)