OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 29-Apr-2004 17:08:21
Branch: HEAD Handle: 2004042916082000
Modified files:
openpkg-src/openpkg HISTORY openpkg.spec rc
Log:
make sure <prefix>/etc/rc does not complain in cronjobs of
non-privileged setups
Summary:
Revision Changes Path
1.171 +1 -0 openpkg-src/openpkg/HISTORY
1.324 +2 -0 openpkg-src/openpkg/openpkg.spec
1.54 +14 -2 openpkg-src/openpkg/rc
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/HISTORY
============================================================================
$ cvs diff -u -r1.170 -r1.171 HISTORY
--- openpkg-src/openpkg/HISTORY 29 Apr 2004 14:17:27 -0000 1.170
+++ openpkg-src/openpkg/HISTORY 29 Apr 2004 15:08:20 -0000 1.171
@@ -2,6 +2,7 @@
2004
====
+20040429 make sure <prefix>/etc/rc does not complain in cronjobs of non-privileged
setups
20040429 port to NetBSD 1.6.2
20040428 fix "openpkg man" command now that OPENPKG_TOOLS_CMDPATH is not provided
20040428 let rc point out that it searches subdirectories for unresolved file
conflicts
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/openpkg.spec
============================================================================
$ cvs diff -u -r1.323 -r1.324 openpkg.spec
--- openpkg-src/openpkg/openpkg.spec 29 Apr 2004 14:17:27 -0000 1.323
+++ openpkg-src/openpkg/openpkg.spec 29 Apr 2004 15:08:20 -0000 1.324
@@ -1008,6 +1008,8 @@
# install Run-Command files
sed -e "s:@l_prefix@:%{l_prefix}:g" \
+ -e "s:@l_susr@:%{l_susr}:g" \
+ -e "s:@l_musr@:%{l_musr}:g" \
<`SOURCE rc` \
>$RPM_BUILD_ROOT%{l_prefix}/etc/rc
chmod 755 $RPM_BUILD_ROOT%{l_prefix}/etc/rc
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg/rc
============================================================================
$ cvs diff -u -r1.53 -r1.54 rc
--- openpkg-src/openpkg/rc 28 Apr 2004 19:29:14 -0000 1.53
+++ openpkg-src/openpkg/rc 29 Apr 2004 15:08:20 -0000 1.54
@@ -534,8 +534,20 @@
# execute the generated script with GNU Bash
if [ ".$user" != ".$s_user" ]; then
# execute as different user
- su - $s_user -c "PATH=\"$PATH\"; $bash $tmpfile" >$outfile
2>$errfile
- rc=$?
+ if [ ".$user" = "[EMAIL PROTECTED]@" -a "[EMAIL PROTECTED]@" =
".root" ]; then
+ su - $s_user -c "PATH=\"$PATH\"; $bash $tmpfile" >$outfile
2>$errfile
+ rc=$?
+ elif [ "[EMAIL PROTECTED]@" != ".root" ]; then
+ # do not complain if we would not have any chance
+ # at all to switch the user because we are running
+ # in a non-privileged instance. Else we would just
+ # trash the mailbox of the user receiving the
+ # output of periodic run-commands.
+ rc=0
+ else
+ echo "openpkg:rc:WARNING: $prefix:$s_name:%$cmd: require root
privileges to run as user \"$s_user\"" 1>&2
+ rc=1
+ fi
else
# execute as current user
$bash $tmpfile >$outfile 2>$errfile
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]