Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 24551 - Installing with /tmp on a separate partition does not give mode 1777
Summary: Installing with /tmp on a separate partition does not give mode 1777
Status: RESOLVED WORKSFORME
Alias: None
Product: [OLD] Docs-user
Classification: Unclassified
Component: Gentoo Linux x86 Installation Guide (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
: 22929 34953 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-07-15 16:18 UTC by Shevek
Modified: 2004-10-15 23:39 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Proposed patch to installation guide (gentoo-x86-install.diff-tmpprivs,673 bytes, patch)
2003-08-11 00:55 UTC, Sven Vermeulen (RETIRED)
Details | Diff
Updated patch (gentoo-x86-install.diff-tmpprivs,706 bytes, patch)
2003-08-11 04:39 UTC, Sven Vermeulen (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shevek 2003-07-15 16:18:31 UTC
If /tmp is a separate partition, then the tar extract of stageX does not change
the mode of the root directory of /tmp, and it ends up root.root 755. Perhaps
something somewhere should twat-check the permissions on /tmp at install-time?
Comment 1 Martin Holzer (RETIRED) gentoo-dev 2003-07-28 11:17:33 UTC
try 

       umask=value
              Set the umask (the bitmask  of  the  permissions  that  are  not
              present).  The default is the umask of the current process.  The
              value is given in octal.
Comment 2 Shevek 2003-08-02 10:34:07 UTC
If you install, and create /tmp as a separate partition, the root inode of the partition can to be given mode 1777 using chmod. This is normal and should be done. The response given is not a fix and is not appropriate to this bug.
Comment 3 Shevek 2003-08-04 02:34:03 UTC
Not only that, but you do not say where that 'umask' flag is to be set. That isn't an extract from the fstab or mount manpages, and indeed, the ext2 filesystem does not support a umask flag.

The bug really is that the root inode of the /tmp filesystem needs its permissions set to avoid silent breakage. Please reopen this bug.
Comment 4 SpanKY gentoo-dev 2003-08-04 15:20:23 UTC
bad martin ;) 
Comment 5 Daniel Robbins (RETIRED) gentoo-dev 2003-08-09 18:08:56 UTC
Docs team, let's add a well-integrated part to the doc about this issue and others like them (where /foo is a partition)
Comment 6 Sven Vermeulen (RETIRED) gentoo-dev 2003-08-10 07:20:24 UTC
Should the "chmod 1777 /tmp" be done before or after /tmp is mounted?
Comment 7 Benny Chuang (RETIRED) gentoo-dev 2003-08-10 08:14:42 UTC
I think after is more secure
Comment 8 Ken Nowack (RETIRED) gentoo-dev 2003-08-10 11:24:01 UTC
I'm not exactly sure what the proposed instructions should contain. Are we discussing how to mount different directories on seperate partitions with appropriate permissions via fstab? If so, that kind of depends on which filesystem the user selects, like the ext2 and umask issue listed here. 

So if someone could clarify exactly what needs to be documented, I'll work up a patch for the install guide.
Comment 9 Shevek 2003-08-10 11:28:39 UTC
Not only should it be done after mounting, it _MUST_ be done after mounting, otherwise you change the mode of the mount point inode, not the root inode on the new fs.

Can this type of thing not be done as a post-install gimmick on baselayout, rather than requiring user intervention? Most directories are fine root.root, 755. The only things that need checking are things like /tmp and /var/tmp, and .... no others come to mind that are likely to be mount points. 
Comment 10 Sven Vermeulen (RETIRED) gentoo-dev 2003-08-11 00:46:40 UTC
Antifa: I'm already on to it (otherwise I wouldn't have taken the bug myself :)
Comment 11 Sven Vermeulen (RETIRED) gentoo-dev 2003-08-11 00:55:53 UTC
Created attachment 15880 [details, diff]
Proposed patch to installation guide

Does this look ok?
Comment 12 Shevek 2003-08-11 04:05:42 UTC
No, you mean /mnt/gentoo/tmp and /mnt/gentoo/var/tmp, and why can't this be done by baselayout preinstall/postinstall anyway?
Comment 13 Sven Vermeulen (RETIRED) gentoo-dev 2003-08-11 04:39:08 UTC
Created attachment 15895 [details, diff]
Updated patch

Good question (regarding baselayout).
Comment 14 Sven Vermeulen (RETIRED) gentoo-dev 2003-08-11 04:41:40 UTC
Cc'ing azarah as he seems to be one of the devs in charge of baselayout...
Comment 15 Douglas R. Hoffman 2003-10-16 17:19:45 UTC
I too have observed this problem  However, I see this as a bung in tar. 
Placing placing comments in install docs, or adding code to some of the install
ebuilds is  a fix.  But isn't this avoiding the root failure/bug being tar?

/doug
Comment 16 Martin Holzer (RETIRED) gentoo-dev 2003-10-17 00:46:11 UTC
*** Bug 22929 has been marked as a duplicate of this bug. ***
Comment 17 Douglas R. Hoffman 2003-10-17 00:59:39 UTC
I've poseted the following to bug-tar@gnu.org...

I'm observing an odd behavior where gnu tar (on Linux) does not restore the
permissions on a directory if that directory has a filesystem mounted on
it.  However, if the same directory exists without a FS mounted on it, tar
correctly sets the permissions.

Is this the expected behavior of gnu tar?

Brief Details...

# cd /root/test_dir

# tar -x -p -v -v -f test-tar.tar
drwx------ root/root         0 2003-10-17 03:43:17 ./
drwxr-xr-t root/root         0 2003-10-17 03:43:17 ./fail/
drwxr-xr-t root/root         0 2003-10-17 03:43:17 ./pass/

# ls -la
total 3
drwx------    4 root     root           96 Oct 17 03:44 .
drwx------   22 root     root         1176 Oct 17 03:44 ..
drwx------    2 root     root           40 Oct 17 03:44 fail
drwxr-xr-t    2 root     root           48 Oct 17 03:44 pass

# df /root/test_dir
tmpfs                  1031608         0   1031608   0% 
/root/test-tar/fail

This happens with reiser, tmpfs, ext2 as well as with different chmod bits
on the 'fail' directory in the archive.  I can post the script I used to
produce these results.

Thanks in advance,
Doug


Comment 18 Douglas R. Hoffman 2003-10-23 02:26:52 UTC
I wonder when the next version of TAR will come out....

Paul Eggert <eggert@CS.UCLA.EDU> writes:

Come to think of it, it's probably because tar doesn't update the metadata
on a directory unless it created it.  With other directories, it can rmdir
the directory and then mkdir it; but it can't do that
with mount points.

The behavior in this area will change in the next tar version; at that point
the problem may be moot.
Comment 19 Joel Metelius 2004-01-15 14:08:11 UTC
I just had this happen with a newly installed gentoo and the only problem I saw ralated to the /tmp permission was that only root can login to Gnome. So at least for now something can be put in the docs at the same place as the note about adding a regular user... BUT SOMETHING NEED TO GO INTO THE DOCS NOW!!!

I saw more people in the forum struggling with the same problem. The thing is that there is not much of an error log from the faulty X/Gnome login.

.xsession-errors:
/etc/X11/gdm/PreSession//Default: Registering your session with wtmp and utmp
/etc/X11/gdm/PreSession//Default: running: sessreg -a -w /var/log/wtmp -u /var/run/utmp -x "/var/lib/gdm/:20.Xservers" -h "" -l :20 joel

/joel
Comment 20 Sven Vermeulen (RETIRED) gentoo-dev 2004-01-16 01:37:59 UTC
Martin, I'm going to add a note to the documentation and leave you with the decision on wether or not to close the bug.
Comment 21 Martin Holzer (RETIRED) gentoo-dev 2004-02-03 03:25:24 UTC
*** Bug 34953 has been marked as a duplicate of this bug. ***
Comment 22 SpanKY gentoo-dev 2004-10-15 23:39:00 UTC
everything should be covered