1 package CloudStore::API;
11 $self->{passwd} ||= '/var/lib/extrausers/passwd';
12 $self->{PORT} ||= $ENV{PORT} || die "no PORT in env";
13 $self->{SLICE} ||= $ENV{SLICE} || die "no SLICE in env";
19 my ( $self, $new_email, $new_passwd, $new_quota ) = @_;
24 open(my $fh, '<', $self->{passwd});
26 my ( $login, $passwd, $uid, $gid, $email, $dir, $shell ) = split(/:/,$_);
27 $max_uid = $uid if $uid > $max_uid;
28 $found = $uid if $email eq $new_email;
34 my $dir = "$self->{SLICE}/$max_uid";
35 warn "# create_user $new_email $new_quota = $max_uid $dir";
36 open(my $fh, '>>', $self->{passwd});
37 print $fh "u$max_uid:$new_passwd:$max_uid:$self->{PORT}:$new_email:$dir:/bin/true\n";
42 chown $max_uid, $self->{PORT}, $dir;
49 my ( $f_uid,$f_path, $t_uid,$t_path ) = @_;
55 my ( $uid, $from, $to ) = @_;
60 my ( $uid, $path ) = @_;