Skip to content

Chntpw ng 1.01 - #3

Open
WicRus wants to merge 2 commits into
rescatux:chntpw-ng-1.01from
WicRus:chntpw-ng-1.01
Open

Chntpw ng 1.01#3
WicRus wants to merge 2 commits into
rescatux:chntpw-ng-1.01from
WicRus:chntpw-ng-1.01

Conversation

@WicRus

@WicRus WicRus commented Nov 7, 2019

Copy link
Copy Markdown

As you requested here, I have rebased my pull request to this branch.
Ready to discuss about bugs in my code.

@adrian15

adrian15 commented Nov 9, 2019

Copy link
Copy Markdown
Collaborator

As you requested here, I have rebased my pull request to this branch.
Ready to discuss about bugs in my code.

Sorry, it's almost there.

You need to create your pull request against our https://github.com/rescatux/chntpw/tree/chntpw-ng-1.01 branch. Not against our master branch.

Thank you.

@WicRus
WicRus changed the base branch from master to chntpw-ng-1.01 November 12, 2019 15:37
@WicRus

WicRus commented Nov 12, 2019

Copy link
Copy Markdown
Author

Sorry. The target branch have been changed.

Comment thread Makefile Outdated

# Force 32 bit
CFLAGS= -DUSEOPENSSL -g -I. -I$(OSSLINC) -Wall -m32
CFLAGS= -DUSEOPENSSL -g -I. -I$(OSSLINC) -Wall -m32

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This typo fixing need to go into its own commit.

Comment thread chntpw.c Outdated
cheap_uni2ascii(vp + comment_offset,comment,comment_len);
cheap_uni2ascii(vp + homedir_offset,homedir,homedir_len);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This typo fixing need to go into its own commit.

Comment thread libsam.c

void sam_free_sid_array(struct sid_array *array)
{

@adrian15 adrian15 Nov 12, 2019

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If every function has an additional line you shouldn't remove it.
I haven't checked it.
Otherwise if removing this line matches the other functions style then this typo fixing need to go into its own commit.
(I mean all the typos fixing need to go into a single commit.)

Comment thread samusrgrp.c
H_SAM = 0;
}


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once again.
Check if it makes sense to remove this line.
If it makes sense you need to put this into the 'Typos' commit.

Comment thread libsam.c Outdated
if (gverbose) printf("put_grp_members_sid: ajusted: mofs = %x, mlen = %x (%d)\n", mofs + 0x34 ,mlen,mlen);

if (gverbose) hexdump(&c->data, 0, c->len, 1);
if (gverbose) hexdump((char *)&(c->data), 0, c->len, 1);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why you change & into (char *)&( ?
Either as an in-code comment (better) or in the commit description.

Comment thread libsam.c Outdated
printf(" Member # %d = <%s>\n", i, str);
FREE(str);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gverbose should only be used to turn on or off the printf statement.
Else if gverbose is false then your code does not do anything useful.

Comment thread libsam.c
printf("sam_add_sid_to_grp: user SID is <%s>\n", str);
free(str);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gverbose should only be used to turn on or off the printf statement.
Else if gverbose is false then your code does not do anything useful.

Comment thread libsam.c
printf(" Member # %d = <%s>\n", o, str);
FREE(str);
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gverbose should only be used to turn on or off the printf statement.
Else if gverbose is false then your code does not do anything useful.

Comment thread libsam.c
printf(" Member # %u = <%s>\n", o, str);
FREE(str);
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gverbose should only be used to turn on or off the printf statement.
Else if gverbose is false then your code does not do anything useful.

Comment thread libsam.c
FREE(str);
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gverbose should only be used to turn on or off the printf statement.
Else if gverbose is false then your code does not do anything useful.

Comment thread libsam.c
printf(" Member # %u = <%s>\n", o, str);
FREE(str);
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gverbose should only be used to turn on or off the printf statement.
Else if gverbose is false then your code does not do anything useful.

Comment thread libsam.c Outdated

if (human) printf("=== Group #%4x : %s\n",grp,groupname);
else if (!listmembers) printf("%x:%s:%d\n",grp,groupname,cd->grp_members);
else if (!listmembers) printf("%x:%s:%d\n",grp,groupname,cd->grp_members);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identation fixes should be in a third commit different from the useful commit and the typos one.

Comment thread libsam.c Outdated
}
FREE(str);

}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go into the identation commit.

Comment thread samusrgrp.c
H_SAM = 0;
}


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goes into typos commit.

Comment thread samusrgrp.c
}

if ( sid ) use_sid = 1;
if ( usr ) use_sid = 0;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There shouldn't be an additional line before the closing } in this function in order to match current style.

Codestyle's fixes.
Removed useless changes.
Fixed gverbose statment logic.
Fixed compiler warnings in libsam.c lines 514, 542, hexdump require char *, but &c->data have type &int.
Fixed compiler warnings in libsam.c line 531, printf %x require int, but sidptr have type void *.
@WicRus

WicRus commented Nov 25, 2019

Copy link
Copy Markdown
Author

Sorry for the delay with fixes.
I have tried to fix all your remarks.

double free fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants