]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSMacOSX/PreferencePane/PrivilegedOperations.h
mDNSResponder-107.1.tar.gz
[apple/mdnsresponder.git] / mDNSMacOSX / PreferencePane / PrivilegedOperations.h
1 /*
2 File: PrivilegedOperations.h
3
4 Abstract: Interface to "ddnswriteconfig" setuid root tool.
5
6 Copyright: (c) Copyright 2005 Apple Computer, Inc. All rights reserved.
7
8 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
9 ("Apple") in consideration of your agreement to the following terms, and your
10 use, installation, modification or redistribution of this Apple software
11 constitutes acceptance of these terms. If you do not agree with these terms,
12 please do not use, install, modify or redistribute this Apple software.
13
14 In consideration of your agreement to abide by the following terms, and subject
15 to these terms, Apple grants you a personal, non-exclusive license, under Apple's
16 copyrights in this original Apple software (the "Apple Software"), to use,
17 reproduce, modify and redistribute the Apple Software, with or without
18 modifications, in source and/or binary forms; provided that if you redistribute
19 the Apple Software in its entirety and without modifications, you must retain
20 this notice and the following text and disclaimers in all such redistributions of
21 the Apple Software. Neither the name, trademarks, service marks or logos of
22 Apple Computer, Inc. may be used to endorse or promote products derived from the
23 Apple Software without specific prior written permission from Apple. Except as
24 expressly stated in this notice, no other rights or licenses, express or implied,
25 are granted by Apple herein, including but not limited to any patent rights that
26 may be infringed by your derivative works or by other works in which the Apple
27 Software may be incorporated.
28
29 The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
30 WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
31 WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
32 PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
33 COMBINATION WITH YOUR PRODUCTS.
34
35 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
36 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
37 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
39 OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
40 (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
41 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42
43 Change History (most recent first):
44 $Log: PrivilegedOperations.h,v $
45 Revision 1.3 2005/02/16 00:17:35 cheshire
46 Don't create empty arrays -- CFArrayGetValueAtIndex(array,0) returns an essentially random (non-null)
47 result for empty arrays, which can lead to code crashing if it's not sufficiently defensive.
48
49 Revision 1.2 2005/02/10 22:35:20 cheshire
50 <rdar://problem/3727944> Update name
51
52 Revision 1.1 2005/02/05 01:59:19 cheshire
53 Add Preference Pane to facilitate testing of DDNS & wide-area features
54
55 */
56
57 #include <CoreServices/CoreServices.h>
58 #include <CoreFoundation/CoreFoundation.h>
59
60 #define PRIV_OP_TOOL_VERS 2
61
62 #define kToolHome "/Library/Application Support/"
63 #define kToolDir "Bonjour"
64 #define kToolName "ddnswriteconfig"
65 #define kToolPath kToolHome kToolDir "/" kToolName
66
67 #define SC_DYNDNS_SETUP_KEY CFSTR("Setup:/Network/DynamicDNS")
68 #define SC_DYNDNS_STATE_KEY CFSTR("State:/Network/DynamicDNS")
69 #define SC_DYNDNS_REGDOMAINS_KEY CFSTR("RegistrationDomains")
70 #define SC_DYNDNS_BROWSEDOMAINS_KEY CFSTR("BrowseDomains")
71 #define SC_DYNDNS_HOSTNAMES_KEY CFSTR("HostNames")
72 #define SC_DYNDNS_DOMAIN_KEY CFSTR("Domain")
73 #define SC_DYNDNS_KEYNAME_KEY CFSTR("KeyName")
74 #define SC_DYNDNS_SECRET_KEY CFSTR("Secret")
75 #define SC_DYNDNS_ENABLED_KEY CFSTR("Enabled")
76 #define SC_DYNDNS_STATUS_KEY CFSTR("Status")
77 #define DYNDNS_KEYCHAIN_DESCRIPTION "Dynamic DNS Key"
78
79
80 OSStatus EnsureToolInstalled(void);
81 OSStatus WriteRegistrationDomain(CFDataRef domainArrayData);
82 OSStatus WriteBrowseDomain(CFDataRef domainArrayData);
83 OSStatus WriteHostname(CFDataRef domainArrayData);
84 OSStatus SetKeyForDomain(CFDataRef secretData);