rpms/cronie/F-12 NFShomes_cant_be_executed.patch, NONE, 1.1 cronie.spec, 1.30, 1.31
Marcela Mašláňová
mmaslano at fedoraproject.org
Wed Jan 20 14:15:06 UTC 2010
- Previous message: rpms/eclipse-dltk/devel eclipse-dltk.spec,1.7,1.8
- Next message: rpms/thunderbird/devel thunderbird-version.patch, NONE, 1.1 .cvsignore, 1.31, 1.32 sources, 1.38, 1.39 thunderbird.spec, 1.158, 1.159
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: mmaslano
Update of /cvs/pkgs/rpms/cronie/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31163
Modified Files:
cronie.spec
Added Files:
NFShomes_cant_be_executed.patch
Log Message:
* Wed Jan 20 2010 Marcela Mašláňová <mmaslano at redhat.com> - 1.4.3-3
- 554698 Cron jobs failing for some users with NFS mounted home directories
NFShomes_cant_be_executed.patch:
do_command.c | 6 +++---
funcs.h | 4 ++--
security.c | 16 ++++++++--------
3 files changed, 13 insertions(+), 13 deletions(-)
--- NEW FILE NFShomes_cant_be_executed.patch ---
>From 0022401f35f2cff1893d5deeeed200c0d3e3738e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcela=20Ma=C5=A1l=C3=A1=C5=88ov=C3=A1?= <mmaslano at redhat.com>
Date: Wed, 13 Jan 2010 13:54:43 +0100
Subject: [PATCH] With NFS homes can't be job executed, because root can't access
this directory.
---
src/do_command.c | 6 +++---
src/funcs.h | 4 ++--
src/security.c | 15 ++++++++-------
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/src/do_command.c b/src/do_command.c
index e1572e5..c6ff0d7 100644
--- a/src/do_command.c
+++ b/src/do_command.c
@@ -156,9 +156,9 @@ static void child_process(entry * e, user * u) {
/*NOTREACHED*/ case 0:
Debug(DPROC, ("[%ld] grandchild process fork()'ed\n", (long) getpid()))
- if (cron_change_user_permanently(e->pwd) < 0)
+ if (cron_change_user_permanently(e->pwd, env_get("HOME", jobenv)) < 0)
_exit(ERROR_EXIT);
-
+
/* write a log message. we've waited this long to do it
* because it was not until now that we knew the PID that
* the actual user command shell was going to get and the
@@ -272,7 +272,7 @@ static void child_process(entry * e, user * u) {
* are part of its reference count now.
*/
close(stdout_pipe[READ_PIPE]);
- if (cron_change_user_permanently(e->pwd) < 0)
+ if (cron_change_user_permanently(e->pwd, env_get("HOME", jobenv)) < 0)
_exit(ERROR_EXIT);
/* translation:
* \% -> %
diff --git a/src/funcs.h b/src/funcs.h
index 32d90c2..fabd0b2 100644
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -93,9 +93,9 @@ int cron_open_security_session( struct passwd *pw );
void cron_close_security_session( void );
-int cron_change_user( struct passwd *pw, char *homedir );
+int cron_change_user( struct passwd *pw );
-int cron_change_user_permanently( struct passwd *pw );
+int cron_change_user_permanently( struct passwd *pw, char *homedir );
int get_security_context(const char *name,
int crontab_fd,
diff --git a/src/security.c b/src/security.c
index 5a2cdfa..c3b1463 100644
--- a/src/security.c
+++ b/src/security.c
@@ -120,7 +120,7 @@ int cron_set_job_security_context(entry * e, user * u, char ***jobenv) {
}
#endif
- if (cron_change_user(e->pwd, env_get("HOME", *jobenv)) != 0) {
+ if (cron_change_user(e->pwd) != 0) {
log_it(e->pwd->pw_name, getpid(), "ERROR", "failed to change user", 0);
return -1;
}
@@ -189,7 +189,7 @@ void cron_close_pam(void) {
#endif
}
-int cron_change_user(struct passwd *pw, char *homedir) {
+int cron_change_user(struct passwd *pw) {
pid_t pid = getpid();
/* set our directory, uid and gid. Set gid first, since once
* we set uid, we've lost root privledges.
@@ -209,18 +209,19 @@ int cron_change_user(struct passwd *pw, char *homedir) {
return -1;
}
- if (chdir(homedir) == -1) {
- log_it("CRON", pid, "ERROR chdir failed", homedir, errno);
- return -1;
- }
return 0;
}
-int cron_change_user_permanently(struct passwd *pw) {
+int cron_change_user_permanently(struct passwd *pw, char *homedir) {
if (setreuid(pw->pw_uid, pw->pw_uid) != 0) {
log_it("CRON", getpid(), "ERROR", "setreuid failed", errno);
return -1;
}
+ if (chdir(homedir) == -1) {
+ log_it("CRON", getpid(), "ERROR chdir failed", homedir, errno);
+ return -1;
+ }
+
return 0;
}
--
1.6.6
Index: cronie.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cronie/F-12/cronie.spec,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -p -r1.30 -r1.31
--- cronie.spec 5 Nov 2009 16:09:15 -0000 1.30
+++ cronie.spec 20 Jan 2010 14:15:06 -0000 1.31
@@ -6,13 +6,14 @@
Summary: Cron daemon for executing programs at set times
Name: cronie
Version: 1.4.3
-Release: 2%{?dist}
+Release: 3%{?dist}
License: MIT and BSD and GPLv2
Group: System Environment/Base
URL: https://fedorahosted.org/cronie
Source0: https://fedorahosted.org/releases/c/r/cronie/%{name}-%{version}.tar.gz
Patch0: cronie-selinux_passwd.patch
Patch1: cronie-pam.patch
+Patch2: NFShomes_cant_be_executed.patch
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: syslog, bash >= 2.0
@@ -75,6 +76,7 @@ Old style of {hourly,daily,weekly,monthl
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
@@ -197,6 +199,9 @@ cp -a /var/lock/subsys/crond /var/lock/s
%attr(0644,root,root) %{_sysconfdir}/cron.d/dailyjobs
%changelog
+* Wed Jan 20 2010 Marcela Mašláňová <mmaslano at redhat.com> - 1.4.3-3
+- 554698 Cron jobs failing for some users with NFS mounted home directories
+
* Thu Nov 5 2009 Marcela Mašláňová <mmaslano at redhat.com> - 1.4.3-2
- 533189 pam needs add a line and selinux needs defined one function
- Previous message: rpms/eclipse-dltk/devel eclipse-dltk.spec,1.7,1.8
- Next message: rpms/thunderbird/devel thunderbird-version.patch, NONE, 1.1 .cvsignore, 1.31, 1.32 sources, 1.38, 1.39 thunderbird.spec, 1.158, 1.159
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list