Language: Go
Label: safe
CWE: CWE-863 \u2014 Incorrect Authorization
The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions.

Code:
func handle() {
	// startReaper()
	fluid.LogVersion()

	if pprofAddr != "" {
		newPprofServer(pprofAddr)
	}

	mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
		Scheme:             scheme,
		MetricsBindAddress: metricsAddr,
		Port:               9443,
	})

	if err != nil {
		panic(fmt.Sprintf("csi: unable to create controller manager due to error %v", err))
	}

	config := config.Config{
		NodeId:            nodeID,
		Endpoint:          endpoint,
		PruneFs:           pruneFs,
		PrunePath:         prunePath,
		KubeletConfigPath: kubeletKubeConfigPath,
	}

	if err = csi.SetupWithManager(mgr, config); err != nil {
		panic(fmt.Sprintf("unable to set up manager due to error %v", err))
	}

	ctx := ctrl.SetupSignalHandler()
	if err = mgr.Start(ctx); err != nil {
		panic(fmt.Sprintf("unable to start controller recover due to error %v", err))
	}
}