mailing list of musl libc
 help / color / mirror / code / Atom feed
643637de8a1ca55c7d5e3648f07942c64995e54e blob 574 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
 
#include "pwf.h"
#include <pthread.h>
#include <limits.h>
#include <stdio.h>

int fgetspent_r(FILE *f, struct spwd* sp, char *line, size_t size, struct spwd **spret)
{
	int res = 0;
	int cs;
	*spret = 0;
	if (size > INT_MAX)
		size = INT_MAX; //2GB ought to be enough for anyone
	pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
	if (!fgets(line, size, f))
		goto out;
	res = ERANGE;
	if (line[strlen(line) - 1] != '\n')
		goto out;
	res = EILSEQ;
	if ( __parsespent(line, sp) < 0)
		goto out;
	*spret = sp;
	res = 0;
out:
	pthread_setcancelstate(cs, 0);
	return res;
}
debug log:

solving 643637de ...
found 643637de in https://inbox.vuxu.org/musl/20190120154154.GA23924@voyager/

applying [1/1] https://inbox.vuxu.org/musl/20190120154154.GA23924@voyager/
diff --git a/src/passwd/fgetspent_r.c b/src/passwd/fgetspent_r.c
new file mode 100644
index 00000000..643637de

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

index at:
100644 643637de8a1ca55c7d5e3648f07942c64995e54e	src/passwd/fgetspent_r.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).