1 // Copyright 2018 Google Inc. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #include <errno.h> 16 #include <grp.h> 17 #include <nss.h> 18 #include <pwd.h> 19 #include <stdio.h> 20 #include <stdlib.h> 21 #include <string.h> 22 #include <syslog.h> 23 #include <sys/param.h> 24 #include <sys/stat.h> 25 #include <sys/types.h> 26 #include <time.h> 27 #include <unistd.h> 28 29 #ifndef NSS_CACHE_OSLOGIN_H 30 #define NSS_CACHE_OSLOGIN_H 31 32 #ifdef DEBUG 33 #undef DEBUG 34 #define DEBUG(fmt, ...) \ 35 do { \ 36 openlog("nss_cache_oslogin", LOG_PID|LOG_PERROR, LOG_DAEMON); \ 37 syslog(LOG_ERR, fmt, ##__VA_ARGS__); \ 38 closelog(); \ 39 } while (0) 40 #else 41 #define DEBUG(fmt, ...) \ 42 do { \ 43 } while (0) 44 #endif /* DEBUG */ 45 46 // why isn't this in compat.h ? 47 #define NSS_CACHE_OSLOGIN_PATH_LENGTH 255 48 49 #endif /* NSS_CACHE_OSLOGIN_H */ 50