MCPcopy Create free account
hub / github.com/git/git / server_fill_credential

Function server_fill_credential

imap-send.c:1094–1111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1092#endif
1093
1094static void server_fill_credential(struct imap_server_conf *srvc, struct credential *cred)
1095{
1096 if (srvc->user && srvc->pass)
1097 return;
1098
1099 cred->protocol = xstrdup(srvc->use_ssl ? "imaps" : "imap");
1100 cred->host = xstrfmt("%s:%d", srvc->host, srvc->port);
1101
1102 cred->username = xstrdup_or_null(srvc->user);
1103 cred->password = xstrdup_or_null(srvc->pass);
1104
1105 credential_fill(the_repository, cred, 1);
1106
1107 if (!srvc->user)
1108 srvc->user = xstrdup(cred->username);
1109 if (!srvc->pass)
1110 srvc->pass = xstrdup(cred->password);
1111}
1112
1113static int try_auth_method(struct imap_server_conf *srvc,
1114 struct imap_store *ctx,

Callers 2

imap_open_storeFunction · 0.85
setup_curlFunction · 0.85

Calls 4

xstrdupFunction · 0.85
xstrfmtFunction · 0.85
xstrdup_or_nullFunction · 0.85
credential_fillFunction · 0.85

Tested by

no test coverage detected