mailing list of musl libc
 help / color / mirror / code / Atom feed
bb0a410903e473ffc2682c39ea7958b6ebf302c6 blob 1142 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
#include <shadow.h>
#include <stdio.h>

int putspent(const struct spwd *sp, FILE *f)
{
	flockfile(f);
	if (sp->sp_namp && fputs(sp->sp_namp, f) == EOF) goto fail;
	if (fputc(':', f) == EOF) goto fail;
	if (sp->sp_pwdp && fputs(sp->sp_pwdp, f) == EOF) goto fail;
	if (fputc(':', f) == EOF) goto fail;
	if (sp->sp_lstchg != -1 && fprintf(f, "%d", sp->sp_lstchg) < 0) goto fail;
	if (fputc(':', f) == EOF) goto fail;
	if (sp->sp_min != -1 && fprintf(f, "%d", sp->sp_min) < 0) goto fail;
	if (fputc(':', f) == EOF) goto fail;
	if (sp->sp_max != -1 && fprintf(f, "%d", sp->sp_max) < 0) goto fail;
	if (fputc(':', f) == EOF) goto fail;
	if (sp->sp_warn != -1 && fprintf(f, "%d", sp->sp_warn) < 0) goto fail;
	if (fputc(':', f) == EOF) goto fail;
	if (sp->sp_inact != -1 && fprintf(f, "%d", sp->sp_inact) < 0) goto fail;
	if (fputc(':', f) == EOF) goto fail;
	if (sp->sp_expire != -1 && fprintf(f, "%d", sp->sp_expire) < 0) goto fail;
	if (fputc(':', f) == EOF) goto fail;
	if (sp->sp_flag != -1 && fprintf(f, "%d", sp->sp_flag) < 0) goto fail;
	if (fputc('\n', f) == EOF) goto fail;
	funlockfile(f);
	return 0;
fail:
	funlockfile(f);
	return -1;
}
debug log:

solving bb0a410 ...
found bb0a410 in https://inbox.vuxu.org/musl/1383637660-7768-1-git-send-email-mforney@mforney.org/

applying [1/1] https://inbox.vuxu.org/musl/1383637660-7768-1-git-send-email-mforney@mforney.org/
diff --git a/src/passwd/putspent.c b/src/passwd/putspent.c
new file mode 100644
index 0000000..bb0a410

Checking patch src/passwd/putspent.c...
Applied patch src/passwd/putspent.c cleanly.

index at:
100644 bb0a410903e473ffc2682c39ea7958b6ebf302c6	src/passwd/putspent.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).