Exemplo n.º 1
0
int getFileSharingStatus() {
  Boolean fileServerStatus, fileServerPersistence = false;
  Boolean smbStatus, smbPersistence = false;

  smbStatus = SMJobIsEnabled(
      kSMDomainSystemLaunchd, CFSTR("com.apple.smbd"), &smbPersistence);
  fileServerStatus = SMJobIsEnabled(kSMDomainSystemLaunchd,
                                    CFSTR("com.apple.AppleFileServer"),
                                    &fileServerPersistence);
  return smbStatus | fileServerStatus;
}
Exemplo n.º 2
0
int getScreenSharingStatus() {
  Boolean persistence = false;
  if (remoteAppleManagementPlistExists()) {
    return 0;
  }
  return SMJobIsEnabled(
      kSMDomainSystemLaunchd, CFSTR("com.apple.screensharing"), &persistence);
}
Exemplo n.º 3
0
int
main(int argc, char *argv[])
{
		int quiet = 0;
		Boolean persistent;
		
		int enabled =  SMJobIsEnabled(kSMDomainSystemLaunchd, CFSTR("com.openssh.sshd"), &persistent);
		
		if ((argc == 2) && strncmp(argv[1], "-q", 3)) {
				quiet = 1;
		}
		
		if (!quiet) {
				printf("Remote Login: %s\n", (enabled ? "on": "off"));
		}
		
		return enabled;
}
Exemplo n.º 4
0
int getDiscSharingStatus() {
  Boolean persistence = false;
  return SMJobIsEnabled(
      kSMDomainSystemLaunchd, CFSTR("com.apple.ODSAgent"), &persistence);
}
Exemplo n.º 5
0
int getRemoteAppleEventStatus() {
  Boolean persistence = false;
  return SMJobIsEnabled(
      kSMDomainSystemLaunchd, CFSTR("com.apple.AEServer"), &persistence);
}
Exemplo n.º 6
0
int getRemoteLoginStatus() {
  Boolean persistence = false;
  return SMJobIsEnabled(
      kSMDomainSystemLaunchd, CFSTR("com.openssh.sshd"), &persistence);
}