Changeset 11953


Ignore:
Timestamp:
Apr 17, 2009, 9:47:32 PM (11 years ago)
Author:
rme
Message:

GET-USER-HOME-DIR: if the user home directory obtained from the password
database isn't really a directory, return NIL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/linux-files.lisp

    r11816 r11953  
    803803                                :int)))
    804804          (if (eql 0 err)
    805             (return (let* ((rp (%get-ptr result)))
    806                       (unless (%null-ptr-p rp)
    807                         (get-foreign-namestring (pref rp :passwd.pw_dir)))))
     805            (let* ((rp (%get-ptr result))
     806                   (dir (and (not (%null-ptr-p rp))
     807                             (get-foreign-namestring (pref rp :passwd.pw_dir)))))
     808              (return (if (and dir (eq (%unix-file-kind dir) :directory))
     809                        dir)))
    808810            (unless (eql err #$ERANGE)
    809811              (return nil))))))))
Note: See TracChangeset for help on using the changeset viewer.