Commit 020f83f4 authored by Pascal J. Bourguignon's avatar Pascal J. Bourguignon

Merged.

parents e29617f8 4c1eb14d
......@@ -17,7 +17,7 @@
;;;;LEGAL
;;;; AGPL3
;;;;
;;;; Copyright Pascal J. Bourguignon 2004 - 2016
;;;; Copyright Pascal J. Bourguignon 2004 - 2018
;;;;
;;;; This program is free software: you can redistribute it and/or modify
;;;; it under the terms of the GNU Affero General Public License as published by
......@@ -38,10 +38,9 @@
(:use "COMMON-LISP"
"COM.INFORMATIMAGO.COMMON-LISP.CESARUM.STRING"
"COM.INFORMATIMAGO.COMMON-LISP.CESARUM.STREAM")
(:export "GROUP" "GROUP-GID" "GROUP-PASSWD"
(:export "GROUP" "GROUP-NAME" "GROUP-GID" "GROUP-PASSWD"
"GROUP-USERS" "READ-GROUP")
(:export "MAKE-GROUP")
(:documentation
"
......@@ -108,11 +107,12 @@ DO: Read the group file.
GROUP-FILE-PATH: The pathname to the group file; default: \"/etc/group\"
RETURN: A list of group GROUP structures.
"
(mapcar (function parse-group)
(with-open-file (in group-file-path
:direction :input
:if-does-not-exist :error)
(stream-to-string-list in))))
(delete nil
(mapcar (function parse-group)
(with-open-file (in group-file-path
:direction :input
:if-does-not-exist :error)
(stream-to-string-list in)))))
;;;; THE END ;;;
......@@ -17,7 +17,7 @@
;;;;LEGAL
;;;; AGPL3
;;;;
;;;; Copyright Pascal J. Bourguignon 2004 - 2016
;;;; Copyright Pascal J. Bourguignon 2004 - 2018
;;;;
;;;; This program is free software: you can redistribute it and/or modify
;;;; it under the terms of the GNU Affero General Public License as published by
......@@ -40,6 +40,7 @@
"COM.INFORMATIMAGO.COMMON-LISP.CESARUM.STREAM")
(:export "USER-SHELL" "USER-HOME" "USER-GECOS" "USER-GID"
"USER-UID" "USER-PASSWD" "USER-LOGIN" "USER" "READ-PASSWD")
(:export "MAKE-USER")
(:documentation
"
This package exports a function to read unix passwd files.
......@@ -68,10 +69,8 @@ License:
"))
(in-package "COM.INFORMATIMAGO.COMMON-LISP.UNIX.PASSWD")
;; pwent ::= login ':' passwd ':' uid ':' gid ':' gecos ':' home ':' shell
(defstruct user
"A unix /etc/passwd USER."
(login "" :type string)
......@@ -121,11 +120,12 @@ DO: Read a passwd file.
PASSWD-FILE-PATH: The pathname of the passwd file. Default: \"/etc/passwd\".
RETURN: A list of passwd USER structures.
"
(mapcar (function parse-passwd)
(with-open-file (in passwd-file-path
:direction :input
:if-does-not-exist :error)
(stream-to-string-list in))))
(delete nil
(mapcar (function parse-passwd)
(with-open-file (in passwd-file-path
:direction :input
:if-does-not-exist :error)
(stream-to-string-list in)))))
;;;; THE END ;;;;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment