find_new_uid.c \
find_new_sub_gids.c \
find_new_sub_uids.c \
- fputsx.c \
fs/mkstemp/fmkomstemp.c \
fs/mkstemp/fmkomstemp.h \
fs/mkstemp/mkomstemp.c \
if (NULL == buf)
goto cleanup_errno;
- while (db->ops->cio_fgets(buf, buflen, db->fp) != NULL) {
+ while (fgets(buf, buflen, db->fp) != NULL) {
struct commonio_entry *p;
while ( (strrchr (buf, '\n') == NULL)
goto cleanup_errno;
len = strlen (buf);
- if (db->ops->cio_fgets(buf + len, buflen - len, db->fp) == NULL)
+ if (fgets(buf + len, buflen - len, db->fp) == NULL)
goto cleanup_buf;
}
stpsep(buf, "\n");
return -1;
}
} else if (NULL != p->line) {
- if (db->ops->cio_fputs(p->line, db->fp) == EOF)
+ if (fputs(p->line, db->fp) == EOF)
return -1;
if (putc ('\n', db->fp) == EOF) {
*/
int (*cio_put)(const void *, FILE *);
- /*
- * fgets and fputs (can be replaced by versions that
- * understand line continuation conventions).
- */
- ATTR_ACCESS(write_only, 1, 2)
- /*@null@*/char *(*cio_fgets)(/*@returned@*/char *restrict s, int n,
- FILE *restrict stream);
- int (*cio_fputs)(const char *, FILE *);
-
/*
* open_hook and close_hook.
* If non NULL, these functions will be called after the database
+++ /dev/null
-/*
- * SPDX-FileCopyrightText: 1990 - 1994, Julianne Frances Haugh
- * SPDX-FileCopyrightText: 1996 - 1999, Marek Michałkiewicz
- * SPDX-FileCopyrightText: 2005 , Tomasz Kłoczko
- * SPDX-FileCopyrightText: 2008 , Nicolas François
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#include "config.h"
-
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "defines.h"
-#include "prototypes.h"
-#include "string/strcmp/streq.h"
-
-
-/*@null@*/char *
-fgetsx(/*@returned@*/char *restrict buf, int cnt, FILE *restrict f)
-{
- char *cp = buf;
- char *ep;
-
- while (cnt > 0) {
- if (fgets(cp, cnt, f) == NULL) {
- if (cp == buf) {
- return NULL;
- } else {
- break;
- }
- }
- ep = strrchr (cp, '\\');
- if ((NULL != ep) && (*(ep + 1) == '\n')) {
- cnt -= ep - cp;
- if (cnt > 0)
- cp = stpcpy(ep, "");
- } else {
- break;
- }
- }
- return buf;
-}
-
-int fputsx (const char *s, FILE * stream)
-{
- int i;
-
- for (i = 0; !streq(s, ""); i++, s++) {
- if (putc (*s, stream) == EOF) {
- return EOF;
- }
-
-#if 0 /* The standard getgr*() can't handle that. --marekm */
- if (i > (BUFSIZ / 2)) {
- if (putc ('\\', stream) == EOF ||
- putc ('\n', stream) == EOF)
- return EOF;
-
- i = 0;
- }
-#endif
- }
- return 0;
-}
-
group_getname,
group_parse,
group_put,
- fgetsx,
- fputsx,
group_open_hook,
group_close_hook
};
/* gettime.c */
extern time_t gettime (void);
-/* fputsx.c */
-ATTR_ACCESS(write_only, 1, 2)
-extern /*@null@*/char *fgetsx(/*@returned@*/char *restrict, int, FILE *restrict);
-extern int fputsx (const char *, FILE *);
-
/* groupio.c */
extern void __gr_del_entry (const struct commonio_entry *ent);
extern /*@observer@*/const struct commonio_db *__gr_get_db (void);
passwd_getname,
passwd_parse,
passwd_put,
- fgets,
- fputs,
NULL, /* open_hook */
NULL /* close_hook */
};
gshadow_getname,
gshadow_parse,
gshadow_put,
- fgetsx,
- fputsx,
NULL, /* open_hook */
NULL /* close_hook */
};
return NULL;
}
- if (fgetsx(buf, buflen, fp) == NULL)
+ if (fgets(buf, buflen, fp) == NULL)
return NULL;
while ( (strrchr(buf, '\n') == NULL)
buflen *= 2;
len = strlen (buf);
- if (fgetsx(&buf[len], buflen - len, fp) == NULL)
+ if (fgets(&buf[len], buflen - len, fp) == NULL)
return NULL;
}
stpsep(buf, "\n");
}
stpcpy(cp, "\n");
- /*
- * Output using the function which understands the line
- * continuation conventions.
- */
- if (fputsx (buf, fp) == EOF) {
+ if (fputs(buf, fp) == EOF) {
free (buf);
return -1;
}
shadow_getname,
shadow_parse,
shadow_put,
- fgets,
- fputs,
NULL, /* open_hook */
NULL /* close_hook */
};
NULL, /* getname */
subordinate_parse, /* parse */
subordinate_put, /* put */
- fgets, /* fgets */
- fputs, /* fputs */
NULL, /* open_hook */
NULL, /* close_hook */
};
lib/find_new_sub_gids.c
lib/find_new_sub_uids.c
lib/find_new_uid.c
-lib/fputsx.c
lib/getdef.c
lib/getgr_nam_gid.c
lib/getrange.c