opendoas

A portable version of the OpenBSD `doas` command
git clone https://pi.duncano.de/git/opendoas.git
Log | Files | Refs | README | LICENSE

commit 5af624acf77da9592443bcfb095b21afaa984404
parent 673f187858a3b10aae4e41b190ca04f6f85c99f1
Author: Duncaen <mail@duncano.de>
Date:   Sat,  7 May 2016 19:02:55 +0200

Enable style option only if bsd_auth.h is available

Diffstat:
doas.c | 12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/doas.c b/doas.c @@ -334,7 +334,9 @@ main(int argc, char **argv, char **envp) int vflag = 0; char cwdpath[PATH_MAX]; const char *cwd; +#ifdef HAVE_BSD_AUTH_H char *login_style = NULL; +#endif setprogname("doas"); @@ -345,11 +347,19 @@ main(int argc, char **argv, char **envp) uid = getuid(); - while ((ch = getopt(argc, argv, "a:C:nsu:v")) != -1) { +#ifdef HAVE_BSD_AUTH_H +# define OPTSTRING "a:C:nsu:v" +#else +# define OPTSTRING "C:nsu:v" +#endif + + while ((ch = getopt(argc, argv, OPTSTRING)) != -1) { switch (ch) { +#ifdef HAVE_BSD_AUTH_H case 'a': login_style = optarg; break; +#endif case 'C': confpath = optarg; break;