Skip to content

Commit

Permalink
Merge pull request #1 from jsuchome/master
Browse files Browse the repository at this point in the history
report critical actions (adding/removing user) in syslog
  • Loading branch information
jsuchome committed Oct 22, 2012
2 parents 02d2593 + d606af9 commit 4da7bdd
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 12 deletions.
32 changes: 32 additions & 0 deletions .gitignore
@@ -0,0 +1,32 @@
Makefile
Makefile.am
Makefile.in
aclocal.m4
autom4te.cache
config.cache
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
configure.in
depcomp
install-sh
*.pot
libtool
ltconfig
ltmain.sh
missing
mkinstalldirs
stamp-h*
Makefile.am.common
*.ami
*.bz2
*.spec
.dep
tmp.*
*.log
*.ybc
*.m4
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
2.22.4
2.23.0
2 changes: 0 additions & 2 deletions package/.cvsignore

This file was deleted.

6 changes: 6 additions & 0 deletions package/yast2-users.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Oct 19 11:37:34 CEST 2012 - jsuchome@suse.cz

- report critical actions (adding/removing user) in syslog
- 2.23.0

-------------------------------------------------------------------
Thu Mar 29 16:25:07 CEST 2012 - jsuchome@suse.cz

Expand Down
17 changes: 12 additions & 5 deletions src/Users.pm
Expand Up @@ -229,13 +229,14 @@ YaST::YCP::Import ("Message");
YaST::YCP::Import ("Mode");
YaST::YCP::Import ("Package");
YaST::YCP::Import ("Popup");
YaST::YCP::Import ("ProductFeatures");
YaST::YCP::Import ("Progress");
YaST::YCP::Import ("Report");
YaST::YCP::Import ("Security");
YaST::YCP::Import ("Service");
YaST::YCP::Import ("Stage");
YaST::YCP::Import ("String");
YaST::YCP::Import ("ProductFeatures");
YaST::YCP::Import ("Progress");
YaST::YCP::Import ("Report");
YaST::YCP::Import ("Syslog");
YaST::YCP::Import ("UsersCache");
YaST::YCP::Import ("UsersLDAP");
YaST::YCP::Import ("UsersPasswd");
Expand Down Expand Up @@ -4128,8 +4129,10 @@ sub PostDeleteUsers {
my $plugin_error;
foreach my $username (keys %{$removed_users{$type}}) {
my %user = %{$removed_users{$type}{$username}};
my $cmd = sprintf ("$userdel_postcmd $username %i %i %s",
$user{"uidNumber"}, $user{"gidNumber"}, $user{"homeDirectory"});
my $uid = $user{"uidNumber"} || 0;
Syslog->Log ("User deleted by YaST: name=$username, UID=$uid");
my $cmd = sprintf ("$userdel_postcmd $username $uid %i %s",
$user{"gidNumber"} || 0, $user{"homeDirectory"} || "");
SCR->Execute (".target.bash", $cmd);
# call the "Write" function from plugins...
my $args = {
Expand All @@ -4140,6 +4143,7 @@ sub PostDeleteUsers {
my $result = UsersPlugins->Apply ("Write", $args, \%user);
$plugin_error = GetPluginError ($args, $result);
y2usernote ("User post-deletion script called: '$cmd'");
Syslog->Log ("USERDEL_POSTCMD command called by YaST: $cmd");
};
};
return $ret;
Expand Down Expand Up @@ -4516,6 +4520,7 @@ sub Write {
UsersRoutines->ChmodHome($home, $mode);
}
}
Syslog->Log ("User added by YaST: name=$username, uid=$uid, gid=$gid, home=$home");
if ($useradd_cmd ne "" && FileUtils->Exists ($useradd_cmd))
{
$command = sprintf ("%s %s", $useradd_cmd, $username);
Expand Down Expand Up @@ -4699,6 +4704,7 @@ sub Write {
y2milestone ("'$command' returns: ",
SCR->Execute (".target.bash", $command));
y2usernote ("Group post-add script called: '$command'");
Syslog->Log ("GROUPADD_CMD command called by YaST: $command");
}
}

Expand All @@ -4716,6 +4722,7 @@ sub Write {
y2milestone ("'$command' returns: ",
SCR->Execute (".target.bash", $command));
y2usernote ("User post-add script called: '$command'");
Syslog->Log ("USERADD_CMD command called by YaST: $command");
}
}

Expand Down
6 changes: 2 additions & 4 deletions yast2-users.spec.in
Expand Up @@ -16,10 +16,8 @@ Requires: yast2-perl-bindings >= 2.18.0
# this forces using yast2-ldap with orrect LDAP object names (fate#303596)
Requires: yast2-ldap-client >= 2.17.1

# String::RemoveShortcut
# Wizard::SetDialogTitleAndIcon
Requires: yast2 >= 2.21.22

# Syslog.ycp
Requires: yast2 >= 2.23.7
# cryptsha256, cryptsha516
Requires: yast2-core >= 2.21.0

Expand Down

0 comments on commit 4da7bdd

Please sign in to comment.