diff options
Diffstat (limited to 'perl-install/any.pm')
-rw-r--r-- | perl-install/any.pm | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index 7e50c1dbc..1c0d9c368 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -12,6 +12,7 @@ use commands; use detect_devices; use fsedit; use run_program; +use log; #-PO: names (tie, curly...) have corresponding icons for kdm my @users_male = (__("tie"), __("default"), __("curly")); #- don't change the names, files correspond to them @@ -51,6 +52,28 @@ sub addUsers { addKdmIcon($prefix, 'root', 'hat', 'force'); } +sub crypt { + my ($password, $md5) = @_; + $md5 ? + c::crypt_md5($password, salt(8)) : + crypt ($password, salt(2)); +} +sub enableShadow { + my ($prefix) = @_; + run_program::rooted($prefix, "pwconv") or log::l("pwconv failed"); + run_program::rooted($prefix, "grpconv") or log::l("grpconv failed"); +} +sub enableMD5Shadow { + my ($prefix, $shadow, $md5) = @_; + substInFile { + if (/^password.*pam_pwdb.so/) { + s/\s*shadow//; s/\s*md5//; + s/$/ shadow/ if $shadow; + s/$/ md5/ if $md5; + } + } grep { -r $_ } map { "$prefix/etc/pam.d/$_" } qw(login rlogin passwd); +} + sub setupBootloader { my ($in, $b, $hds, $fstab, $security, $prefix, $more) = @_; @@ -213,4 +236,23 @@ sub setAutologin { # (dam's) : a patch for gdm is being done. } + +sub writeandclean_ldsoconf { + my ($prefix) = @_; + my $file = "$prefix/etc/ld.so.conf"; + + log::l("before: ", cat_($file)); + output $file, + grep { !m|^(/usr)?/lib$| } #- no need to have /lib and /usr/lib in ld.so.conf + uniq cat_($file), "/usr/X11R6/lib\n"; + log::l("after: ", cat_($file)); +} + +sub shells { + my ($prefix) = @_; + grep { -x "$prefix$_" } map { chomp; $_ } cat_("$prefix/etc/shells"); +} + + + 1; |