281N/A# The contents of this file are subject to the terms of the 281N/A# Common Development and Distribution License (the "License"). 281N/A# You may not use this file except in compliance with the License. 281N/A# See the License for the specific language governing permissions 281N/A# and limitations under the License. 281N/A# When distributing Covered Code, include this CDDL HEADER in each 281N/A# If applicable, add the following below this CDDL HEADER, with the 281N/A# fields enclosed by brackets "[]" replaced with your own identifying 281N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3158N/A# Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. 289N/A# NOTE: This module is inherently posix specific. Care is taken in the modules 289N/A# that use this module to not use it on other operating systems. 281N/A """ Solaris configuration file editor... make it easier to 281N/A modify Solaris line-oriented configuration files from actions """ 281N/A """ given self, return list of lines to be printed. 281N/A default impl preserves orignal + insertion order""" 281N/A """ returns dictionary of default string values - ignores 1507N/A """ update existing record, using orig values if missing 281N/A """ set value of record in file, replacing any previous def. 281N/A for any missing info, use defaults. Will insert new value """ 281N/A # bring in any missing values as defaults if not None 281N/A """ print out values in file format """ 281N/A """Manage the passwd and shadow together. Note that 281N/A {
"username" : (
1,
None),
1507N/A "gcos-field" : (
5,
"& User"),
281N/A {
"username" : (
1,
None),
281N/A "password" : (
2,
"*LK*"),
281N/A """ merge dbs... do passwd file first to get right passwd value""" 281N/A # ignore attempts to set passwd for passwd file 1507N/A """returns next free system (<=99) uid""" 281N/A """ manage the group file""" 281N/A {
"groupname" : (
1,
None),
1507N/A """returns next free system (<=99) gid""" 281N/A """"add named user to group; does not check if user exists""" 2003N/A # If the group isn't in the database, we'll add the user to the group, 2003N/A # but unless the group is being added in the same transaction, the group 2003N/A # won't have a gid, and essentially be inert on the system. 281N/A """ remove named user from group """ 281N/A """ return list of additional groups user belongs to """ 281N/A """ If a username is present in this file, it denies that user 281N/A the ability to use ftp""" 281N/A {
"username" : (
1,
None)
281N/A """ returns true if user is allowed to use FTP - ie is NOT in file""" 281N/A """ add specified user to file, removing ability to use ftp""" 281N/A """ remove specified user from file """ 1552N/A """Add or remove 'username' from the file to turn off or on the user's 1552N/A ability to ftp into the system. If 'value' is True, allow the user, and 1552N/A if False, deny the user. If the value matches what is already encoded, 281N/A """ manage the userattr file """ 281N/A {
"username" : (
1,
None),
281N/A """ return tokenized line, with attribute column a dictionary 281N/A """ print out string; replace attribute dictionary with proper 281N/A string and use base class to convert entire record to a string """