-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chntpw ng 1.01 #3
base: chntpw-ng-1.01
Are you sure you want to change the base?
Conversation
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. |
Sorry. The target branch have been changed. |
Makefile
Outdated
@@ -13,7 +13,7 @@ OSSLINC=$(OSSLPATH)/include | |||
CC=gcc | |||
|
|||
# Force 32 bit | |||
CFLAGS= -DUSEOPENSSL -g -I. -I$(OSSLINC) -Wall -m32 | |||
CFLAGS= -DUSEOPENSSL -g -I. -I$(OSSLINC) -Wall -m32 |
There was a problem hiding this comment.
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.
chntpw.c
Outdated
@@ -408,7 +408,7 @@ char *change_pw(char *buf, int rid, int vlen, int stat) | |||
cheap_uni2ascii(vp + fullname_offset,fullname,fullname_len); | |||
cheap_uni2ascii(vp + comment_offset,comment,comment_len); | |||
cheap_uni2ascii(vp + homedir_offset,homedir,homedir_len); | |||
|
There was a problem hiding this comment.
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.
libsam.c
Outdated
@@ -349,7 +349,6 @@ struct sid_array *sam_make_sid_array(struct sid_binary *sidbuf, int size) | |||
|
|||
void sam_free_sid_array(struct sid_array *array) | |||
{ | |||
|
There was a problem hiding this comment.
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.)
samusrgrp.c
Outdated
@@ -260,7 +382,6 @@ int main(int argc, char **argv) | |||
H_SAM = 0; | |||
} | |||
|
|||
|
There was a problem hiding this comment.
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.
libsam.c
Outdated
@@ -511,7 +510,7 @@ int sam_put_grp_members_sid(struct hive *hdesc, int grp, struct sid_array *sarra | |||
|
|||
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); |
There was a problem hiding this comment.
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.
libsam.c
Outdated
printf(" Member # %d = <%s>\n", i, str); | ||
FREE(str); | ||
} | ||
|
There was a problem hiding this comment.
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.
printf("sam_add_sid_to_grp: user SID is <%s>\n", str); | ||
free(str); | ||
} | ||
|
There was a problem hiding this comment.
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.
printf(" Member # %d = <%s>\n", o, str); | ||
FREE(str); | ||
} | ||
} |
There was a problem hiding this comment.
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.
printf(" Member # %u = <%s>\n", o, str); | ||
FREE(str); | ||
} | ||
} |
There was a problem hiding this comment.
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.
FREE(str); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
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.
printf(" Member # %u = <%s>\n", o, str); | ||
FREE(str); | ||
} | ||
} |
There was a problem hiding this comment.
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.
libsam.c
Outdated
@@ -1559,7 +1734,7 @@ void sam_list_groups(struct hive *hdesc, int listmembers, int human) { | |||
cheap_uni2ascii((char *)cd + grpnamoffs, groupname, grpnamlen); | |||
|
|||
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); |
There was a problem hiding this comment.
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.
libsam.c
Outdated
} | ||
FREE(str); | ||
|
||
} |
There was a problem hiding this comment.
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.
samusrgrp.c
Outdated
@@ -260,7 +382,6 @@ int main(int argc, char **argv) | |||
H_SAM = 0; | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goes into typos commit.
} | ||
|
||
if ( sid ) use_sid = 1; | ||
if ( usr ) use_sid = 0; |
There was a problem hiding this comment.
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 *.
0efa426
to
272e659
Compare
Sorry for the delay with fixes. |
double free fix
As you requested here, I have rebased my pull request to this branch.
Ready to discuss about bugs in my code.