Changeset 29060 in vbox
- Timestamp:
- May 5, 2010 9:14:49 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/pam/pam_vbox.c
r29057 r29060 25 25 26 26 #ifdef _DEBUG 27 #define PAM_DEBUG27 # define PAM_DEBUG 28 28 #endif 29 29 … … 34 34 #include <security/pam_appl.h> 35 35 #ifdef RT_OS_LINUX 36 # include <security/_pam_macros.h>36 # include <security/_pam_macros.h> 37 37 #endif 38 38 … … 53 53 /** For debugging. */ 54 54 #ifdef _DEBUG 55 56 55 static pam_handle_t *g_pam_handle; 56 static int g_verbosity = 99; 57 57 #else 58 58 static int g_verbosity = 0; 59 59 #endif 60 60 … … 67 67 { 68 68 #ifdef RT_OS_LINUX 69 70 71 69 openlog("pam_vbox", LOG_PID, LOG_AUTHPRIV); 70 syslog(LOG_ERR, pszBuf); 71 closelog(); 72 72 #elif defined(RT_OS_SOLARIS) 73 73 syslog(LOG_ERR, "pam_vbox: %s\n", pszBuf); 74 74 #endif 75 75 } … … 87 87 char *buf; 88 88 va_start(va, pszFormat); 89 /** @todo is this NULL terminated? */90 89 if (RT_SUCCESS(RTStrAPrintfV(&buf, pszFormat, va))) 91 90 { … … 106 105 static void pam_vbox_log(pam_handle_t *h, const char *pszFormat, ...) 107 106 { 108 va_list va; 109 char *buf; 110 va_start(va, pszFormat); 111 /** @todo is this NULL terminated? */ 112 if (RT_SUCCESS(RTStrAPrintfV(&buf, pszFormat, va))) 113 { 114 if (g_verbosity) 107 if (g_verbosity) 108 { 109 va_list va; 110 char *buf; 111 va_start(va, pszFormat); 112 if (RT_SUCCESS(RTStrAPrintfV(&buf, pszFormat, va))) 115 113 { 116 114 /* Only do normal logging in debug mode; could contain … … 119 117 /* Log to syslog */ 120 118 pam_vbox_writesyslog(buf); 119 RTStrFree(buf); 121 120 } 122 RTStrFree(buf); 123 } 124 va_end(va); 121 va_end(va); 122 } 125 123 } 126 124 … … 265 263 { 266 264 if (!RTStrICmp(argv[i], "debug")) 267 g_verbosity =1;265 g_verbosity = 1; 268 266 else 269 267 pam_vbox_error(h, "pam_sm_authenticate: unknown command line argument \"%s\"\n", argv[i]);
Note:
See TracChangeset
for help on using the changeset viewer.