In Linux there are SUID, SGID, and sticky bits for directory permissions.
I am absolutely clear about the sticky and SGID bit on files or folders.
But what happens if I apply SUID bit on a directory?
Virtualbox windows xp setup. For example, if I apply a SGID bit on a file, a process that gets started with this file will use the effective group ID of the file's group and not the primary group of the user who is calling the file. Same thing if you apply the SUID bit on a file: it will run with the owner as the effective user.
This changes as soon as you apply the SGID bit on a directory, for example
chmod -R 2770 /var/testdir/
. Now all new files and folders what will be created within /var/testdir/
will inherit the same group as /var/testdir/
even if the creator's primary group is different. Also, subdirectories will inherit the SGID bit.But what happens if you apply the SUID bit on a directory? I did not find any information for that case.
Also, what happens if you apply SGID and SGID bit on the same folder?
TheMAnTheMAn
1 Answer
27.5 Directories and the Set-User-ID and Set-Group-ID Bits
On most systems, if a directory’s set-group-ID bit is set, newly created subfiles inherit the same group as the directory, and newly created subdirectories inherit the set-group-ID bit of the parent directory. On a few systems, a directory’s set-user-ID bit has a similar effect on the ownership of new subfiles and the set-user-ID bits of new subdirectories. These mechanisms let users share files more easily, by lessening the need to use chmod or chown to share new files.
StevenSteven23.8k1010 gold badges7777 silver badges110110 bronze badges
Not the answer you're looking for? Browse other questions tagged linuxpermissionsfile-permissionschmodposix or ask your own question.
Posted by2 years ago
Archived
I don't know if this is the right place for it but I've spent 3 hours now looking online, through the GDStash zip files, etc. for how the hell to run this mod. The read me was exceedingly useless, the only things I've found online are about how to use it when you already have it open but I can't even figure out how to open/install it.
Can anyone point me in the right direction for a resource on how to open/install GD stash, already downloaded it from multiple sites.
8 comments
I just downloaded the latest GD stash update and the latest java update when I try to select the save game directory I get three errors:
1. Error reading D:My DocumentsMy GamesGrim Dawnsavemain_icarusplayer.gdc
2. Please check if a newer version of GD Stash is available
3. Version not supported
org.gdstash.util.FileVersionException: Version not supported
at org.gdstash.character.GDChar.readSummary(GDChar.java:780)
at org.gdstash.character.GDChar.readCharSummary(GDChar.java:728)
at org.gdstash.ui.util.GDCharInfoList.processCharFile(GDCharInfoList.java:89)
at org.gdstash.ui.util.GDCharInfoList.processCharDir(GDCharInfoList.java:80)
at org.gdstash.ui.util.GDCharInfoList.processCharDir(GDCharInfoList.java:79)
at org.gdstash.ui.util.GDCharInfoList.findCharsInDir(GDCharInfoList.java:61)
at org.gdstash.ui.util.GDCharInfoList.findChars(GDCharInfoList.java:44)
at org.gdstash.ui.GDConfigPane$SaveDirListener.actionPerformed(GDConfigPane.java:574)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
1. Error reading D:My DocumentsMy GamesGrim Dawnsavemain_icarusplayer.gdc
2. Please check if a newer version of GD Stash is available
3. Version not supported
org.gdstash.util.FileVersionException: Version not supported
at org.gdstash.character.GDChar.readSummary(GDChar.java:780)
at org.gdstash.character.GDChar.readCharSummary(GDChar.java:728)
at org.gdstash.ui.util.GDCharInfoList.processCharFile(GDCharInfoList.java:89)
at org.gdstash.ui.util.GDCharInfoList.processCharDir(GDCharInfoList.java:80)
at org.gdstash.ui.util.GDCharInfoList.processCharDir(GDCharInfoList.java:79)
at org.gdstash.ui.util.GDCharInfoList.findCharsInDir(GDCharInfoList.java:61)
at org.gdstash.ui.util.GDCharInfoList.findChars(GDCharInfoList.java:44)
at org.gdstash.ui.GDConfigPane$SaveDirListener.actionPerformed(GDConfigPane.java:574)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
When I generate a stash in
git
, there is a 'parent' (the last commit before I stashed my changes).When I use
git stash
to stash my changes, an ID to that parent-commit is added to the message describing my stash. calling git stash list
can e.g. show:But when I run
git stash save 'My own message'
the ID of the parent-commit is not added (git stash list
):It there a way to show the ID of the parent-commit to the list of stashes?
I tried:
git stash list --oneline --parents
, which gave me:![How to install gd stash How to install gd stash](/uploads/1/2/3/7/123735850/624735720.png)
But here the wrong IDs are shown. I expected (the first line beeing the ID of the parent-commit which is the same for groups of two commits in this example): Recover my files v6 3.2 offline activation key.
SQB3,66411 gold badge1717 silver badges4343 bronze badges
EdwardEdward1,53344 gold badges2323 silver badges6262 bronze badges
1 Answer
If you want the ID included in the message you supply, you can supply the ID as part of the message. That is, instead of:
![Wrong Wrong](/uploads/1/2/3/7/123735850/171706700.gif)
you might run:
(you might turn this into an alias—either a shell alias, or a git alias that invokes the shell).
If you want to make use of the parent IDs actually stored in the tree, you must delve into the implementation of
git stash
. See this answer for lots of detail, but in short, the first parent of the work-tree commit w
(refs/stash
, or the reflog entry, points to this w
commit) is the commit that was HEAD
at the time the stash was made.The
git stash list
sub-command simply passes additional arguments directly to git log
, so --oneline --parents
does what it does with git log
—except that git stash list
does it like this:(where
'$@'
are your additional arguments). Unfortunately, --parents
uses history simplification and parent rewriting (see the documentation for git rev-list
), which with -g
, turns into 'replace parentage with result of reflog walk', which totally destroys the original parentage information.(Incidentally, the only reason I can see for the explicit
--first-parent
here is to make --parents
hide the index and optional extra commit. Since --parents
get clobbered anyway by the reflog walk, it seems to be pointless. Not sure if the git folks might intend reflog walks not to clobber parent information, and if it didn't clobber, you'd have seen what you wanted. So this might be a git bug, although there is a lot of guessing-at-intentions here.)You can (sort of) get what you want by going back to the original commit IDs (the
w
commits) and using git rev-parse
to find the first-parent of each w
commit:(there may be ways to shorten this, the above is pretty straightforward though).
Community♦
torektorek212k2121 gold badges271271 silver badges357357 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.