Bug 121763 - TinyBSD remove_workdir function needs some extra checking for existing mounts
Summary: TinyBSD remove_workdir function needs some extra checking for existing mounts
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 7.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Remko Lodder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-16 15:20 UTC by Richard Arends
Modified: 2008-03-24 10:40 UTC (History)
0 users

See Also:


Attachments
file.diff (843 bytes, patch)
2008-03-16 15:20 UTC, Richard Arends
no flags Details | Diff
patch.txt (836 bytes, text/plain; charset=us-ascii)
2008-03-16 15:48 UTC, Richard Arends
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Arends 2008-03-16 15:20:03 UTC
If a tinybsd build is interrupted and later started again, there's a possibility that directory's are still mounted with mount_nullfs.

Running the remove_workdir function can than do severe damage to the build host, because it wil remove anything below $WORKDIR, thus also the mounted directory's like /lib. ..oops..

Fix: Apply the patch

Patch attached with submission follows:
How-To-Repeat: Interupt a tinybsd build at the time it is building the (optional) ports. Then start it again and the remove_workdir function will delete everything under $WORKDIR,
Comment 1 Richard Arends 2008-03-16 15:48:16 UTC
Hello,

In the patch is an extra 'exit 11' that should not be there. Sorry for
the inconvenience, the attached patch is the right one.
 
-- 
Regards,

Richard.

/* Homo Sapiens non urinat in ventum */
Comment 2 Remko Lodder freebsd_committer freebsd_triage 2008-03-16 16:13:59 UTC
Responsible Changed
From-To: freebsd-bugs->remko

I'll take it.
Comment 3 Remko Lodder freebsd_committer freebsd_triage 2008-03-20 12:57:00 UTC
State Changed
From-To: open->patched

Patched in current will MFC in a few days
Comment 4 dfilter service freebsd_committer freebsd_triage 2008-03-20 12:57:00 UTC
remko       2008-03-20 12:56:49 UTC

  FreeBSD src repository

  Modified files:
    tools/tools/tinybsd  tinybsd 
  Log:
  Alert properly when we have stale mounts left after interupting
  a tinybsd build.  If we do not do this, we can accidentally remove
  critical files from directories like /lib (if mounted).
  
  PR:             misc/121763
  Submitted by:   Richard Arends < richard at unixguru dot nl >
  MFC after:      3 days
  
  Revision  Changes    Path
  1.9       +14 -6     src/tools/tools/tinybsd/tinybsd
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 dfilter service freebsd_committer freebsd_triage 2008-03-24 10:39:40 UTC
remko       2008-03-24 10:39:34 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_7)
    tools/tools/tinybsd  tinybsd 
  Log:
  MFC rev 1.9 tinybsd
  
    Alert properly when we have stale mounts left after interupting
    a tinybsd build.  If we do not do this, we can accidentally remove
    critical files from directories like /lib (if mounted).
  
    PR:             misc/121763
    Submitted by:   Richard Arends < richard at unixguru dot nl >
    MFC after:      3 days
  
  Approved by:    imp (mentor, implicit)
  
  Revision  Changes    Path
  1.7.2.2   +14 -6     src/tools/tools/tinybsd/tinybsd
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Remko Lodder freebsd_committer freebsd_triage 2008-03-24 10:39:52 UTC
State Changed
From-To: patched->closed

MFC'ed to releng7, thanks for the submission richard!