summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2002-02-19 17:01:41 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2002-02-19 17:01:41 +0000
commit12aa4650eb799a3866fb3895211b630bbf2247e5 (patch)
tree4dff75c3d6afac400edc3aa1fe3df16ed4d2d233 /lib
parent58749249683ae1753ecbfbf50a096fd26b34031e (diff)
downloadmailutils-12aa4650eb799a3866fb3895211b630bbf2247e5.tar.gz
mailutils-12aa4650eb799a3866fb3895211b630bbf2247e5.tar.bz2
New options: --sql-getpwuid for setting
sql query returning passwd data for a given uid, and --pam-service for setting the PAM service name to be used.
Diffstat (limited to 'lib')
-rw-r--r--lib/mu_argp.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/lib/mu_argp.c b/lib/mu_argp.c
index 6e4aea870..6d6e68d22 100644
--- a/lib/mu_argp.c
+++ b/lib/mu_argp.c
@@ -33,12 +33,14 @@
#define ARG_LOG_FACILITY 1
#define ARG_SQL_GETPWNAM 2
-#define ARG_SQL_GETPASS 3
-#define ARG_SQL_HOST 4
-#define ARG_SQL_USER 5
-#define ARG_SQL_PASSWD 6
-#define ARG_SQL_DB 7
-#define ARG_SQL_PORT 8
+#define ARG_SQL_GETPWUID 3
+#define ARG_SQL_GETPASS 4
+#define ARG_SQL_HOST 5
+#define ARG_SQL_USER 6
+#define ARG_SQL_PASSWD 7
+#define ARG_SQL_DB 8
+#define ARG_SQL_PORT 9
+#define ARG_PAM_SERVICE 10
static struct argp_option mu_common_argp_option[] =
{
@@ -47,9 +49,15 @@ static struct argp_option mu_common_argp_option[] =
{"log-facility", ARG_LOG_FACILITY, "FACILITY", 0,
"output logs to syslog FACILITY", 0},
{ "license", 'L', NULL, 0, "print license and exit", 0 },
+#ifdef USE_LIBPAM
+ { "pam-service", ARG_PAM_SERVICE, "STRING", 0,
+ "Use STRING as PAM service name", 0},
+#endif
#ifdef HAVE_MYSQL
{"sql-getpwnam", ARG_SQL_GETPWNAM, "QUERY", 0,
- "SQL query to retrieve a passwd entry from the database", 0},
+ "SQL query to retrieve a passwd entry based on username", 0},
+ {"sql-getpwuid", ARG_SQL_GETPWUID, "QUERY", 0,
+ "SQL query to retrieve a passwd entry based on UID", 0},
{"sql-getpass", ARG_SQL_GETPASS, "QUERY", 0,
"SQL query to retrieve a password from the database", 0},
{"sql-host", ARG_SQL_HOST, "HOSTNAME", 0,
@@ -169,6 +177,7 @@ static char license_text[] =
#ifdef HAVE_MYSQL
char *sql_getpwnam_query;
char *sql_getpass_query;
+char *sql_getpwuid_query;
char *sql_host = MHOST;
char *sql_user = MUSER;
char *sql_passwd = MPASS;
@@ -176,6 +185,9 @@ char *sql_db = MDB;
char *sql_socket = MSOCKET;
int sql_port = MPORT;
#endif
+#ifdef USE_LIBPAM
+char *pam_service = NULL;
+#endif
static error_t
mu_common_argp_parser (int key, char *arg, struct argp_state *state)
@@ -193,12 +205,22 @@ mu_common_argp_parser (int key, char *arg, struct argp_state *state)
case ARG_LOG_FACILITY:
log_facility = parse_log_facility (arg);
break;
+
+#ifdef USE_LIBPAM
+ case ARG_PAM_SERVICE:
+ pam_service = arg;
+ break;
+#endif
#ifdef HAVE_MYSQL
case ARG_SQL_GETPWNAM:
sql_getpwnam_query = arg;
break;
+ case ARG_SQL_GETPWUID:
+ sql_getpwuid_query = arg;
+ break;
+
case ARG_SQL_GETPASS:
sql_getpass_query = arg;
break;

Return to:

Send suggestions and report system problems to the System administrator.