* src/usermod.c (move_home): It is always an error to use -m if
the new home directory already exist (independently from the existence of the old home directory did not exist)
This commit is contained in:
		@@ -1,6 +1,9 @@
 | 
			
		||||
2011-07-14  Nicolas François  <nicolas.francois@centraliens.net>
 | 
			
		||||
 | 
			
		||||
	* src/usermod.c: Fix typo in comment.
 | 
			
		||||
	* src/usermod.c (move_home): It is always an error to use -m if
 | 
			
		||||
	the new home directory already exist (independently from the
 | 
			
		||||
	existence of the old home directory did not exist)
 | 
			
		||||
 | 
			
		||||
2011-07-08  Nicolas François  <nicolas.francois@centraliens.net>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1408,18 +1408,18 @@ static void move_home (void)
 | 
			
		||||
{
 | 
			
		||||
	struct stat sb;
 | 
			
		||||
 | 
			
		||||
	if (stat (user_home, &sb) == 0) {
 | 
			
		||||
	if (access (user_newhome, F_OK) == 0) {
 | 
			
		||||
		/*
 | 
			
		||||
		 * If the new home directory already exist, the user
 | 
			
		||||
		 * should not use -m.
 | 
			
		||||
		 */
 | 
			
		||||
		if (access (user_newhome, F_OK) == 0) {
 | 
			
		||||
			fprintf (stderr,
 | 
			
		||||
			         _("%s: directory %s exists\n"),
 | 
			
		||||
			         Prog, user_newhome);
 | 
			
		||||
			fail_exit (E_HOMEDIR);
 | 
			
		||||
		}
 | 
			
		||||
		fprintf (stderr,
 | 
			
		||||
		         _("%s: directory %s exists\n"),
 | 
			
		||||
		         Prog, user_newhome);
 | 
			
		||||
		fail_exit (E_HOMEDIR);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (stat (user_home, &sb) == 0) {
 | 
			
		||||
		/*
 | 
			
		||||
		 * Don't try to move it if it is not a directory
 | 
			
		||||
		 * (but /dev/null for example).  --marekm
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user