Skip to content

Commit b034539

Browse files
author
Etienne Stalmans
committed
Temporary fix for issue 57. Don't try display client-side rules
1 parent 2eb541a commit b034539

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

ruler.go

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,10 @@ func connect(c *cli.Context) error {
512512

513513
func printRules() error {
514514
//rules, er := mapi.DisplayRules()
515-
cols := make([]mapi.PropertyTag, 3)
515+
cols := make([]mapi.PropertyTag, 2)
516516
cols[0] = mapi.PidTagRuleName
517517
cols[1] = mapi.PidTagRuleID
518-
cols[2] = mapi.PidTagRuleActions
518+
//cols[2] = mapi.PidTagRuleActions
519519

520520
rows, er := mapi.FetchRules(cols)
521521

@@ -533,28 +533,30 @@ func printRules() error {
533533
}
534534
}
535535
maxwidth -= 10
536-
fmstr1 := fmt.Sprintf("%%-%ds | %%-16s | %%-s\n", maxwidth)
537-
fmstr2 := fmt.Sprintf("%%-%ds | %%x | %%s\n", maxwidth)
538-
utils.Info.Printf(fmstr1, "Rule Name", "Rule ID", "Client-Side")
539-
utils.Info.Printf("%s|%s|%s\n", (strings.Repeat("-", maxwidth+1)), strings.Repeat("-", 18), strings.Repeat("-", 11))
536+
fmstr1 := fmt.Sprintf("%%-%ds | %%-16s \n", maxwidth)
537+
fmstr2 := fmt.Sprintf("%%-%ds | %%x \n", maxwidth)
538+
utils.Info.Printf(fmstr1, "Rule Name", "Rule ID")
539+
utils.Info.Printf("%s|%s\n", (strings.Repeat("-", maxwidth+1)), strings.Repeat("-", 18))
540540
for k := 0; k < int(rows.RowCount); k++ {
541541
clientSide := false
542542
clientApp := ""
543-
rd := mapi.RuleAction{}
544-
rd.Unmarshal(rows.RowData[k][2].ValueArray)
545-
if rd.ActionType == 0x05 {
546-
for _, a := range rd.ActionData.Conditions {
547-
if a.Tag[1] == 0x49 {
548-
clientSide = true
549-
clientApp = string(utils.FromUnicode(a.Value))
550-
break
543+
/*
544+
rd := mapi.RuleAction{}
545+
rd.Unmarshal(rows.RowData[k][2].ValueArray)
546+
if rd.ActionType == 0x05 {
547+
for _, a := range rd.ActionData.Conditions {
548+
if a.Tag[1] == 0x49 {
549+
clientSide = true
550+
clientApp = string(utils.FromUnicode(a.Value))
551+
break
552+
}
551553
}
552554
}
553-
}
555+
*/
554556
if clientSide == true {
555557
utils.Info.Printf(fmstr2, string(utils.FromUnicode(rows.RowData[k][0].ValueArray)), rows.RowData[k][1].ValueArray, fmt.Sprintf("* %s", clientApp))
556558
} else {
557-
utils.Info.Printf(fmstr2, string(utils.FromUnicode(rows.RowData[k][0].ValueArray)), rows.RowData[k][1].ValueArray, "")
559+
utils.Info.Printf(fmstr2, string(utils.FromUnicode(rows.RowData[k][0].ValueArray)), rows.RowData[k][1].ValueArray)
558560
}
559561
}
560562
utils.Info.Println()

0 commit comments

Comments
 (0)