diff options
author | Jeremy Allison <jra@samba.org> | 2002-02-01 23:31:31 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-02-01 23:31:31 +0000 |
commit | 57511c6d7dc8c508acdea3a3e87c94426c9d13f3 (patch) | |
tree | 7b451dc5a9280ed47a8b93f4e5dcceb39f14c198 /examples | |
parent | 7d8f52ac8f2d79cf9694bb1774f55b4ccdca5e39 (diff) | |
download | samba-57511c6d7dc8c508acdea3a3e87c94426c9d13f3.tar.gz samba-57511c6d7dc8c508acdea3a3e87c94426c9d13f3.tar.xz samba-57511c6d7dc8c508acdea3a3e87c94426c9d13f3.zip |
Sync for release.
Jeremy.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/LDAP/samba.schema | 93 | ||||
-rw-r--r-- | examples/libsmbclient/testsmbc.c | 126 |
2 files changed, 64 insertions, 155 deletions
diff --git a/examples/LDAP/samba.schema b/examples/LDAP/samba.schema index d62423458e7..28828f4f940 100644 --- a/examples/LDAP/samba.schema +++ b/examples/LDAP/samba.schema @@ -3,12 +3,16 @@ ## Schema for storing Samba's smbpasswd file in LDAP ## OIDs are owned by the Samba Team ## -## Prerequisite schemas - uid & uidNumber (nis.schema) +## Prerequisite schemas - uid (cosine.schema) +## - displayName (inetorgperson.schema) ## ## 1.3.1.5.1.4.1.7165.2.1.x - attributetypes ## 1.3.1.5.1.4.1.7165.2.2.x - objectclasses ## +## +## Password hashes +## attributetype ( 1.3.6.1.4.1.7165.2.1.1 NAME 'lmPassword' DESC 'LanManager Passwd' EQUALITY caseIgnoreIA5Match @@ -19,41 +23,50 @@ attributetype ( 1.3.6.1.4.1.7165.2.1.2 NAME 'ntPassword' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE ) -attributetype ( 1.3.6.1.4.1.7165.2.1.3 NAME 'pwdLastSet' - DESC 'NT pwdLastSet' - EQUALITY caseIgnoreIA5Match - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE ) - +## +## Account flags in string format ([UWDX ]) +## attributetype ( 1.3.6.1.4.1.7165.2.1.4 NAME 'acctFlags' DESC 'Account Flags' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{16} SINGLE-VALUE ) +## +## Password timestamps & policies +## +attributetype ( 1.3.6.1.4.1.7165.2.1.3 NAME 'pwdLastSet' + DESC 'NT pwdLastSet' + EQUALITY integerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) + attributetype ( 1.3.6.1.4.1.7165.2.1.5 NAME 'logonTime' DESC 'NT logonTime' - EQUALITY caseIgnoreIA5Match - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE ) + EQUALITY integerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.6 NAME 'logoffTime' DESC 'NT logoffTime' - EQUALITY caseIgnoreIA5Match - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE ) + EQUALITY integerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.7 NAME 'kickoffTime' DESC 'NT kickoffTime' - EQUALITY caseIgnoreIA5Match - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE ) + EQUALITY integerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.8 NAME 'pwdCanChange' DESC 'NT pwdCanChange' - EQUALITY caseIgnoreIA5Match - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE ) + EQUALITY integerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.7165.2.1.9 NAME 'pwdMustChange' DESC 'NT pwdMustChange' - EQUALITY caseIgnoreIA5Match - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{32} SINGLE-VALUE ) + EQUALITY integerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) +## +## string settings +## attributetype ( 1.3.6.1.4.1.7165.2.1.10 NAME 'homeDrive' DESC 'NT homeDrive' EQUALITY caseIgnoreIA5Match @@ -74,24 +87,28 @@ attributetype ( 1.3.6.1.4.1.7165.2.1.13 NAME 'userWorkstations' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{255} SINGLE-VALUE ) -attributetype ( 1.3.6.1.4.1.7165.2.1.14 NAME 'rid' - DESC 'NT rid' +attributetype ( 1.3.6.1.4.1.7165.2.1.17 NAME 'smbHome' + DESC 'smbHome' EQUALITY caseIgnoreIA5Match - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{255} SINGLE-VALUE ) + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} ) -attributetype ( 1.3.6.1.4.1.7165.2.1.15 NAME 'primaryGroupID' - DESC 'NT Group RID' +attributetype ( 1.3.6.1.4.1.7165.2.1.18 NAME 'domain' + DESC 'Windows NT domain to which the user belongs' EQUALITY caseIgnoreIA5Match - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{255} SINGLE-VALUE ) + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} ) -attributetype ( 1.3.6.1.4.1.7165.2.1.16 NAME 'displayName' - DESC 'Friendly User Name' - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{255} SINGLE-VALUE ) +## +## user and group RID +## +attributetype ( 1.3.6.1.4.1.7165.2.1.14 NAME 'rid' + DESC 'NT rid' + EQUALITY integerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) -attributetype ( 1.3.6.1.4.1.7165.2.1.17 NAME 'smbHome' - DESC 'smbHome' - EQUALITY caseIgnoreIA5Match - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{128} ) +attributetype ( 1.3.6.1.4.1.7165.2.1.15 NAME 'primaryGroupID' + DESC 'NT Group RID' + EQUALITY integerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE ) ## ## The smbPasswordEntry objectclass has been depreciated in favor of the @@ -104,8 +121,20 @@ attributetype ( 1.3.6.1.4.1.7165.2.1.17 NAME 'smbHome' objectclass ( 1.3.1.5.1.4.1.7165.2.2.2 NAME 'sambaAccount' SUP top STRUCTURAL DESC 'Samba Account' - MUST ( uid $ uidNumber ) - MAY ( cn $ gidNumber $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $ + MUST ( uid $ rid ) + MAY ( cn $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $ logoffTime $ kickoffTime $ pwdCanChange $ pwdMustChange $ acctFlags $ displayName $ smbHome $ homeDrive $ scriptPath $ profilePath $ - description $ userWorkstations $ rid $ primaryGroupID )) + description $ userWorkstations $ primaryGroupID $ domain )) + +## +## Used for Winbind experimentation +## +objectclass ( 1.3.1.5.1.4.1.7165.1.2.2.3 NAME 'uidPool' SUP top AUXILIARY + DESC 'Pool for allocating UNIX uids' + MUST ( uidNumber $ cn ) ) + +objectclass ( 1.3.1.5.1.4.1.7165.1.2.2.4 NAME 'gidPool' SUP top AUXILIARY + DESC 'Pool for allocating UNIX gids' + MUST ( gidNumber $ cn ) ) + diff --git a/examples/libsmbclient/testsmbc.c b/examples/libsmbclient/testsmbc.c index 7aae9d85616..f67c91073c6 100644 --- a/examples/libsmbclient/testsmbc.c +++ b/examples/libsmbclient/testsmbc.c @@ -95,74 +95,10 @@ int main(int argc, char *argv[]) if (argc > 1) { - /* Try to list the print jobs ... */ + if ((dh1 = smbc_opendir(argv[1]))<1) { - if (smbc_list_print_jobs("smb://samba/pclp", print_list_fn) < 0) { - - fprintf(stderr, "Could not list print jobs: %s, %d\n", strerror(errno), errno); - exit(1); - - } - - /* Try to delete the last job listed */ - - if (global_id > 0) { - - fprintf(stdout, "Trying to delete print job %u\n", global_id); - - if (smbc_unlink_print_job("smb://samba/pclp", global_id) < 0) { - - fprintf(stderr, "Failed to unlink job id %u, %s, %u\n", global_id, - strerror(errno), errno); - - exit(1); - - } - - } - - /* Try to print a file ... */ - - if (smbc_print_file("smb://samba/public/testfile2.txt", "smb://samba/pclp") < 0) { - - fprintf(stderr, "Failed to print job: %s %u\n", strerror(errno), errno); - exit(1); - - } - - /* Try to delete argv[1] as a file ... */ - - if (smbc_unlink(argv[1]) < 0) { - - fprintf(stderr, "Could not unlink: %s, %s, %d\n", - argv[1], strerror(errno), errno); - - exit(0); - - } - - if ((dh1 = smbc_opendir("smb://"))<1) { - - fprintf(stderr, "Could not open directory: smb://: %s\n", - strerror(errno)); - - exit(1); - - } - - if ((dh2 = smbc_opendir("smb://sambanet")) < 0) { - - fprintf(stderr, "Could not open directory: smb://sambanet: %s\n", - strerror(errno)); - - exit(1); - - } - - if ((dh3 = smbc_opendir("smb://samba")) < 0) { - - fprintf(stderr, "Could not open directory: smb://samba: %s\n", - strerror(errno)); + fprintf(stderr, "Could not open directory: %s: %s\n", + argv[1], strerror(errno)); exit(1); @@ -203,62 +139,6 @@ int main(int argc, char *argv[]) dirp = (char *)dirbuf; - if ((dirc = smbc_getdents(dh2, (struct smbc_dirent *)dirp, - sizeof(dirbuf))) < 0) { - - fprintf(stderr, "Problems getting directory entries: %s\n", - strerror(errno)); - - exit(1); - - } - - /* Now, process the list of names ... */ - - fprintf(stdout, "\nDirectory listing, size = %u\n", dirc); - - while (dirc > 0) { - - dsize = ((struct smbc_dirent *)dirp)->dirlen; - fprintf(stdout, "Dir Ent, Type: %u, Name: %s, Comment: %s\n", - ((struct smbc_dirent *)dirp)->smbc_type, - ((struct smbc_dirent *)dirp)->name, - ((struct smbc_dirent *)dirp)->comment); - - dirp += dsize; - (char *)dirc -= dsize; - - } - - dirp = (char *)dirbuf; - - if ((dirc = smbc_getdents(dh3, (struct smbc_dirent *)dirp, - sizeof(dirbuf))) < 0) { - - fprintf(stderr, "Problems getting directory entries: %s\n", - strerror(errno)); - - exit(1); - - } - - /* Now, process the list of names ... */ - - fprintf(stdout, "Directory listing, size = %u\n", dirc); - - while (dirc > 0) { - - dsize = ((struct smbc_dirent *)dirp)->dirlen; - fprintf(stdout, "\nDir Ent, Type: %u, Name: %s, Comment: %s\n", - ((struct smbc_dirent *)dirp)->smbc_type, - ((struct smbc_dirent *)dirp)->name, - ((struct smbc_dirent *)dirp)->comment); - - (char *)dirp += dsize; - (char *)dirc -= dsize; - - } - exit(1); } |