Bug 847794

Summary: openSUSE_13.1 RC1: after installation /var/tmp/ is present in /var/tmp
Product: [openSUSE] openSUSE 13.1 Reporter: Richard Bos <richard.bos>
Component: YaST2Assignee: Ladislav Slezák <lslezak>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Minor    
Priority: P2 - High CC: aschnell
Version: RC 1   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: yast log with lines above

Description Richard Bos 2013-10-27 15:58:34 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36 SUSE/30.0.1599.66

Installed openSUSE_13.1 normal procedure
Played with it.

Checked /var/tmp:
# cd /var/tmp
# ls

Hmm, there is a directory called var
# cd var
# ls
tmp

So there is the directory: /var/tmp/var/tmp

Which is unexpected


Reproducible: Didn't try

Steps to Reproduce:
1. see details
2. I installed openSUSE_13.1 rc1 only once, I don't know if it is reproduable
3.
Actual Results:  
/var/tmp/var is present


Expected Results:  
/var/tmp/var should not exist
Comment 1 Arvin Schnell 2014-01-08 13:05:42 UTC
Same here, in the logs I found:

[zypp] PathInfo.cc(assert_dir):358 mkdir /mnt/var/tmp/var 00755
[zypp] PathInfo.cc(assert_dir):358 mkdir /mnt/var/tmp/var/tmp 00755

Also matches the timestamp of the directories.
Comment 2 Michael Andres 2014-01-09 08:56:23 UTC
Arvin: Please attach the full log, or at least a reasonable large part showing the context. As zypp is a library, I can't tell who's doing the call.
Comment 3 Arvin Schnell 2014-01-09 09:09:08 UTC
Created attachment 573804 [details]
yast log with lines above
Comment 4 Michael Andres 2014-01-09 11:38:46 UTC
@Ladislav: Looks like it happens in yast-pkg-bindings

  [Source_Download.cc]
    YCPValue PkgFunctions::SourceProvideFileCommon(...)
    ...
      // create the tmpdir in <_download_area>/var/tmp
      zypp::filesystem::TmpDir tmpdir(

          _download_area / zypp::filesystem::TmpDir::defaultLocation());

The log says:
2014-01-08 06:57:24 <1> linux(2440) 
  [Pkg] Source_Installation.cc(SourceMoveDownloadArea):286 
  Moving download area of all sources to /mnt/var/tmp
2014-01-08 06:57:24 <1> linux(2440) 
  [zypp] MediaHandler.cc(setAttachPrefix):324 
  Setting user defined attach point prefix: /mnt/var/tmp

I guess 'usually' your _download_area is unset, that's why you append TmpDir::defaultLocation (/var/tmp) so it fits your needs. 

But in case you redirect the download area to a tmp dir (/mnt/var/tmp), appending TmpDir::defaultLocation is superfluous.


I guess it should be like this:
      zypp::filesystem::TmpDir tmpdir(
          _download_area ? _download_area
                         : zypp::filesystem::TmpDir::defaultLocation());


Or initialize '_download_area = zypp::filesystem::TmpDir::defaultLocation()' so _download_area will always point to a valid tmp dir:

      zypp::filesystem::TmpDir tmpdir( _download_area );
Comment 5 Ladislav Slezák 2014-01-10 08:08:44 UTC
Michael, thanks for the explanation and the proposed fix!
Comment 6 Ladislav Slezák 2014-01-10 10:08:31 UTC
Fixed in yast2-pkg-bindings-3.1.3 (openSUSE-13.2)
Comment 7 Richard Bos 2014-01-10 12:54:41 UTC
Thanks for the fix