* libmisc/tz.c: tz() is only used when USE_PAM is not defined.
* lib/prototypes.h: Indicate functions whose presence depends on the USE_PAM flag.
This commit is contained in:
parent
70cf08329b
commit
c89eb6d7eb
@ -147,7 +147,9 @@ extern void audit_logger (int type, const char *pgname, const char *op,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* limits.c */
|
/* limits.c */
|
||||||
|
#ifndef USE_PAM
|
||||||
extern void setup_limits (const struct passwd *);
|
extern void setup_limits (const struct passwd *);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* list.c */
|
/* list.c */
|
||||||
extern char **add_list (char **, const char *);
|
extern char **add_list (char **, const char *);
|
||||||
@ -178,10 +180,14 @@ extern void motd (void);
|
|||||||
extern struct passwd *get_my_pwent (void);
|
extern struct passwd *get_my_pwent (void);
|
||||||
|
|
||||||
/* obscure.c */
|
/* obscure.c */
|
||||||
|
#ifndef USE_PAM
|
||||||
extern int obscure (const char *, const char *, const struct passwd *);
|
extern int obscure (const char *, const char *, const struct passwd *);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* pam_pass.c */
|
/* pam_pass.c */
|
||||||
|
#ifdef USE_PAM
|
||||||
extern void do_pam_passwd (const char *user, bool silent, bool change_expired);
|
extern void do_pam_passwd (const char *user, bool silent, bool change_expired);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* port.c */
|
/* port.c */
|
||||||
extern bool isttytime (const char *, const char *, time_t);
|
extern bool isttytime (const char *, const char *, time_t);
|
||||||
@ -190,7 +196,9 @@ extern bool isttytime (const char *, const char *, time_t);
|
|||||||
extern struct spwd *pwd_to_spwd (const struct passwd *);
|
extern struct spwd *pwd_to_spwd (const struct passwd *);
|
||||||
|
|
||||||
/* pwdcheck.c */
|
/* pwdcheck.c */
|
||||||
|
#ifndef USE_PAM
|
||||||
extern void passwd_check (const char *, const char *, const char *);
|
extern void passwd_check (const char *, const char *, const char *);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* pwd_init.c */
|
/* pwd_init.c */
|
||||||
extern void pwd_init (void);
|
extern void pwd_init (void);
|
||||||
@ -262,7 +270,9 @@ extern void subsystem (const struct passwd *);
|
|||||||
extern void ttytype (const char *);
|
extern void ttytype (const char *);
|
||||||
|
|
||||||
/* tz.c */
|
/* tz.c */
|
||||||
|
#ifndef USE_PAM
|
||||||
extern char *tz (const char *);
|
extern char *tz (const char *);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ulimit.c */
|
/* ulimit.c */
|
||||||
extern int set_filesize_limit (int blocks);
|
extern int set_filesize_limit (int blocks);
|
||||||
|
@ -33,6 +33,8 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#ifndef USE_PAM
|
||||||
|
|
||||||
#ident "$Id$"
|
#ident "$Id$"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -40,6 +42,7 @@
|
|||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
#include "prototypes.h"
|
#include "prototypes.h"
|
||||||
#include "getdef.h"
|
#include "getdef.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* tz - return local timezone name
|
* tz - return local timezone name
|
||||||
*
|
*
|
||||||
@ -54,10 +57,8 @@ char *tz (const char *fname)
|
|||||||
|
|
||||||
if ((fp = fopen (fname, "r")) == NULL ||
|
if ((fp = fopen (fname, "r")) == NULL ||
|
||||||
fgets (tzbuf, (int) sizeof (tzbuf), fp) == NULL) {
|
fgets (tzbuf, (int) sizeof (tzbuf), fp) == NULL) {
|
||||||
#ifndef USE_PAM
|
|
||||||
if (!(def_tz = getdef_str ("ENV_TZ")) || def_tz[0] == '/')
|
if (!(def_tz = getdef_str ("ENV_TZ")) || def_tz[0] == '/')
|
||||||
def_tz = "TZ=CST6CDT";
|
def_tz = "TZ=CST6CDT";
|
||||||
#endif /* !USE_PAM */
|
|
||||||
|
|
||||||
strcpy (tzbuf, def_tz);
|
strcpy (tzbuf, def_tz);
|
||||||
} else
|
} else
|
||||||
@ -68,3 +69,7 @@ char *tz (const char *fname)
|
|||||||
|
|
||||||
return tzbuf;
|
return tzbuf;
|
||||||
}
|
}
|
||||||
|
#else /* !USE_PAM */
|
||||||
|
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||||
|
#endif /* !USE_PAM */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user