Compare commits

...

2 Commits

Author SHA1 Message Date
ncpfs archive import
ab78307868 Import ncpfs 2.0.5 2026-04-28 20:39:58 +02:00
ncpfs archive import
3019bba627 Import ncpfs 2.0.4 2026-04-28 20:39:58 +02:00
23 changed files with 632 additions and 57 deletions

BIN
.downloads/ncpfs-2.0.4.tgz Normal file

Binary file not shown.

BIN
.downloads/ncpfs-2.0.5.tgz Normal file

Binary file not shown.

19
Changes
View File

@@ -1,6 +1,25 @@
I only began this file with ncpfs-0.12. If you're interested in older
versions, you can find them on ftp.gwdg.de:/pub/linux/misc/ncpfs/old.
ncpfs-2.0.4 -> ncpfs-2.0.5
- Removed another bug in nwbpvalues.
- Cleaned up man/Makefile
- Some manpage typos fixed. Thanks to Jim Van Zandt
<jrv@mbunix.mitre.org>
- added nwrights
ncpfs-2.0.3 -> ncpfs-2.0.4
- Changed name of npasswd to nwpasswd, as npasswd collides with
RedHat. Thanks to Mike Slater <mslater@nfinity.com> for pointing me
at this one.
- Put '\r\n' into nwmsg, because sometimes it did not print
correctly. Thanks to Petr Vandrovec Ing. VTEI
<VANDROVE@vcnet.vc.cvut.cz> for this one.
- Improved the ELF Makefile for ELF support. Thanks to Uwe Bonnes
<bon@elektron.ikp.physik.th-darmstadt.de>.
- Removed a very embarassing bug in nwpvalues :-(.
- Added a some routines to nwbpvalues.
ncpfs-2.0.2 -> ncpfs-2.0.3
- Removed the kernel-2.0 directory. Linus took the patch into 2.0.8.
So, if you want to use long file name support, upgrade to Linux

View File

@@ -2,14 +2,17 @@
# Makefile for the linux ncp-filesystem routines.
#
VERSION = 2.0.3
VERSION = 2.0.5
# If you are using kerneld to autoload ncp support,
# uncomment this (kerneld is in linux since about 1.3.57):
#KERNELD = -DHAVE_KERNELD
# If your system is ELF, please uncomment the following line:
#HAVE_ELF=yes
# If your system is ELF, either also do a 'make install', or append the util/
# directory where the dynamic library resides to the environment
# variable LD_LIBRARY_PATH
HAVE_ELF=$(shell file `which gcc`|grep ELF >/dev/null && echo -n yes )
TOPDIR = $(shell pwd)
BINDIR = /usr/local/bin
@@ -28,6 +31,17 @@ export INCLUDES BINDIR INTERM_BINDIR SBINDIR KERNELD VERSION HAVE_ELF
all:
for i in $(SUBDIRS); do make -C $$i all; done
@if [ "$(HAVE_ELF)" = yes ] ;\
then \
echo ; echo ; echo ;\
echo Please add \'`pwd`/util\' to the environment ; \
echo variable LD_LIBRARY_PATH by executing ; \
echo ;\
echo export LD_LIBRARY_PATH=\"\$$LD_LIBRARY_PATH:`pwd`/util\" ; \
echo ;\
echo or do a \'make install\'. ;\
echo ;\
fi
dep:
for i in $(SUBDIRS); do make -C $$i dep; done

23
README
View File

@@ -3,11 +3,24 @@ some little utilities it also contains nprint, which enables you to
print on NetWare print queues. The opposite side, pserver, is also
provided.
I'm planning major changes in the structure of ncpfs for Linux 2.1.x
which will break the binary compatibility. So I changed the numbering
scheme for ncpfs. ncpfs-2.0.x will be the version to be used with
Linux 2.0.0 and older kernels, and ncpfs-2.1.x will be the version for
the development kernels.
ncpfs works with NetWare versions 3.x and following. It does NOT work
with NetWare version 2.x. Some of the NetWare look-alikes, such as
CD-ROM servers WinNT 3.51 Server are also NOT supported. This
restriction comes from the fact that ncpfs relies heavily on the name
space facilities NetWare supports since version 3. When you want to
mount volumes that have been exported by mars_nwe, you have to
activate the name space calls in mars_nwe's config.h file, although
probably it's more clever to use nfs between two Linux machines.
The user-space utilities such as nprint and the bindery utils should
work with all versions of NetWare.
ncpfs does NOT support access to the NDS, so if you want to mount
volumes exported by a NetWare 4.x server, you will have to install the
bindery emulation on that server. If you need access to the NDS, ask
Caldera for their CND. See http://www.caldera.com for more
information.
INSTALLATION

View File

@@ -481,6 +481,12 @@ void handle_ncp (struct sockaddr_ipx *source,
case 75:
printf("Keyed change password\n");
break;
case 113:
printf("Service Queue Job (old)\n");
break;
case 124:
printf("Service Queue Job \n");
break;
}
data += 3;

View File

@@ -1,20 +1,12 @@
MAN1= slist nprint pqlist nsend pserver ncopy npasswd
MAN1 += nwbols nwboprops nwbpvalues nwfsinfo nwuserlist
MAN5= nwclient
MAN8= ncpmount ncpumount ipx_configure ipx_interface ipx_internal_net \
ipx_route nwmsg
MAN8 += nwbocreate nwborm nwbpadd nwbpcreate nwbprm
MAN8 += nwgrant nwrevoke
all:
dep:
install:
for i in $(MAN1); do install $$i.1 -m 755 /usr/local/man/man1; done
for i in $(MAN5); do install $$i.5 -m 755 /usr/local/man/man5; done
for i in $(MAN8); do install $$i.8 -m 755 /usr/local/man/man8; done
for i in *.1; do install $$i -m 755 /usr/local/man/man1; done
for i in *.5; do install $$i -m 755 /usr/local/man/man5; done
for i in *.8; do install $$i -m 755 /usr/local/man/man8; done
clean:
rm -f *~

View File

@@ -57,7 +57,7 @@ protocol Novell NetWare clients use to talk to NetWare servers. ncpfs
was inspired by
.B lwared,
a free NetWare emulator for Linux written by Ales Dryak. See
ftp://klokan.sh.cvut.cz/pub/linux for this very intersting program.
ftp://klokan.sh.cvut.cz/pub/linux for this very interesting program.
.B ncpmount
when invoked with all appropriate arguments attaches, logs in and
@@ -83,7 +83,7 @@ If the real uid of the caller is not root,
checks whether the user is allowed to mount a filesystem on the
mount-point. So it should be safe to make
.B ncpmount
setuid root. The filesystem stores the uid of the user who called
setuid root. The filesystem stores the uid of the user who called
ncpmount. So
.B ncpumount
can check whether the caller is allowed to unmount the filesystem.
@@ -271,7 +271,7 @@ of your server.
.B USER / LOGNAME
.RS 3
The variables USER or LOGNAME may contain the username of the person
using the client. USER is tried first. If it's emtpy, LOGNAME is
using the client. USER is tried first. If it's empty, LOGNAME is
tried.
.RE

View File

@@ -65,14 +65,14 @@ is the name of the server you want to use.
If the user name your NetWare administrator gave to you differs
from your unix user-id, you should use
.B -U
to tell the server about you NetWare user name.
to tell the server about your NetWare user name.
.RE
.B -P
.I password
.RS 3
You may want to give the password required by the server on the
command line. You should be careful to use passwords in scripts.
command line. You should be careful about using passwords in scripts.
.RE
.B -n

View File

@@ -1,4 +1,4 @@
.TH NWCLIENT 5 12/27/1995 nwmount nwmount
.TH NWCLIENT 5 12/27/1995 nwclient nwclient
.SH NAME
nwclient \- configuration file for NWClient program suite
.SH DESCRIPTION
@@ -35,11 +35,11 @@ An example might be the following:
# And a passwordless account on another server
CD-SERV/GUEST -
With these lines in $HOME/.nwclient, calling 'nwmount /mnt' will mount
With these lines in $HOME/.nwclient, calling 'ncpmount /mnt' will mount
the the file server FS311 with user name ME on /mnt after asking the
user for a password.
\'nwmount -S cd-serv /cd' will silently mount the server cd-serv on /cd.
\'ncpmount -S cd-serv /cd' will silently mount the server cd-serv on /cd.
.B nprint
,

View File

@@ -1,8 +1,8 @@
.TH NPASSWD 1 06/22/1996 npasswd npasswd
.TH NWPASSWD 1 06/22/1996 nwpasswd nwpasswd
.SH NAME
npasswd \- Change a user's password
nwpasswd \- Change a user's password
.SH SYNOPSIS
.B npasswd
.B nwpasswd
[
.B -h
] [
@@ -18,9 +18,9 @@ npasswd \- Change a user's password
.SH DESCRIPTION
With
.B npasswd,
.B nwpasswd,
you can change your password on a NetWare server.
.B npasswd
.B nwpasswd
asks for the old password and twice for the new password. Then it
changes the password on the server.
@@ -28,7 +28,7 @@ changes the password on the server.
.B -h
.RS 3
With -h npasswd prints a little help text.
With -h nwpasswd prints a little help text.
.RE
.B -S
@@ -51,5 +51,5 @@ changed.
.RE
.SH CREDITS
npasswd would not have been possible without the work of Guntram
nwpasswd would not have been possible without the work of Guntram
Blom. Look at nwcrypt.c for his work.

41
man/nwrights.1 Normal file
View File

@@ -0,0 +1,41 @@
.TH NWRIGHTS 1 8/1/1996 nwrights nwrights
.SH NAME
nwrights \- Show effective rights for file or directory
.SH SYNOPSIS
.B nwrights
[
.B -h
]
.B file/directory
.SH DESCRIPTION
.B nwrights
asks the NetWare server for the effective rights the user has for a
specific file or directory. The rights the server grants are the
definitive restriction for what you may do with files or
directories. The Linux permission bits are not really relevant, they
can only restrict the possibilities further.
.B nwrights
operates on the current directory or the file or directory that is
given as an argument. Certainly the file or directory you specify has
to reside on a ncpfs mounted directory for nwrights to work properly.
.SH OPTIONS
.B -h
.RS 3
.B -h
is used to print out a short help text.
.RE
.B file/directory
.RS 3
You can specify the file or directory you want information about. The
default is the current working directory.
.RE
.SH AUTHORS
nwrights was written by Volker Lendecke with the corresponding NetWare
utility in mind. See the Changes file of ncpfs for other contributors.

View File

@@ -68,14 +68,14 @@ is the name of the server you want to use.
If the user name your NetWare administrator gave to you differs
from your unix user-id, you should use
.B -U
to tell the server about you NetWare user name.
to tell the server about your NetWare user name.
.RE
.B -P
.I password
.RS 3
You may want to give the password required by the server on the
command line. You should be careful to use passwords in scripts.
command line. You should be careful about using passwords in scripts.
.RE
.B -n

View File

@@ -1,7 +1,7 @@
Begin3
Title: ncpfs
Version: 2.0.3
Entered-date: 22. July 1996
Version: 2.0.5
Entered-date: 01. August 1996
Description: With ncpfs you can mount volumes of your netware
server under Linux. You can also print to netware
print queues and spool netware print queues to the
@@ -13,7 +13,7 @@ Author: lendecke@namu01.Num.Math.Uni-Goettingen.de (Volker Lendecke)
Maintained-by: lendecke@namu01.Num.Math.Uni-Goettingen.de (Volker Lendecke)
Primary-site: ftp.gwdg.de:/pub/linux/misc/ncpfs
Alternate-site: sunsite.unc.edu:/pub/Linux/system/Filesystems/ncpfs
~128k ncpfs-2.0.3.tgz
~ 1k ncpfs-2.0.3.lsm
~132k ncpfs-2.0.5.tgz
~ 1k ncpfs-2.0.5.lsm
Copying-policy: GPL
End

View File

@@ -2,10 +2,10 @@
# Makefile for the linux ncp-filesystem routines.
#
USERUTILS = slist pqlist nwfsinfo pserver nprint nsend ncopy npasswd
USERUTILS = slist pqlist nwfsinfo pserver nprint nsend ncopy nwpasswd
USERUTILS += nwbols nwbocreate nwborm nwboprops
USERUTILS += nwbpcreate nwbprm nwbpvalues nwbpadd
USERUTILS += nwgrant nwrevoke nwuserlist
USERUTILS += nwgrant nwrevoke nwuserlist nwrights
UIDUTILS = ncpmount ncpumount
SBINUTILS = nwmsg
@@ -60,6 +60,8 @@ $(NCP_LIB): ncplib.o ncplib_err.o $(COM_ERR_CFILES)
com_err/com_err.o com_err/error_message.o com_err/et_name.o \
com_err/init_et.o
ln -sf libncp.so.1.0 libncp.so.1
ln -sf libncp.so.1 libncp.so
export LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH
ncplib_err.o: ncplib_err.h ncplib_err.c
$(CC) $(CFLAGS) $(PIC_FLAG) -c ncplib_err.c
@@ -82,8 +84,8 @@ dep: ncplib_err.h
clean:
make -C com_err clean
rm -f *.o *~ slist test ncptest ncplib_err.[ch] libncp.a
rm -f libncp.so.*
rm -f *.o *~ slist test ncptest ncplib_err.[ch]
rm -f libncp.*
mrproper: clean
make -C com_err mrproper

View File

@@ -680,6 +680,40 @@ ncp_temp_request(struct ncp_conn *conn, int function)
return r->completion_code == 0 ? 0 : NCPL_ET_REQUEST_ERROR;
}
#ifdef PACKET_SIGNATURES
static long
ncp_setup_security(struct ncp_conn *conn)
{
__u8 security;
__u8 accepted_security;
__u16 socket, size;
conn->want_signatures = 0;
if (ncp_get_big_ncp_max_packet_size(conn, 576, 0, &size, &socket,
&accepted_security) != 0)
{
return 0;
}
if ((accepted_security & NCP_SEC_SIGNATURE_REQUESTED) == 0)
{
return 0;
}
security = NCP_SEC_SIGNATURE_REQUESTED;
if (ncp_get_big_ncp_max_packet_size(conn, 576, security,
&size, &socket,
&accepted_security) != 0)
{
return 0;
}
if ((accepted_security & NCP_SEC_SIGNATURE_REQUESTED) != 0)
{
conn->want_signatures = 1;
}
return 0;
}
#endif
static long
ncp_connect_addr(struct ncp_conn *conn, const struct sockaddr_ipx *target,
int wdog_needed)
@@ -1085,6 +1119,15 @@ ncp_open_mount(const char *mount_point, long *err)
}
strcpy(result->mount_point, mount_point);
result->is_connected = CONN_PERMANENT;
result->i.version = NCP_GET_FS_INFO_VERSION;
if (ioctl(result->mount_fid, NCP_IOC_GET_FS_INFO, &(result->i)) != 0)
{
free(result);
*err = NCPL_ET_NO_NCPFS_FILE;
return NULL;
}
return result;
}
@@ -2255,6 +2298,31 @@ ncp_write_property_value(struct ncp_conn *conn,
return result;
}
long
ncp_get_big_ncp_max_packet_size(struct ncp_conn *conn,
__u16 proposed_max_size,
__u8 proposed_security_flag,
__u16 *accepted_max_size,
__u16 *echo_socket,
__u8 *accepted_security_flag)
{
long result;
ncp_init_request(conn);
ncp_add_word(conn, htons(proposed_max_size));
ncp_add_byte(conn, proposed_security_flag);
if ((result = ncp_request(conn, 97)) != 0)
{
ncp_unlock_conn(conn);
return result;
}
*accepted_max_size = ntohs(ncp_reply_word(conn, 0));
*echo_socket = ntohs(ncp_reply_word(conn, 2));
*accepted_security_flag = ncp_reply_byte(conn, 4);
ncp_unlock_conn(conn);
return 0;
}
long
ncp_login_encrypted(struct ncp_conn *conn,
const struct ncp_bindery_object *object,
@@ -2831,6 +2899,34 @@ ncp_obtain_file_or_subdir_info(struct ncp_conn *conn,
return 0;
}
long
ncp_get_eff_directory_rights(struct ncp_conn *conn,
__u8 source_ns, __u8 target_ns,
__u16 search_attribs,
__u8 vol, __u32 dirent, const char *path,
__u16 *my_effective_rights)
{
long result;
ncp_init_request(conn);
ncp_add_byte(conn, 29);
ncp_add_byte(conn, source_ns);
ncp_add_byte(conn, target_ns);
ncp_add_word(conn, search_attribs);
ncp_add_dword(conn, 0);
ncp_add_handle_path(conn, vol, dirent, 1, path);
if ((result = ncp_request(conn, 87)) != 0)
{
ncp_unlock_conn(conn);
return result;
}
*my_effective_rights = ncp_reply_word(conn, 0);
ncp_unlock_conn(conn);
return 0;
}
long
ncp_do_lookup(struct ncp_conn *conn,
struct nw_info_struct *dir,

View File

@@ -235,6 +235,12 @@ ncp_change_object_security(struct ncp_conn *conn,
const char *object_name,
__u8 security);
struct ncp_station_addr {
__u32 NetWork __attribute__ ((packed));
__u8 Node[6] __attribute__ ((packed));
__u16 Socket __attribute__ ((packed));
};
struct ncp_prop_login_control {
__u8 AccountExpireDate[3] __attribute__ ((packed));
__u8 Disabled __attribute__ ((packed));
@@ -251,7 +257,7 @@ struct ncp_prop_login_control {
__u32 MaxDiskUsage __attribute__ ((packed));
__u16 BadLoginCount __attribute__ ((packed));
__u32 BadLoginCountDown __attribute__ ((packed));
__u8 LastIntruder[8] __attribute__ ((packed));
struct ncp_station_addr LastIntruder __attribute__ ((packed));
};
long
@@ -296,6 +302,22 @@ ncp_write_property_value(struct ncp_conn *conn,
const char *property_name,
__u8 segment,
struct nw_property *property_value);
/* Bit masks for security flag */
#define NCP_SEC_CHECKSUMMING_REQUESTED (1)
#define NCP_SEC_SIGNATURE_REQUESTED (2)
#define NCP_SEC_COMPLETE_SIGNATURES_REQUESTED (4)
#define NCP_SEC_ENCRYPTION_REQUESTED (8)
#define NCP_SEC_LIP_DISABLED (128)
long
ncp_get_big_ncp_max_packet_size(struct ncp_conn *conn,
__u16 proposed_max_size,
__u8 proposed_security_flag,
__u16 *accepted_max_size,
__u16 *echo_socket,
__u8 *accepted_security_flag);
long
ncp_login_encrypted(struct ncp_conn *conn,
const struct ncp_bindery_object *object,
@@ -422,6 +444,22 @@ ncp_obtain_file_or_subdir_info(struct ncp_conn *conn,
__u8 vol, __u32 dirent, const char *path,
struct nw_info_struct *target);
#define NCP_PERM_READ (0x001)
#define NCP_PERM_WRITE (0x002)
#define NCP_PERM_OPEN (0x004)
#define NCP_PERM_CREATE (0x008)
#define NCP_PERM_DELETE (0x010)
#define NCP_PERM_OWNER (0x020)
#define NCP_PERM_SEARCH (0x040)
#define NCP_PERM_MODIFY (0x080)
#define NCP_PERM_SUPER (0x100)
long
ncp_get_eff_directory_rights(struct ncp_conn *conn,
__u8 source_ns, __u8 target_ns,
__u16 search_attribs,
__u8 vol, __u32 dirent, const char *path,
__u16 *my_effective_rights);
long
ncp_do_lookup(struct ncp_conn *conn,

View File

@@ -37,6 +37,9 @@ ec NCPL_ET_PWD_TOO_LONG,
"Password too long"
ec NCPL_ET_NO_IPX,
"Could not alloc IPX socket. Probably no IPX support in kernel."
"Could not alloc IPX socket. Probably no IPX support in kernel"
ec NCPL_ET_NO_NCPFS_FILE,
"The file is probably not on a ncpfs mounted directory"
end

View File

@@ -182,6 +182,43 @@ test_readdir(struct ncp_conn *conn)
}
void
test_rights(struct ncp_conn *conn)
{
struct nw_info_struct sys;
struct nw_info_struct me;
__u16 rights;
if (ncp_do_lookup(conn, NULL, "SYS", &sys) != 0)
{
printf("lookup error\n");
return;
}
if (ncp_do_lookup(conn, &sys, "ME", &me) != 0)
{
printf("lookup me error\n");
return;
}
if (ncp_get_eff_directory_rights(conn, 0, 0, 0x8006,
sys.volNumber, sys.DosDirNum, NULL,
&rights) != 0)
{
printf("get sys rights error\n");
return;
}
printf("sys right: %4.4x\n", rights);
if (ncp_get_eff_directory_rights(conn, 0, 0, 0x8006,
me.volNumber, me.DosDirNum, NULL,
&rights) != 0)
{
printf("get me rights error\n");
return;
}
printf("me right: %4.4x\n", rights);
return;
}
int
main(int argc, char *argv[])
@@ -195,7 +232,7 @@ main(int argc, char *argv[])
return 1;
}
test_readdir(conn);
test_rights(conn);
ncp_close(conn);
return 0;
}

View File

@@ -139,6 +139,7 @@ main(int argc, char *argv[])
{
break;
}
segno += 1;
}
@@ -150,17 +151,19 @@ main(int argc, char *argv[])
{
int objects = 32 * segno;
__u32 *value = (__u32 *)property_value;
int i;
int i = 0;
for (i = 0; i < objects; i++)
while (i < objects)
{
struct ncp_bindery_object o;
if ((*value == 0) || (*value == 0xffffffff))
if ((value[i] == 0) || (value[i] == 0xffffffff))
{
break;
/* Continue with next segment */
i = ((i/32) + 1) * 32;
continue;
}
if (ncp_get_bindery_object_name(conn, ntohl(*value),
if (ncp_get_bindery_object_name(conn, ntohl(value[i]),
&o) == 0)
{
if (verbose != 0)
@@ -175,7 +178,7 @@ main(int argc, char *argv[])
printf("%s\n", o.object_name);
}
}
value += 1;
i += 1;
}
}
result = 0;
@@ -218,6 +221,174 @@ print_string(__u8 *val)
puts(val);
}
static char *
print_station_addr(char *fmt, struct ncp_station_addr *addr, char *buff)
{
char *ret = buff;
while ( *fmt != 0 )
{
switch ( *fmt )
{
case '%':
switch ( *(++fmt) )
{
case 'N': /* node */
{
int i ;
for ( i = 0 ; i < 6 ; buff += 2 , i++ )
{
sprintf(buff, "%02X",addr->Node[i]);
}
}
break;
case 'S': /* Socket */
sprintf(buff, "%04X", htons(addr->Socket));
buff += 4 ;
break ;
case 'L': /* Lan */
sprintf(buff, "%08lX", htonl(addr->NetWork));
buff += 8 ;
break ;
case '%':
*buff++ = '%';
default:
break ;
}
if (*fmt)
{
fmt++ ;
}
break ;
default:
*buff++ = *fmt++ ;
}
}
*buff = 0 ;
return ret ;
}
void
print_login_control ( __u8 *val )
{
int i , j , mask;
char buff[32];
struct ncp_prop_login_control *a =(struct ncp_prop_login_control *)val;
static char *days[]
= { "Sun" , "Mon" , "Tue" , "Wen" , "Thu" , "Fri" , "Sat" } ;
if (a->LastLogin[2] || a->LastLogin[1] || a->LastLogin[0] ||
a->LastLogin[3] || a->LastLogin[4] || a->LastLogin[5])
{
printf("Last Login: %d.%d.%02d at %2d:%02d:%02d\n",
a->LastLogin[2] , a->LastLogin[1] , a->LastLogin[0] ,
a->LastLogin[3] , a->LastLogin[4] , a->LastLogin[5]);
}
else
{
printf("Never logged in\n");
}
if (a->Disabled != 0)
{
printf(" --- Account disabled ---\n");
}
if (a->AccountExpireDate[2] || a->AccountExpireDate[1] ||
a->AccountExpireDate[0])
{
printf("Account expires on: %d.%d.%d\n",
a->AccountExpireDate[2],
a->AccountExpireDate[1],
a->AccountExpireDate[0]);
}
if (a->PasswordExpireDate[2] || a->PasswordExpireDate[1] ||
a->PasswordExpireDate[0])
{
printf("Password expires on: %d.%d.%d\n" ,
a->PasswordExpireDate[2],
a->PasswordExpireDate[1],
a->PasswordExpireDate[0]);
printf("GraceLogins left: %d\nof max. : %d\n",
a->GraceLogins, a->MaxGraceLogins);
printf("PasswortChangeInterval : %d days\n",
ntohs(a->PasswordExpireInterval));
}
if ((a->RestrictionMask & 2) != 0)
{
printf("New password must be different when changing\n");
}
if ((a->RestrictionMask & 1) != 0)
{
printf("User ist not allowed to change password\n");
}
printf("Minimal password length : %d\n", a->MinPasswordLength);
if (ntohs(a->MaxConnections) != 0)
{
printf("Maximum no of connections: %d\n",
ntohs(a->MaxConnections));
}
if ( a->MaxDiskUsage != 0xFFFFFF7FL )
{
printf("Maximum DiskQuota : %8ld blocks\n",
ntohl(a->MaxDiskUsage));
}
printf("Failed Logins: %5d\n", ntohs(a->BadLoginCount));
if (a->BadLoginCountDown != 0L)
{
printf("Account disabled still %8ld seconds\n",
ntohl(a->BadLoginCountDown));
}
if (a->LastIntruder.NetWork != 0L)
{
printf("Last \'intruder\' address: %s\n" ,
print_station_addr("(%L): %N[%S]" ,
&(a->LastIntruder),buff));
}
if ( a->RestrictionMask & 0xFC )
{
printf("RestrictionMask : %02X\n", a->RestrictionMask);
}
for ( i = 0 ; i < 42 ; i++ )
{
if ( a->ConnectionTimeMask[i] != 0xFF )
{
i = 101;
}
}
if ( i < 100 )
{
return;
}
val = a->ConnectionTimeMask;
printf("Time restrictions: 1 1 1 1 1 1 1 1 1 1 2 2 2 2 ]\n");
printf(" Day [0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 ]\n");
for ( i = 0 ; i < 7 ; i++ )
{
printf (" %s [" , days[i]);
for ( j = 0 ; j < 6 ; j++ )
{
for ( mask = 1 ; mask < 0x100 ; mask <<= 1 )
{
putchar ( (*val & mask) ? '*' : ' ' ) ;
}
val++ ;
}
printf ( "]\n" ) ;
}
}
void
print_addr( __u8 *val)
{
char buff[50];
print_station_addr("(%L): %N[%S]",
(struct ncp_station_addr *)val, buff);
printf("%s\n", buff);
}
static struct {
char *pname ;
void (*func)(__u8 *) ;
@@ -228,6 +399,8 @@ static struct {
{ "DESCRIPTION" , print_string } ,
{ "IDENTIFICATION" , print_string } ,
{ "Q_DIRECTORY" , print_string } ,
{ "LOGIN_CONTROL" , print_login_control } ,
{ "NET_ADDRESS" , print_addr } ,
{ NULL , NULL }
};

View File

@@ -130,9 +130,9 @@ main(int argc, char *argv[])
exit(1);
}
fprintf(tty_file, "\r\n\007\007\007Message from NetWare Server: %s\n",
fprintf(tty_file,"\r\n\007\007\007Message from NetWare Server: %s\r\n",
mnt->mnt_fsname);
fprintf(tty_file, "%s\n", message);
fprintf(tty_file, "%s\r\n", message);
fclose(tty_file);
fclose(mtab);
return;

View File

@@ -1,5 +1,5 @@
/*
* npasswd.c
* nwpasswd.c
*
* Change a bindery object's password
*

141
util/nwrights.c Normal file
View File

@@ -0,0 +1,141 @@
/*
* nwrights.c
*
* Show effective rights for dir or file.
*
* Copyright (C) 1996 by Volker Lendecke
*
*/
#include "ncplib.h"
#include <unistd.h>
#include <stdlib.h>
static char *progname;
static void
usage(void)
{
fprintf(stderr, "usage: %s [options]\n", progname);
}
static void
help(void)
{
printf("\n");
printf("usage: %s [options] file/directory\n", progname);
printf("\n"
"-h Print this help text\n"
"\n"
"file/directory\n"
"\n");
}
int
main(int argc, char *argv[])
{
struct ncp_conn *conn = NULL;
char *path = ".";
long err;
int result = 1;
int opt;
__u16 rights;
progname = argv[0];
while ((opt = getopt(argc, argv, "h?")) != EOF)
{
switch(opt) {
case 'h':
case '?':
help();
goto finished;
default:
usage();
goto finished;
}
}
if (optind > argc)
{
usage();
goto finished;
}
if (optind == argc-1)
{
path = argv[optind];
}
if ((conn = ncp_open_mount(path, &err)) == NULL)
{
com_err(argv[0], err, "when initializing");
goto finished;
}
if ((err = ncp_get_eff_directory_rights(conn, 0, 0, 0x8006,
conn->i.volume_number,
conn->i.directory_id, NULL,
&rights)) != 0)
{
com_err(argv[0], err, "when finding rights");
goto finished;
}
printf("Your effective rights for %s are: [%c%c%c%c%c%c%c%c]\n",
path,
((rights & NCP_PERM_SUPER ) != 0) ? 'S' : ' ',
((rights & NCP_PERM_READ ) != 0) ? 'R' : ' ',
((rights & NCP_PERM_WRITE ) != 0) ? 'W' : ' ',
((rights & NCP_PERM_CREATE) != 0) ? 'C' : ' ',
((rights & NCP_PERM_DELETE) != 0) ? 'E' : ' ',
((rights & NCP_PERM_MODIFY) != 0) ? 'M' : ' ',
((rights & NCP_PERM_SEARCH) != 0) ? 'F' : ' ',
((rights & NCP_PERM_OWNER ) != 0) ? 'A' : ' ');
if ((rights & NCP_PERM_SUPER ) != 0)
{
printf("(S): You have SUPERVISOR rights\n");
}
if ((rights & NCP_PERM_READ ) != 0)
{
printf("(R): You may READ from files\n");
}
if ((rights & NCP_PERM_WRITE ) != 0)
{
printf("(W): You may WRITE to files\n");
}
if ((rights & NCP_PERM_CREATE) != 0)
{
printf("(C): You may CREATE files\n");
}
if ((rights & NCP_PERM_DELETE) != 0)
{
printf("(E): You may ERASE files\n");
}
if ((rights & NCP_PERM_MODIFY) != 0)
{
printf("(M): You may MODIFY directory\n");
}
if ((rights & NCP_PERM_SEARCH) != 0)
{
printf("(F): You may SCAN for files\n");
}
if ((rights & NCP_PERM_OWNER ) != 0)
{
printf("(A): You may change ACCESS control\n");
}
result = 0;
finished:
ncp_close(conn);
return result;
}