summaryrefslogtreecommitdiff
path: root/map_common.c
diff options
context:
space:
mode:
authorDave Olson <olson@cumulusnetworks.com>2018-02-26 09:52:09 -0800
committerDave Olson <olson@cumulusnetworks.com>2018-04-10 12:33:12 -0700
commita8740bec7979f1060ab6759808e9f02dce184e46 (patch)
tree487107efe6069f172c7e4454b6bc2335416f4326 /map_common.c
parent800323e6d53315de4d12f73626b4461a8cf63090 (diff)
downloadlibnss-mapuser-a8740bec7979f1060ab6759808e9f02dce184e46.tar.gz
libnss-mapuser-a8740bec7979f1060ab6759808e9f02dce184e46.zip
Fixed exclude_users to work, added more users, alway skip tacacs[0-9]*
Ticket: CM-19886 Reviewed By: nobody Testing Done: Somehow exclude_users wasn't implemented (or got deleted somewhere along the line). Make list match tacplus_client, except exclude our own mapped users by matching config items, and also skip any user starting with tacacs[0-9] inline instead of listing all 16 in exclude_users field in config file. Implemened for mapped_priv_user too, since that work is ongoing. Listed change in debian/changelog If debug is set to 2 or higher, print that the name lookup was skipped due to exclusion.
Diffstat (limited to 'map_common.c')
-rw-r--r--map_common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/map_common.c b/map_common.c
index 1c3bfa9..f7ee038 100644
--- a/map_common.c
+++ b/map_common.c
@@ -35,6 +35,7 @@ static const char config_file[] = "/etc/nss_mapuser.conf";
* in build, so local to the shared lib. */
char *exclude_users; /* don't lookup these users */
char *mappeduser;
+char *mapped_priv_user;
uid_t min_uid = DEF_MIN_UID;
int debug;
@@ -54,6 +55,10 @@ reset_config(void)
(void)free(mappeduser);
mappeduser = NULL;
}
+ if(mapped_priv_user) {
+ (void)free(mapped_priv_user);
+ mapped_priv_user = NULL;
+ }
debug = 0;
min_uid = DEF_MIN_UID;
}
@@ -117,6 +122,10 @@ nss_mapuser_config(int *errnop, const char *lname)
/* the user we are mapping to */
mappeduser = strdup(lbuf+12);
}
+ else if(!strncmp(lbuf, "mapped_priv_user=", 17)) {
+ /* the user we are mapping to */
+ mapped_priv_user = strdup(lbuf+17);
+ }
else if(!strncmp(lbuf, "min_uid=", 8)) {
/*
* Don't lookup uids that are local, typically set to either