Anda di halaman 1dari 3

System iNetwork Head Nav Subscribe Log In Contact Us Advertise User login Username: * Password: * Request new password

Search Primary links Forums Archives Code Blogs Podcasts Webcasts e-Learning Guides Newsletters About Us Contact Us About the Network Tech Editor Profiles Editorial Calendar Writers Kit Advertise Join Network Categories RPG Programming Other Languages Application Development Database/SQL Availability Security Systems Management Networking IT Mgmt/Careers Site Links Solutions Store Events UK Centre Jobs System iPortal Home Content Quick Utility to Share NetServer Folders Article ID: 57061Posted August 14th, 2008 in RPG Programming By:Scott Klement The IBM i operating system has a tool called NetServer, which lets your System i act as a server on a Windows Network. With this support, you can navigate to yo ur System i on your Windows Network and access the IFS folders marked as "shared " to the Windows Network. Traditionally, the only way to share or unshare the IFS folders is through Syste m i Navigator. However, I need to enable and disable these shares from the green -screen environment. Oh, woe is me! What shall I do? You guessed it . . . I wrot e my own CL commands to share and unshare these folders. Now I can enable or dis able the shares from the 5250 command line or even from a CL program. How Do the Commands Work? IBM provides APIs that make it possible to control NetServer from a program. The se APIs can retrieve the current configuration parameters, as well as change the configuration, start and stop the server, and add and remove shares. To write my SHARE and UNSHARE utilities, all I had to do was write simple CL pro grams that use the IBM APIs.

How Do I Use These Utilities The utilities consist of the SHARE and UNSHARE CL commands. Here are the paramet ers supported by the SHARE command: Share Directory (SHARE) Type choices, press Enter. Share name . . . . . . . . . . . IFS directory to share . . . . . Character value

... Share for reading only . . . . . *YES *YES, *NO

F3=Exit F4=Prompt F24=More keys

F5=Refresh

F12=Cancel

Bottom F13=How to use this display

Likewise, here's a screen shot of the UNSHARE command: UN-Share Directory (UNSHARE) Type choices, press Enter. Share name . . . . . . . . . . . Character value

F3=Exit F4=Prompt F24=More keys

F5=Refresh

F12=Cancel

Bottom F13=How to use this display

For example, if I have an IFS directory named /usr/local/lib/group/qc that I wan t to share under the name QC on the Windows Network, I type the following: SHARE SHARE('QC') DIR('/usr/local/lib/group/qc') READONLY(*NO)

Assuming that NetServer has already been set up and configured, this should imme diately show up as a share named QC on my server. If I want to remove that share , I can simply do the following: UNSHARE SHARE(QC) I find this handy when I want to quickly share a directory. I can just type SHAR E at the command line, and presto! I have a new share. I also find these utilities useful for enabling and disabling shares on the fly from a CL program. For example, at my company, we have a process that generates a file containing each payroll period's direct-deposit information. Once generat ed, that file has to be uploaded to an HTTP server provided by our bank. Because of the sensitive nature of that file (it contains employees' bank accoun t numbers) we need to keep it as secure as possible. Of course, we use object-le vel security, but I find that security is even better if we share the directory only when it's needed. Our employee runs the option to "export direct deposit in formation," and the utility automatically enables the share. When the user is do ne uploading the file to the bank, the utility unshares the folder so that nobod y can access it from the Windows Network. Doing this makes me feel a bit more se cure. In order to steal the file, a hacker would not only have to know the user ID and password of a legitimate user profile, but the hacker would also have to get the timing right, since he or she would be able to steal only the data at th e precise moment that the file is being uploaded to the bank. Code Download You can download the SHARE and UNSHARE utilities from the following link: http://www.pentontech.com/IBMContent/Documents/article/57061_634_Share.zip Bookmark/Search this post with: Login to post comments Email this page Printer-friendly version Relate d Links The SSH, SCP, and SFTP Tools from OpenSSH FTP for Techies and Programmers Tips for Programming and Development, Part 1 Get Windows Networking Name in a Program Killer Club Tech ProVIP Sponsors ProVIP Sponsors Featured LinksSponsored Links Footer Site Links Home Subscribe Now Advertise Contact Us Feedback Terms & Conditions Trademarks P rivacy Policy Copyright Penton Media

Anda mungkin juga menyukai