From 2e9f1bbdab7ee4cbf9fba8b5c99cb3e970f35f4b Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Fri, 7 Dec 2007 00:39:43 +0000 Subject: Correctly implement the documented intention that setting an attribute to the empty string clears the attribute values. --- NEWS | 3 +++ perl/Wallet/Server.pm | 3 +++ 2 files changed, 6 insertions(+) diff --git a/NEWS b/NEWS index 0a53e35..6752302 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,9 @@ wallet 0.5 (unreleased) Load the Perl modules for ACL verifiers and object types dynamically now that we're reading the class from the database. + Correctly implement the documented intention that setting an attribute + to the empty string clears the attribute values. + Fix the keytab principal validation regex to allow instances containing periods. Otherwise, it's hard to manage host keytabs. Add a missing test suite for that method. diff --git a/perl/Wallet/Server.pm b/perl/Wallet/Server.pm index 5a7efb9..f04c139 100644 --- a/perl/Wallet/Server.pm +++ b/perl/Wallet/Server.pm @@ -373,6 +373,9 @@ sub attr { my $host = $self->{host}; if (@values) { return unless $self->acl_check ($object, 'setattr'); + if (@values == 1 and $values[0] eq '') { + @values = (); + } my $result = $object->attr ($attr, [ @values ], $user, $host); $self->error ($object->error) unless $result; return $result; -- cgit v1.2.3