// KeybaseFuseStatus returns Fuse status
547444
func KeybaseFuseStatus(bundleVersion string, log Log) keybase1.FuseStatus {
	st := keybase1.FuseStatus{
		BundleVersion: bundleVersion,
		InstallStatus: keybase1.InstallStatus_UNKNOWN,
		InstallAction: keybase1.InstallAction_UNKNOWN,
	}

	var kextInfo *kext.Info

	if _, err := os.Stat(installPath); err == nil {
		st.Path = installPath
		kextID := "com.github.kbfuse.filesystems.kbfuse"
		var loadErr error
		kextInfo, loadErr = kext.LoadInfo(kextID)
		if loadErr != nil {
			st.InstallStatus = keybase1.InstallStatus_ERROR
			st.InstallAction = keybase1.InstallAction_REINSTALL
			st.Status = keybase1.Status{Code: libkb.SCGeneric, Name: "INSTALL_ERROR", Desc: fmt.Sprintf("Error loading kext info: %s", loadErr)}
			return st
		}
		if kextInfo == nil {
			log.Debug("No kext info available (kext not loaded)")
			// This means the kext isn't loaded, which is ok, kbfs will call
			// load_kbfuse when it starts up.
			// We have to get the version from the installed plist.
			installedVersion, fivErr := fuseInstallVersion(log)
			if fivErr != nil {
				st.InstallStatus = keybase1.InstallStatus_ERROR
				st.InstallAction = keybase1.InstallAction_REINSTALL
				st.Status = keybase1.Status{Code: libkb.SCGeneric, Name: "INSTALL_ERROR", Desc: fmt.Sprintf("Error loading (plist) info: %s", fivErr)}
				return st
			}
			if installedVersion != "" {
				kextInfo = &kext.Info{
					Version: installedVersion,
					Started: false,
				}
			}
		}

		// Installed
		st.KextID = kextID
	}

	// If neither is found, we have no install
	if st.KextID == "" || kextInfo == nil {
		st.InstallStatus = keybase1.InstallStatus_NOT_INSTALLED
		st.InstallAction = keybase1.InstallAction_INSTALL
		return st
	}

	// Try to get mount info, it's non-critical if we fail though.
	mountInfos, err := mountInfo("kbfuse")
	if err != nil {
		log.Errorf("Error trying to read mount info: %s", err)
	}
	st.MountInfos = mountInfos

	st.Version = kextInfo.Version
	st.KextStarted = kextInfo.Started

	installStatus, installAction, status := ResolveInstallStatus(st.Version, st.BundleVersion, "", log)
	st.InstallStatus = installStatus
	st.InstallAction = installAction
	st.Status = status

	return st
}
1226676
func (s *CachediSCSIVolume) SetVolumeStatus(v string) *CachediSCSIVolume {
	s.VolumeStatus = &v
	return s
}
1306512
func (c LoginClient) PaperKeySubmit(ctx context.Context, __arg PaperKeySubmitArg) (err error) {
	err = c.Cli.Call(ctx, "keybase.1.login.paperKeySubmit", []interface{}{__arg}, nil)
	return
}
1007212
func (u NoSecretKeyError) ToStatus() (s keybase1.Status) {
	s.Code = SCKeyNoSecret
	s.Name = "KEY_NO_SECRET"
	return
}
1135997
func (s *SimpleFSHandler) SimpleFSSyncConfigAndStatus(
	ctx context.Context) (keybase1.SyncConfigAndStatusRes, error) {
	ctx, cancel := s.wrapContextWithTimeout(ctx)
	defer cancel()
	cli, err := s.client()
	if err != nil {
		return keybase1.SyncConfigAndStatusRes{}, err
	}
	return cli.SimpleFSSyncConfigAndStatus(ctx)
}
7051
func (k KeybaseServiceMeasured) PutGitMetadata(
	ctx context.Context, folder keybase1.Folder, repoID keybase1.RepoID,
	metadata keybase1.GitLocalMetadata) (err error) {
	k.putGitMetadataTimer.Time(func() {
		err = k.delegate.PutGitMetadata(ctx, folder, repoID, metadata)
	})
	return err
}
1199017
func (b *SystemBackend) handleKeyStatus(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
	// Get the key info
	info, err := b.Core.barrier.ActiveKeyInfo()
	if err != nil {
		return nil, err
	}

	resp := &logical.Response{
		Data: map[string]interface{}{
			"term":         info.Term,
			"install_time": info.InstallTime.Format(time.RFC3339Nano),
		},
	}
	return resp, nil
}
717016
func parseSlaveStatus(fields map[string]string) SlaveStatus {
	status := SlaveStatus{
		MasterHost:      fields["Master_Host"],
		SlaveIORunning:  fields["Slave_IO_Running"] == "Yes",
		SlaveSQLRunning: fields["Slave_SQL_Running"] == "Yes",
	}
	parseInt, _ := strconv.ParseInt(fields["Master_Port"], 10, 0)
	status.MasterPort = int(parseInt)
	parseInt, _ = strconv.ParseInt(fields["Connect_Retry"], 10, 0)
	status.MasterConnectRetry = int(parseInt)
	parseUint, _ := strconv.ParseUint(fields["Seconds_Behind_Master"], 10, 0)
	status.SecondsBehindMaster = uint(parseUint)
	return status
}
297123
func (s *Server) initStampedTrustedKeys() bool {
	// Check to see if we have an override in options, which will cause us to fail.
	if len(s.opts.TrustedKeys) > 0 {
		return false
	}
	tks := checkTrustedKeyString(trustedKeys)
	if len(tks) == 0 {
		return false
	}
	s.trustedKeys = tks
	return true
}
1140031
func AutoInstallWithStatus(context Context, binPath string, force bool, timeout time.Duration, log Log) keybase1.InstallResult {
	_, res, err := autoInstall(context, binPath, force, timeout, log)
	if err != nil {
		return keybase1.InstallResult{Status: keybase1.StatusFromCode(keybase1.StatusCode_SCInstallError, err.Error())}
	}
	return newInstallResult(res)
}
988039
func (md *RootMetadataV3) MergedStatus() MergeStatus {
	if md.WriterMetadata.WFlags&MetadataFlagUnmerged != 0 {
		return Unmerged
	}
	return Merged
}
438807
func (c *ConfigLocal) KeybaseService() KeybaseService {
	c.lock.RLock()
	defer c.lock.RUnlock()
	return c.service
}
81536
func (e NoSuchUserError) ToStatus() keybase1.Status {
	return keybase1.Status{
		Name: "NotFound",
		Code: int(keybase1.StatusCode_SCNotFound),
		Desc: e.Error(),
	}
}
511753
func (c SimpleFSClient) SimpleFSSetStat(ctx context.Context, __arg SimpleFSSetStatArg) (err error) {
	err = c.Cli.Call(ctx, "keybase.1.SimpleFS.simpleFSSetStat", []interface{}{__arg}, nil)
	return
}
1268576
func (k *SimpleFS) SimpleFSStat(ctx context.Context, arg keybase1.SimpleFSStatArg) (de keybase1.Dirent, err error) {
	if arg.IdentifyBehavior != nil {
		ctx, err = tlfhandle.MakeExtendedIdentify(ctx, *arg.IdentifyBehavior)
		if err != nil {
			return keybase1.Dirent{}, err
		}
	}
	ctx, err = k.startSyncOp(ctx, "Stat", arg.Path)
	if err != nil {
		return keybase1.Dirent{}, err
	}
	defer func() { k.doneSyncOp(ctx, err) }()

	fs, finalElem, err := k.getFSIfExists(ctx, arg.Path)
	switch errors.Cause(err).(type) {
	case nil:
	case libfs.TlfDoesNotExist:
		if finalElem != "" && finalElem != "." {
			return keybase1.Dirent{}, err
		}

		// TLF doesn't exist yet; just return an empty result.
		return keybase1.Dirent{
			DirentType: keybase1.DirentType_DIR,
			Writable:   false,
		}, nil
	default:
		return keybase1.Dirent{}, err
	}

	if arg.RefreshSubscription {
		err = k.refreshSubscription(ctx, arg.Path)
		if err != nil {
			return keybase1.Dirent{}, err
		}
	}

	// Use LStat so we don't follow symlinks.
	fi, err := fs.Lstat(finalElem)
	if err != nil {
		return keybase1.Dirent{}, err
	}

	err = k.setStat(&de, fi)
	return de, err
}
1071295
func (c KbfsClient) EncryptFavorites(ctx context.Context, dataToEncrypt []byte) (res []byte, err error) {
	__arg := EncryptFavoritesArg{DataToEncrypt: dataToEncrypt}
	err = c.Cli.Call(ctx, "keybase.1.kbfs.encryptFavorites", []interface{}{__arg}, &res)
	return
}
283325
func (c *ConfigLocal) KBFSOps() KBFSOps {
	c.lock.RLock()
	defer c.lock.RUnlock()
	return c.kbfs
}