diff options
author | Russ Allbery <rra@stanford.edu> | 2008-02-07 23:33:23 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2008-02-07 23:33:23 +0000 |
commit | f0bde61f5ecfc6a58a2c0ec0ccadbdd1332b64f8 (patch) | |
tree | d13773de8ccd3461a1fc3cedcfb06d7f61d18aff /tests/data/cmd-fake | |
parent | 71bba523b426da1a9cf39ce066b2a3ebb376860b (diff) |
Add new exists and autocreate wallet server interfaces. The first
states whether a given object exists and the second attempts to create
the object using the default owner rules. Remove default owner
handling from the create interface, which is now for administrators
only. Remove server-side auto-creation of objects on get or store and
instead have the client check for object existence and call autocreate
if necessary. This removes confusion between default ACLs and
administrative object creation for users who are also on the ADMIN
ACL.
Diffstat (limited to 'tests/data/cmd-fake')
-rwxr-xr-x | tests/data/cmd-fake | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/data/cmd-fake b/tests/data/cmd-fake index a8d979a..17bbb90 100755 --- a/tests/data/cmd-fake +++ b/tests/data/cmd-fake @@ -67,6 +67,41 @@ setattr) ;; esac ;; +exists) + if [ -n "$2" ] ; then + echo "Too many arguments" >&2 + exit 1 + fi + case "${type}:${1}" in + file:fake-test) + if [ -f autocreated ] ; then + echo 'yes' + else + echo 'no' + fi + ;; + *) + echo 'yes' + ;; + esac + exit 0 + ;; +autocreate) + if [ -n "$2" ] ; then + echo "Too many arguments" >&2 + exit 1 + fi + case "${type}:${1}" in + file:fake-test) + touch autocreated + exit 0 + ;; + *) + echo "Autocreate called for existing object" >&2 + exit 1 + ;; + esac + ;; get) if [ -n "$2" ] ; then echo "Too many arguments" >&2 |