[vhffs-dev] [593] Users' homes are now in +t mode. |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 593
Author: beuss
Date: 2007-05-01 18:08:27 +0000 (Tue, 01 May 2007)
Log Message:
-----------
Users' homes are now in +t mode. Added a script to convert existing homes.
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Robots/User.pm
Added Paths:
-----------
trunk/vhffs-compat/fix-home-perms.sh
Modified: trunk/vhffs-api/src/Vhffs/Robots/User.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/User.pm 2007-05-01 11:23:01 UTC (rev 592)
+++ trunk/vhffs-api/src/Vhffs/Robots/User.pm 2007-05-01 18:08:27 UTC (rev 593)
@@ -97,6 +97,7 @@
#return -1 if( mkdir( $path ) == false );
}
chown $user->get_uid , $user->get_gid , $path ;
+ chmod oct('1755'), $path;
$user->add_history( "Creation complete for user. Homedir is now created." );
$user->set_status( Vhffs::Constants::ACTIVATED );
Added: trunk/vhffs-compat/fix-home-perms.sh
===================================================================
--- trunk/vhffs-compat/fix-home-perms.sh 2007-05-01 11:23:01 UTC (rev 592)
+++ trunk/vhffs-compat/fix-home-perms.sh 2007-05-01 18:08:27 UTC (rev 593)
@@ -0,0 +1,27 @@
+#!/bin/bash
+function help()
+{
+ echo "Usage: $0 /path/to/homes/base [--perform]" >&2
+ echo " --perform : really fix permissions"
+ echo "Example:" >&2
+ echo " $0 /data/home" >&2
+ exit
+}
+
+if [ $# -lt 1 ]; then
+ echo "*** Error *** $0 takes at least 1 argument" >&2
+ help
+fi
+
+if [ `echo $1 | grep /$` ]; then
+ regex="$1././[^/]+$"
+else
+ regex="$1/././[^/]+$"
+fi
+if [ "$2" = "--perform" ]; then
+ find $1 -type d | egrep $regex | xargs chmod +t
+else
+ echo "Here are the files that would be chmod'ed +t :"
+ echo ""
+ find $1 -type d | egrep $regex
+fi
Property changes on: trunk/vhffs-compat/fix-home-perms.sh
___________________________________________________________________
Name: svn:executable
+ *