From 6e41dc477d6463418aace54145073df2b5c63db6 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 24 Aug 2012 14:44:11 +0200 Subject: [PATCH] =?UTF-8?q?Accept=20des=20valeurs=20vide=20pour=20le=20she?= =?UTF-8?q?ll=20et=20le=20r=C3=A9pertoire=20de=20chroot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- root/etc/e-smith/web/functions/userinfo | 4 ++-- root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/root/etc/e-smith/web/functions/userinfo b/root/etc/e-smith/web/functions/userinfo index 9be35ab..7519761 100644 --- a/root/etc/e-smith/web/functions/userinfo +++ b/root/etc/e-smith/web/functions/userinfo @@ -135,7 +135,7 @@ __DATA__ + value="get_ldap_value('Shell')" validation="exec_exists_or_empty"> DESKTOP_SHELL + value="get_ldap_value('ChrootDir')" validation="dir_exists_or_empty"> diff --git a/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm b/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm index dc093d1..afae1fd 100644 --- a/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm +++ b/root/usr/lib/perl5/site_perl/esmith/FormMagick/Panel/userinfo.pm @@ -235,20 +235,20 @@ sub url_or_empty { return $ret; } -sub dir_exists { +sub dir_exists_or_empty { my ($self, $field) = @_; my $ret = $self->localise('DIR_DOES_NOT_EXIST'); - $ret = 'OK' if (-d "$field"); + $ret = 'OK' if ((-d "$field") || ($field eq '')); return $ret; } -sub exec_exists { +sub exec_exists_or_empty { my ($self, $field) = @_; my $ret = $self->localise('IS_NOT_AN_EXECUTABLE'); - $ret = 'OK' if (-x "$field"); + $ret = 'OK' if ((-x "$field") || ($field eq '')); return $ret; }