b192a347f4360806f96d1f708eb4c847c852e0e5
[samba.git] / source / nsswitch / pam_winbind.c
1 /* pam_winbind module
2
3    Copyright Andrew Tridgell <tridge@samba.org> 2000
4    Copyright Tim Potter <tpot@samba.org> 2000
5    Copyright Andrew Bartlett <abartlet@samba.org> 2002
6
7    largely based on pam_userdb by Christian Gafton <gafton@redhat.com> 
8    also contains large slabs of code from pam_unix by Elliot Lee <sopwith@redhat.com>
9    (see copyright below for full details)
10 */
11
12 #include "pam_winbind.h"
13
14 /* prototypes from common.c */
15 void init_request(struct winbindd_request *req,int rq_type);
16 int write_sock(void *buffer, int count);
17 int read_reply(struct winbindd_response *response);
18
19 /* data tokens */
20
21 #define MAX_PASSWD_TRIES        3
22
23 /* some syslogging */
24 static void _pam_log(int err, const char *format, ...)
25 {
26         va_list args;
27
28         va_start(args, format);
29         openlog(MODULE_NAME, LOG_CONS|LOG_PID, LOG_AUTH);
30         vsyslog(err, format, args);
31         va_end(args);
32         closelog();
33 }
34
35 static int _pam_parse(int argc, const char **argv)
36 {
37         int ctrl;
38         /* step through arguments */
39         for (ctrl = 0; argc-- > 0; ++argv) {
40
41                 /* generic options */
42                 
43                 if (!strcmp(*argv,"debug"))
44                         ctrl |= WINBIND_DEBUG_ARG;
45                 else if (!strcasecmp(*argv, "use_authtok"))
46                         ctrl |= WINBIND_USE_AUTHTOK_ARG;
47                 else if (!strcasecmp(*argv, "use_first_pass"))
48                         ctrl |= WINBIND_USE_FIRST_PASS_ARG;
49                 else if (!strcasecmp(*argv, "try_first_pass"))
50                         ctrl |= WINBIND_TRY_FIRST_PASS_ARG;
51                 else if (!strcasecmp(*argv, "unknown_ok"))
52                         ctrl |= WINBIND_UNKNOWN_OK_ARG;
53                 else {
54                         _pam_log(LOG_ERR, "pam_parse: unknown option; %s", *argv);
55                 }
56         }
57         
58         return ctrl;
59 }
60
61 /* --- authentication management functions --- */
62
63 /* Attempt a conversation */
64
65 static int converse(pam_handle_t *pamh, int nargs,
66                     struct pam_message **message,
67                     struct pam_response **response)
68 {
69     int retval;
70     struct pam_conv *conv;
71
72     retval = pam_get_item(pamh, PAM_CONV, (const void **) &conv ) ;
73     if (retval == PAM_SUCCESS) {
74         retval = conv->conv(nargs, (const struct pam_message **)message,
75                             response, conv->appdata_ptr);
76     }
77         
78     return retval; /* propagate error status */
79 }
80
81
82 int _make_remark(pam_handle_t * pamh, int type, const char *text)
83 {
84         int retval = PAM_SUCCESS;
85
86         struct pam_message *pmsg[1], msg[1];
87         struct pam_response *resp;
88         
89         pmsg[0] = &msg[0];
90         msg[0].msg = text;
91         msg[0].msg_style = type;
92         
93         resp = NULL;
94         retval = converse(pamh, 1, pmsg, &resp);
95         
96         if (resp) {
97                 _pam_drop_reply(resp, 1);
98         }
99         return retval;
100 }
101
102 static int winbind_request(enum winbindd_cmd req_type,
103                            struct winbindd_request *request,
104                            struct winbindd_response *response)
105 {
106         /* Fill in request and send down pipe */
107         init_request(request, req_type);
108         
109         if (write_sock(request, sizeof(*request)) == -1) {
110                 _pam_log(LOG_ERR, "write to socket failed!");
111                 return PAM_SERVICE_ERR;
112         }
113         
114         /* Wait for reply */
115         if (read_reply(response) == -1) {
116                 _pam_log(LOG_ERR, "read from socket failed!");
117                 return PAM_SERVICE_ERR;
118         }
119
120         /* Copy reply data from socket */
121         if (response->result != WINBINDD_OK) {
122                 if (response->data.auth.pam_error != PAM_SUCCESS) {
123                         _pam_log(LOG_ERR, "request failed, PAM error was %d, NT error was %s", 
124                                  response->data.auth.pam_error,
125                                  response->data.auth.nt_status_string);
126                         return response->data.auth.pam_error;
127                 } else {
128                         _pam_log(LOG_ERR, "request failed, but PAM error 0!");
129                         return PAM_SERVICE_ERR;
130                 }
131         }
132         
133         return PAM_SUCCESS;
134 }
135
136 /* talk to winbindd */
137 static int winbind_auth_request(const char *user, const char *pass, int ctrl)
138 {
139         struct winbindd_request request;
140         struct winbindd_response response;
141         int retval;
142
143         ZERO_STRUCT(request);
144
145         strncpy(request.data.auth.user, user, 
146                 sizeof(request.data.auth.user)-1);
147
148         strncpy(request.data.auth.pass, pass, 
149                 sizeof(request.data.auth.pass)-1);
150         
151         retval = winbind_request(WINBINDD_PAM_AUTH, &request, &response);
152
153         switch (retval) {
154         case PAM_AUTH_ERR:
155                 /* incorrect password */
156                 _pam_log(LOG_WARNING, "user `%s' denied access (incorrect password)", user);
157                 return retval;
158         case PAM_USER_UNKNOWN:
159                 /* the user does not exist */
160                 if (ctrl & WINBIND_DEBUG_ARG)
161                         _pam_log(LOG_NOTICE, "user `%s' not found",
162                                  user);
163                 if (ctrl & WINBIND_UNKNOWN_OK_ARG) {
164                         return PAM_IGNORE;
165                 }        
166                 return retval;
167         case PAM_SUCCESS:
168                 /* Otherwise, the authentication looked good */
169                 _pam_log(LOG_NOTICE, "user '%s' granted acces", user);
170                 return retval;
171         default:
172                 /* we don't know anything about this return value */
173                 _pam_log(LOG_ERR, "internal module error (retval = %d, user = `%s'",
174                          retval, user);
175                 return retval;
176         }
177      /* should not be reached */
178 }
179
180 /* talk to winbindd */
181 static int winbind_chauthtok_request(const char *user, const char *oldpass,
182                                      const char *newpass)
183 {
184         struct winbindd_request request;
185         struct winbindd_response response;
186
187         ZERO_STRUCT(request);
188
189         if (request.data.chauthtok.user == NULL) return -2;
190
191         strncpy(request.data.chauthtok.user, user, 
192                 sizeof(request.data.chauthtok.user) - 1);
193
194         if (oldpass != NULL) {
195             strncpy(request.data.chauthtok.oldpass, oldpass, 
196                     sizeof(request.data.chauthtok.oldpass) - 1);
197         } else {
198             request.data.chauthtok.oldpass[0] = '\0';
199         }
200         
201         if (newpass != NULL) {
202             strncpy(request.data.chauthtok.newpass, newpass, 
203                     sizeof(request.data.chauthtok.newpass) - 1);
204         } else {
205             request.data.chauthtok.newpass[0] = '\0';
206         }
207         
208         return winbind_request(WINBINDD_PAM_CHAUTHTOK, &request, &response);
209 }
210
211 /*
212  * Checks if a user has an account
213  *
214  * return values:
215  *       1  = User not found
216  *       0  = OK
217  *      -1  = System error
218  */
219 static int valid_user(const char *user)
220 {
221         if (getpwnam(user)) return 0;
222         return 1;
223 }
224
225 static char *_pam_delete(register char *xx)
226 {
227     _pam_overwrite(xx);
228     _pam_drop(xx);
229     return NULL;
230 }
231
232 /*
233  * obtain a password from the user
234  */
235
236 int _winbind_read_password(pam_handle_t * pamh
237                         ,unsigned int ctrl
238                         ,const char *comment
239                         ,const char *prompt1
240                         ,const char *prompt2
241                         ,const char **pass)
242 {
243         int authtok_flag;
244         int retval;
245         const char *item;
246         char *token;
247
248         /*
249          * make sure nothing inappropriate gets returned
250          */
251
252         *pass = token = NULL;
253
254         /*
255          * which authentication token are we getting?
256          */
257
258         authtok_flag = on(WINBIND__OLD_PASSWORD, ctrl) ? PAM_OLDAUTHTOK : PAM_AUTHTOK;
259
260         /*
261          * should we obtain the password from a PAM item ?
262          */
263
264         if (on(WINBIND_TRY_FIRST_PASS_ARG, ctrl) || on(WINBIND_USE_FIRST_PASS_ARG, ctrl)) {
265                 retval = pam_get_item(pamh, authtok_flag, (const void **) &item);
266                 if (retval != PAM_SUCCESS) {
267                         /* very strange. */
268                         _pam_log(LOG_ALERT, 
269                                  "pam_get_item returned error to unix-read-password"
270                             );
271                         return retval;
272                 } else if (item != NULL) {      /* we have a password! */
273                         *pass = item;
274                         item = NULL;
275                         return PAM_SUCCESS;
276                 } else if (on(WINBIND_USE_FIRST_PASS_ARG, ctrl)) {
277                         return PAM_AUTHTOK_RECOVER_ERR;         /* didn't work */
278                 } else if (on(WINBIND_USE_AUTHTOK_ARG, ctrl)
279                            && off(WINBIND__OLD_PASSWORD, ctrl)) {
280                         return PAM_AUTHTOK_RECOVER_ERR;
281                 }
282         }
283         /*
284          * getting here implies we will have to get the password from the
285          * user directly.
286          */
287
288         {
289                 struct pam_message msg[3], *pmsg[3];
290                 struct pam_response *resp;
291                 int i, replies;
292
293                 /* prepare to converse */
294
295                 if (comment != NULL) {
296                         pmsg[0] = &msg[0];
297                         msg[0].msg_style = PAM_TEXT_INFO;
298                         msg[0].msg = comment;
299                         i = 1;
300                 } else {
301                         i = 0;
302                 }
303
304                 pmsg[i] = &msg[i];
305                 msg[i].msg_style = PAM_PROMPT_ECHO_OFF;
306                 msg[i++].msg = prompt1;
307                 replies = 1;
308
309                 if (prompt2 != NULL) {
310                         pmsg[i] = &msg[i];
311                         msg[i].msg_style = PAM_PROMPT_ECHO_OFF;
312                         msg[i++].msg = prompt2;
313                         ++replies;
314                 }
315                 /* so call the conversation expecting i responses */
316                 resp = NULL;
317                 retval = converse(pamh, i, pmsg, &resp);
318
319                 if (resp != NULL) {
320
321                         /* interpret the response */
322
323                         if (retval == PAM_SUCCESS) {    /* a good conversation */
324
325                                 token = x_strdup(resp[i - replies].resp);
326                                 if (token != NULL) {
327                                         if (replies == 2) {
328
329                                                 /* verify that password entered correctly */
330                                                 if (!resp[i - 1].resp
331                                                     || strcmp(token, resp[i - 1].resp)) {
332                                                         _pam_delete(token);     /* mistyped */
333                                                         retval = PAM_AUTHTOK_RECOVER_ERR;
334                                                         _make_remark(pamh                                                                   ,PAM_ERROR_MSG, MISTYPED_PASS);
335                                                 }
336                                         }
337                                 } else {
338                                         _pam_log(LOG_NOTICE
339                                                  ,"could not recover authentication token");
340                                 }
341
342                         }
343                         /*
344                          * tidy up the conversation (resp_retcode) is ignored
345                          * -- what is it for anyway? AGM
346                          */
347
348                         _pam_drop_reply(resp, i);
349
350                 } else {
351                         retval = (retval == PAM_SUCCESS)
352                             ? PAM_AUTHTOK_RECOVER_ERR : retval;
353                 }
354         }
355
356         if (retval != PAM_SUCCESS) {
357                 if (on(WINBIND_DEBUG_ARG, ctrl))
358                         _pam_log(LOG_DEBUG,
359                                  "unable to obtain a password");
360                 return retval;
361         }
362         /* 'token' is the entered password */
363
364         /* we store this password as an item */
365         
366         retval = pam_set_item(pamh, authtok_flag, token);
367         _pam_delete(token);     /* clean it up */
368         if (retval != PAM_SUCCESS
369             || (retval = pam_get_item(pamh, authtok_flag
370                                       ,(const void **) &item))
371             != PAM_SUCCESS) {
372                 
373                 _pam_log(LOG_CRIT, "error manipulating password");
374                 return retval;
375                 
376         }
377
378         *pass = item;
379         item = NULL;            /* break link to password */
380
381         return PAM_SUCCESS;
382 }
383
384 PAM_EXTERN
385 int pam_sm_authenticate(pam_handle_t *pamh, int flags,
386                         int argc, const char **argv)
387 {
388      const char *username;
389      const char *password;
390      int retval = PAM_AUTH_ERR;
391     
392      /* parse arguments */
393      int ctrl = _pam_parse(argc, argv);
394
395      /* Get the username */
396      retval = pam_get_user(pamh, &username, NULL);
397      if ((retval != PAM_SUCCESS) || (!username)) {
398         if (ctrl & WINBIND_DEBUG_ARG)
399             _pam_log(LOG_DEBUG,"can not get the username");
400         return PAM_SERVICE_ERR;
401      }
402      
403      retval = _winbind_read_password(pamh, ctrl, NULL, 
404                                      "Password: ", NULL,
405                                      &password);
406      
407      if (retval != PAM_SUCCESS) {
408          _pam_log(LOG_ERR, "Could not retrieve user's password");
409          return PAM_AUTHTOK_ERR;
410      }
411      
412      if (ctrl & WINBIND_DEBUG_ARG) {
413
414              /* Let's not give too much away in the log file */
415
416 #ifdef DEBUG_PASSWORD
417          _pam_log(LOG_INFO, "Verify user `%s' with password `%s'",
418                   username, password);
419 #else
420          _pam_log(LOG_INFO, "Verify user `%s'", username);
421 #endif
422      }
423
424      /* Now use the username to look up password */
425      return winbind_auth_request(username, password, ctrl);
426 }
427
428 PAM_EXTERN
429 int pam_sm_setcred(pam_handle_t *pamh, int flags,
430                    int argc, const char **argv)
431 {
432     return PAM_SUCCESS;
433 }
434
435 /*
436  * Account management. We want to verify that the account exists 
437  * before returning PAM_SUCCESS
438  */
439 PAM_EXTERN
440 int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags,
441                    int argc, const char **argv)
442 {
443     const char *username;
444     int retval = PAM_USER_UNKNOWN;
445
446     /* parse arguments */
447     int ctrl = _pam_parse(argc, argv);
448
449     /* Get the username */
450     retval = pam_get_user(pamh, &username, NULL);
451     if ((retval != PAM_SUCCESS) || (!username)) {
452         if (ctrl & WINBIND_DEBUG_ARG)
453             _pam_log(LOG_DEBUG,"can not get the username");
454         return PAM_SERVICE_ERR;
455     }
456
457     /* Verify the username */
458     retval = valid_user(username);
459     switch (retval) {
460         case -1:
461             /* some sort of system error. The log was already printed */
462             return PAM_SERVICE_ERR;
463         case 1:
464             /* the user does not exist */
465             if (ctrl & WINBIND_DEBUG_ARG)
466                 _pam_log(LOG_NOTICE, "user `%s' not found",
467                          username);
468             if (ctrl & WINBIND_UNKNOWN_OK_ARG)
469                 return PAM_IGNORE;
470             return PAM_USER_UNKNOWN;
471         case 0:
472             /* Otherwise, the authentication looked good */
473             _pam_log(LOG_NOTICE, "user '%s' granted acces", username);
474             return PAM_SUCCESS;
475         default:
476             /* we don't know anything about this return value */
477             _pam_log(LOG_ERR, "internal module error (retval = %d, user = `%s'",
478                      retval, username);
479             return PAM_SERVICE_ERR;
480     }
481     
482     /* should not be reached */
483     return PAM_IGNORE;
484 }
485 PAM_EXTERN
486 int pam_sm_open_session(pam_handle_t *pamh, int flags,
487                 int argc, const char **argv)
488 {
489         /* parse arguments */
490         int ctrl = _pam_parse(argc, argv);
491         if (ctrl & WINBIND_DEBUG_ARG)
492               _pam_log(LOG_DEBUG,"libpam_winbind:pam_sm_open_session handler");
493         return PAM_SUCCESS;
494 }
495 PAM_EXTERN
496 int pam_sm_close_session(pam_handle_t *pamh, int flags,
497                 int argc, const char **argv)
498 {
499         /* parse arguments */
500         int ctrl = _pam_parse(argc, argv);
501         if (ctrl & WINBIND_DEBUG_ARG)
502               _pam_log(LOG_DEBUG,"libpam_winbind:pam_sm_close_session handler");
503         return PAM_SUCCESS;
504 }
505
506
507
508 PAM_EXTERN int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
509                                 int argc, const char **argv)
510 {
511         unsigned int lctrl;
512         int retval;
513         unsigned int ctrl = _pam_parse(argc, argv);
514
515         /* <DO NOT free() THESE> */
516         const char *user;
517         char *pass_old, *pass_new;
518         /* </DO NOT free() THESE> */
519
520         char *Announce;
521         
522         int retry = 0;
523
524         /*
525          * First get the name of a user
526          */
527         retval = pam_get_user(pamh, &user, "Username: ");
528         if (retval == PAM_SUCCESS) {
529                 if (user == NULL) {
530                         _pam_log(LOG_ERR, "username was NULL!");
531                         return PAM_USER_UNKNOWN;
532                 }
533                 if (retval == PAM_SUCCESS && on(WINBIND_DEBUG_ARG, ctrl))
534                         _pam_log(LOG_DEBUG, "username [%s] obtained",
535                                  user);
536         } else {
537                 if (on(WINBIND_DEBUG_ARG, ctrl))
538                         _pam_log(LOG_DEBUG,
539                                  "password - could not identify user");
540                 return retval;
541         }
542
543         /*
544          * obtain and verify the current password (OLDAUTHTOK) for
545          * the user.
546          */
547
548         if (flags & PAM_PRELIM_CHECK) {
549                 
550                 /* instruct user what is happening */
551 #define greeting "Changing password for "
552                 Announce = (char *) malloc(sizeof(greeting) + strlen(user));
553                 if (Announce == NULL) {
554                 _pam_log(LOG_CRIT, 
555                          "password - out of memory");
556                 return PAM_BUF_ERR;
557                 }
558                 (void) strcpy(Announce, greeting);
559                 (void) strcpy(Announce + sizeof(greeting) - 1, user);
560 #undef greeting
561                 
562                 lctrl = ctrl | WINBIND__OLD_PASSWORD;
563                 retval = _winbind_read_password(pamh, lctrl
564                                                 ,Announce
565                                                 ,"(current) NT password: "
566                                                 ,NULL
567                                                 ,(const char **) &pass_old);
568                 free(Announce);
569                 
570                 if (retval != PAM_SUCCESS) {
571                         _pam_log(LOG_NOTICE
572                                  ,"password - (old) token not obtained");
573                         return retval;
574                 }
575                 /* verify that this is the password for this user */
576                 
577                 retval = winbind_auth_request(user, pass_old, ctrl);
578                 
579                 if (retval != PAM_ACCT_EXPIRED 
580                     && retval != PAM_NEW_AUTHTOK_REQD 
581                     && retval != PAM_SUCCESS) {
582                         pass_old = NULL;
583                         return retval;
584                 }
585                 
586                 retval = pam_set_item(pamh, PAM_OLDAUTHTOK, (const void *) pass_old);
587                 pass_old = NULL;
588                 if (retval != PAM_SUCCESS) {
589                         _pam_log(LOG_CRIT, 
590                                  "failed to set PAM_OLDAUTHTOK");
591                 }
592         } else if (flags & PAM_UPDATE_AUTHTOK) {
593         
594                 /*
595                  * obtain the proposed password
596                  */
597                 
598                 /*
599                  * get the old token back. 
600                  */
601                 
602                 retval = pam_get_item(pamh, PAM_OLDAUTHTOK
603                                       ,(const void **) &pass_old);
604                 
605                 if (retval != PAM_SUCCESS) {
606                         _pam_log(LOG_NOTICE, "user not authenticated");
607                         return retval;
608                 }
609                 
610                 lctrl = ctrl;
611                 
612                 if (on(WINBIND_USE_AUTHTOK_ARG, lctrl)) {
613                         ctrl = WINBIND_USE_FIRST_PASS_ARG | lctrl;
614                 }
615                 retry = 0;
616                 retval = PAM_AUTHTOK_ERR;
617                 while ((retval != PAM_SUCCESS) && (retry++ < MAX_PASSWD_TRIES)) {
618                         /*
619                          * use_authtok is to force the use of a previously entered
620                          * password -- needed for pluggable password strength checking
621                          */
622                         
623                         retval = _winbind_read_password(pamh, lctrl
624                                                         ,NULL
625                                                         ,"Enter new NT password: "
626                                                         ,"Retype new NT password: "
627                                                         ,(const char **) &pass_new);
628                         
629                         if (retval != PAM_SUCCESS) {
630                                 if (on(WINBIND_DEBUG_ARG, ctrl)) {
631                                         _pam_log(LOG_ALERT
632                                                  ,"password - new password not obtained");
633                                 }
634                                 pass_old = NULL;/* tidy up */
635                                 return retval;
636                         }
637
638                         /*
639                          * At this point we know who the user is and what they
640                          * propose as their new password. Verify that the new
641                          * password is acceptable.
642                          */
643                         
644                         if (pass_new[0] == '\0') {/* "\0" password = NULL */
645                                 pass_new = NULL;
646                         }
647                 }
648                 
649                 /*
650                  * By reaching here we have approved the passwords and must now
651                  * rebuild the password database file.
652                  */
653
654                 retval = winbind_chauthtok_request(user, pass_old, pass_new);
655                 _pam_overwrite(pass_new);
656                 _pam_overwrite(pass_old);
657                 pass_old = pass_new = NULL;
658         } else {
659                 retval = PAM_SERVICE_ERR;
660         }
661         
662         return retval;
663 }
664
665 #ifdef PAM_STATIC
666
667 /* static module data */
668
669 struct pam_module _pam_winbind_modstruct = {
670      MODULE_NAME,
671      pam_sm_authenticate,
672      pam_sm_setcred,
673      pam_sm_acct_mgmt,
674      pam_sm_open_session,
675      pam_sm_close_session,
676      pam_sm_chauthtok
677 };
678
679 #endif
680
681 /*
682  * Copyright (c) Andrew Tridgell  <tridge@samba.org>   2000
683  * Copyright (c) Tim Potter       <tpot@samba.org>     2000
684  * Copyright (c) Andrew Bartlettt <abartlet@samba.org> 2002
685  * Copyright (c) Jan Rêkorajski 1999.
686  * Copyright (c) Andrew G. Morgan 1996-8.
687  * Copyright (c) Alex O. Yuriev, 1996.
688  * Copyright (c) Cristian Gafton 1996.
689  * Copyright (C) Elliot Lee <sopwith@redhat.com> 1996, Red Hat Software. 
690  *
691  * Redistribution and use in source and binary forms, with or without
692  * modification, are permitted provided that the following conditions
693  * are met:
694  * 1. Redistributions of source code must retain the above copyright
695  *    notice, and the entire permission notice in its entirety,
696  *    including the disclaimer of warranties.
697  * 2. Redistributions in binary form must reproduce the above copyright
698  *    notice, this list of conditions and the following disclaimer in the
699  *    documentation and/or other materials provided with the distribution.
700  * 3. The name of the author may not be used to endorse or promote
701  *    products derived from this software without specific prior
702  *    written permission.
703  *
704  * ALTERNATIVELY, this product may be distributed under the terms of
705  * the GNU Public License, in which case the provisions of the GPL are
706  * required INSTEAD OF the above restrictions.  (This clause is
707  * necessary due to a potential bad interaction between the GPL and
708  * the restrictions contained in a BSD-style copyright.)
709  *
710  * THIS SOFTWARE IS PROVIDED `AS IS'' AND ANY EXPRESS OR IMPLIED
711  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
712  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
713  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
714  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
715  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
716  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
717  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
718  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
719  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
720  * OF THE POSSIBILITY OF SUCH DAMAGE.
721  */