2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * Server Service RPC (SRVSVC) server-side interface definition. 2N/A * The server service provides a remote administration interface. 2N/A * This service uses NERR/Win32 error codes rather than NT status 2N/A "SRVSVC",
/* name */ 2N/A "Server services",
/* desc */ 2N/A "\\srvsvc",
/* endpoint */ 2N/A "4b324fc8-1670-01d3-1278-5a47bf6ee188",
3,
/* abstract */ 2N/A 0,
/* no bind_instance_size */ 2N/A 0,
/* no bind_req() */ 2N/A 0,
/* no unbind_and_close() */ 2N/A 0,
/* use generic_call_stub() */ 2N/A * This function registers the SRVSVC RPC interface with the RPC runtime 2N/A * library. It must be called in order to use either the client side 2N/A * or the server side functions. 2N/A * Turn "dfsroot" property on/off for the specified 2N/A * share and save it. 2N/A * If the requested value is the same as what is already 2N/A * set then no change is required and the function returns. 2N/A * srvsvc_s_NetConnectEnum 2N/A * List tree connections made to a share on this server or all tree 2N/A * connections established from a specific client. Administrator, 2N/A * Server Operator, Print Operator or Power User group membership 2N/A * is required to use this interface. 2N/A * There are three information levels: 0, 1, and 50. We don't support 2N/A * level 50, which is only used by Windows 9x clients. 2N/A * It seems Server Manger (srvmgr) only sends workstation as the qualifier 2N/A * and the Computer Management Interface on Windows 2000 doesn't request 2N/A * a list of connections. 2N/A * ERROR_SUCCESS Success 2N/A * ERROR_ACCESS_DENIED Caller does not have access to this call. 2N/A * ERROR_INVALID_PARAMETER One of the parameters is invalid. 2N/A * ERROR_INVALID_LEVEL Unknown information level specified. 2N/A * ERROR_MORE_DATA Partial date returned, more entries available. 2N/A * ERROR_NOT_ENOUGH_MEMORY Insufficient memory is available. 2N/A * NERR_NetNameNotFound The share qualifier cannot be found. 2N/A * NERR_BufTooSmall The supplied buffer is too small. 2N/A * Allocate memory and estimate the number of objects that can 2N/A * be returned for NetConnectEnum level 0. 2N/A * Allocate memory and estimate the number of objects that can 2N/A * be returned for NetConnectEnum level 1. 2N/A * Request a list of connections from the kernel and set up 2N/A * the connection information to be returned to the client. 2N/A * srvsvc_netconnect_qualifier 2N/A * The qualifier is a string that specifies a share name or computer name 2N/A * for the connections of interest. If it is a share name then all the 2N/A * connections made to that share name are listed. If it is a computer 2N/A * name (it starts with two backslash characters), then NetConnectEnum 2N/A * lists all connections made from that computer to the specified server. 2N/A * srvsvc_s_NetFileEnum 2N/A * Return information on open files or named pipes. Only members of the 2N/A * Administrators or Server Operators local groups are allowed to make 2N/A * this call. Currently, we only support Administrators. 2N/A * If basepath is null, all open resources are enumerated. If basepath 2N/A * is non-null, only resources that have basepath as a prefix should 2N/A * If username is specified (non-null), only files opened by username 2N/A * should be returned. 2N/A * 1. We don't validate the servername because we would have to check 2N/A * all primary IPs and the ROI seems unlikely to be worth it. 2N/A * 2. Both basepath and username are currently ignored because both 2N/A * Server Manger (NT 4.0) and CMI (Windows 2000) always set them to null. 2N/A * The level of information requested may be one of: 2N/A * 2 Return the file identification number. 2N/A * This level is not supported on Windows Me/98/95. 2N/A * 3 Return information about the file. 2N/A * This level is not supported on Windows Me/98/95. 2N/A * 50 Windows Me/98/95: Return information about the file. 2N/A * If pref_max_len is unlimited and resume_handle is null, the client 2N/A * expects to receive all data in a single call. 2N/A * If we are unable to do fit all data in a single response, we would 2N/A * normally return ERROR_MORE_DATA with a partial list. 2N/A * Unfortunately, when both of these conditions occur, Server Manager 2N/A * pops up an error box with the message "more data available" and 2N/A * doesn't display any of the returned data. In this case, it is 2N/A * probably better to return ERROR_SUCCESS with the partial list. 2N/A * Windows 2000 doesn't have this problem because it always sends a 2N/A * non-null resume_handle. 2N/A * ERROR_SUCCESS Success 2N/A * ERROR_ACCESS_DENIED Caller does not have access to this call. 2N/A * ERROR_INVALID_PARAMETER One of the parameters is invalid. 2N/A * ERROR_INVALID_LEVEL Unknown information level specified. 2N/A * ERROR_MORE_DATA Partial date returned, more entries available. 2N/A * ERROR_NOT_ENOUGH_MEMORY Insufficient memory is available. 2N/A * NERR_BufTooSmall The supplied buffer is too small. 2N/A * Build level 2 file information. 2N/A * SMB fids are 16-bit values but this interface expects 32-bit file ids. 2N/A * So we use the uniqid here. 2N/A * On success, the caller expects that the info2, fi2 and entries_read 2N/A * fields have been set up. 2N/A * Build level 3 file information. 2N/A * SMB fids are 16-bit values but this interface expects 32-bit file ids. 2N/A * So we use the uniqid here. 2N/A * On success, the caller expects that the info3, fi3 and entries_read 2N/A * fields have been set up. 2N/A * srvsvc_s_NetFileClose 2N/A * NetFileClose forces a file to close. This function can be used when 2N/A * an error prevents closure by other means. Use NetFileClose with 2N/A * caution because it does not flush data, cached on a client, to the 2N/A * file before closing the file. 2N/A * SMB fids are 16-bit values but this interface expects 32-bit file ids. 2N/A * So we use the uniqid here. 2N/A * ERROR_SUCCESS Operation succeeded. 2N/A * ERROR_ACCESS_DENIED Operation denied. 2N/A * NERR_FileIdNotFound No open file with the specified id. 2N/A * Note: MSDN suggests ERROR_FILE_NOT_FOUND for NetFileClose but network 2N/A * captures using NT show NERR_FileIdNotFound, which is consistent with 2N/A * the NetFileClose2 page on MSDN. 2N/A * srvsvc_s_NetShareGetInfo 2N/A * Returns Win32 error codes. 2N/A * srvsvc_s_NetShareSetInfo 2N/A * This call is made by SrvMgr to set share information. 2N/A * Only power users groups can manage shares. 2N/A * To avoid misleading errors, we don't report an error 2N/A * when a FS doesn't support ACLs on shares. 2N/A * Returns Win32 error codes. 2N/A * We don't limit the maximum number of concurrent 2N/A * connections to a share. 2N/A * Update transient shares. This includes autohome shares. 2N/A * srvsvc_update_share_flags 2N/A * This function updates flags for shares. 2N/A * Flags for Persistent shares are updated in both libshare and the local cache. 2N/A * Flags for Transient shares are updated only in the local cache. 2N/A * Default to CSC_CACHE_MANUAL_REINT. 2N/A /* if 'smb' zfs property: shortnames=disabled */ 2N/A * srvsvc_s_NetSessionEnum 2N/A * Level 1 request is made by (Server Manager (srvmgr) on NT Server when 2N/A * the user info icon is selected. 2N/A * On success, the return value is NERR_Success. 2N/A * On error, the return value can be one of the following error codes: 2N/A * ERROR_ACCESS_DENIED The user does not have access to the requested 2N/A * ERROR_INVALID_LEVEL The value specified for the level is invalid. 2N/A * ERROR_INVALID_PARAMETER The specified parameter is invalid. 2N/A * ERROR_MORE_DATA More entries are available. Specify a large 2N/A * enough buffer to receive all entries. 2N/A * ERROR_NOT_ENOUGH_MEMORY Insufficient memory is available. 2N/A * NERR_ClientNameNotFound A session does not exist with the computer name. 2N/A * NERR_InvalidComputer The computer name is invalid. 2N/A * NERR_UserNotFound The user name could not be found. 2N/A * srvsvc_s_NetSessionDel 2N/A * Ends a network session between a server and a workstation. 2N/A * On NT only members of the Administrators or Account Operators 2N/A * local groups are permitted to use NetSessionDel. 2N/A * If unc_clientname is NULL, all sessions associated with the 2N/A * specified user will be disconnected. 2N/A * If username is NULL, all sessions from the specified client 2N/A * will be disconnected. 2N/A * On failure, the return value can be one of the following errors: 2N/A * ERROR_ACCESS_DENIED The user does not have access to the 2N/A * requested information. 2N/A * ERROR_INVALID_PARAMETER The specified parameter is invalid. 2N/A * ERROR_NOT_ENOUGH_MEMORY Insufficient memory is available. 2N/A * NERR_ClientNameNotFound A session does not exist with that 2N/A * The following level 102 fields are defaulted to zero 2N/A * by virtue of the call to bzero above. 2N/A#
endif /* SRVSVC_SATISFY_SMBTORTURE */ 2N/A#
endif /* SRVSVC_SATISFY_SMBTORTURE */ 2N/A * Returns information about the time of day on this server. 2N/A * typedef struct _TIME_OF_DAY_INFO { 2N/A * DWORD tod_elapsedt; // seconds since 00:00:00 January 1 1970 GMT 2N/A * DWORD tod_msecs; // arbitrary milliseconds (since reset) 2N/A * DWORD tod_hours; // current hour [0-23] 2N/A * DWORD tod_mins; // current minute [0-59] 2N/A * DWORD tod_secs; // current second [0-59] 2N/A * DWORD tod_hunds; // current hundredth (0.01) second [0-99] 2N/A * LONG tod_timezone; // time zone of the server 2N/A * DWORD tod_tinterval; // clock tick time interval 2N/A * DWORD tod_day; // day of the month [1-31] 2N/A * DWORD tod_month; // month of the year [1-12] 2N/A * DWORD tod_year; // current year 2N/A * DWORD tod_weekday; // day of the week since Sunday [0-6] 2N/A * } TIME_OF_DAY_INFO; 2N/A * The time zone of the server is calculated in minutes from Greenwich 2N/A * Mean Time (GMT). For time zones west of Greenwich, the value is 2N/A * positive; for time zones east of Greenwich, the value is negative. 2N/A * A value of -1 indicates that the time zone is undefined. 2N/A * Determine offset from GMT. If daylight saving time use altzone, 2N/A * otherwise use timezone. 2N/A * The clock tick value represents a resolution of one ten-thousandth 2N/A * srvsvc_s_NetNameValidate 2N/A * Perform name validation. 2N/A * Returns Win32 error codes. 2N/A * srvsvc_s_NetShareAdd 2N/A * Add a new share. Only power users groups can manage shares. 2N/A * This interface is used by the rmtshare command from the NT resource 2N/A * kit. Rmtshare allows a client to add or remove shares on a server 2N/A * from the client's command line. 2N/A * Returns Win32 error codes. 2N/A * Derive the real path which will be stored in the 2N/A * directory field of the smb_share_t structure 2N/A * from the path field in this RPC request. 2N/A * srvsvc_get_realpath 2N/A * Derive the real path for a share from the path provided by a client. 2N/A * For instance, the real path of C:\ may be /cvol or the real path of 2N/A * clntpath - path provided by the Windows client is in the 2N/A * format of <drive letter>:\<dir> 2N/A * realpath - path that will be stored as the directory field of 2N/A * the smb_share_t structure of the share. 2N/A * maxlen - maximum length of the realpath buffer 2N/A * Return LAN Manager network error code. 2N/A * srvsvc_estimate_limit 2N/A * Estimate the number of objects that will fit in prefmaxlen. 2N/A * nlimit is adjusted here. 2N/A * Enumerate all shares (see also NetShareEnumSticky). 2N/A * Request for various levels of information about our shares. 2N/A * Level 0: share names. 2N/A * Level 1: share name, share type and comment field. 2N/A * Level 2: everything that we know about the shares. 2N/A * Level 501: level 1 + flags. 2N/A * Level 502: level 2 + security descriptor. 2N/A * Enumerate sticky shares: all shares except those marked STYPE_SPECIAL. 2N/A * Except for excluding STYPE_SPECIAL shares, NetShareEnumSticky is the 2N/A * same as NetShareEnum. 2N/A * Request for various levels of information about our shares. 2N/A * Level 0: share names. 2N/A * Level 1: share name, share type and comment field. 2N/A * Level 2: everything that we know about the shares. 2N/A * Level 501: not valid for this request. 2N/A * Level 502: level 2 + security descriptor. 2N/A * We set n_skip to resume_handle, which is used to find the appropriate 2N/A * place to resume. The resume_handle is similar to the readdir cookie. 2N/A * mlsvc_NetShareEnumCommon 2N/A * Build the levels 0, 1, 2, 501 and 502 share information. This function 2N/A * is called by the various NetShareEnum levels for each share. If 2N/A * we cannot build the share data for some reason, we return an error 2N/A * but the actual value of the error is not important to the caller. 2N/A * The caller just needs to know not to include this info in the RPC 2N/A * ERROR_NOT_ENOUGH_MEMORY 2N/A * ERROR_INVALID_LEVEL 2N/Astatic int /*ARGSUSED*/ 2N/A * Delete a share. Only members of the Administrators, Server Operators 2N/A * or Power Users local groups are allowed to delete shares. 2N/A * This interface is used by the rmtshare command from the NT resource 2N/A * kit. Rmtshare allows a client to add or remove shares on a server 2N/A * from the client's command line. 2N/A * Returns Win32 error codes. 2N/A * srvsvc_s_NetGetFileSecurity 2N/A * Right now, just returns ERROR_ACCESS_DENIED, because we cannot 2N/A * get the requested SD here in RPC code. 2N/A * srvsvc_s_NetSetFileSecurity 2N/A * Set the given security descriptor for the requested file/folder 2N/A * Right now, just returns ERROR_ACCESS_DENIED, because we cannot 2N/A * set the requested SD here in RPC code. 2N/A * Check whether or not there is a restriction on a share. Restricted 2N/A * shares are generally STYPE_SPECIAL, for example, IPC$. All the 2N/A * administration share names are restricted: C$, D$ etc. Returns B_TRUE 2N/A * if the share is restricted. Otherwise B_FALSE is returned to indicate 2N/A * that there are no restrictions. 2N/A * Check whether or not access to the share should be restricted to 2N/A * administrators. This is a bit of a hack because what we're doing 2N/A * is checking for the default admin shares: C$, D$ etc.. There are 2N/A * other shares that have restrictions: see srvsvc_share_is_restricted(). 2N/A * Returns B_TRUE if the shares is an admin share. Otherwise B_FALSE 2N/A * is returned to indicate that there are no restrictions. 2N/A * get mntpnt from path 2N/A * (mntpnt must be freed when done.) 2N/A * Stores the given share in sharemgr 2N/A * Removes the share via libshare 2N/A * Remove the SMB properties from the share. 2N/A * If there are no other protocols enabled for this share, 2N/A * remove it, otherwise save it. 2N/A * Update the share information. 2N/A * remove share description if it exists 2N/A * description has been added or modified 2N/A * info contains new name, update share 2N/A * share has been updated, save and publish 2N/A * share was renamed, unpublish and remove old share 2N/A * Sets the share properties. 2N/A * Updates the smb protocol properties of the share. 2N/A * The properties are given as a list of name-value pair. 2N/A * The name argument should be the optionset property name and the value 2N/A * should be a valid value for the specified property. 2N/A * validate and update share