Skip to content

Commit 2180df1

Browse files
authored
Merge pull request #108 from rmaksimov/misc-fixes
add misc fixes
2 parents 032952e + 3c10147 commit 2180df1

File tree

6 files changed

+12
-14
lines changed

6 files changed

+12
-14
lines changed

forms/rulerforms.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ func DeleteForm(suffix string, folderid []byte) ([]byte, error) {
237237
ruleid := v.RuleID
238238
err = mapi.ExecuteMailRuleDelete(ruleid)
239239
if err != nil {
240-
utils.Error.Printf("Failed to delete rule")
240+
utils.Error.Println("Failed to delete rule")
241241
return nil, err
242242
}
243243
utils.Info.Println("Rule deleted successfully")

mapi/datastructs.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ type ExecuteResponse struct {
7373
AuxilliaryBuf []byte
7474
}
7575

76-
//ConnectResponse strcut
76+
//ConnectResponse struct
7777
type ConnectResponse struct {
7878
StatusCode uint32 //if 0x00000 --> failure and we only have AuzilliaryBufferSize and AuxilliaryBuffer
7979
ErrorCode uint32
@@ -826,7 +826,7 @@ type RopReadStreamRequest struct {
826826
MaximumByteCount uint32
827827
}
828828

829-
//RopRestrictRequest strcut
829+
//RopRestrictRequest struct
830830
type RopRestrictRequest struct {
831831
RopID uint8 //0x14
832832
LogonID uint8
@@ -836,7 +836,7 @@ type RopRestrictRequest struct {
836836
RestrictionData []byte
837837
}
838838

839-
//RopRestrictResponse strcut
839+
//RopRestrictResponse struct
840840
type RopRestrictResponse struct {
841841
RopID uint8 //0x14
842842
InputHandleIndex uint8
@@ -929,7 +929,7 @@ type RopModifyRulesResponse struct {
929929
ReturnValue uint32
930930
}
931931

932-
//RopGetRulesTableResponse strcut
932+
//RopGetRulesTableResponse struct
933933
type RopGetRulesTableResponse struct {
934934
RopID uint8
935935
OutputHandleIndex uint8

mapi/mapi.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ func readResponse(headers http.Header, body []byte) ([]byte, error) {
342342
return body[start+4:], nil
343343
}
344344

345-
//Authenticate is used to create the MAPI session, get's session cookie ect
345+
//Authenticate is used to create the MAPI session, get's session cookie etc
346346
func Authenticate() (*RopLogonResponse, error) {
347347
if AuthSession.Transport == RPC {
348348
return AuthenticateRPC()
@@ -386,7 +386,7 @@ func AuthenticateRPC() (*RopLogonResponse, error) {
386386
return nil, &TransportError{fmt.Errorf("An error occurred setting up RPC. %s", err)}
387387
}
388388

389-
utils.Trace.Println("User DN: ", string(connRequest.UserDN))
389+
utils.Trace.Printf("User DN: %s", string(connRequest.UserDN))
390390
utils.Trace.Println("Got Context, Doing ROPLogin")
391391

392392
AuthSession.UserDN = append([]byte(AuthSession.LID), []byte{0x00}...)
@@ -419,7 +419,7 @@ func AuthenticateHTTP() (*RopLogonResponse, error) {
419419
connResponse.Unmarshal(responseBody)
420420

421421
if connResponse.StatusCode == 0 {
422-
utils.Trace.Println("User DN: ", string(connRequest.UserDN))
422+
utils.Trace.Printf("User DN: %s", string(connRequest.UserDN))
423423
utils.Trace.Println("Got Context, Doing ROPLogin")
424424

425425
AuthSession.UserDN = connRequest.UserDN
@@ -2038,7 +2038,7 @@ func FastTransferFetchStep(handles []byte) ([]byte, error) {
20382038
pprops := RopFastTransferSourceGetBufferResponse{}
20392039
rops := []RopResponse{&pprops}
20402040
bufPtr, e := UnmarshalRops(execResponse.RopBuffer.Body, rops)
2041-
utils.Trace.Printf("Large transfer in progress. Status: %d ", pprops.TransferStatus)
2041+
utils.Trace.Printf("Large transfer in progress. Status: %d", pprops.TransferStatus)
20422042

20432043
if pprops.TransferStatus == 0x0001 {
20442044
buff, err := FastTransferFetchStep(execResponse.RopBuffer.Body[bufPtr:])

rpc-http/packets.go

-2
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,6 @@ func (response *RPCResponse) Unmarshal(raw []byte) (int, error) {
480480
return pos, nil
481481
}
482482
response.SecTrailer, pos = utils.ReadBytes(pos, int(response.Header.AuthLen), raw)
483-
} else {
484-
485483
}
486484
}
487485
return pos, nil

ruler.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func deleteRule(c *cli.Context) error {
228228
ruleid = v.RuleID
229229
err = mapi.ExecuteMailRuleDelete(ruleid)
230230
if err != nil {
231-
utils.Error.Printf("Failed to delete rule")
231+
utils.Error.Println("Failed to delete rule")
232232
}
233233
}
234234
}
@@ -243,7 +243,7 @@ func deleteRule(c *cli.Context) error {
243243
}
244244
err = mapi.ExecuteMailRuleDelete(ruleid)
245245
if err != nil {
246-
utils.Error.Printf("Failed to delete rule")
246+
utils.Error.Println("Failed to delete rule")
247247
}
248248
}
249249

utils/datatypes.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type Config struct {
2121
UserAgent string
2222
}
2323

24-
//Session stores authentication cookies ect
24+
//Session stores authentication cookies etc
2525
type Session struct {
2626
User string
2727
Pass string

0 commit comments

Comments
 (0)