mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
appliance: remove custom Shadow augeas lens
Now that augeas 1.2.0 is required, assume the Shadow lens is available there, and thus drop the local copy.
This commit is contained in:
@@ -32,7 +32,6 @@ include $(top_srcdir)/subdir-rules.mk
|
||||
EXTRA_DIST = \
|
||||
99-guestfs-serial.rules \
|
||||
excludefiles.in \
|
||||
guestfs_shadow.aug \
|
||||
hostfiles.in \
|
||||
init \
|
||||
libguestfs-make-fixed-appliance.in \
|
||||
@@ -86,12 +85,11 @@ packagelist: packagelist.in Makefile
|
||||
cmp -s $@ $@-t || mv $@-t $@
|
||||
rm -f $@-t
|
||||
|
||||
supermin.d/daemon.tar.gz: ../daemon/guestfsd guestfs_shadow.aug
|
||||
supermin.d/daemon.tar.gz: ../daemon/guestfsd
|
||||
rm -f $@ $@-t
|
||||
rm -rf tmp-d
|
||||
mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc tmp-d/usr/share/guestfs
|
||||
mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc
|
||||
ln ../daemon/guestfsd tmp-d$(DAEMON_SUPERMIN_DIR)/guestfsd
|
||||
ln $(srcdir)/guestfs_shadow.aug tmp-d/usr/share/guestfs/guestfs_shadow.aug
|
||||
( cd tmp-d && tar zcf - * ) > $@-t
|
||||
rm -r tmp-d
|
||||
mv $@-t $@
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
(*
|
||||
Module: Shadow
|
||||
Parses /etc/shadow
|
||||
|
||||
Author: Lorenzo M. Catucci <catucci@ccd.uniroma2.it>
|
||||
|
||||
Original Author: Free Ekanayaka <free@64studio.com>
|
||||
|
||||
About: Reference
|
||||
|
||||
- man 5 shadow
|
||||
- man 3 getspnam
|
||||
|
||||
About: License
|
||||
This file is licensed under the LGPL v2+, like the rest of Augeas.
|
||||
|
||||
About:
|
||||
|
||||
Each line in the shadow files represents the additional shadow-defined attributes
|
||||
for the corresponding user, as defined in the passwd file.
|
||||
|
||||
*)
|
||||
|
||||
module Guestfs_Shadow =
|
||||
|
||||
autoload xfm
|
||||
|
||||
(************************************************************************
|
||||
* USEFUL PRIMITIVES
|
||||
*************************************************************************)
|
||||
|
||||
let eol = Util.eol
|
||||
let comment = Util.comment
|
||||
let empty = Util.empty
|
||||
let dels = Util.del_str
|
||||
|
||||
let colon = Sep.colon
|
||||
|
||||
let word = Rx.word
|
||||
let integer = Rx.integer
|
||||
|
||||
let sto_to_col = Passwd.sto_to_col
|
||||
let sto_to_eol = Passwd.sto_to_eol
|
||||
|
||||
(************************************************************************
|
||||
* Group: ENTRIES
|
||||
*************************************************************************)
|
||||
|
||||
(* View: entry *)
|
||||
let entry = [ key word
|
||||
. colon
|
||||
. [ label "password" . sto_to_col? . colon ]
|
||||
. [ label "lastchange_date" . store integer? . colon ]
|
||||
. [ label "minage_days" . store integer? . colon ]
|
||||
. [ label "maxage_days" . store integer? . colon ]
|
||||
. [ label "warn_days" . store integer? . colon ]
|
||||
. [ label "inactive_days" . store integer? . colon ]
|
||||
. [ label "expire_date" . store integer? . colon ]
|
||||
. [ label "flag" . store integer? ]
|
||||
. eol ]
|
||||
|
||||
(************************************************************************
|
||||
* LENS
|
||||
*************************************************************************)
|
||||
|
||||
let lns = (comment|empty|entry) *
|
||||
|
||||
let filter
|
||||
= incl "/shadow"
|
||||
. Util.stdexcl
|
||||
|
||||
let xfm = transform lns filter
|
||||
@@ -134,7 +134,7 @@ do_aug_init (const char *root, int flags)
|
||||
}
|
||||
|
||||
/* Pass AUG_NO_ERR_CLOSE so we can display detailed errors. */
|
||||
aug = aug_init (buf, "/usr/share/guestfs/", flags | AUG_NO_ERR_CLOSE);
|
||||
aug = aug_init (buf, NULL, flags | AUG_NO_ERR_CLOSE);
|
||||
|
||||
if (!aug) {
|
||||
reply_with_error ("augeas initialization failed");
|
||||
@@ -148,25 +148,6 @@ do_aug_init (const char *root, int flags)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!augeas_is_version (1, 2, 1)) {
|
||||
int r = aug_transform (aug, "guestfs_shadow", "/etc/shadow",
|
||||
0 /* = included */);
|
||||
if (r == -1) {
|
||||
AUGEAS_ERROR ("aug_transform");
|
||||
aug_close (aug);
|
||||
aug = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* If aug_load was implicitly called, reload the handle. */
|
||||
if ((flags & AUG_NO_LOAD) == 0) {
|
||||
if (aug_load (aug) == -1) {
|
||||
AUGEAS_ERROR ("aug_load");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user