AboutSummaryRefsLogTreeCommitDiffStats
path: root/src/mcron/utils.scm
diff options
context:
space:
mode:
Diffstat (limited to 'src/mcron/utils.scm')
-rw-r--r--src/mcron/utils.scm13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mcron/utils.scm b/src/mcron/utils.scm
index bb23f4a..98afaf0 100644
--- a/src/mcron/utils.scm
+++ b/src/mcron/utils.scm
@@ -29,7 +29,8 @@
parse-args
show-version
show-package-information
- process-update-request)
+ process-update-request
+ get-user)
#:re-export (option-ref
read-string))
@@ -101,3 +102,13 @@ comes in on the above socket."
(remove-user-jobs user)
(set-configuration-user user)
(read-vixie-file (string-append config-spool-dir "/" user-name)))))))
+
+(define (get-user spec)
+ "Return the passwd entry corresponding to SPEC. If SPEC is passwd entry
+then return it. If SPEC is not a valid specification throw an exception."
+ (cond ((or (string? spec) (integer? spec))
+ (getpw spec))
+ ((vector? spec) ;assume a user passwd entry
+ spec)
+ (else
+ (throw 'invalid-user-specification spec))))