diff options
Diffstat (limited to 'src/property.lisp')
-rw-r--r-- | src/property.lisp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/property.lisp b/src/property.lisp index 4403eb7..263200f 100644 --- a/src/property.lisp +++ b/src/property.lisp @@ -464,6 +464,14 @@ apply or unapply properties.") (failed-change "Property requires root to apply")) (setf (slot-value *connection* 'remote-uid) new-uid))))) +(defun get-user () + "Get the remote username." + (or (slot-value *connection* 'remote-user) + (setf (slot-value *connection* 'remote-user) + (multiple-value-bind (match groups) + (re:scan-to-strings "^uid=[0-9]+\\(([^)]+)" (mrun "id")) + (and match (elt groups 0)))))) + (defun assert-connection-supports (type) (unless (or (eq type :posix) (lisp-connection-p)) (failed-change |