Skip to content
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

mdb iamproxy auth support #561

Merged
merged 30 commits into from
Feb 5, 2024
Merged

mdb iamproxy auth support #561

merged 30 commits into from
Feb 5, 2024

Conversation

AndrewOvvv
Copy link
Contributor

No description provided.

sources/auth.c Outdated Show resolved Hide resolved
sources/auth.c Outdated Show resolved Hide resolved
sources/auth.c Outdated Show resolved Hide resolved
sources/mdb_iamproxy.c Outdated Show resolved Hide resolved
sources/mdb_iamproxy.c Outdated Show resolved Hide resolved
sources/mdb_iamproxy.c Show resolved Hide resolved
uint64_t msg_size = sizeof(body_size) + body_size;
uint64_t sent = 0; // stores byte-size of sended info
char *msg = (char *)calloc(
msg_size, sizeof(*msg)); // allocate memory for msg buffer
Copy link
Collaborator

Choose a reason for hiding this comment

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

sizeof(char) == 1 by C standard

Copy link
Contributor Author

@AndrewOvvv AndrewOvvv Jan 29, 2024

Choose a reason for hiding this comment

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

Yes, but what's incorrect here? i think it's common to allocate dynamic memory in that way

type *mem = calloc(n, sizeof(*mem)); its easily to read, and remove nubmers/random (for common code reader) constants from code

But if necessary, I can fix it

sources/auth.c Outdated
msg = od_read(&client->io, UINT32_MAX);
if (msg == NULL) {
od_error(&instance->logger, "auth", client, NULL,
"fuck that shit again");
Copy link
Collaborator

Choose a reason for hiding this comment

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

be polite, the Internet remembers all

sources/auth.c Outdated Show resolved Hide resolved
sources/auth.c Outdated Show resolved Hide resolved
sources/mdb_iamproxy.c Outdated Show resolved Hide resolved
sources/mdb_iamproxy.c Outdated Show resolved Hide resolved
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's avoid spurrious changes

#define MDB_IAMPROXY_DEFAULT_SOCKET_FILE \
"/var/run/iam-auth-proxy/iam-auth-proxy.sock" // PAM SOCKET FILE place

void put_header(char dst[], uint64_t src)
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's mark these as static.
Generaly we do all the formatting stuff in KiWi... it's kind of byte-formatting lib.

@x4m x4m merged commit 0e44d13 into yandex:master Feb 5, 2024
1 check passed
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.

4 participants