Hello, Eskimo,
When dealing with stringly-typed APIs, like the notification APIs, you have to understand that the only supported strings are those documented by Apple, either by way of a string constant in the headers or explicitly in the documentation. Observing some random string may work today, but it’s not something that we consider API and thus it may stop working in the future.
So, to create a program that will work in the long term, you must restrict yourself to documented notification names.
Of course. But when I supply nil as value of name I should receive all notifications (by documentation), right?
the answer depends on the context. Are you creating a security product? If not, why do you need to know about these events?
Oh, and are you targeting the Mac App Store? Or independent distribution using Developer ID?
We should be able to run some 'job' on this event. User will can choose which event should be a trigger. We distribute our product by self and can't distribute it via AppStore because of we have a daemon. But it's not a problem for our customers.
I'm not sure that observing on user's log off or lock screen is very insecure thing.
So, can You help me please?
Post
Replies
Boosts
Views
Activity
In our legacy code we had
#pragma pack ( push )
#pragma pack ( 1 )
before and
#pragma pack ( pop )
after CTcpThread class declaration. So, problem was in legacy code with memory alignment preprocessor directives.
These directives were added in year 2011 originally for Linux, but without #ifdef ____linux____ somewhy.
Beyond that, I have a quick test you can run: If you build your installer plug-in for arm64e (as opposed to arm64), how does it behave?
Unfortunately issue still reproduces :(
Regardless of what else you do here, you should file a bug about this.
Bug number is FB8859425
this post is duplicate of https://developer.apple.com/forums/thread/653347
Can Apple's Systems Engineer add something to information in post on stackoverflow?
https://stackoverflow.com/questions/20752254/using-mdm-to-configure-an-enterprise-app-via-nsuserdefaults
I want to believe you know more about using mobileconfig in applications
Thanks
Does any API (for C or Obj-C) exist for that, maybe? And official or not so documentation about it?
It's possible without determining of profile's path? Is possible just determine that required profile is deployed and then get from it some 'fields' ?
Are you wanting to know this information on macOS, iOS, iPadOS or tvOS? I apologize, I was meant macOS
Also to clarify your question, you have app on your device and you want
that app to determine if the device is enrolled in MDM or not, correct? Yes, I think it's correct. And also I need to read some information from that MDM profile - in this profile will be stored some settings for my app
I need mounted SMB shares from user. To make sure SMB are always mounted when I need, I want to mount them myself. So, I ask password from User and try to mount SMB share via my daemon (working by root user).I tried to use nsmb.conf, but it doesn't work. In manual pages of written:-NDo not ask for a password. At run time, mount_smbfs reads the ~/Library/Preferences/nsmb.conf file for additional configuration parameters and a password. If no password is found, mount_smbfs prompts for it.but here are all parameters of nsmb.conf described in manual pages of nsmb.conf:Possible keywords may include:KeywordSectionDefaultComment A B CValuesaddr- + - DNS name or IP address of servernbtimeout+ + -1sTimeout for resolving a NetBIOS nameminauth+ + -NTLMv2Minimum authentication level allowedport445+ + -bothHow to use SMB TCP/UDP portsstreams+ + +yesUse NTFS Streams if server supportedsoft+ + + Make the mount softnotify_off+ + +noTurn off using notificationskloglevel+ - -0Turn on smb kernel loggingprotocol_vers_map + - -7Bitmap of SMB Versions that are enabledsigning_required+ - -noTurn on smb client signingsigning_req_vers+ - -6Bitmap of SMB Versions that have signing requiredvalidate_neg_off+ - -noTurn off using validate negotiatemax_resp_timeout+ + -30sMax time to wait for any response from serversubmounts_off+ + +noTurn off using submountsdir_cache_async_cnt + + -10Max async queries to fill dir cachedir_cache_max+ + -60sMax time to cache for a dirdir_cache_min+ + -30sMin time to cache for a dirSo, threre is not parameter "password", maybe therefore it doesn't workNetFSMountURLAsync and NetFSMountURLSync from NetFS.framework it's exactly what I need, thanks a lot!/*
* Given a URL that refers to a file server, connect to that server
* and mount stuff.
*
* If the URL just specifies a server and you can't just mount the
* "root directory" of the server, the user will be prompted with
* a window to let them select one or more items to mount from that
* server, otherwise whatever item the URL specifies to mount will
* be mounted.
*
* If the mountpath is provided it will be used as the mount point.
* If the mountpath is set to NULL, a default mount point will be used.
*
* If the user and passwd are set, they will override any user name
* or password that may be set in the URL. These calls go through the NetAuth agent.
* If the URL doesn't specify a password, and one is needed, the
* user will be prompted with a window requesting password.
*
* Options can be provided for the session open and the mount itself.
* If the mount is successful, the POSIX path to each mountpoint is
* returned as a CFStringRef in mountpoints.
*
* If the return value is zero the mount has succeeded.
*
* A positive non-zero return value represents an errno value
* (see /usr/include/sys/errno.h). For instance, a missing mountpoint
* error will be returned as ENOENT (2).
*
* A negative non-zero return value represents an OSStatus error.
* For instance, error -128 is userCanceledErr, returned when a mount
* operation is canceled by the user. These OSStatus errors are
* extended to include:
*
* from this header:
* ENETFSPWDNEEDSCHANGE -5045
* ENETFSPWDPOLICY -5046
* ENETFSACCOUNTRESTRICTED -5999
* ENETFSNOSHARESAVAIL -5998
* ENETFSNOAUTHMECHSUPP -5997
* ENETFSNOPROTOVERSSUPP -5996
*
* from
* kNetAuthErrorInternal -6600
* kNetAuthErrorMountFailed -6602
* kNetAuthErrorNoSharesAvailable -6003
* kNetAuthErrorGuestNotSupported -6004
* kNetAuthErrorAlreadyClosed -6005
*
*/
NETFS_EXPORT int
NetFSMountURLSync(
CFURLRef url, // URL to mount, e.g. nfs://server/path
CFURLRef mountpath, // Path for the mountpoint
CFStringRef user, // Auth user name (overrides URL)
CFStringRef passwd, // Auth password (overrides URL)
CFMutableDictionaryRef open_options, // Options for session open (see below)
CFMutableDictionaryRef mount_options, // Options for mounting (see below)
CFArrayRef *mountpoints) // Array of mountpoints
__OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_NA);I checked NetFSMountURLSync works, thanks!
All can be be changed - Volume UUID, Filesystem UUID. Maybe Disk UUID will always the same, I don't know - it may depends on OS.One thing is important - how this device tree will used and what elements of this tree most important. For me really important are filesystems, because volume (disk/partition) without filesystem can't present data as files and directories.If you need to collect only devices - OK, it is true, you can don't care about filesystems. But when filesystem is missing a disk will present in system, but you can't mount it (because really you can mount filesystem - not a volume) and user will can't get data from it (can, but only binary blob).Yes, I know that exist some filesystems which use few volumes - BTRFS for example. In this case managing of filesystems is more logical right too, IMHO. Because finally you need filesystems to get data from volumes. Volumes are intended just for storing filesystems 🙂 You can do "mount <filesystem UUID>" and you mount all volumes with this filesystem, but you can do "mount volume1_with_path_of_fs" and you mount only part filesystem which can be stored on few volumes (I didn't check it in macOS but it is true for Linux).So, I still think that knowledge about filesystems of volumes is important (at least for me)
Yes, I know how GPT works 🙂The Volume UUID reported by diskutil matches the value returned by DiskArbitration for the kDADiskDescriptionVolumeUUIDKey property. For example:import DiskArbitration func uuidForDisk(_ bsdName: String) -> UUID? { guard let session = DASessionCreate(nil), let disk = DADiskCreateFromBSDName(nil, session, bsdName), let descCF = DADiskCopyDescription(disk), let desc = descCF as? [String:Any], let uuidCF = desc[kDADiskDescriptionVolumeUUIDKey as String] as CFTypeRef?, CFGetTypeID(uuidCF) == CFUUIDGetTypeID(), let uuidStr = CFUUIDCreateString(nil, (uuidCF as! CFUUID)) as String?, let uuid = UUID(uuidString: uuidStr) else { return nil } return uuid } For Apple file systems (like APFS and HFS Plus) this UUID is stored on the volume. The VFS plug-in makes it available to the rest of the system via ATTR_VOL_UUID (see the getattrlist man page).Thanks! I hope I also can make it in C 🙂If that entry is missing, I believe that our exFAT VFS plug-in will synthesise a UUID by hashing the volume serial number.Make sense, I thought so tooThank you
I just want to build tree of block devices.Most filesystems have UUID. It can be used for identifying what filesystem should be mounted (for example). Usually this UUID stored in filesystem. So, this UUID of in case exFAT is not depends on OS.I understand that "9CAD-0C6D" is not true UUID, but it is some ID, right? I thinks this ID should be the same in Linux, macOS, UnixWhen I write "programatically" I mean "via API" (preferably). I read IO Registry via IOKit framework and I post here output from ioreg utility just for inspecting results which I can take from IO Registry.I understand that I can ignore it, but maybe somebody know more about these diferrences 🙂