Project

General

Profile

« Previous | Next » 

Revision d3f3b75f

Added by Chris Buechler about 9 years ago

If there was a group with a space, delete all the user-defined groups before hitting local_sync_accounts so pw doesn't get hung up. Ticket #6012

View differences:

src/etc/inc/upgrade_config.inc
4725 4725
			$exgrps[] = $grp['name'];
4726 4726
		}
4727 4727

  
4728
		$cleargroups = false;
4728 4729
		foreach ($config['system']['group'] as $idx => $grp) {
4729 4730
			if (strstr($grp['name'], " ")) {
4731
				$cleargroups = true;
4730 4732
				$newgrpname = str_replace(" ", "_", $grp['name']);
4731 4733
				// In the unlikely event that there is already a group with this name
4732 4734
				// just replace the whole thing with a unique string
......
4737 4739
				}
4738 4740
			}
4739 4741
		}
4742

  
4743
		// if there was a space in a group name, there may be multiple
4744
		// groups with the same name in the group file. To prevent pw 
4745
		// from getting into a neverending loop, delete all user-defined
4746
		// groups here. local_sync_accounts will run shortly after this
4747
		// and add them back. redmine #6012
4748
		if ($cleargroups) {
4749
			foreach ($config['system']['group'] as $grp) {
4750
				mwexec("/usr/sbin/pw groupdel -g {$grp['gid']}");
4751
			}
4752
		}
4740 4753
	}
4741 4754
}
4742 4755
?>

Also available in: Unified diff