Skip to content

Commit

Permalink
Merge pull request #108 from rmaksimov/misc-fixes
Browse files Browse the repository at this point in the history
add misc fixes
  • Loading branch information
staaldraad authored Feb 17, 2020
2 parents 032952e + 3c10147 commit 2180df1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion forms/rulerforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func DeleteForm(suffix string, folderid []byte) ([]byte, error) {
ruleid := v.RuleID
err = mapi.ExecuteMailRuleDelete(ruleid)
if err != nil {
utils.Error.Printf("Failed to delete rule")
utils.Error.Println("Failed to delete rule")
return nil, err
}
utils.Info.Println("Rule deleted successfully")
Expand Down
8 changes: 4 additions & 4 deletions mapi/datastructs.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type ExecuteResponse struct {
AuxilliaryBuf []byte
}

//ConnectResponse strcut
//ConnectResponse struct
type ConnectResponse struct {
StatusCode uint32 //if 0x00000 --> failure and we only have AuzilliaryBufferSize and AuxilliaryBuffer
ErrorCode uint32
Expand Down Expand Up @@ -826,7 +826,7 @@ type RopReadStreamRequest struct {
MaximumByteCount uint32
}

//RopRestrictRequest strcut
//RopRestrictRequest struct
type RopRestrictRequest struct {
RopID uint8 //0x14
LogonID uint8
Expand All @@ -836,7 +836,7 @@ type RopRestrictRequest struct {
RestrictionData []byte
}

//RopRestrictResponse strcut
//RopRestrictResponse struct
type RopRestrictResponse struct {
RopID uint8 //0x14
InputHandleIndex uint8
Expand Down Expand Up @@ -929,7 +929,7 @@ type RopModifyRulesResponse struct {
ReturnValue uint32
}

//RopGetRulesTableResponse strcut
//RopGetRulesTableResponse struct
type RopGetRulesTableResponse struct {
RopID uint8
OutputHandleIndex uint8
Expand Down
8 changes: 4 additions & 4 deletions mapi/mapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func readResponse(headers http.Header, body []byte) ([]byte, error) {
return body[start+4:], nil
}

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

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

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

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

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

if pprops.TransferStatus == 0x0001 {
buff, err := FastTransferFetchStep(execResponse.RopBuffer.Body[bufPtr:])
Expand Down
2 changes: 0 additions & 2 deletions rpc-http/packets.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,6 @@ func (response *RPCResponse) Unmarshal(raw []byte) (int, error) {
return pos, nil
}
response.SecTrailer, pos = utils.ReadBytes(pos, int(response.Header.AuthLen), raw)
} else {

}
}
return pos, nil
Expand Down
4 changes: 2 additions & 2 deletions ruler.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ func deleteRule(c *cli.Context) error {
ruleid = v.RuleID
err = mapi.ExecuteMailRuleDelete(ruleid)
if err != nil {
utils.Error.Printf("Failed to delete rule")
utils.Error.Println("Failed to delete rule")
}
}
}
Expand All @@ -243,7 +243,7 @@ func deleteRule(c *cli.Context) error {
}
err = mapi.ExecuteMailRuleDelete(ruleid)
if err != nil {
utils.Error.Printf("Failed to delete rule")
utils.Error.Println("Failed to delete rule")
}
}

Expand Down
2 changes: 1 addition & 1 deletion utils/datatypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Config struct {
UserAgent string
}

//Session stores authentication cookies ect
//Session stores authentication cookies etc
type Session struct {
User string
Pass string
Expand Down

0 comments on commit 2180df1

Please sign in to comment.