diff -Nru samba-2.0.10-ja-1.0/Changelog.en samba-2.0.10-ja-1.1alpha1/Changelog.en --- samba-2.0.10-ja-1.0/Changelog.en Sat Jul 7 15:53:36 2001 +++ samba-2.0.10-ja-1.1alpha1/Changelog.en Tue Jul 17 03:59:46 2001 @@ -9,7 +9,30 @@ x: Fix of sending a patch to Samba Team c: Fix of being commited a patch by Samba Team -samba-2.0.10-ja-1.0 (2001/07/xx) +samba-2.0.10-ja-1.1 (2001/07/xx) +~~~~~~~~~~~~~~~~~~~ + * Fixed "J0046: Cannot treat a long file name" + * Fixed to use KANJI chars including '`' in "coding system = + SJIS/HEX/CAP" as a NetBIOS name + * Fixed to use Japanese in %S variable + * Fixed for the commands not to use Japanese correctly because + of invalid calling dos_to_unix()/unix_to_dos(). + * Fixed that a half-width KATAKANA filename becomes invalid + under coding system = cap/utf8 + * Fixed the bug of case translation that makes a 2nd byte of a + 2byte character conversion which is once fixed in Samba + 2.0.7-ja-2.2 + * Fixed that tar command in smbclient cannot work if its + current directory がhas a sub directory including Japanese chars + * smbtorture cannot treat Japanese and causes broken characters. + * Fixed again "J0007: Japanese computername in browse list + becomes broken when Samba is a master browser" + Changes to the original version + * Fixed that to specify a directory as an argument of + smbclient's builtin command causes an error if the directory + exists + +samba-2.0.10-ja-1.0 (2001/07/07) ~~~~~~~~~~~~~~~~~~~ Changes to the internationalized version * Added samba-2.0.9-ja-1.0 features diff -Nru samba-2.0.10-ja-1.0/Changelog.ja samba-2.0.10-ja-1.1alpha1/Changelog.ja --- samba-2.0.10-ja-1.0/Changelog.ja Sat Jul 7 15:53:36 2001 +++ samba-2.0.10-ja-1.1alpha1/Changelog.ja Tue Jul 17 03:59:46 2001 @@ -9,7 +9,30 @@ x: 本家に patch を提出した修正 c: 本家に patch がコミットされた修正 -samba-2.0.10-ja-1.0 (2001/07/xx) +samba-2.0.10-ja-1.1 (2001/07/xx) +~~~~~~~~~~~~~~~~~~~ + 国際化版独自の修正 + * 「J0046: 長いファイル名を扱うことができない」の修正 + * SJIS/HEX/CAP で'`'を含んでいる漢字を NetBIOS 名に使えるように + 修正 + * %S 変数の日本語対応 + * dos_to_unix()/unix_to_dos() 発行箇所の不備によるコマンドの日本 + 語対応の不備を修正 + * coding system = cap/utf8 の時半角仮名ファイル名が正しく扱えな + い点の修正 + * 2バイト文字のファイル名のSFN作成時に2バイト目が大文字/小文字変 + 換ロジックによって変換されてしまうバグを修正。このバグは + Samba 2.0.7-ja-2.2 で一度修正されている。 + * smbclient の tar command で、current directory が日本語の + sub directory を持つ場合に失敗してしまう。 + * smbtorture で日本語が扱えない。もしくは文字化けする + * 「J0007: Sambaがマスタブラウザの時に日本語のコンピュータ名が文 + 字化けする」の再修正 + オリジナル版に対する修正 + * smbclient の builtin command の引数に directory を記述して指定 + すると、実在する場合でも error になってしまう。 + +samba-2.0.10-ja-1.0 (2001/07/07) ~~~~~~~~~~~~~~~~~~~ 国際化版独自の修正 * samba-2.0.9-ja-1.0 相当の修正を追加 diff -Nru samba-2.0.10-ja-1.0/RELNOTE.ja samba-2.0.10-ja-1.1alpha1/RELNOTE.ja --- samba-2.0.10-ja-1.0/RELNOTE.ja Sat Jul 7 15:53:36 2001 +++ samba-2.0.10-ja-1.1alpha1/RELNOTE.ja Tue Jul 17 04:03:22 2001 @@ -89,6 +89,74 @@ をご参照ください。なお現在上記ページは整備中です。 +## 移行にあたっての注意点 + +1. samba-2.0.5a-JP{1,2} からの移行の注意点 + Samba 2.0.5a日本語版では、client codepage = 932がデフォルトのため、 + SWATでsmb.conf を作成しているときは、client codepage 行がsmb.conf中 + に作成されません。移行する際には"client codepage"をsmb.confに追加す + るのを忘れないようにしてください。 + +2. samba-2.0.5a-JP2 で日本語共有名などを使っている状態から移行する際の + 注意点 + + (1) Samba 2.0.7日本語版では、"coding system"で指定した文字コードで + smb.conf を記述する必要があります。samba-2.0.5a-JP2では"coding + system"に関わらずsmb.confをシフトJISで記述する必要があったので、例 + えば"coding system = EUC"の場合は、nkf 等を使って、smb.conf の文字 + コードをEUCに変更しておく必要があります。 + + (2) client codepage と coding system は global セクションの冒頭に記 + 述する必要があります。SWATでsmb.confを作成する場合は、Samba 2.0.7 + から自動的に冒頭に記述するようになりましたが、手作業でsmb.confを記 + 述している場合は、注意してください。 + +3. Samba 2.0.7-ja-2.1 以前の日本語版で、外字、機種依存文字をファイル名 + に使用している状態から移行する際の注意点 + + 以前のリリースでは一部の文字の扱いに不具合があったため、本リリースの + アーカイブに同梱されているexamples/smbchartool/以下のツールを利用し + て修復します。アーカイブを取得展開後、./INSTALL.sh と実行することで + このツールをインストールできます。 + + 修正は、以下のようなコマンドを実行することでおこないます。 + + smbfnconv -a euctoeuc /where/to/share + + -aオプションには、これまで使用していた文字コードおよび今後使用したい + 文字コードを以下のルールで指定します。 + + "<これまでのコード>to<今後のコード>" + + たとえば、euctoeuc, hextoeuc, jistoeucなどとなります。これまでと同じ + コードを用いる場合でも、外字や機種依存文字をファイル名に使用している + 時はこの修正を行なって下さい。 + + (制限事項: 本ツールではeucJP-openコードは現在サポートされておりません) + +4. UTF-8を用いたコーディングシステムを用いる場合 + + 3.と同様に、examples/smbchartool/以下のツールを利用してコード変換し + ます。変換には以下のようなコマンドを実行することでおこないます。 + + smbutfconv -a euctoutf8 /where/to/share + + -aオプションには、euctoutf8, utf8toeucが利用可能です。 + +5. 日本語ドキュメント中のバージョン表記 + Samba 2.0.7 から Samba 2.0.10へのバージョンアップでは、機能自体は全く +更新されていないため、Samba 日本語版ではドキュメントの更新を行っていませ +ん。そのため、バージョン表記が 2.0.7 となっておりますが、御了承ください。 + + +## 既知の問題点 + + 現在判明している問題点については + + http://www.samba.gr.jp/project/samba-ja/bugs.html + +を参照してください。 + ## 変更点 Samba 2.0.10日本語版はSamba 2.0.10に対して上位互換です。しかしながら、 Samba 2.0.5a日本語版と、Samba 2.0.6以降のSambaとの間には、一部互換性の @@ -98,7 +166,7 @@ るもの)を使われてきた利用者の方は、互換性に関する重要な注意点がありま す。移行する際には以下の「移行にあたっての注意点」を熟読してください。 - 2.0.5a-JP{1,2}からの変更点は以下のとおりです。 + 2.0.5a-JP{1,2}以降の変更点は以下のとおりです。 a. smb.confの文字コード(2.0.7での変更点) 2.0.5a-JP2では、 smb.confを内部コードであるシフトJISで記述する必要 @@ -163,70 +231,437 @@ #define KANJI_WIN95_COMPATIBILITY この行を削除→ */ -## 移行にあたっての注意点 - -1. samba-2.0.5a-JP{1,2} からの移行の注意点 - Samba 2.0.5a日本語版では、client codepage = 932がデフォルトのため、 - SWATでsmb.conf を作成しているときは、client codepage 行がsmb.conf中 - に作成されません。移行する際には"client codepage"をsmb.confに追加す - るのを忘れないようにしてください。 - -2. samba-2.0.5a-JP2 で日本語共有名などを使っている状態から移行する際の - 注意点 - - (1) Samba 2.0.7日本語版では、"coding system"で指定した文字コードで - smb.conf を記述する必要があります。samba-2.0.5a-JP2では"coding - system"に関わらずsmb.confをシフトJISで記述する必要があったので、例 - えば"coding system = EUC"の場合は、nkf 等を使って、smb.conf の文字 - コードをEUCに変更しておく必要があります。 - - (2) client codepage と coding system は global セクションの冒頭に記 - 述する必要があります。SWATでsmb.confを作成する場合は、Samba 2.0.7 - から自動的に冒頭に記述するようになりましたが、手作業でsmb.confを記 - 述している場合は、注意してください。 - -3. Samba 2.0.7-ja-2.1 以前の日本語版で、外字、機種依存文字をファイル名 - に使用している状態から移行する際の注意点 - - 以前のリリースでは一部の文字の扱いに不具合があったため、本リリースの - アーカイブに同梱されているexamples/smbchartool/以下のツールを利用し - て修復します。アーカイブを取得展開後、./INSTALL.sh と実行することで - このツールをインストールできます。 - - 修正は、以下のようなコマンドを実行することでおこないます。 - - smbfnconv -a euctoeuc /where/to/share - - -aオプションには、これまで使用していた文字コードおよび今後使用したい - 文字コードを以下のルールで指定します。 - - "<これまでのコード>to<今後のコード>" - - たとえば、euctoeuc, hextoeuc, jistoeucなどとなります。これまでと同じ - コードを用いる場合でも、外字や機種依存文字をファイル名に使用している - 時はこの修正を行なって下さい。 - - (制限事項: 本ツールではeucJP-openコードは現在サポートされておりません) - -4. UTF-8を用いたコーディングシステムを用いる場合 - - 3.と同様に、examples/smbchartool/以下のツールを利用してコード変換し - ます。変換には以下のようなコマンドを実行することでおこないます。 +Samba 2.0.7-ja-2.2 の修正点 - smbutfconv -a euctoutf8 /where/to/share - - -aオプションには、euctoutf8, utf8toeucが利用可能です。 +Samba 2.0.9-ja-1.0 の修正点 -5. 日本語ドキュメント中のバージョン表記 - Samba 2.0.7 から Samba 2.0.10へのバージョンアップでは、機能自体は全く -更新されていないため、Samba 日本語版ではドキュメントの更新を行っていませ -ん。そのため、バージョン表記が 2.0.7 となっておりますが、御了承ください。 +Samba 2.0.10-ja-1.0 の修正点 + bug#1) J0004: ワイルドカードによるファイル指定がうまくいかない + o CVS branch: X-shirai-2_0_7-dos_wildcard + o patch: sugj-tech:2403 + sugj-tech:2677 + o テスト方法 + sugj-tech:3304 + + bug#2) J0031: 「:」や「\」を含む filename に access 出来ない + o patch: sugj-tech:3012(samba-jp:09566) + sugj-tech:3085 + o テスト方法 + UNIX 側から「:」や「\」を含む filename を作成し、 + Samba 経由で Windows 側から access してみる。 + + bug#3) J0001: Windows 95/98の2バイト文字ディレクトリ処理に関する不具合 + o CVS branch: X-shirai-2_0_7-trans2 + o patch: sugj-tech:2503 + sugj-tech:2989 + o テスト方法: + sugj-tech:3304 + + bug#4) J0024: coding system = EUC の時にsmbclient から日本語の共有に接 + 続できない + o CVS branch: X-shirai-2_0_7-smbclient-euc + o patch: sugj-tech:2741 + sugj-tech:2783 + o テスト方法: + Windows 側で日本語名の共有を作成し、 + coding system = EUC の状態で smbclient //SERVER/共有 + を実行。 + 但し「共有」は EUC-JP で書く。 + + bug#5) J0030: coding system = EUC の時に username map ファイル中で日本 + 語ユーザ名が使用できない + o CVS branch: X-shirai-username_map + o patch: sugj-tech:2699 + sugj-tech:2739 + o テスト方法: + username map = /etc/smbusers とし、/etc/smbusers に + 以下の一行を記述。 + unix_user = NTユーザ + 但し「NTユーザ」は coding system で書く。 + UNIX 側に「unix_user」、PDC 側に「NTユーザ」を作成し、 + 「NTユーザ」で Samba に access して unix_user + として access 出来るかどうかを確認する。 + + bug#6) J0035: Windows 9xから13文字以上の長さの共有名が利用できない + J0036: Windows NTから12文字以上の長さの共有名が利用できない + o CVS branch: X-shirai-2_0_9-longshare_name + o patch: sugj-tech:3352 + sugj-tech:3622 + o テスト方法: + smb.conf に 14 文字以上の共有名を作成し Windows から + access してみる。 + + bug#7) J0100: ボリュームラベルのデフォルト値に関する不具合 + J0102: ボリュームラベルに日本語を設定したときに文字化けする + J0028: default service の文字コードが coding system に依存しない + o CVS branch: X-hasegawa-2_0_7-volume-name + o patch: sugj-tech:3097 + o テスト方法: + default service = で日本語共有名を指定。Windows 側から + 「\\SERVER_NAME\存在しない共有」を access。 + 但し日本語共有名は coding system で書く。 + + sugj-tech:3304 + + bug#8) J0021: 印刷時に日本語のドキュメント名が正しく表示されない + o patch: samba-jp:09322 + o テスト方法: + 日本語ファイル名のテキストを「メモ帳」から Samba 経由で印字。 + 「スタート」->「設定」->「プリンタ」でスプールを確認。 + + bug#9) unix_to_dos/dos_to_unix 発行タイミング、バッファ上書きの修正 + o patch: sugj-tech:3422 (sugj-tech:2783) + o テスト方法: + 特に無し。一通り動作確認出来れば OK。 + + bug#10) kanji.h lookup 高速化について + o patch: sugj-tech:3422 + sugj-tech:2384 kanji.h lookup table #1 + sugj-tech:2468 kanji.h lookup table #2 + sugj-tech:2476 kanji.h lookup table #3 + o テスト方法: + 全ての漢字コードを利用して filename を生成してみる。 + test program あり。 + + bug#11) J0045: default service が有効だと不正な日本語共有名が現れる + o patch: sugj-tech:3392, sugj-tech:3537 + o テスト方法: + default service = で有効な共有名を指定した上で、 + 6 文字以上の日本語共有名に access してみる。 + + bug#12) Mac OS X でコンパイルに失敗する + o patch: sugj-tech:3358 + o テスト方法: + Mac OS X で compile が正常に行われることを確認する + + bug#13) Mac OS X の UTF-8 対応 + o patch: sugj-tech:3310 + sugj-tech:3422 + sugj-tech:3489 + + sugj-tech:3506 + o テスト方法: + Mac OS X で coding system = UTF-Mac で利用する。 + + bug#14) Strncpy() 関数の日本語対応 + o patch: sugj-tech:3469 + o テスト方法: + 6) のテストで、12 文字目や 13 文字目が漢字の 1byte 目に + なる場合を確認。 + + bug#15) unix_to_dos() / dos_to_unix() のバッファオーバーフローの可能性 + を修正 + o patch: sugj-tech:3507 + o テスト方法: + 日本語共有名を持つ Windows client に対し、smbclient -L + HOSTNAME -t hex (又は cap/utf8) として core dump しな + いことを確認。 + + bug#16) rpcclient が動作しない点の修正 + o patch: sugj-tech:3537 + o テスト方法: + sugj-tech:3537 + 1.WinNT workstation/server を用意します。 + Win2000 では packet header 仕様が異なっているので + rpcclient は動きません。 + 2.その NT の Administrator 権限のある user を予め作 + 成しておきます。domain 構成の場合は domain 全体の + Administrator でも代用出来ます。 + 3.Administrator 権限のある user で logon し、「スタ + ート」->「ファイル名を指定して実行」で REGEDT32.EXE + を起動します。 + 4.HKEY_USERS\.DEFAULT というキーがあるので、その下に + 「値の追加」で日本語名を「値の名前」に持つ「値」を + 追加します。日本語名は適当で構いません。 + 5.「データタイプ」に「REG_SZ」を選び、文字列として日 + 本語文字列を入れておきます。これも適当な文字列で構 + いません。 + 6.同様にして、「データタイプ」が「REG_MULTI_SZ」であ + るような「値」も追加します。こちらも「値の名前」及 + び「データ」は適当な日本語にします。「データ」は複 + 数行記述して下さい。 + 7.Samba を install した UNIX で以下を実行します。 + rpcclient //SERVER/SHARE -U USER -S SERVER + SERVER は先の WinNT の NETBIOS 名。SHARE は適当な + 共有名。USER は上で作成した Administrator 権限を持 + つ user 名です。 + 8.「Enter Password:」に USER 用の password を入力す + ると「smb: \>」という prompt が現れますので以下の + command 文字列を入力します。 + regenum HKEY_USERS\.DEFAULT + 9.「Subkeys」として .DEFAULT 以下のキー名一覧が表示 + され、続いて「Key Values」として先に追加した値が日 + 本語で表示される筈です。smb.conf の coding system + も確認してみて下さい。 + 10.「exit」と入力すると終了します。 + + bug#17) rpcclient の Usage が正しく表示されない点の修正 + o patch: sugj-tech:3537 + o テスト方法: + rpcclient foobar -h と入力して Usage 行のコマンド名 + が rpcclient になっている(foobarでない)ことを確認。 + + bug#18) J0048: 2バイト文字の終端文字が1バイトだけ出力される + o patch: sugj-tech:3537, sugj-tech:3550 + sugj-tech:3676 + o テスト方法: + sugj-tech:3550 + 1.smbclient //SERVER/SHARE -L SERVER -t euc + 予め SERVER に長い名前の共有名を半角仮名で作成。 + 2.rpcclient //SERVER/SHARE -S SERVER + srvinfo, srvshares, srvshares 2 をそれぞれ実行。 + 予め SERVER に長い名前の共有名と長いコメントを作成。 + 3.「netbios name =」で 15 文字以上の共有名を作ってか + ら client の「ネットワークコンピュータ」で確認する。 + 15 文字目と 16 文字目の境に日本語がかかっている場 + 合を確認。 + + bug#19) Samba 2.0.10 への修正 + o テスト方法: + log file = に %m macro を含むような設定で、NETBIOS 名 + に「/」を含む client から access して、生成される log file 名称で + 、該当文字が「_」に変わっていることを確認。 + + bug#20) NEWS-OS 付属の cc でコンパイルできるように修正 + o patch: sugj-tech:3669 + o テスト方法: + NEWS-OS 標準の cc で compile する。 + + bug#21) NEWS-OS 6 付属の cc でコンパイルできるように修正 + o patch: sugj-tech:3690 + o テスト方法: + NEWS-OS 6 標準の cc で compile する。 + + + bug#22) coding system = jis7/junet で半角仮名を扱えるよう修正。 + o patch: sugj-tech:3699 + o テスト方法: + coding system = jis7/junet で半角仮名文字を含む filename + を作成してみる。 + + bug#23) 日本語 NETBIOS 名に対し log filename が全て均一に「_」 + に置換えられてしまう症状を修正。 + o depend on: bug#19 + o patch: sugj-tech:3699 + o テスト方法: + 日本語 NETBIOS 名を持つ client から接続して生成される + log filename を確認。 + 特に coding system = jis7/jis8/junet に於いて、「く」 + 「渥」(手偏じゃないよ)「ッ」(半角仮名)等「/」を含む文 + 字を用いた NETBIOS 名について log file が生成されるか + どうかを確認。 + + bug#24) make_printerdef で読み込めないエントリがあったものを修正 + o patch: sugj-tech: 3668 + o テスト方法: + make_printerdef xxx.inf "Printer Name" を実行する + + a) smb.conf.default を最新版に + + b) NT_Security.man の削除 + + c) smb.conf のマニュアルページおよび smb.conf.default.ja に Mac OS X + の UTF-8 関連の記述を追加 + + +Samba 2.0.10-ja-1.1 の修正点 + + bug#29) UNIX 上で 127 文字より長いファイル名をうまく扱えない問題の修正 + o patch: sugj-tech:3503 + o テスト方法: + sugj-tech:3454 +----- +C:\> net use f: \\server\share + +C:\> rem > f:\0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.TXT + +C:\> ren f:\*.TXT X*.TXT + +C:\> dir f:\ + + Volume in drive F is share + Directory of F:\ + +. 06-13-01 11:40a . +.. 05-29-01 5:06p .. +X1234~R1 0 06-13-01 11:40a X12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345 + ← 126文字以降が落ちている + 1 file(s) 0 bytes + 2 dir(s) 1,057,292,288 bytes free + +C:\> +----- + + bug#30) jis7/jis8/junet で全ての漢字を filename に使えるように修正 + o depend on bug#23 + o patch: sugj-tech:3705 + o テスト方法: + coding system = jis7/jis8/junet の設定で、「く」「渥」 + 「ッ」(半角仮名) 等「/」を含むファイル名を作成してみる。 + + bug#31) sjis/hex/cap で全ての漢字を NETBIOS 名に使えるように修正 + o depend on bug#23 + o patch: sugj-tech:3705 + o テスト方法: + coding system = sjis/hex/cap の設定で、「形」「港」等2バイト目に + 「`」を含む NETBIOS 名の client から access して、生成されるログ + ファイル名を確認する。 + + bug#32) %S 変数の日本語対応 + o patch: sugj-tech:3705 + o テスト方法: + 1.「log file」等で %S を含む設定をして日本語共有名が + そのまま反映されているかどうか確認する。 + 2.「valid users」「invalid users」「username」「read + list」「write list」「force user」「force group」の + 各設定文字列に「%S」を含み、日本語共有名に対してその + 効果を確認する。 + + bug#36) smbclient の日本語 NetBIOS 名対応。 + o depend on bug#4 + o patch: sugj-tech:3744 + o テスト方法: + 1.「netbios name =」に coding system の code で日本語 + 名を記述してから、 + smbclient //SERVER/SHARE + server 側で log filename 及び log 内容を確認。 + 2.-n option に続けて coding system の code で日本語名 + を記述して、 + smbclient //SERVER/SHARE -n 日本語 + server 側で log filename 及び log 内容を確認。 + + bug#37) %m マクロ展開の日本語対応を client codepage = 932 の時のみに限 + 定 + o depend on bug#19 + o patch: sugj-tech:3744 + o テスト方法: + client codepage = 850(Latin)/437(US) 等の設定で MSB=1 + の code (Umlaut や accent aigu 等) を NetBIOS 名に指定 + した client から access し、log filename の NetBIOS 名 + 部分が「_」になっていることを確認する。 + + bug#38) 真偽値を表す引数を int 型から BOOL 型に修正。 + o patch: sugj-tech:3711 + sugj-tech:3744 + o テスト方法: + 特に無し + + bug#39) smbclient で日本語ユーザ名が扱えない + o patch: sugj-tech:3776 + o テスト方法: + 「smbclient -U ユーザ」を実行して日本語ユーザ名指定の有 + 効性を確認する。 + + bug#40) dos_to_unix()/unix_to_dos() 発行箇所の不備によるコマンドの日本 + 語対応の不備 + o depend on bug#9 + o patch: sugj-tech:3776 + o テスト方法: + 下記の tool 群でひととおり日本語を使った利用をしてみる。 + masktest + rpcclient rpctorture + smbclient smbmount smbpasswd + smbsh smbspool smbtorture + + bug#41) coding system = cap/utf8 の時半角仮名 filename が正しく扱えな + い + o depends on bug#samba-2.0.10-ja-1.0 + o patch: sugj-tech:3775 + o テスト方法: + coding system = cap/utf8 で半角仮名を含む filename を生成し、UNIX 側 + から ls して確認する。もしくは、旧 Samba を稼働して同じ filename が + 生成されるかどうか確認する。 + + bug#42) 2バイト文字のファイル名のSFN作成時に2バイト目が大文字/小文字変 + 換ロジックによって変換されてしまう + o depends on bug#samba-2.0.10-ja-1.0 + o patch: sugj-tech:3780 + o テスト方法: + Win95/98 client で Samba 共有を network drive に割当て、 + LFN 対応していない DOS アプリ経由で「!.txt」「(.txt」 + の順で作成出来るかどうかを確認する。 + + bug#43) smbclient の builtin command の引数に directory を記述 + して指定すると、実在する場合でも error になってしまう。 + o patch: sugj-tech:3790 + o テスト方法: + smbclient の prompt で以下の operation を実行してみる。 + put DIR_NAME/FILE_NAME + mput DIR_NAME/WILD_CARD + get DIR_NAME/FILE_NAME + mgut DIR_NAME/WILD_CARD + del DIR_NAME/WILD_CARD + + bug#44) smbclient の tar command で、current directory が日本 + 語を sub directory を持つ場合に失敗してしまう。 + o depends on bug#43 + o patch: sugj-tech:3790 + o テスト方法: + smbclient の prompt で、日本語の sub directory を持つ + directory 下で以下の oparation を実行してみる。 + tar c FILE_NAME + + bug#45) asprintf(3) のない環境で compile 出来ない。 + o depends on bug#43 + o patch: sugj-tech:3792 + o テスト方法: + asprintf(3) のない環境で compile してみる。(NEWS-OS 等) + + bug#46) smbclient で長い日本語 pathname を含む tar file を扱え + ない。 + o depends on: bug#44 + o patch: sugj-tech:3792 + o テスト方法: + 1) 100 文字以上の日本語 pathname を含む tar file を local + に作成しておいて、smbclient prompt で「tar x TAR_FILE」 + を実行して、remote file が正しく生成されることを確認す + る。 + 2) 100 文字以上の日本語 pathname を server 上に構成する。 + テスト用 directory を作ってその下に 100 文字以上の日本 + 語 filename を作るか、もしくはテスト用 directory 名自 + 体を 100 文字以上の日本語名にすると良い。合わせて 100 + 文字以上になる構成でも可。 + smbclient を起動し、テスト用 directory 下の prompt で + 「tar c TAR_FILE」を実行して、local に作られた TAR_FILE + の内容を tar(1) で確認する。 + + bug#47) smbtorture で日本語が扱えない。もしくは文字化けする + o テスト方法: + 「smbtorture //サーバ/共有」を実行して結果を確認する。但 + し「サーバ」「共有」は実在するもので日本語名にすること。 + + bug#48) smbclient でコメントが文字化けする。 + o depends on bug#39 + o patch: sugj-tech:3790 (sugj-tech:3787) + o テスト方法: + 「smbclient -L //server」を実行して出力される一覧のコメ + ント部分に日本語が正しく表示されることを確認する。 + + bug#33) J0007: 「Sambaがマスタブラウザの時に日本語のコンピュータ名が文 + 字化けする」 + o patch: sugj-tech:3793 + o テスト方法: + 日本語の workgroup 名およびコメントを設定した上で、 + 「wins support = on」「wins proxy = on」の状態で nmbd を + 動かして、smbclient -L でこの server 情報を取得する。 + + a) welcome.html の文法ミスの修正 + o patch: sugj-tech:3781 + +修正予定の問題点など + + bug#26) J0005: FreeBSDで一部のアプリケーションからの書き込みに時間がか + かる + # ifdef 0 でなくて、FreeBSD の場合だけこのロジックが有効になるように + して取り込みましょうか? + + bug#27) ごみばこ patch + o patch: samba-jp:09932 Samba 用ゴミ箱 + + bug#28) J0013: log が無限に増え続ける + o patch: samba-jp:10004 log の増大について + +修正予定のない(メドが立たない)問題点など + 現状 merge する予定がそもそもない、できないもの + + bug#25) パラメータ受渡しに利用していた関数をマクロに展開する修正 + X-okuyama-expand-param-loadparm_c-FN_GLOBAL_XXXX-and-FN_LOCAL_XXXX-to-defines -## 既知の問題点 + bug#34) J0049: 「短いファイル名が同一になる」 + o patch: samba-jp:10017 - 現在判明している問題点については + bug#35) J0103: 上書きコピーで読み取り専用属性が消える + o sugj-tech:3667, samba-jp:10253 - http://www.samba.gr.jp/project/samba-ja/bugs.html +#48まで登録 -を参照してください。 diff -Nru samba-2.0.10-ja-1.0/packaging/Caldera/OpenLinux/samba2.spec samba-2.0.10-ja-1.1alpha1/packaging/Caldera/OpenLinux/samba2.spec --- samba-2.0.10-ja-1.0/packaging/Caldera/OpenLinux/samba2.spec Sat Jul 7 15:59:47 2001 +++ samba-2.0.10-ja-1.1alpha1/packaging/Caldera/OpenLinux/samba2.spec Tue Jul 17 04:05:09 2001 @@ -1,7 +1,7 @@ Summary: Samba SMB client and server Name: samba Version: 2.0.10 -Release: 1.0 +Release: 1.1alpha1 Copyright: GNU GPL version 2 Group: Server/Network Source: ftp://samba.org/pub/samba/samba-2.0.10.tar.gz diff -Nru samba-2.0.10-ja-1.0/packaging/Kondara/samba2.ja.spec samba-2.0.10-ja-1.1alpha1/packaging/Kondara/samba2.ja.spec --- samba-2.0.10-ja-1.0/packaging/Kondara/samba2.ja.spec Sat Jul 7 15:59:47 2001 +++ samba-2.0.10-ja-1.1alpha1/packaging/Kondara/samba2.ja.spec Tue Jul 17 04:05:10 2001 @@ -1,7 +1,7 @@ Summary: Samba SMB client and server Summary(ja): Samba SMB クライアントとサーバー Name: samba -#%define ja_rel 1.0 +#%define ja_rel 1.1alpha1 %define ja_rel 20000807 Version: 2.0.10 Release: ja_%{ja_rel} diff -Nru samba-2.0.10-ja-1.0/packaging/PHT/TurboLinux/makerpms.sh samba-2.0.10-ja-1.1alpha1/packaging/PHT/TurboLinux/makerpms.sh --- samba-2.0.10-ja-1.0/packaging/PHT/TurboLinux/makerpms.sh Sat Jul 7 15:59:47 2001 +++ samba-2.0.10-ja-1.1alpha1/packaging/PHT/TurboLinux/makerpms.sh Tue Jul 17 04:05:09 2001 @@ -7,7 +7,7 @@ GRPID=`id -g` VER=2.0.10 -LVER=1.0 +LVER=1.1alpha1 LPREF=ja ( cd ../../../.. ; chown -R ${USERID}.${GRPID} ${SRCDIR}/samba-${VER}-${LPREF}-${LVER}) diff -Nru samba-2.0.10-ja-1.0/packaging/PHT/TurboLinux/samba2.ja.spec samba-2.0.10-ja-1.1alpha1/packaging/PHT/TurboLinux/samba2.ja.spec --- samba-2.0.10-ja-1.0/packaging/PHT/TurboLinux/samba2.ja.spec Sat Jul 7 15:59:47 2001 +++ samba-2.0.10-ja-1.1alpha1/packaging/PHT/TurboLinux/samba2.ja.spec Tue Jul 17 04:05:09 2001 @@ -1,7 +1,7 @@ Summary: Samba SMB client and server Name: samba Version: 2.0.10 -%define ja_rel 1.0 +%define ja_rel 1.1alpha1 Release: ja_%{ja_rel} Copyright: GNU GPL version 2 Group: Networking diff -Nru samba-2.0.10-ja-1.0/packaging/PHT/TurboLinux/samba2.spec samba-2.0.10-ja-1.1alpha1/packaging/PHT/TurboLinux/samba2.spec --- samba-2.0.10-ja-1.0/packaging/PHT/TurboLinux/samba2.spec Sat Jul 7 15:59:47 2001 +++ samba-2.0.10-ja-1.1alpha1/packaging/PHT/TurboLinux/samba2.spec Tue Jul 17 04:05:09 2001 @@ -1,7 +1,7 @@ Summary: Samba SMB client and server Name: samba Version: 2.0.10 -Release: 1.0 +Release: 1.1alpha1 Copyright: GNU GPL version 2 Group: Networking Source: ftp://samba.org/pub/samba/samba-2.0.10.tar.gz @@ -15,13 +15,13 @@ %package debugtools Version: 2.0.10 -Release: 1.0 +Release: 1.1alpha1 Group: Networking Summary: Programs to debug Samba and to test SMB client integrity %package -n smbfs Version: 2.0.10 -Release: 1.0 +Release: 1.1alpha1 Group: Utilities/File Summary: Programs to mount SMB shares. diff -Nru samba-2.0.10-ja-1.0/packaging/RedHat/makerpms.sh samba-2.0.10-ja-1.1alpha1/packaging/RedHat/makerpms.sh --- samba-2.0.10-ja-1.0/packaging/RedHat/makerpms.sh Sat Jul 7 15:59:47 2001 +++ samba-2.0.10-ja-1.1alpha1/packaging/RedHat/makerpms.sh Tue Jul 17 04:05:10 2001 @@ -6,7 +6,7 @@ GRPID=`id -g` VER=2.0.10 -LVER=1.0 +LVER=1.1alpha1 LPREF=ja rpm3var () { diff -Nru samba-2.0.10-ja-1.0/packaging/RedHat/samba2.i18n.spec samba-2.0.10-ja-1.1alpha1/packaging/RedHat/samba2.i18n.spec --- samba-2.0.10-ja-1.0/packaging/RedHat/samba2.i18n.spec Sat Jul 7 15:59:47 2001 +++ samba-2.0.10-ja-1.1alpha1/packaging/RedHat/samba2.i18n.spec Tue Jul 17 04:05:10 2001 @@ -1,7 +1,7 @@ Summary: Samba SMB client and server Summary(ja): Samba SMB クライアントとサーバー Name: samba -%define ja_rel 1.0 +%define ja_rel 1.1alpha1 Version: 2.0.10 Release: ja_%{ja_rel} Vendor: Samba User Group Japan diff -Nru samba-2.0.10-ja-1.0/packaging/RedHat/samba2.ja.spec samba-2.0.10-ja-1.1alpha1/packaging/RedHat/samba2.ja.spec --- samba-2.0.10-ja-1.0/packaging/RedHat/samba2.ja.spec Sat Jul 7 15:59:47 2001 +++ samba-2.0.10-ja-1.1alpha1/packaging/RedHat/samba2.ja.spec Tue Jul 17 04:05:10 2001 @@ -1,7 +1,7 @@ Summary: Samba SMB client and server Name: samba Version: 2.0.10 -%define ja_rel 1.0 +%define ja_rel 1.1alpha1 Release: ja_%{ja_rel} Copyright: GNU GPL version 2 Group: Networking diff -Nru samba-2.0.10-ja-1.0/packaging/RedHat/samba2.spec samba-2.0.10-ja-1.1alpha1/packaging/RedHat/samba2.spec --- samba-2.0.10-ja-1.0/packaging/RedHat/samba2.spec Sat Jul 7 15:59:47 2001 +++ samba-2.0.10-ja-1.1alpha1/packaging/RedHat/samba2.spec Tue Jul 17 04:05:10 2001 @@ -1,7 +1,7 @@ Summary: Samba SMB client and server Name: samba Version: 2.0.10 -Release: 1.0 +Release: 1.1alpha1 Copyright: GNU GPL version 2 Group: Networking Source: ftp://samba.org/pub/samba/samba-2.0.10.tar.gz diff -Nru samba-2.0.10-ja-1.0/packaging/Solaris/pkginfo samba-2.0.10-ja-1.1alpha1/packaging/Solaris/pkginfo --- samba-2.0.10-ja-1.0/packaging/Solaris/pkginfo Sat Jul 7 15:59:47 2001 +++ samba-2.0.10-ja-1.1alpha1/packaging/Solaris/pkginfo Tue Jul 17 04:05:10 2001 @@ -1,7 +1,7 @@ PKG=samba NAME=SMB based file/printer sharing ARCH=sparc -VERSION=2.0.10-ja-1.0 +VERSION=2.0.10-ja-1.1alpha1 CATEGORY=system VENDOR=Samba Users Group Japan DESC=File and printer sharing for NT workstations diff -Nru samba-2.0.10-ja-1.0/packaging/Vine/samba2.ja.spec samba-2.0.10-ja-1.1alpha1/packaging/Vine/samba2.ja.spec --- samba-2.0.10-ja-1.0/packaging/Vine/samba2.ja.spec Sat Jul 7 15:59:47 2001 +++ samba-2.0.10-ja-1.1alpha1/packaging/Vine/samba2.ja.spec Tue Jul 17 04:05:10 2001 @@ -1,7 +1,7 @@ Summary: Samba SMB client and server Japanese Edition Summary(ja): Samba SMB クライアントとサーバー 日本語版 Name: samba -%define ja_rel 1.0 +%define ja_rel 1.1alpha1 Version: 2.0.10 Release: ja_%{ja_rel} Vendor: Samba Users Group Japan diff -Nru samba-2.0.10-ja-1.0/source/client/client.c samba-2.0.10-ja-1.1alpha1/source/client/client.c --- samba-2.0.10-ja-1.0/source/client/client.c Sat Jul 7 15:54:24 2001 +++ samba-2.0.10-ja-1.1alpha1/source/client/client.c Tue Jul 17 03:48:55 2001 @@ -31,7 +31,7 @@ extern BOOL in_client; static int port = SMB_PORT; pstring cur_dir = "\\"; -pstring cd_path = ""; +pstring cd_path = "\\"; static pstring service; static pstring desthost; extern pstring global_myname; @@ -190,6 +190,7 @@ msg[l] = c; } + unix_to_dos(msg, msg); if (!cli_message_text(cli, msg, l, grp_id)) { printf("SMBsendtxt failed (%s)\n",cli_errstr(cli)); return; @@ -232,8 +233,10 @@ ****************************************************************************/ static void cmd_pwd(void) { - DEBUG(0,("Current directory is %s",service)); - DEBUG(0,("%s\n",cur_dir)); + pstring s; + + DEBUG(0,("Current directory is %s", dos_to_unix(s, service))); + DEBUG(0,("%s\n", cd_path)); } @@ -255,7 +258,7 @@ pstrcpy(cur_dir,p); else pstrcat(cur_dir,p); - if (*(cur_dir+strlen(cur_dir)-1) != '\\') { + if (!(p = strrchr(cur_dir, '\\')) || *(p+1)) { pstrcat(cur_dir, "\\"); } dos_clean_name(cur_dir); @@ -265,12 +268,13 @@ if (!strequal(cur_dir,"\\")) { if (!cli_chkpath(cli, dname)) { + dos_to_unix(dname, dname); DEBUG(0,("cd %s: %s\n", dname, cli_errstr(cli))); pstrcpy(cur_dir,saved_dir); } } - pstrcpy(cd_path,cur_dir); + dos_to_unix(cd_path,cur_dir); } /**************************************************************************** @@ -278,12 +282,12 @@ ****************************************************************************/ static void cmd_cd(void) { - fstring buf; + pstring buf; if (next_token(NULL,buf,NULL,sizeof(buf))) do_cd(buf); else - DEBUG(0,("Current directory is %s\n",cur_dir)); + DEBUG(0,("Current directory is %s\n", cd_path)); } @@ -292,21 +296,24 @@ ********************************************************************/ static BOOL do_this_one(file_info *finfo) { + pstring name; + if (finfo->mode & aDIR) return(True); + dos_to_unix(name, finfo->name); if (*fileselection && !mask_match(finfo->name,fileselection,False,False)) { - DEBUG(3,("match_match %s failed\n", finfo->name)); + DEBUG(3,("match_match %s failed\n", name)); return False; } if (newer_than && finfo->mtime < newer_than) { - DEBUG(3,("newer_than %s failed\n", finfo->name)); + DEBUG(3,("newer_than %s failed\n", name)); return(False); } if ((archive_level==1 || archive_level==2) && !(finfo->mode & aARCH)) { - DEBUG(3,("archive %s failed\n", finfo->name)); + DEBUG(3,("archive %s failed\n", name)); return(False); } @@ -320,8 +327,10 @@ { if (do_this_one(finfo)) { time_t t = finfo->mtime; /* the time is assumed to be passed as GMT */ + pstring name; + DEBUG(0,(" %-30s%7.7s %8.0f %s", - finfo->name, + dos_to_unix(name, finfo->name), attrib_string(finfo->mode), (double)finfo->size, asctime(LocalTime(&t)))); @@ -468,6 +477,19 @@ ****************************************************************************/ static void do_list_helper(file_info *f, const char *mask) { + pstring saved_curdir; + pstring mask2; + char *p; + + pstrcpy(saved_curdir, cur_dir); + pstrcpy(mask2, mask); + string_replace(mask2, '/', '\\'); + p = strrchr(mask2, '\\'); + if (p) { + p[1] = '\0'; + pstrcpy(cur_dir, mask2); + } + if (f->mode & aDIR) { if (do_list_dirs && do_this_one(f)) { do_list_fn(f); @@ -475,23 +497,16 @@ if (do_list_recurse && !strequal(f->name,".") && !strequal(f->name,"..")) { - pstring mask2; - char *p; - - pstrcpy(mask2, mask); - p = strrchr(mask2,'\\'); if (!p) return; - p[1] = 0; pstrcat(mask2, f->name); pstrcat(mask2,"\\*"); add_to_do_list_queue(mask2); } - return; } - - if (do_this_one(f)) { + else if (do_this_one(f)) { do_list_fn(f); } + pstrcpy(cur_dir, saved_curdir); } @@ -501,6 +516,7 @@ void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),BOOL rec, BOOL dirs) { static int in_do_list = 0; + pstring name; if (in_do_list && rec) { @@ -544,7 +560,8 @@ strlen(next_file) - 2; *save_ch = '\0'; } - DEBUG(0,("\n%s\n",next_file)); + DEBUG(0,("\n%s\n", + dos_to_unix(name, next_file))); if (save_ch) { *save_ch = '\\'; @@ -556,7 +573,8 @@ { if (cli_list(cli, mask, attribute, do_list_helper) == -1) { - DEBUG(0, ("%s listing %s\n", cli_errstr(cli), mask)); + DEBUG(0, ("%s listing %s\n", cli_errstr(cli), + dos_to_unix(name, mask))); } } @@ -644,17 +662,20 @@ uint16 attr; size_t size; off_t nread = 0; + pstring name; GetTimeOfDay(&tp_start); if (lowercase) { strlower(lname); } + dos_to_unix(name, rname); + dos_to_unix(lname, lname); fnum = cli_open(cli, rname, O_RDONLY, DENY_NONE); if (fnum == -1) { - DEBUG(0,("%s opening remote file %s\n",cli_errstr(cli),rname)); + DEBUG(0,("%s opening remote file %s\n",cli_errstr(cli),name)); return; } @@ -679,7 +700,7 @@ } DEBUG(2,("getting file %s of size %.0f as %s ", - lname, (double)size, lname)); + name, (double)size, lname)); if(!(data = (char *)malloc(read_size))) { DEBUG(0,("malloc fail for size %d\n", read_size)); @@ -702,7 +723,7 @@ if (nread < size) { DEBUG (0, ("Short read when getting file %s. Only got %ld bytes.\n", - rname, (long)nread)); + name, (long)nread)); } free(data); @@ -757,6 +778,9 @@ } pstrcpy(lname,p); dos_clean_name(rname); + string_replace(lname, '/', '\\'); + p = strrchr(lname, '\\'); + if (p) memmove(lname, p+1, strlen(p)); next_token(NULL,lname,NULL,sizeof(lname)); @@ -773,6 +797,7 @@ pstring quest; pstring saved_curdir; pstring mget_mask; + pstring name; if (strequal(finfo->name,".") || strequal(finfo->name,"..")) return; @@ -782,12 +807,13 @@ return; } + dos_to_unix(name, finfo->name); if (finfo->mode & aDIR) slprintf(quest,sizeof(pstring)-1, - "Get directory %s? ",finfo->name); + "Get directory %s? ", name); else slprintf(quest,sizeof(pstring)-1, - "Get file %s? ",finfo->name); + "Get file %s? ", name); if (prompt && !yesno(quest)) return; @@ -807,16 +833,16 @@ unix_format(finfo->name); if (lowercase) strlower(finfo->name); - - if (!directory_exist(finfo->name,NULL) && - mkdir(finfo->name,0777) != 0) { - DEBUG(0,("failed to create directory %s\n",finfo->name)); + dos_to_unix(name, finfo->name); + if (!directory_exist(name, NULL) && + mkdir(name, 0777) != 0) { + DEBUG(0,("failed to create directory %s\n", name)); pstrcpy(cur_dir,saved_curdir); return; } - if (chdir(finfo->name) != 0) { - DEBUG(0,("failed to chdir to directory %s\n",finfo->name)); + if (chdir(name) != 0) { + DEBUG(0,("failed to chdir to directory %s\n", name)); pstrcpy(cur_dir,saved_curdir); return; } @@ -914,8 +940,10 @@ static BOOL do_mkdir(char *name) { if (!cli_mkdir(cli, name)) { + pstring s; + DEBUG(0,("%s making remote directory %s\n", - cli_errstr(cli),name)); + cli_errstr(cli), dos_to_unix(s, name))); return(False); } @@ -983,14 +1011,28 @@ int nread=0; char *buf=NULL; int maxwrite=io_bufsize; + pstring name; struct timeval tp_start; GetTimeOfDay(&tp_start); + dos_to_unix(name, rname); + dos_to_unix(lname, lname); + { + SMB_STRUCT_STAT st; + /* allow '-' to represent stdin + jdblair, 24.jun.98 */ + if (!file_exist(lname,&st) && + (strcmp(lname,"-"))) { + DEBUG(0,("%s does not exist\n",lname)); + return; + } + } + fnum = cli_open(cli, rname, O_WRONLY|O_CREAT|O_TRUNC, DENY_NONE); if (fnum == -1) { - DEBUG(0,("%s opening remote file %s\n",cli_errstr(cli),rname)); + DEBUG(0,("%s opening remote file %s\n",cli_errstr(cli),name)); return; } @@ -1010,7 +1052,7 @@ DEBUG(1,("putting file %s as %s ",lname, - rname)); + name)); buf = (char *)malloc(maxwrite); while (!feof(f)) { @@ -1036,7 +1078,7 @@ } if (!cli_close(cli, fnum)) { - DEBUG(0,("%s closing remote file %s\n",cli_errstr(cli),rname)); + DEBUG(0,("%s closing remote file %s\n",cli_errstr(cli),name)); fclose(f); if (buf) free(buf); return; @@ -1089,42 +1131,59 @@ } pstrcpy(lname,p); - if (next_token(NULL,p,NULL,sizeof(buf))) - pstrcat(rname,p); - else - pstrcat(rname,lname); + if (!next_token(NULL,p,NULL,sizeof(buf))) { + p = strrchr(lname, '/'); + if (p) p++; + else p = lname; + } + pstrcat(rname, p); dos_clean_name(rname); - { - SMB_STRUCT_STAT st; - /* allow '-' to represent stdin - jdblair, 24.jun.98 */ - if (!file_exist(lname,&st) && - (strcmp(lname,"-"))) { - DEBUG(0,("%s does not exist\n",lname)); - return; - } - } - do_put(rname,lname); } +/************************************* + File list structure +*************************************/ + +static struct file_list { + struct file_list *prev, *next; + char *file_path; + BOOL isdir; +} *file_list; + +/**************************************************************************** + Free a file_list structure +****************************************************************************/ + +static void free_file_list (struct file_list * list) +{ + struct file_list *tmp; + + while (list) + { + tmp = list; + DLIST_REMOVE(list, list); + if (tmp->file_path) free(tmp->file_path); + free(tmp); + } +} /**************************************************************************** seek in a directory/file list until you get something that doesn't start with the specified name ****************************************************************************/ -static BOOL seek_list(FILE *f,char *name) +static BOOL seek_list(struct file_list *list, char *name) { - pstring s; - while (!feof(f)) { - if (!fgets(s,sizeof(s),f)) return(False); + char *s; + while (list) { + s = list->file_path; trim_string(s, strlen( s )+1, "./", sizeof( "./" ), "\n", sizeof( "\n" )); if (strncmp(s,name,strlen(name)) != 0) { - pstrcpy(name,s); return(True); } + list = list->next; } return(False); @@ -1140,6 +1199,69 @@ next_token(NULL,fileselection,NULL,sizeof(fileselection)); } +/**************************************************************************** + Recursive file matching function act as find + match must be always set to True when calling this function +****************************************************************************/ +static int file_find(struct file_list **list, const char *directory, + const char *expression, BOOL match) +{ + DIR *dir; + struct file_list *entry; + struct stat statbuf; + int ret; + pstring path; + BOOL isdir; + char *dname; + + dir = opendir(directory); + if (!dir) return -1; + + while ((dname = readdirname(dir))) { + if (!strcmp("..", dname)) continue; + if (!strcmp(".", dname)) continue; + + slprintf(path, sizeof(path)-1, "%s/%s", directory, dname); + + isdir = False; + if (!match || unix_do_match(dname, (char *)expression, True)) { + if (recurse) { + ret = stat(path, &statbuf); + if (ret == 0) { + if (S_ISDIR(statbuf.st_mode)) { + isdir = True; + ret = file_find(list, path, expression, False); + } + } else { + DEBUG(0,("file_find: cannot stat file %s\n", path)); + } + + if (ret == -1) { + closedir(dir); + return -1; + } + } + entry = (struct file_list *) malloc(sizeof (struct file_list)); + if (!entry) { + DEBUG(0,("Out of memory in file_find\n")); + closedir(dir); + return -1; + } + entry->file_path = strdup(path); + if (entry->file_path == NULL) { + DEBUG(0,("Out of memory in file_find\n")); + free(entry); + closedir(dir); + return -1; + } + entry->isdir = isdir; + DLIST_ADD(*list, entry); + } + } + + closedir(dir); + return 0; +} /**************************************************************************** mput some files @@ -1152,64 +1274,60 @@ char *p=buf; while (next_token(NULL,p,NULL,sizeof(buf))) { - SMB_STRUCT_STAT st; - pstring cmd; - pstring tmpname; - FILE *f; - int fd; - - slprintf(tmpname,sizeof(tmpname)-1, "%s/ls.smb.XXXXXX", - tmpdir()); - fd = smb_mkstemp(tmpname); - - if (fd == -1) { - DEBUG(0,("Failed to create temporary file %s\n", - tmpname)); + int ret; + struct file_list *temp_list; + pstring name; + + file_list = NULL; + + p = strrchr(buf, '/'); + if (p) { + *(p++) = '\0'; + dos_to_unix(name, p); + dos_to_unix(buf, buf); + } + else { + dos_to_unix(name, buf); + pstrcpy(buf, "."); + } + ret = file_find(&file_list, buf, name, True); + if (ret) { + free_file_list(file_list); continue; } - if (recurse) - slprintf(cmd,sizeof(pstring)-1, - "find . -name \"%s\" -print > %s",p,tmpname); - else - slprintf(cmd,sizeof(pstring)-1, - "find . -maxdepth 1 -name \"%s\" -print > %s",p,tmpname); - system(cmd); - close(fd); - - f = sys_fopen(tmpname,"r"); - if (!f) continue; - unlink(tmpname); - - while (!feof(f)) { + for (temp_list = file_list; temp_list; + temp_list = temp_list->next) { pstring quest; - if (!fgets(lname,sizeof(lname),f)) break; + pstrcpy(lname, temp_list->file_path); + pstrcat(lname, "/"); trim_string( lname, strlen( lname )+1, - "./", sizeof( "./" ), "\n", sizeof("\n" )); - - again1: + "./", sizeof( "./" ), "/", sizeof("/" )); /* check if it's a directory */ - if (directory_exist(lname,&st)) { + unix_to_dos(name, lname); + p = strrchr(name, '/'); + if (p) p++; + else p = name; + if (temp_list->isdir) { if (!recurse) continue; slprintf(quest,sizeof(pstring)-1, "Put directory %s? ",lname); if (prompt && !yesno(quest)) { pstrcat(lname,"/"); - if (!seek_list(f,lname)) + if (!seek_list(temp_list, lname)) break; - goto again1; + continue; } pstrcpy(rname,cur_dir); - pstrcat(rname,lname); + pstrcat(rname,p); dos_format(rname); if (!cli_chkpath(cli, rname) && !do_mkdir(rname)) { pstrcat(lname,"/"); - if (!seek_list(f,lname)) + if (!seek_list(temp_list, lname)) break; - goto again1; } continue; } else { @@ -1218,14 +1336,14 @@ if (prompt && !yesno(quest)) continue; pstrcpy(rname,cur_dir); - pstrcat(rname,lname); + pstrcat(rname,p); } dos_format(rname); - do_put(rname,lname); + do_put(rname,name); } - fclose(f); + free_file_list(file_list); } } @@ -1295,7 +1413,10 @@ ****************************************************************************/ static void queue_fn(struct print_job_info *p) { - DEBUG(0,("%-6d %-9d %s\n", (int)p->id, (int)p->size, p->name)); + pstring name; + + DEBUG(0,("%-6d %-9d %s\n", + (int)p->id, (int)p->size, dos_to_unix(name, p->name))); } /**************************************************************************** @@ -1320,7 +1441,8 @@ return; if (!cli_unlink(cli, mask)) { - DEBUG(0,("%s deleting remote file %s\n",cli_errstr(cli),mask)); + DEBUG(0,("%s deleting remote file %s\n", + cli_errstr(cli), dos_to_unix(mask, mask))); } } @@ -1384,7 +1506,7 @@ if (!cli_rmdir(cli, mask)) { DEBUG(0,("%s removing remote directory file %s\n", - cli_errstr(cli),mask)); + cli_errstr(cli), dos_to_unix(mask, mask))); } } @@ -1546,7 +1668,8 @@ static void browse_fn(const char *name, uint32 m, const char *comment) { fstring typestr; - pstring s; + pstring uname; + pstring ucomment; *typestr=0; @@ -1562,8 +1685,9 @@ fstrcpy(typestr,"IPC"); break; } - dos_to_unix(s, strncpy_fill(s, unix_to_dos(s, name), 15)); - printf("\t%s%-10.10s%s\n", s, typestr, comment); + dos_to_unix(uname, strncpy_fill(uname, name, 15)); + dos_to_unix(ucomment, comment); + printf("\t%s%-10.10s%s\n", uname, typestr, ucomment); } @@ -1588,10 +1712,12 @@ ****************************************************************************/ static void server_fn(const char *name, uint32 m, const char *comment) { - pstring s; + pstring uname; + pstring ucomment; - dos_to_unix(s, strncpy_fill(s, unix_to_dos(s, name), 16)); - printf("\t%s %s\n", s, comment); + dos_to_unix(uname, strncpy_fill(uname, name, 16)); + dos_to_unix(ucomment, comment); + printf("\t%s %s\n", uname, ucomment); } /**************************************************************************** @@ -1807,6 +1933,7 @@ } /* and get the first part of the command */ + unix_to_dos(line, line); ptr = line; if (!next_token(&ptr,tok,NULL,sizeof(tok))) continue; @@ -1849,7 +1976,7 @@ temp = (char *)NULL; } - snprintf( prompt_str, PROMPTSIZE - 1, "smb: %s> ", cur_dir ); + snprintf( prompt_str, PROMPTSIZE - 1, "smb: %s> ", cd_path ); temp = readline( prompt_str ); /* We read the line here */ @@ -1862,7 +1989,7 @@ strncpy( line, temp, 1023 ); /* Maximum size of (pstring)line. Null is guarranteed. */ #else /* display a prompt */ - DEBUG(0,("smb: %s> ", cur_dir)); + DEBUG(0,("smb: %s> ", cd_path)); dbgflush( ); wait_keyboard(); @@ -1879,6 +2006,7 @@ } /* and get the first part of the command */ + unix_to_dos(line, line); ptr = line; if (!next_token(&ptr,tok,NULL,sizeof(tok))) continue; @@ -1903,6 +2031,7 @@ char *server_n; struct in_addr ip; extern struct in_addr ipzero; + pstring name; if (*share == '\\') { server = share+2; @@ -1926,14 +2055,15 @@ /* have to open a new connection */ if (!(c=cli_initialise(NULL)) || (cli_set_port(c, port) == 0) || !cli_connect(c, server_n, &ip)) { - DEBUG(0,("Connection to %s failed\n", server_n)); + DEBUG(0,("Connection to %s failed\n", + dos_to_unix(name, server_n))); return NULL; } if (!cli_session_request(c, &calling, &called)) { char *p; DEBUG(0,("session request to %s failed (%s)\n", - called.name, cli_errstr(c))); + dos_to_unix(name, called.name), cli_errstr(c))); cli_shutdown(c); if ((p=strchr(called.name, '.'))) { *p = 0; @@ -1957,7 +2087,7 @@ if (!got_pass) { char *pass = getpass("Password: "); if (pass) { - pstrcpy(password, pass); + unix_to_dos(password, pass); } } @@ -1984,7 +2114,8 @@ if (*c->server_domain || *c->server_os || *c->server_type) DEBUG(1,("Domain=[%s] OS=[%s] Server=[%s]\n", - c->server_domain,c->server_os,c->server_type)); + dos_to_unix(name, c->server_domain), + c->server_os,c->server_type)); DEBUG(4,(" session setup ok\n")); @@ -2111,7 +2242,7 @@ exit(1); } } - pstrcpy(password, pass); + unix_to_dos(password, pass); if (close_it) close(fd); } @@ -2164,23 +2295,25 @@ { struct in_addr ip; struct nmb_name called, calling; + pstring name; ip = ipzero; make_nmb_name(&calling, global_myname, 0x0); make_nmb_name(&called , desthost, name_type); + dos_to_unix(name, desthost); ip = ipzero; if (have_ip) ip = dest_ip; else { if (!resolve_name( desthost, &ip, name_type )) { - DEBUG(0,("Unable to resolve name %s\n", desthost)); + DEBUG(0,("Unable to resolve name %s\n", name)); return 1; } } if (!(cli=cli_initialise(NULL)) || !cli_connect(cli, desthost, &ip)) { - DEBUG(0,("Connection to %s failed\n", desthost)); + DEBUG(0,("Connection to %s failed\n", name)); return 1; } @@ -2284,7 +2417,7 @@ umask(myumask); if (getenv("USER")) { - pstrcpy(username,getenv("USER")); + unix_to_dos(username,getenv("USER")); /* modification to support userid%passwd syntax in the USER var 25.Aug.97, jdblair@uab.edu */ @@ -2301,7 +2434,7 @@ /* modification to support PASSWD environmental var 25.Aug.97, jdblair@uab.edu */ if (getenv("PASSWD")) { - pstrcpy(password,getenv("PASSWD")); + unix_to_dos(password,getenv("PASSWD")); got_pass = True; } @@ -2311,7 +2444,7 @@ } if (*username == 0 && getenv("LOGNAME")) { - pstrcpy(username,getenv("LOGNAME")); + unix_to_dos(username,getenv("LOGNAME")); strupper(username); } @@ -2325,13 +2458,13 @@ } if (*argv[1] != '-') { - pstrcpy(service,argv[1]); + unix_to_dos(service,argv[1]); argc--; argv++; if (argc > 1 && (*argv[1] != '-')) { got_pass = True; - pstrcpy(password,argv[1]); + unix_to_dos(password,argv[1]); memset(argv[1],'X',strlen(argv[1])); argc--; argv++; @@ -2352,7 +2485,7 @@ break; case 'M': name_type = 0x03; /* messages are sent to NetBIOS name type 0x3 */ - pstrcpy(desthost,optarg); + unix_to_dos(desthost,optarg); message = True; break; case 'i': @@ -2366,7 +2499,7 @@ got_pass = True; break; case 'n': - pstrcpy(global_myname,optarg); + unix_to_dos(global_myname,optarg); break; case 'd': if (*optarg == 'A') @@ -2401,20 +2534,21 @@ case 'U': { char *lp; - pstrcpy(username,optarg); + unix_to_dos(username,optarg); if ((lp=strchr(username,'%'))) { *lp = 0; pstrcpy(password,lp+1); got_pass = True; memset(strchr(optarg,'%')+1,'X',strlen(password)); } + strupper(username); } break; case 'L': p = optarg; while(*p == '\\' || *p == '/') p++; - pstrcpy(query_host,p); + unix_to_dos(query_host,p); break; case 't': pstrcpy(term_code, optarg); @@ -2423,7 +2557,7 @@ /* no longer supported */ break; case 'W': - pstrcpy(workgroup,optarg); + unix_to_dos(workgroup,optarg); break; case 'T': if (!tar_parseargs(argc, argv, optarg, optind)) { @@ -2432,7 +2566,7 @@ } break; case 'D': - pstrcpy(base_directory,optarg); + unix_to_dos(base_directory,optarg); break; case 'c': cmdstr = optarg; @@ -2460,6 +2594,7 @@ string_replace( service, '/','\\'); if (count_chars(service,'\\') < 3) { usage(pname); + dos_to_unix(service, service); printf("\n%s: Not enough '\\' characters in service\n",service); exit(1); } diff -Nru samba-2.0.10-ja-1.0/source/client/clitar.c samba-2.0.10-ja-1.1alpha1/source/client/clitar.c --- samba-2.0.10-ja-1.0/source/client/clitar.c Fri May 4 04:11:42 2001 +++ samba-2.0.10-ja-1.1alpha1/source/client/clitar.c Tue Jul 17 03:45:30 2001 @@ -119,6 +119,7 @@ extern BOOL readbraw_supported; extern int max_xmit; extern pstring cur_dir; +extern pstring cd_path; extern int get_total_time_ms; extern int get_total_size; extern int Protocol; @@ -174,16 +175,25 @@ { union hblock hb; int i, chk, l; + pstring lname; char *jp; - DEBUG(5, ("WriteTarHdr, Type = %c, Size= %i, Name = %s\n", ftype, size, aname)); + pstrcpy(lname, aname); + if (lowercase) + strlower(lname); + string_replace(lname, '\\', '/'); + dos_to_unix(lname, lname); + + DEBUG(5, ("WriteTarHdr, Type = %c, Size= %i, Name = %s\n", ftype, size, lname)); memset(hb.dummy, 0, sizeof(hb.dummy)); - l=strlen(aname); + l=strlen(lname); if (l >= NAMSIZ) { /* write a GNU tar style long header */ char *b; + pstring name; + b = (char *)malloc(l+TBLOCK+100); if (!b) { DEBUG(0,("out of memory\n")); @@ -191,18 +201,16 @@ } writetarheader(f, "/./@LongLink", l+1, 0, " 0 \0", 'L'); memset(b, 0, l+TBLOCK+100); - fixtarname(b, aname, l); + fixtarname(b, lname, l); i = strlen(b)+1; - DEBUG(5, ("File name in tar file: %s, size=%d, \n", b, (int)strlen(b))); + DEBUG(5, ("File name in tar file: %s, size=%d, \n", + dos_to_unix(name, b), (int)strlen(b))); dotarbuf(f, b, TBLOCK*(((i-1)/TBLOCK)+1)); free(b); } /* use l + 1 to do the null too */ - fixtarname(hb.dbuf.name, aname, (l >= NAMSIZ) ? NAMSIZ : l + 1); - - if (lowercase) - strlower(hb.dbuf.name); + fixtarname(hb.dbuf.name, lname, (l >= NAMSIZ) ? NAMSIZ-1 : l + 1); /* write out a "standard" tar format header */ @@ -232,6 +240,7 @@ long chk, fchk; int i; char *jp; + pstring name; /* * read in a "standard" tar format header - we're not that interested @@ -262,24 +271,24 @@ return -1; } - if ((finfo->name = string_create_s(strlen(prefix) + strlen(hb -> dbuf.name) + 3)) == NULL) { + unix_to_dos(name, hb -> dbuf.name); + if ((finfo->name = string_create_s(strlen(prefix) + strlen(name) + 3)) == NULL) { DEBUG(0, ("Out of space creating file_info2 for %s\n", hb -> dbuf.name)); return(-1); } - safe_strcpy(finfo->name, prefix, strlen(prefix) + strlen(hb -> dbuf.name) + 3); + safe_strcpy(finfo->name, prefix, strlen(prefix) + strlen(name) + 3); /* use l + 1 to do the null too; do prefix - prefcnt to zap leading slash */ - unfixtarname(finfo->name + strlen(prefix), hb->dbuf.name, - strlen(hb->dbuf.name) + 1, True); + unfixtarname(finfo->name + strlen(prefix), name, strlen(name) + 1, True); /* can't handle some links at present */ if ((hb->dbuf.linkflag != '0') && (hb -> dbuf.linkflag != '5')) { if (hb->dbuf.linkflag == 0) { DEBUG(6, ("Warning: NULL link flag (gnu tar archive ?) %s\n", - finfo->name)); + dos_to_unix(name, finfo->name))); } else { if (hb -> dbuf.linkflag == 'L') { /* We have a longlink */ /* Do nothing here at the moment. do_tarput will handle this @@ -427,24 +436,8 @@ *tptr++='.'; while (l > 0) { - int skip = get_character_len(*fp); - if(skip != 0) { - if (skip == 2) { - *tptr++ = *fp++; - *tptr++ = *fp++; - l -= 2; - } else if (skip == 1) { - *tptr++ = *fp++; - l--; - } - } else if (*fp == '\\') { - *tptr++ = '/'; - fp++; - l--; - } else { - *tptr++ = *fp++; - l--; - } + *tptr++ = *fp++; + l--; } } @@ -532,15 +525,17 @@ char *partpath, *ffname; char *p=fname, *basehack; + pstring name; - DEBUG(5, ( "Ensurepath called with: %s\n", fname)); + dos_to_unix(name, fname); + DEBUG(5, ( "Ensurepath called with: %s\n", name)); partpath = string_create_s(strlen(fname)); ffname = string_create_s(strlen(fname)); if ((partpath == NULL) || (ffname == NULL)){ - DEBUG(0, ("Out of memory in ensurepath: %s\n", fname)); + DEBUG(0, ("Out of memory in ensurepath: %s\n", name)); return(False); } @@ -570,7 +565,7 @@ return False; } else - DEBUG(3, ("mkdirhiering %s\n", partpath)); + DEBUG(3, ("mkdirhiering %s\n", dos_to_unix(name, partpath))); } @@ -630,6 +625,7 @@ char data[65520]; int read_size = 65520; int datalen=0; + pstring name; struct timeval tp_start; GetTimeOfDay(&tp_start); @@ -658,8 +654,7 @@ if (dry_run) { DEBUG(3,("skipping file %s of size %d bytes\n", - finfo.name, - (int)finfo.size)); + dos_to_unix(name, finfo.name), (int)finfo.size)); shallitime=0; ttarf+=finfo.size + TBLOCK - (finfo.size % TBLOCK); ntarf++; @@ -672,7 +667,7 @@ if (fnum == -1) { DEBUG(0,("%s opening remote file %s (%s)\n", - cli_errstr(cli),rname, cur_dir)); + cli_errstr(cli), dos_to_unix(name, rname), cd_path)); return; } @@ -691,27 +686,28 @@ finfo.ctime = finfo.mtime; } - DEBUG(3,("file %s attrib 0x%X\n",finfo.name,finfo.mode)); + dos_to_unix(name, finfo.name); + DEBUG(3,("file %s attrib 0x%X\n",name,finfo.mode)); if (tar_inc && !(finfo.mode & aARCH)) { - DEBUG(4, ("skipping %s - archive bit not set\n", finfo.name)); + DEBUG(4, ("skipping %s - archive bit not set\n", name)); shallitime=0; } else if (!tar_system && (finfo.mode & aSYSTEM)) { - DEBUG(4, ("skipping %s - system bit is set\n", finfo.name)); + DEBUG(4, ("skipping %s - system bit is set\n", name)); shallitime=0; } else if (!tar_hidden && (finfo.mode & aHIDDEN)) { - DEBUG(4, ("skipping %s - hidden bit is set\n", finfo.name)); + DEBUG(4, ("skipping %s - hidden bit is set\n", name)); shallitime=0; } else { DEBUG(3,("getting file %s of size %d bytes as a tar file %s", - finfo.name, + name, (int)finfo.size, lname)); @@ -724,8 +720,9 @@ datalen = cli_read(cli, fnum, data, nread, read_size); + dos_to_unix(name, rname); if (datalen == -1) { - DEBUG(0,("Error reading file %s : %s\n", rname, cli_errstr(cli))); + DEBUG(0,("Error reading file %s : %s\n", name, cli_errstr(cli))); break; } @@ -738,7 +735,7 @@ nread += datalen; if (datalen == 0) { - DEBUG(0,("Error reading file %s. Got 0 bytes\n", rname)); + DEBUG(0,("Error reading file %s. Got 0 bytes\n", name)); break; } @@ -780,9 +777,11 @@ if (tar_noisy) { + pstring name; + DEBUG(0, ("%10d (%7.1f kb/s) %s\n", (int)finfo.size, finfo.size / MAX(0.001, (1.024*this_time)), - finfo.name)); + dos_to_unix(name, finfo.name))); } /* Thanks to Carel-Jan Engel (ease@mail.wirehub.nl) for this one */ @@ -797,7 +796,7 @@ ***************************************************************************/ static void do_tar(file_info *finfo) { - pstring rname; + pstring name, rname; if (strequal(finfo->name,"..") || strequal(finfo->name,".")) return; @@ -822,7 +821,7 @@ #else (tar_re_search && mask_match(exclaim, cliplist[0], True, False))) { #endif - DEBUG(3,("Skipping file %s\n", exclaim)); + DEBUG(3,("Skipping file %s\n", dos_to_unix(name, exclaim))); return; } } @@ -834,23 +833,26 @@ safe_strcpy(saved_curdir, cur_dir, sizeof(saved_curdir)); - DEBUG(5, ("Sizeof(cur_dir)=%d, strlen(cur_dir)=%d, strlen(finfo->name)=%d\nname=%s,cur_dir=%s\n", (int)sizeof(cur_dir), (int)strlen(cur_dir), (int)strlen(finfo->name), finfo->name, cur_dir)); + DEBUG(5, ("Sizeof(cur_dir)=%d, strlen(cur_dir)=%d, strlen(finfo->name)=%d\nname=%s,cur_dir=%s\n", (int)sizeof(cur_dir), (int)strlen(cur_dir), (int)strlen(finfo->name), dos_to_unix(name, finfo->name), cd_path)); safe_strcat(cur_dir,finfo->name, sizeof(cur_dir)); safe_strcat(cur_dir,"\\", sizeof(cur_dir)); + dos_clean_name(cur_dir); - DEBUG(5, ("Writing a dir, Name = %s\n", cur_dir)); + dos_to_unix(name, cur_dir); + DEBUG(5, ("Writing a dir, Name = %s\n", name)); /* write a tar directory, don't bother with mode - just set it to * 40755 */ writetarheader(tarhandle, cur_dir, 0, finfo->mtime, "040755 \0", '5'); if (tar_noisy) { - DEBUG(0,(" directory %s\n", cur_dir)); + DEBUG(0,(" directory %s\n", name)); } ntarf++; /* Make sure we have a file on there */ safe_strcpy(mtar_mask,cur_dir, sizeof(pstring)); safe_strcat(mtar_mask,"*", sizeof(pstring)); - DEBUG(5, ("Doing list with mtar_mask: %s\n", mtar_mask)); + DEBUG(5, ("Doing list with mtar_mask: %s\n", + dos_to_unix(name, mtar_mask))); do_list(mtar_mask, attribute, do_tar, False, True); safe_strcpy(cur_dir,saved_curdir, sizeof(pstring)); } @@ -858,7 +860,7 @@ { safe_strcpy(rname,cur_dir, sizeof(pstring)); safe_strcat(rname,finfo->name, sizeof(pstring)); - do_atar(rname,finfo->name,finfo); + do_atar(rname,dos_to_unix(name, finfo->name),finfo); } } @@ -990,8 +992,10 @@ static int get_file(file_info2 finfo) { int fnum = -1, pos = 0, dsize = 0, rsize = 0, bpos = 0; + pstring name; - DEBUG(5, ("get_file: file: %s, size %i\n", finfo.name, (int)finfo.size)); + DEBUG(5, ("get_file: file: %s, size %i\n", + dos_to_unix(name, finfo.name), (int)finfo.size)); if (ensurepath(finfo.name) && (fnum=cli_open(cli, finfo.name, O_WRONLY|O_CREAT|O_TRUNC, DENY_NONE)) == -1) { @@ -1071,18 +1075,19 @@ /* Now we update the creation date ... */ - DEBUG(5, ("Updating creation date on %s\n", finfo.name)); + dos_to_unix(name, finfo.name); + DEBUG(5, ("Updating creation date on %s\n", name)); if (!cli_setatr(cli, finfo.name, finfo.mode, finfo.mtime)) { if (tar_real_noisy) { - DEBUG(0, ("Could not set time on file: %s\n", finfo.name)); + DEBUG(0, ("Could not set time on file: %s\n", name)); /*return(False); */ /* Ignore, as Win95 does not allow changes */ } } ntarf++; - DEBUG(0, ("restore tar file %s of size %d bytes\n", finfo.name, (int)finfo.size)); + DEBUG(0, ("restore tar file %s of size %d bytes\n", name, (int)finfo.size)); return(True); } @@ -1092,8 +1097,9 @@ */ static int get_dir(file_info2 finfo) { + pstring name; - DEBUG(0, ("restore directory %s\n", finfo.name)); + DEBUG(0, ("restore directory %s\n", dos_to_unix(name, finfo.name))); if (!ensurepath(finfo.name)) { @@ -1116,8 +1122,10 @@ char *longname = malloc(namesize); int offset = 0, left = finfo.size; BOOL first = True; + pstring name; - DEBUG(5, ("Restoring a long file name: %s\n", finfo.name)); + DEBUG(5, ("Restoring a long file name: %s\n", + dos_to_unix(name, finfo.name))); DEBUG(5, ("Len = %d\n", (int)finfo.size)); if (longname == NULL) { @@ -1127,13 +1135,6 @@ return(NULL); } - /* First, add cur_dir to the long file name */ - - if (strlen(cur_dir) > 0) { - strncpy(longname, cur_dir, namesize); - offset = strlen(cur_dir); - } - /* Loop through the blocks picking up the name */ while (left > 0) { @@ -1152,6 +1153,15 @@ left -= TBLOCK; } + unix_to_dos(name, longname); + + /* add cur_dir to the long file name */ + offset = strlen(cur_dir); + if (offset > 0) + strncpy(longname, cur_dir, offset); + + strncpy(longname + offset, name, namesize - offset); + longname[namesize-1] = '\0'; return(longname); @@ -1163,6 +1173,7 @@ struct timeval tp_start; char *longfilename = NULL, linkflag; int skip = False; + pstring name, cname; GetTimeOfDay(&tp_start); @@ -1189,7 +1200,7 @@ switch (readtarheader((union hblock *) buffer_p, &finfo, cur_dir)) { case -2: /* Hmm, not good, but not fatal */ - DEBUG(0, ("Skipping %s...\n", finfo.name)); + DEBUG(0, ("Skipping %s...\n", dos_to_unix(name, finfo.name))); if ((next_block(tarbuf, &buffer_p, tbufsiz) <= 0) && !skip_file(finfo.size)) { @@ -1237,7 +1248,9 @@ || (tar_re_search && mask_match(finfo.name, cliplist[0], True, False))); #endif - DEBUG(5, ("Skip = %i, cliplist=%s, file=%s\n", skip, (cliplist?cliplist[0]:NULL), finfo.name)); + DEBUG(5, ("Skip = %i, cliplist=%s, file=%s\n", skip, + (cliplist?dos_to_unix(cname, cliplist[0]):NULL), + dos_to_unix(name, finfo.name))); if (skip) { @@ -1273,7 +1286,7 @@ case '5': if (!get_dir(finfo)) { - DEBUG(0, ("Abandoning restore \n")); + DEBUG(0, ("Abandoning restore\n")); return; } break; @@ -1281,11 +1294,11 @@ case 'L': longfilename = get_longfilename(finfo); if (!longfilename) { - DEBUG(0, ("abandoning restore\n")); + DEBUG(0, ("Abandoning restore\n")); return; } - DEBUG(5, ("Long file name: %s\n", longfilename)); + DEBUG(5, ("Long file name: %s\n", dos_to_unix(name, longfilename))); break; default: @@ -1453,6 +1466,8 @@ ***************************************************************************/ int process_tar(void) { + pstring name; + initarbuf(); switch(tar_type) { case 'x': @@ -1472,7 +1487,7 @@ pstring tarmac; for (i=0; i 2 && strncmp(argv[0],"smb://", 6) && !strncmp(argv[1],"smb://", 6)) { @@ -116,6 +117,7 @@ } uri[sizeof(uri) - 1] = '\0'; + unix_to_dos(uri, uri); /* * Extract the destination from the URI... @@ -202,8 +204,9 @@ * Queue the job... */ + unix_to_dos(title, argv[3]); for (i = 0; i < copies; i ++) - if ((status = smb_print(cli, argv[3] /* title */, fp)) != 0) + if ((status = smb_print(cli, title, fp)) != 0) break; cli_shutdown(cli); diff -Nru samba-2.0.10-ja-1.0/source/include/kanji.h samba-2.0.10-ja-1.1alpha1/source/include/kanji.h --- samba-2.0.10-ja-1.0/source/include/kanji.h Sat Jul 7 15:55:10 2001 +++ samba-2.0.10-ja-1.1alpha1/source/include/kanji.h Tue Jul 17 03:11:46 2001 @@ -90,6 +90,8 @@ #define is_shift_jis(c) IS_KCTYPE(c, KC_SHIFT_JIS) #define is_shift_jis2(c) IS_KCTYPE(c, KC_SHIFT_JIS2) #define is_kana(c) IS_KCTYPE(c, KC_KANA) +#define is_shift_jis_str(s) (IS_KCTYPE((s)[0], KC_SHIFT_JIS) \ + && IS_KCTYPE((s)[1], KC_SHIFT_JIS2)) /* case conversion */ #define is_sj_upper2(c) IS_KCTYPE(c, KC_SJ_UPPER2) diff -Nru samba-2.0.10-ja-1.0/source/include/proto.h samba-2.0.10-ja-1.1alpha1/source/include/proto.h --- samba-2.0.10-ja-1.0/source/include/proto.h Sat Jul 7 15:55:10 2001 +++ samba-2.0.10-ja-1.1alpha1/source/include/proto.h Tue Jul 17 02:09:43 2001 @@ -410,9 +410,9 @@ BOOL in_list(char *s,char *list,BOOL casesensitive); void string_free(char **s); BOOL string_set(char **dest,const char *src); -BOOL string_sub(char *s,const char *pattern,const char *insert, size_t len); -BOOL fstring_sub(char *s,const char *pattern,const char *insert); -BOOL pstring_sub(char *s,const char *pattern,const char *insert); +BOOL string_sub(char *s,const char *pattern,const char *insert, size_t len, BOOL unixcode); +BOOL fstring_sub(char *s,const char *pattern,const char *insert, BOOL unixcode); +BOOL pstring_sub(char *s,const char *pattern,const char *insert, BOOL unixcode); BOOL all_string_sub(char *s,const char *pattern,const char *insert, size_t len); void split_at_last_component(char *path, char *front, char sep, char *back); char *octal_string(int i); @@ -1250,7 +1250,7 @@ BOOL lp_add_printer(char *pszPrintername, int iDefaultService); BOOL lp_file_list_changed(void); void *lp_local_ptr(int snum, void *ptr); -BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue, int unixcode); +BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue, BOOL unixcode); BOOL lp_is_default(int snum, struct parm_struct *parm); struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters); BOOL lp_snum_ok(int iService); diff -Nru samba-2.0.10-ja-1.0/source/include/smb.h samba-2.0.10-ja-1.1alpha1/source/include/smb.h --- samba-2.0.10-ja-1.0/source/include/smb.h Sat Jul 7 15:55:10 2001 +++ samba-2.0.10-ja-1.1alpha1/source/include/smb.h Tue Jul 17 01:19:54 2001 @@ -329,9 +329,11 @@ #define ERRsharebufexc 36 /* share buffer exceeded */ #define ERRdiskfull 39 +#define PSTRING_LEN 1024 +#define FSTRING_LEN 256 -typedef char pstring[1024]; -typedef char fstring[128]; +typedef char pstring[PSTRING_LEN]; +typedef char fstring[FSTRING_LEN]; /* * SMB UCS2 (16-bit unicode) internal type. @@ -340,8 +342,8 @@ typedef uint16 smb_ucs2_t; /* ucs2 string types. */ -typedef smb_ucs2_t wpstring[1024]; -typedef smb_ucs2_t wfstring[128]; +typedef smb_ucs2_t wpstring[PSTRING_LEN]; +typedef smb_ucs2_t wfstring[FSTRING_LEN]; /* pipe string names */ #define PIPE_LANMAN "\\PIPE\\LANMAN" @@ -871,7 +873,7 @@ gid_t gid; char name[24]; char addr[24]; - char machine[128]; + char machine[FSTRING_LEN]; time_t start; }; diff -Nru samba-2.0.10-ja-1.0/source/include/version.h samba-2.0.10-ja-1.1alpha1/source/include/version.h --- samba-2.0.10-ja-1.0/source/include/version.h Sat Jul 7 15:59:46 2001 +++ samba-2.0.10-ja-1.1alpha1/source/include/version.h Tue Jul 17 04:05:09 2001 @@ -1 +1 @@ -#define VERSION "2.0.10-ja-1.0" +#define VERSION "2.0.10-ja-1.1alpha1" diff -Nru samba-2.0.10-ja-1.0/source/lib/kanji.c samba-2.0.10-ja-1.1alpha1/source/lib/kanji.c --- samba-2.0.10-ja-1.0/source/lib/kanji.c Sat Jul 7 15:55:15 2001 +++ samba-2.0.10-ja-1.1alpha1/source/lib/kanji.c Tue Jul 17 03:11:49 2001 @@ -112,7 +112,7 @@ s1 = s; } for (q = s1; *s1; ) { - if (is_shift_jis (s1[0]) && is_shift_jis2 (s1[1])) { + if (is_shift_jis_str (s1)) { s1 += 2; } else if (is_kana (*s1)) { s1++; @@ -151,7 +151,7 @@ if (strncmp (s1, s2, len) == 0) return (const char *) s1; } - if (is_shift_jis (s1[0]) && is_shift_jis2 (s1[1])) { + if (is_shift_jis_str (s1)) { s1 += 2; } else { s1++; @@ -170,7 +170,7 @@ for (; *s; ) { if (*s == c) return s; - if (is_shift_jis (s[0]) && is_shift_jis2 (s[1])) { + if (is_shift_jis_str (s)) { s += 2; } else { s++; @@ -192,7 +192,7 @@ if (*s == c) { q = s; } - if (is_shift_jis (s[0]) && is_shift_jis2 (s[1])) { + if (is_shift_jis_str (s)) { s += 2; } else { s++; @@ -496,7 +496,7 @@ from = pstrcpy ((char *) cvtbuf, from); } for (out = to; *from && (out - to < sizeof(pstring)-3);) { - if (is_shift_jis (from[0]) && is_shift_jis2 (from[1])) { + if (is_shift_jis_str (from)) { int code = sj2euc ((unsigned char)from[0], (unsigned char)from[1]); *out++ = (code >> 8) & 0xff; *out++ = code & 0xff; @@ -709,7 +709,7 @@ from = pstrcpy ((char *) cvtbuf, from); } for (out = to; *from && (out - to < sizeof(pstring)-4);) { - if (is_shift_jis (from[0]) && is_shift_jis2 (from[1])) { + if (is_shift_jis_str (from)) { int code = sjis3euc ((unsigned char)from[0], (unsigned char)from[1], &len); if (len == 3) { @@ -798,7 +798,7 @@ } shifted = _KJ_ROMAN; for (out = to; *from && (out - to < sizeof(pstring)-9); ) { - if (is_shift_jis (from[0]) && is_shift_jis2 (from[1])) { + if (is_shift_jis_str (from)) { int code; switch (shifted) { case _KJ_ROMAN: /* to KANJI */ @@ -810,6 +810,7 @@ } code = sj2j ((unsigned char)from[0], (unsigned char)from[1]); *out++ = (code >> 8) & 0xff; + if ((code &= 0xff) == '/') code = ' '; *out++ = code; from += 2; } else { @@ -873,7 +874,12 @@ break; case _KJ_KANJI: { - int code = j2sj ((unsigned char)from[0], (unsigned char)from[1]); + int code; + + if (from[1] == ' ') + code = j2sj ((unsigned char)from[0], '/'); + else + code = j2sj ((unsigned char)from[0], (unsigned char)from[1]); *out++ = (code >> 8) & 0xff; *out++ = code; from += 2; @@ -901,60 +907,55 @@ } shifted = _KJ_ROMAN; for (out = to; *from && (out - to < sizeof(pstring)-11); ) { - if (is_shift_jis (from[0]) && is_shift_jis2 (from[1])) { + if (is_shift_jis_str (from)) { int code; - switch (shifted) { - case _KJ_KANA: - *out++ = jis_si; /* to ROMAN and through down */ - case _KJ_ROMAN: /* to KANJI */ - *out++ = jis_esc; + + if (shifted & _KJ_KANA) { + *out++ = jis_si; /* to ROMAN */ + shifted &= ~_KJ_KANA; + } + if (!(shifted & _KJ_KANJI)) { + *out++ = jis_esc; /* to KANJI */ *out++ = jis_so1; *out++ = jis_kso; - shifted = _KJ_KANJI; - break; + shifted |= _KJ_KANJI; } code = sj2j ((unsigned char)from[0], (unsigned char)from[1]); *out++ = (code >> 8) & 0xff; + if ((code &= 0xff) == '/') code = ' '; *out++ = code; from += 2; } else if (is_kana (from[0])) { - switch (shifted) { - case _KJ_KANJI: /* to ROMAN */ - *out++ = jis_esc; - *out++ = jis_si1; - *out++ = jis_ksi; - case _KJ_ROMAN: /* to KANA */ - *out++ = jis_so; - shifted = _KJ_KANA; - break; - } - *out++ = ((unsigned char)*from++) - 0x80; + if (!(shifted & _KJ_KANA)) { + *out++ = jis_so; /* to KANA */ + shifted |= _KJ_KANA; + } + if ((unsigned char)*from == '/' + 0x80) + *out++ = ' '; + else + *out++ = ((unsigned char)*from) - 0x80; + from++; } else { - switch (shifted) { - case _KJ_KANA: + if (shifted & _KJ_KANA) { *out++ = jis_si; /* to ROMAN */ - shifted = _KJ_ROMAN; - break; - case _KJ_KANJI: /* to ROMAN */ - *out++ = jis_esc; + shifted &= ~_KJ_KANA; + } + if (shifted & _KJ_KANJI) { + *out++ = jis_esc; /* to ROMAN */ *out++ = jis_si1; *out++ = jis_ksi; - shifted = _KJ_ROMAN; - break; + shifted &= ~_KJ_KANJI; } *out++ = *from++; } } - switch (shifted) { - case _KJ_KANA: + if (shifted & _KJ_KANA) *out++ = jis_si; /* to ROMAN */ - break; - case _KJ_KANJI: /* to ROMAN */ - *out++ = jis_esc; + if (shifted & _KJ_KANJI) { + *out++ = jis_esc; /* to ROMAN */ *out++ = jis_si1; *out++ = jis_ksi; - break; } *out = '\0'; return to; @@ -1001,14 +1002,23 @@ break; case _KJ_KANJI: { - int code = j2sj ((unsigned char)from[0], (unsigned char)from[1]); + int code; + + if (from[1] == ' ') + code = j2sj ((unsigned char)from[0], '/'); + else + code = j2sj ((unsigned char)from[0], (unsigned char)from[1]); *out++ = (code >> 8) & 0xff; *out++ = code; from += 2; } break; case _KJ_KANA: - *out++ = ((unsigned char)*from++) + 0x80; + if (*from == ' ') + *out++ = '/' + 0x80; + else + *out++ = ((unsigned char)*from) + 0x80; + from++; break; } } @@ -1032,7 +1042,7 @@ } shifted = _KJ_ROMAN; for (out = to; *from && (out - to < sizeof(pstring)-9); ) { - if (is_shift_jis (from[0]) && is_shift_jis2 (from[1])) { + if (is_shift_jis_str (from)) { int code; switch (shifted) { case _KJ_KANA: @@ -1045,6 +1055,7 @@ } code = sj2j ((unsigned char)from[0], (unsigned char)from[1]); *out++ = (code >> 8) & 0xff; + if ((code &= 0xff) == '/') code = ' '; *out++ = code; from += 2; } else if (is_kana (from[0])) { @@ -1057,7 +1068,11 @@ shifted = _KJ_KANA; break; } - *out++ = ((unsigned char)*from++) - 0x80; + if ((unsigned char)*from == '/' + 0x80) + *out++ = ' '; + else + *out++ = ((unsigned char)*from) - 0x80; + from++; } else { switch (shifted) { case _KJ_KANA: @@ -1123,14 +1138,23 @@ break; case _KJ_KANJI: { - int code = j2sj ((unsigned char)from[0], (unsigned char)from[1]); + int code; + + if (from[1] == ' ') + code = j2sj ((unsigned char)from[0], '/'); + else + code = j2sj ((unsigned char)from[0], (unsigned char)from[1]); *out++ = (code >> 8) & 0xff; *out++ = code; from += 2; } break; case _KJ_KANA: - *out++ = ((unsigned char)*from++) + 0x80; + if (*from == ' ') + *out++ = '/' + 0x80; + else + *out++ = ((unsigned char)*from) + 0x80; + from++; break; } } @@ -1156,7 +1180,7 @@ *out++ = bin2hex (((*from)>>4)&0x0f); *out++ = bin2hex ((*from)&0x0f); from++; - } else if (is_shift_jis (from[0]) && is_shift_jis2 (from[1])) { + } else if (is_shift_jis_str (from)) { int w; w = (int)(((unsigned char)from[0] << 8) | (unsigned char)from[1]); @@ -1214,7 +1238,7 @@ for (out = to; *from && (out - to < sizeof(pstring)-7);) { int w; - if (is_shift_jis (from[0]) && is_shift_jis2 (from[1])) { + if (is_shift_jis_str (from)) { w = (int)(((unsigned char)from[0] << 8) | (unsigned char)from[1]); from += 2; w = regularize_sjis(w); @@ -1223,7 +1247,7 @@ *out++ = bin2hex ((w>>8)&0x0f); w &= 0xff; } else { - w = *from++; + w = (unsigned char)*from++; } if (w >= 0x80) { *out++ = hex_tag; @@ -1280,7 +1304,7 @@ from = pstrcpy ((char *) cvtbuf, from); } for (out = to; *from && (out - to < sizeof(pstring)-3);) { - if (is_shift_jis (from[0]) && is_shift_jis2 (from[1])) { + if (is_shift_jis_str (from)) { w = (int)(((unsigned char)from[0] << 8) | (unsigned char)from[1]); from += 2; w = regularize_sjis(w); @@ -1306,11 +1330,11 @@ if (utf8_normalization != NF_NONE) { for (i = 0; *from && i < MAXUCS2STR-1; i++) { - if (is_shift_jis (from[0]) && is_shift_jis2 (from[1])) { + if (is_shift_jis_str (from)) { w = (int)(((unsigned char)from[0] << 8) | (unsigned char)from[1]); from += 2; } else { - w = *from++; + w = (unsigned char)*from++; } src[i] = doscp2ucs2(w); } @@ -1337,11 +1361,11 @@ from = pstrcpy ((char *) cvtbuf, from); } for (out = to; *from && (out - to < sizeof(pstring)-4);) { - if (is_shift_jis (from[0]) && is_shift_jis2 (from[1])) { + if (is_shift_jis_str (from)) { w = (int)(((unsigned char)from[0] << 8) | (unsigned char)from[1]); from += 2; } else { - w = *from++; + w = (unsigned char)*from++; } val = doscp2ucs2(w); diff -Nru samba-2.0.10-ja-1.0/source/lib/util.c samba-2.0.10-ja-1.1alpha1/source/lib/util.c --- samba-2.0.10-ja-1.0/source/lib/util.c Sat Jul 7 15:55:15 2001 +++ samba-2.0.10-ja-1.1alpha1/source/lib/util.c Tue Jul 17 03:11:49 2001 @@ -312,6 +312,26 @@ p++; /* Now convert the name to the rfc1001/1002 format. */ + if (lp_client_code_page() == KANJI_CODEPAGE) + for( i = 0; i < 16; i++ ) + { + if (i < 15 && is_shift_jis_str(&(buf[i]))) + { + c = (unsigned char)buf[i]; + p[i*2] = ( (c >> 4) & 0x000F ) + 'A'; + p[(i*2)+1] = (c & 0x000F) + 'A'; + c = (unsigned char)buf[++i]; + p[i*2] = ( (c >> 4) & 0x000F ) + 'A'; + p[(i*2)+1] = (c & 0x000F) + 'A'; + } + else + { + c = toupper( buf[i] ); + p[i*2] = ( (c >> 4) & 0x000F ) + 'A'; + p[(i*2)+1] = (c & 0x000F) + 'A'; + } + } + else for( i = 0; i < 16; i++ ) { c = toupper( buf[i] ); @@ -499,8 +519,9 @@ void dos_clean_name(char *s) { char *p=NULL; + pstring name; - DEBUG(3,("dos_clean_name [%s]\n",s)); + DEBUG(3,("dos_clean_name [%s]\n", dos_to_unix(name, s))); /* remove any double slashes */ all_string_sub(s, "\\\\", "\\", 0); @@ -1261,18 +1282,18 @@ if (!*regexp) return (*str == '.' && !*(str+1)) ? NULL : regexp; else if (*regexp == '?') { - if (is_shift_jis(*str) && is_shift_jis2(*(str+1))) + if (is_shift_jis_str(str)) str++; str++; regexp++; } else if (*regexp == '*') { if (do_match_sub_sj(str, regexp+1, win9x_semantics) == NULL) return NULL; - if (is_shift_jis(*str) && is_shift_jis2(*(str+1))) + if (is_shift_jis_str(str)) str++; str++; - } else if (is_shift_jis(*str) && is_shift_jis(*(str+1))) { - if (is_shift_jis(*regexp) && is_shift_jis(*(regexp+1))) { + } else if (is_shift_jis_str(str)) { + if (is_shift_jis_str(regexp)) { if (*str != *regexp) { int w1, w2; @@ -1319,18 +1340,18 @@ if (!*regexp) return (*str == '.' && !*(str+1)) ? NULL : regexp; else if (*regexp == '?') { - if (is_shift_jis(*str) && is_shift_jis2(*(str+1))) + if (is_shift_jis_str(str)) str++; str++; regexp++; } else if (*regexp == '*') { if (do_match_sub_cs_sj(str, regexp+1, win9x_semantics) == NULL) return NULL; - if (is_shift_jis(*str) && is_shift_jis2(*(str+1))) + if (is_shift_jis_str(str)) str++; str++; - } else if (is_shift_jis(*str) && is_shift_jis(*(str+1))) { - if (is_shift_jis(*regexp) && is_shift_jis(*(regexp+1))) { + } else if (is_shift_jis_str(str)) { + if (is_shift_jis_str(regexp)) { if (*str != *regexp) { int w1, w2; @@ -1415,8 +1436,8 @@ /* * Handle broken clients that send us old 8.3 format. */ - pstring_sub(t_pattern,"????????","*"); - pstring_sub(t_pattern,".???",".*"); + pstring_sub(t_pattern,"????????","*", False); + pstring_sub(t_pattern,".???",".*", False); #endif } @@ -1833,7 +1854,7 @@ char *p = strchr(hostname,'.'); if (p) *p = 0; - fstrcpy(my_name,hostname); + unix_to_dos(my_name,hostname); } return(True); @@ -2055,7 +2076,7 @@ DEBUG(3, ("NIS+ result: %s\n", entry->en_cols.en_cols_val[1].ec_value.ec_value_val)); pstrcpy(last_value, entry->en_cols.en_cols_val[1].ec_value.ec_value_val); - pstring_sub(last_value, "&", user_name); + pstring_sub(last_value, "&", user_name, False); fstrcpy(last_key, user_name); } } @@ -2240,7 +2261,7 @@ copylen = MIN((q+1-p),(sizeof(envname)-1)); strncpy(envname,p,copylen); envname[copylen] = '\0'; - string_sub(p,envname,envval,len); + string_sub(p,envname,envval,len, False); return 0; /* Allow the environment contents to be parsed. */ } @@ -2256,7 +2277,6 @@ char pidstr[10]; struct passwd *pass; char *username = sam_logon_in_ssb ? samlogon_user : sesssetup_user; - pstring unixname; for (s = str ; s && *s && (p = strchr(s,'%')); s = p ) { @@ -2274,38 +2294,29 @@ case 'G' : { if ((pass = Get_Pwnam(username,False))!=NULL) { - string_sub(p,"%G",gidtoname(pass->pw_gid),l); + string_sub(p,"%G",gidtoname(pass->pw_gid),l, False); } else { p += 2; } break; } - case 'N' : string_sub(p,"%N", automount_server(username),l); break; - case 'I' : string_sub(p,"%I", client_addr(Client),l); break; - case 'L' : string_sub(p,"%L", dos_to_unix(unixname,local_machine),l); break; - case 'M' : string_sub(p,"%M", client_name(Client),l); break; - case 'R' : string_sub(p,"%R", remote_proto,l); break; - case 'T' : string_sub(p,"%T", timestring(False),l); break; - case 'U' : string_sub(p,"%U", username,l); break; - case 'a' : string_sub(p,"%a", remote_arch,l); break; + case 'N' : string_sub(p,"%N", automount_server(username),l, False); break; + case 'I' : string_sub(p,"%I", client_addr(Client),l, False); break; + case 'L' : string_sub(p,"%L", local_machine,l, True); break; + case 'M' : string_sub(p,"%M", client_name(Client),l, False); break; + case 'R' : string_sub(p,"%R", remote_proto,l, False); break; + case 'T' : string_sub(p,"%T", timestring(False),l, False); break; + case 'U' : string_sub(p,"%U", username,l, False); break; + case 'a' : string_sub(p,"%a", remote_arch,l, False); break; case 'd' : { slprintf(pidstr,sizeof(pidstr) - 1, "%d",(int)getpid()); - string_sub(p,"%d", pidstr,l); - break; - } - case 'h' : string_sub(p,"%h", myhostname(),l); break; - case 'm' : { - int i; - - dos_to_unix(unixname, remote_machine); - for (i = 0; unixname[i]; i++) - if (unixname[i] == '/') - unixname[i] = '_'; - string_sub(p,"%m", unixname,l); + string_sub(p,"%d", pidstr,l, False); break; } - case 'v' : string_sub(p,"%v", VERSION,l); break; + case 'h' : string_sub(p,"%h", myhostname(),l, True); break; + case 'm' : string_sub(p,"%m", remote_machine,l, True); break; + case 'v' : string_sub(p,"%v", VERSION,l, False); break; case '$' : p += expand_env_var(p,l); break; /* Expand environment variables */ case '\0': p++; break; /* don't run off end if last character is % */ default : p+=2; break; @@ -2329,27 +2340,27 @@ switch (*(p+1)) { case 'H': if ((home = get_user_home_dir(conn->user))) { - string_sub(p,"%H",home,l); + string_sub(p,"%H",home,l, False); } else { p += 2; } break; case 'P': - string_sub(p,"%P",conn->connectpath,l); + string_sub(p,"%P",conn->connectpath,l, False); break; case 'S': string_sub(p,"%S", - lp_servicename(SNUM(conn)),l); + lp_servicename(SNUM(conn)),l, True); break; case 'g': string_sub(p,"%g", - gidtoname(conn->gid),l); + gidtoname(conn->gid),l, False); break; case 'u': - string_sub(p,"%u",conn->user,l); + string_sub(p,"%u",conn->user,l, False); break; /* Patch from jkf@soton.ac.uk Left the %N (NIS @@ -2361,7 +2372,7 @@ * service name, not the username. */ case 'p': string_sub(p,"%p", - automount_path(lp_servicename(SNUM(conn))),l); + automount_path(lp_servicename(SNUM(conn))),l, False); break; case '\0': p++; diff -Nru samba-2.0.10-ja-1.0/source/lib/util_str.c samba-2.0.10-ja-1.1alpha1/source/lib/util_str.c --- samba-2.0.10-ja-1.0/source/lib/util_str.c Sat Jul 7 15:55:15 2001 +++ samba-2.0.10-ja-1.1alpha1/source/lib/util_str.c Tue Jul 17 03:11:49 2001 @@ -124,7 +124,7 @@ { if (!*s || !*t) return *s - *t; - else if (is_shift_jis (*s) && is_shift_jis (*t)) + else if (is_shift_jis_str (s) && is_shift_jis_str (t)) { diff = ((int)(unsigned char) *s) - ((int)(unsigned char) *t); if (diff) { @@ -140,9 +140,9 @@ s += 2; t += 2; } - else if (is_shift_jis (*s)) + else if (is_shift_jis_str (s)) return 1; - else if (is_shift_jis (*t)) + else if (is_shift_jis_str (t)) return -1; else { @@ -192,7 +192,7 @@ { if (!*s || !*t) return toupper (*s) - toupper (*t); - else if (is_shift_jis (*s) && is_shift_jis (*t)) + else if (is_shift_jis_str (s) && is_shift_jis_str (t)) { diff = ((int)(unsigned char) *s) - ((int)(unsigned char) *t); if (diff) { @@ -242,9 +242,9 @@ s += 2; t += 2; } - else if (is_shift_jis (*s)) + else if (is_shift_jis_str (s)) return 1; - else if (is_shift_jis (*t)) + else if (is_shift_jis_str (t)) return -1; else { @@ -294,7 +294,7 @@ { if (!*s || !*t) return toupper (*s) - toupper (*t); - else if (is_shift_jis (*s) && is_shift_jis (*t)) + else if (is_shift_jis_str (s) && is_shift_jis_str (t)) { diff = ((int)(unsigned char) *s) - ((int)(unsigned char) *t); if (diff) { @@ -345,9 +345,9 @@ t += 2; n -= 2; } - else if (is_shift_jis (*s)) + else if (is_shift_jis_str (s)) return 1; - else if (is_shift_jis (*t)) + else if (is_shift_jis_str (t)) return -1; else { @@ -433,7 +433,7 @@ while (*s) { /* Win95 treats full width ascii characters as case sensitive. */ - if (is_shift_jis (*s)) + if (is_shift_jis_str (s)) { int w; @@ -502,7 +502,7 @@ while (*s) { /* Win95 treats full width ascii characters as case sensitive. */ - if (is_shift_jis (*s)) + if (is_shift_jis_str (s)) { int w; @@ -878,7 +878,7 @@ while (*s) { /* Win95 treats full width ascii characters as case sensitive. */ - if (is_shift_jis (*s)) + if (is_shift_jis_str (s)) { int w, c1, c2; @@ -942,7 +942,7 @@ while (*s) { /* Win95 treats full width ascii characters as case sensitive. */ - if (is_shift_jis (*s)) + if (is_shift_jis_str (s)) { int w, c1, c2; @@ -1128,10 +1128,11 @@ if (!other_safe_chars) other_safe_chars = ""; + if (lp_client_code_page() == KANJI_CODEPAGE) for(i = 0; i < len; i++) { int val = (src[i] & 0xff); - if (is_shift_jis(val) && is_shift_jis2(src[i+1])) { + if (is_shift_jis_str(&(src[i]))) { dest[i] = src[i]; dest[i+1] = src[i+1]; i++; @@ -1141,6 +1142,14 @@ else dest[i] = '_'; } + else + for(i = 0; i < len; i++) { + int val = (src[i] & 0xff); + if(isupper(val) ||islower(val) || isdigit(val) || strchr(other_safe_chars, val)) + dest[i] = src[i]; + else + dest[i] = '_'; + } dest[i] = '\0'; @@ -1389,20 +1398,68 @@ Return True if a change was made, False otherwise. ****************************************************************************/ -BOOL string_sub(char *s,const char *pattern,const char *insert, size_t len) +BOOL string_sub(char *s,const char *pattern,const char *insert, size_t len, BOOL unixcode) { BOOL changed = False; + pstring buf; char *p; ssize_t ls,lp,li, i; - if (!insert || !pattern || !s) return False; + if (!insert || !pattern || !*pattern || !s) return False; + + if (lp_client_code_page() == KANJI_CODEPAGE) + for (i = 0; insert[i] && i < sizeof(pstring)-3; i++) { + if (is_shift_jis_str(&(insert[i]))) { + buf[i] = insert[i]; + buf[i+1] = insert[i+1]; + i++; + } + else switch (insert[i]) { + case '`': + case '"': + case '\'': + case ';': + case '$': + case '%': + case '\r': + case '\n': + buf[i] = '_'; + break; + default: + buf[i] = insert[i]; + break; + } + } + else + for (i = 0; insert[i] && i < sizeof(pstring)-3; i++) { + switch (insert[i]) { + case '`': + case '"': + case '\'': + case ';': + case '$': + case '%': + case '\r': + case '\n': + buf[i] = '_'; + break; + default: + buf[i] = insert[i]; + break; + } + } + + buf[i] = '\0'; + + /* The insert string is dos code base. + If use as unix code, need to convert. + */ + if (unixcode) dos_to_unix(buf, buf); ls = (ssize_t)strlen(s); lp = (ssize_t)strlen(pattern); - li = (ssize_t)strlen(insert); + li = (ssize_t)strlen(buf); - if (!*pattern) return False; - while (lp <= ls && (p = strstr(s,pattern))) { changed = True; if (len && (ls + (li-lp) >= len)) { @@ -1414,22 +1471,7 @@ if (li != lp) { memmove(p+li,p+lp,strlen(p+lp)+1); } - for (i=0;i rdrcnt) continue; stype = IVAL(p,18) & ~SV_TYPE_LOCAL_LIST_ONLY; - - dos_to_unix(s1, sname); - dos_to_unix(s2, cmnt); - - fn(s1, stype, s2); + fn(sname, stype, cmnt); } } } @@ -957,14 +949,14 @@ * Non-encrypted passwords - convert to DOS codepage before encryption. */ passlen = 24; - unix_to_dos(dos_pword,pass); + fstrcpy(dos_pword,pass); SMBencrypt((uchar *)dos_pword,(uchar *)cli->cryptkey,(uchar *)pword); } else { if(!(cli->sec_mode & 2)) { /* * Non-encrypted passwords - convert to DOS codepage before using. */ - unix_to_dos(pword,pass); + fstrcpy(pword,pass); } else { memcpy(pword, pass, passlen); } @@ -972,7 +964,6 @@ slprintf(fullshare, sizeof(fullshare)-1, "\\\\%s\\%s", cli->desthost, share); - unix_to_dos(fullshare, fullshare); strupper(fullshare); set_message(cli->outbuf,4, @@ -988,7 +979,7 @@ p += passlen; fstrcpy(p,fullshare); p = skip_string(p,1); - unix_to_dos(p,dev); + fstrcpy(p,dev); SCVAL(cli->inbuf,smb_rcls, 1); @@ -1060,10 +1051,10 @@ p = smb_buf(cli->outbuf); *p++ = 4; - unix_to_dos(p,fname_src); + pstrcpy(p,fname_src); p = skip_string(p,1); *p++ = 4; - unix_to_dos(p,fname_dst); + pstrcpy(p,fname_dst); cli_send_smb(cli); if (!cli_receive_smb(cli)) { @@ -1097,7 +1088,7 @@ p = smb_buf(cli->outbuf); *p++ = 4; - unix_to_dos(p,fname); + pstrcpy(p,fname); cli_send_smb(cli); if (!cli_receive_smb(cli)) { @@ -1129,7 +1120,7 @@ p = smb_buf(cli->outbuf); *p++ = 4; - unix_to_dos(p,dname); + pstrcpy(p,dname); cli_send_smb(cli); if (!cli_receive_smb(cli)) { @@ -1161,7 +1152,7 @@ p = smb_buf(cli->outbuf); *p++ = 4; - unix_to_dos(p,dname); + pstrcpy(p,dname); cli_send_smb(cli); if (!cli_receive_smb(cli)) { @@ -1205,7 +1196,7 @@ SSVAL(cli->outbuf,smb_ntcreate_NameLength, strlen(fname)); p = smb_buf(cli->outbuf); - unix_to_dos(p,fname); + pstrcpy(p,fname); p = skip_string(p,1); cli_send_smb(cli); @@ -1283,7 +1274,7 @@ } p = smb_buf(cli->outbuf); - unix_to_dos(p,fname); + pstrcpy(p,fname); p = skip_string(p,1); cli_send_smb(cli); @@ -1739,7 +1730,7 @@ p = smb_buf(cli->outbuf); *p = 4; - unix_to_dos(p+1, fname); + pstrcpy(p+1, fname); cli_send_smb(cli); if (!cli_receive_smb(cli)) { @@ -1788,7 +1779,7 @@ p = smb_buf(cli->outbuf); *p = 4; - unix_to_dos(p+1, fname); + pstrcpy(p+1, fname); p = skip_string(p,1); *p = 4; @@ -1824,7 +1815,7 @@ memset(param, 0, param_len); SSVAL(param, 0, SMB_INFO_STANDARD); - unix_to_dos(¶m[6], fname); + pstrcpy(¶m[6], fname); do { ret = (cli_send_trans(cli, SMBtrans2, @@ -1897,7 +1888,7 @@ memset(param, 0, param_len); SSVAL(param, 0, SMB_QUERY_FILE_ALL_INFO); - unix_to_dos(¶m[6], fname); + pstrcpy(¶m[6], fname); if (!cli_send_trans(cli, SMBtrans2, NULL, 0, /* name, length */ @@ -2042,7 +2033,7 @@ finfo->mtime = make_unix_date2(p+12); finfo->size = IVAL(p,16); finfo->mode = CVAL(p,24); - dos_to_unix(finfo->name,p+27); + pstrcpy(finfo->name,p+27); } return(28 + CVAL(p,26)); @@ -2054,7 +2045,7 @@ finfo->mtime = make_unix_date2(p+12); finfo->size = IVAL(p,16); finfo->mode = CVAL(p,24); - dos_to_unix(finfo->name,p+31); + pstrcpy(finfo->name,p+31); } return(32 + CVAL(p,30)); @@ -2067,7 +2058,7 @@ finfo->mtime = make_unix_date2(p+16); finfo->size = IVAL(p,20); finfo->mode = CVAL(p,28); - dos_to_unix(finfo->name,p+33); + pstrcpy(finfo->name,p+33); } return(SVAL(p,4)+4); @@ -2079,7 +2070,7 @@ finfo->mtime = make_unix_date2(p+16); finfo->size = IVAL(p,20); finfo->mode = CVAL(p,28); - dos_to_unix(finfo->name,p+37); + pstrcpy(finfo->name,p+37); } return(SVAL(p,4)+4); @@ -2116,7 +2107,6 @@ p += 2; /* short name len? */ p += 24; /* short name? */ StrnCpy(finfo->name,p,MIN(sizeof(finfo->name)-1,namelen)); - dos_to_unix(finfo->name,finfo->name); return(ret); } return(SVAL(p,0)); @@ -2155,7 +2145,7 @@ uint16 setup; pstring param; - unix_to_dos(mask,Mask); + pstrcpy(mask,Mask); while (ff_eos == 0) { loop_count++; @@ -2248,8 +2238,6 @@ pstrcpy(mask,""); } - dos_to_unix(mask, mask); - /* and add them to the dirlist pool */ dirlist = Realloc(dirlist,dirlist_len + data_len); @@ -2336,11 +2324,11 @@ * use this as the key to make_oem_passwd_hash(). */ memset(upper_case_old_pw, '\0', sizeof(upper_case_old_pw)); - unix_to_dos(upper_case_old_pw, old_password); + pstrcpy(upper_case_old_pw, old_password); strupper(upper_case_old_pw); E_P16((uchar *)upper_case_old_pw, old_pw_hash); - unix_to_dos(dos_new_password, new_password); + pstrcpy(dos_new_password, new_password); if (!make_oem_passwd_hash( data, dos_new_password, old_pw_hash, False)) return False; @@ -2349,7 +2337,7 @@ * Now place the old password hash in the data. */ memset(upper_case_new_pw, '\0', sizeof(upper_case_new_pw)); - unix_to_dos(upper_case_new_pw, new_password); + pstrcpy(upper_case_new_pw, new_password); strupper(upper_case_new_pw); E_P16((uchar *)upper_case_new_pw, new_pw_hash); @@ -2409,7 +2397,7 @@ prots[numprots].name && prots[numprots].prot<=cli->protocol; numprots++) { *p++ = 2; - unix_to_dos(p,prots[numprots].name); + pstrcpy(p,prots[numprots].name); p += strlen(p) + 1; } @@ -3076,7 +3064,7 @@ cli_setup_packet(cli); p = smb_buf(cli->outbuf); *p++ = 4; - unix_to_dos(p,path2); + pstrcpy(p,path2); cli_send_smb(cli); if (!cli_receive_smb(cli)) { @@ -3106,10 +3094,10 @@ p = smb_buf(cli->outbuf); *p++ = 4; - unix_to_dos(p,username); + pstrcpy(p,username); p = skip_string(p,1); *p++ = 4; - unix_to_dos(p,host); + pstrcpy(p,host); p = skip_string(p,1); set_message(cli->outbuf,0,PTR_DIFF(p,smb_buf(cli->outbuf)),False); @@ -3141,7 +3129,6 @@ */ msg[len] = '\0'; - unix_to_dos(msg,msg); len = strlen(msg); memset(cli->outbuf,'\0',smb_size); diff -Nru samba-2.0.10-ja-1.0/source/param/loadparm.c samba-2.0.10-ja-1.1alpha1/source/param/loadparm.c --- samba-2.0.10-ja-1.0/source/param/loadparm.c Sat Jul 7 15:55:29 2001 +++ samba-2.0.10-ja-1.1alpha1/source/param/loadparm.c Tue Jul 17 02:20:33 2001 @@ -1453,7 +1453,7 @@ BOOL *pcopymapDest ); static BOOL service_ok(int iService); static BOOL do_parameter(char *pszParmName, char *pszParmValue); -static BOOL lp_do_section(char *pszSectionName, int unixcode); +static BOOL lp_do_section(char *pszSectionName, BOOL unixcode); static BOOL do_section(char *pszSectionName); static void init_copymap(service *pservice); @@ -2080,18 +2080,14 @@ static BOOL handle_netbios_name(char *pszParmValue,char **ptr) { - pstring netbios_name; - - pstrcpy(netbios_name,pszParmValue); - - standard_sub_basic(netbios_name); - strupper(netbios_name); - /* * Convert from UNIX to DOS string - the UNIX to DOS converter * isn't called on the special handlers. */ - unix_to_dos(global_myname,netbios_name); + unix_to_dos(global_myname, pszParmValue); + + standard_sub_basic(global_myname); + strupper(global_myname); DEBUG(4,("handle_netbios_name: set global_myname to: %s\n", global_myname)); @@ -2380,7 +2376,7 @@ Process a parameter for a particular service number. If snum < 0 then assume we are in the globals ***************************************************************************/ -BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue, int unixcode) +BOOL lp_do_parameter(int snum, char *pszParmName, char *pszParmValue, BOOL unixcode) { int parmnum, i; pstring s; @@ -2625,7 +2621,7 @@ Later we'll have special sections that permit server parameters to be set. Returns True on success, False on failure. ***************************************************************************/ -static BOOL lp_do_section(char *pszSectionName, int unixcode) +static BOOL lp_do_section(char *pszSectionName, BOOL unixcode) { BOOL bRetval, isglobal; pstring s; diff -Nru samba-2.0.10-ja-1.0/source/passdb/ldap.c samba-2.0.10-ja-1.1alpha1/source/passdb/ldap.c --- samba-2.0.10-ja-1.0/source/passdb/ldap.c Sat Jul 7 15:55:34 2001 +++ samba-2.0.10-ja-1.1alpha1/source/passdb/ldap.c Tue Jul 17 01:56:30 2001 @@ -121,7 +121,7 @@ so in ldap filter, %u MUST exist :-) */ pstrcpy(filter,lp_ldap_filter()); - pstring_sub(filter,"%u",user); + pstring_sub(filter,"%u",user, False); if ( !ldap_search_one_user(ldap_struct, filter, result) ) { diff -Nru samba-2.0.10-ja-1.0/source/passdb/smbpasschange.c samba-2.0.10-ja-1.1alpha1/source/passdb/smbpasschange.c --- samba-2.0.10-ja-1.0/source/passdb/smbpasschange.c Fri May 4 04:11:43 2001 +++ samba-2.0.10-ja-1.1alpha1/source/passdb/smbpasschange.c Tue Jul 17 03:00:19 2001 @@ -67,9 +67,14 @@ struct smb_passwd *smb_pwent; uchar new_p16[16]; uchar new_nt_p16[16]; + pstring uname; + pstring pass; *err_str = '\0'; *msg_str = '\0'; + + user_name = dos_to_unix(uname, user_name); + new_passwd = dos_to_unix(pass, new_passwd); if (local_flags & LOCAL_ADD_USER) { diff -Nru samba-2.0.10-ja-1.0/source/printing/printing.c samba-2.0.10-ja-1.1alpha1/source/printing/printing.c --- samba-2.0.10-ja-1.0/source/printing/printing.c Sat Jul 7 15:55:42 2001 +++ samba-2.0.10-ja-1.1alpha1/source/printing/printing.c Tue Jul 17 01:56:33 2001 @@ -74,8 +74,8 @@ DEBUG(2,("WARNING! No placeholder for the filename in the print command for service %s!\n", SERVICE(snum))); } - pstring_sub(syscmd, "%s", filename); - pstring_sub(syscmd, "%f", filename); + pstring_sub(syscmd, "%s", filename, False); + pstring_sub(syscmd, "%f", filename, False); /* Does the service have a printername? If not, make a fake and empty */ @@ -87,7 +87,7 @@ tstr = SERVICE(snum); } - pstring_sub(syscmd, "%p", tstr); + pstring_sub(syscmd, "%p", tstr, False); standard_sub(conn,syscmd); @@ -411,7 +411,7 @@ int count=0; /* handle the case of "(standard input)" as a filename */ - pstring_sub(line,"standard input","STDIN"); + pstring_sub(line,"standard input","STDIN", False); all_string_sub(line,"(","\"",0); all_string_sub(line,")","\"",0); @@ -528,7 +528,7 @@ } if (!header_line_ok) return (False); /* incorrect header line */ /* handle the case of "(standard input)" as a filename */ - pstring_sub(line,"standard input","STDIN"); + pstring_sub(line,"standard input","STDIN", False); all_string_sub(line,"(","\"",0); all_string_sub(line,")","\"",0); @@ -566,7 +566,7 @@ else if (base_prio) base_prio_reset=False; /* handle the dash in the job id */ - pstring_sub(line,"-"," "); + pstring_sub(line,"-"," ", False); for (count=0; count<12 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ; @@ -690,14 +690,14 @@ DEBUG(4,("antes [%s]\n", line)); /* handle the case of "-- standard input --" as a filename */ - pstring_sub(line,"standard input","STDIN"); + pstring_sub(line,"standard input","STDIN", False); DEBUG(4,("despues [%s]\n", line)); all_string_sub(line,"-- ","\"",0); all_string_sub(line," --","\"",0); DEBUG(4,("despues 1 [%s]\n", line)); - pstring_sub(line,"[job #",""); - pstring_sub(line,"]",""); + pstring_sub(line,"[job #","", False); + pstring_sub(line,"]","", False); DEBUG(4,("despues 2 [%s]\n", line)); @@ -753,7 +753,7 @@ int count=0; /* handle the case of "(standard input)" as a filename */ - pstring_sub(line,"stdin","STDIN"); + pstring_sub(line,"stdin","STDIN", False); all_string_sub(line,"(","\"",0); all_string_sub(line,")","\"",0); @@ -823,7 +823,7 @@ int count=0; /* mung all the ":"s to spaces*/ - pstring_sub(line,":"," "); + pstring_sub(line,":"," ", False); for (count=0; count<10 && next_token(&line,tok[count],NULL,sizeof(tok[count])); count++) ; @@ -1018,7 +1018,7 @@ } pstrcpy(syscmd,lpq_command); - pstring_sub(syscmd,"%p",printername); + pstring_sub(syscmd,"%p",printername, False); standard_sub(conn,syscmd); @@ -1104,8 +1104,8 @@ slprintf(jobstr,sizeof(jobstr)-1,"%d",jobid); pstrcpy(syscmd,lprm_command); - pstring_sub(syscmd,"%p",printername); - pstring_sub(syscmd,"%j",jobstr); + pstring_sub(syscmd,"%p",printername, False); + pstring_sub(syscmd,"%j",jobstr, False); standard_sub(conn,syscmd); ret = smbrun(syscmd,NULL,False); @@ -1142,8 +1142,8 @@ slprintf(jobstr,sizeof(jobstr)-1,"%d",jobid); pstrcpy(syscmd,lpstatus_command); - pstring_sub(syscmd,"%p",printername); - pstring_sub(syscmd,"%j",jobstr); + pstring_sub(syscmd,"%p",printername, False); + pstring_sub(syscmd,"%j",jobstr, False); standard_sub(conn,syscmd); ret = smbrun(syscmd,NULL,False); @@ -1198,7 +1198,7 @@ } pstrcpy(syscmd,queuestatus_command); - pstring_sub(syscmd,"%p",printername); + pstring_sub(syscmd,"%p",printername, False); standard_sub(conn,syscmd); ret = smbrun(syscmd,NULL,False); diff -Nru samba-2.0.10-ja-1.0/source/rpc_server/srv_srvsvc.c samba-2.0.10-ja-1.1alpha1/source/rpc_server/srv_srvsvc.c --- samba-2.0.10-ja-1.0/source/rpc_server/srv_srvsvc.c Sat Jul 7 15:55:48 2001 +++ samba-2.0.10-ja-1.1alpha1/source/rpc_server/srv_srvsvc.c Tue Jul 17 01:56:35 2001 @@ -45,7 +45,7 @@ (get_remote_arch() == RA_WIN2K) ? 127 : 12); pstrcpy(net_name, service); pstrcpy(remark, lp_comment(snum)); - pstring_sub(remark,"%S", service); + pstring_sub(remark,"%S", service, False); len_net_name = strlen(net_name); /* work out the share type */ @@ -77,7 +77,7 @@ pstrcpy(net_name, lp_servicename(snum)); pstrcpy(remark, lp_comment(snum)); - pstring_sub(remark,"%S",lp_servicename(snum)); + pstring_sub(remark,"%S",lp_servicename(snum), False); pstrcpy(path, lp_pathname(snum)); pstrcpy(passwd, ""); len_net_name = strlen(net_name); diff -Nru samba-2.0.10-ja-1.0/source/rpcclient/rpcclient.c samba-2.0.10-ja-1.1alpha1/source/rpcclient/rpcclient.c --- samba-2.0.10-ja-1.0/source/rpcclient/rpcclient.c Sat Jul 7 15:55:51 2001 +++ samba-2.0.10-ja-1.1alpha1/source/rpcclient/rpcclient.c Tue Jul 17 03:00:21 2001 @@ -479,7 +479,7 @@ if (getenv("USER")) { - pstrcpy(smb_cli->user_name,getenv("USER")); + unix_to_dos(smb_cli->user_name,getenv("USER")); /* modification to support userid%passwd syntax in the USER var 25.Aug.97, jdblair@uab.edu */ @@ -505,7 +505,7 @@ if (*smb_cli->user_name == 0 && getenv("LOGNAME")) { - pstrcpy(smb_cli->user_name,getenv("LOGNAME")); + unix_to_dos(smb_cli->user_name,getenv("LOGNAME")); strupper(smb_cli->user_name); } @@ -593,7 +593,7 @@ case 'U': { char *lp; - pstrcpy(smb_cli->user_name,optarg); + unix_to_dos(smb_cli->user_name,optarg); if ((lp=strchr(smb_cli->user_name,'%'))) { *lp = 0; @@ -601,6 +601,7 @@ got_pass = True; memset(strchr(optarg,'%')+1,'X',strlen(password)); } + strupper(smb_cli->user_name); break; } diff -Nru samba-2.0.10-ja-1.0/source/smbd/chgpasswd.c samba-2.0.10-ja-1.1alpha1/source/smbd/chgpasswd.c --- samba-2.0.10-ja-1.0/source/smbd/chgpasswd.c Fri May 4 04:11:44 2001 +++ samba-2.0.10-ja-1.1alpha1/source/smbd/chgpasswd.c Tue Jul 17 01:56:38 2001 @@ -441,12 +441,12 @@ } } - pstring_sub(passwordprogram,"%u",name); + pstring_sub(passwordprogram,"%u",name, False); /* note that we do NOT substitute the %o and %n in the password program as this would open up a security hole where the user could use a new password containing shell escape characters */ - pstring_sub(chatsequence,"%u",name); + pstring_sub(chatsequence,"%u",name, False); all_string_sub(chatsequence,"%o",oldpass,sizeof(pstring)); all_string_sub(chatsequence,"%n",newpass,sizeof(pstring)); return(chat_with_program(passwordprogram,name,chatsequence, as_root)); diff -Nru samba-2.0.10-ja-1.0/source/smbd/filename.c samba-2.0.10-ja-1.1alpha1/source/smbd/filename.c --- samba-2.0.10-ja-1.0/source/smbd/filename.c Sat Jul 7 15:55:56 2001 +++ samba-2.0.10-ja-1.1alpha1/source/smbd/filename.c Tue Jul 17 03:11:52 2001 @@ -395,7 +395,7 @@ if (lp_client_code_page() == KANJI_CODEPAGE) { for (s=name2 ; *s ; s++) { - if (is_shift_jis(*s) && is_shift_jis2(*(s+1))) s++; + if (is_shift_jis_str(s)) s++; else if (!issafe(*s) && !is_kana(*s)) *s = '_'; } } else diff -Nru samba-2.0.10-ja-1.0/source/smbd/ipc.c samba-2.0.10-ja-1.1alpha1/source/smbd/ipc.c --- samba-2.0.10-ja-1.0/source/smbd/ipc.c Sat Jul 7 15:55:56 2001 +++ samba-2.0.10-ja-1.1alpha1/source/smbd/ipc.c Tue Jul 17 03:11:52 2001 @@ -81,7 +81,7 @@ if (!src || !dst || !n || !(*dst)) return(0); StrnCpy(buf,src,sizeof(buf)/2); - pstring_sub(buf,"%S",lp_servicename(snum)); + pstring_sub(buf,"%S",lp_servicename(snum), False); standard_sub(conn,buf); StrnCpy(*dst,buf,*n); l = strlen(*dst) + 1; @@ -106,7 +106,7 @@ pstring buf; if (!s) return(0); StrnCpy(buf,s,sizeof(buf)/2); - pstring_sub(buf,"%S",lp_servicename(snum)); + pstring_sub(buf,"%S",lp_servicename(snum), False); standard_sub(conn,buf); return strlen(buf) + 1; } @@ -116,7 +116,7 @@ static pstring buf; if (!s) return(NULL); StrnCpy(buf,s,sizeof(buf)/2); - pstring_sub(buf,"%S",lp_servicename(snum)); + pstring_sub(buf,"%S",lp_servicename(snum), False); standard_sub(conn,buf); return &buf[0]; } @@ -2060,7 +2060,7 @@ if (isalpha((int)*s) || is_kana(*s)) { name[l++] = *s; s++; - } else if (is_shift_jis(*s) && is_shift_jis2(*(s+1))) { + } else if (is_shift_jis_str(s)) { name[l++] = *s; name[l++] = *(s+1); s += 2; @@ -2068,8 +2068,7 @@ if (l) while (l<64 && *s) { if (issafe(*s) || is_kana(*s)) name[l++] = *s; - else if (is_shift_jis(*s) && - is_shift_jis2(*(s+1))) { + else if (is_shift_jis_str(s)) { if (l>=63) break; name[l++] = *(s++); name[l++] = *s; diff -Nru samba-2.0.10-ja-1.0/source/smbd/message.c samba-2.0.10-ja-1.1alpha1/source/smbd/message.c --- samba-2.0.10-ja-1.0/source/smbd/message.c Sat Jul 7 15:55:56 2001 +++ samba-2.0.10-ja-1.1alpha1/source/smbd/message.c Tue Jul 17 01:56:38 2001 @@ -86,10 +86,10 @@ pstring s; pstrcpy(s,lp_msg_command()); - pstring_sub(s,"%f",alpha_strcpy(alpha_msgfrom,msgfrom,NULL,sizeof(alpha_msgfrom))); - pstring_sub(s,"%t",alpha_strcpy(alpha_msgto,msgto,NULL,sizeof(alpha_msgto))); + pstring_sub(s,"%f",alpha_strcpy(alpha_msgfrom,msgfrom,NULL,sizeof(alpha_msgfrom)), True); + pstring_sub(s,"%t",alpha_strcpy(alpha_msgto,msgto,NULL,sizeof(alpha_msgto)), True); standard_sub_basic(s); - pstring_sub(s,"%s",name); + pstring_sub(s,"%s",name, False); smbrun(s,NULL,False); } diff -Nru samba-2.0.10-ja-1.0/source/smbd/password.c samba-2.0.10-ja-1.1alpha1/source/smbd/password.c --- samba-2.0.10-ja-1.0/source/smbd/password.c Sat Jul 7 15:55:56 2001 +++ samba-2.0.10-ja-1.1alpha1/source/smbd/password.c Tue Jul 17 01:56:38 2001 @@ -568,8 +568,8 @@ StrnCpy(valid, lp_valid_users(snum), sizeof(pstring)-1); StrnCpy(invalid, lp_invalid_users(snum), sizeof(pstring)-1); - pstring_sub(valid,"%S",lp_servicename(snum)); - pstring_sub(invalid,"%S",lp_servicename(snum)); + pstring_sub(valid,"%S",lp_servicename(snum), True); + pstring_sub(invalid,"%S",lp_servicename(snum), True); ret = !user_in_list(user,invalid); @@ -579,7 +579,7 @@ if (ret && lp_onlyuser(snum)) { char *user_list = lp_username(snum); - pstring_sub(user_list,"%S",lp_servicename(snum)); + pstring_sub(user_list,"%S",lp_servicename(snum), True); ret = user_in_list(user,user_list); } @@ -773,7 +773,7 @@ pstring user_list; StrnCpy(user_list,lp_username(snum),sizeof(pstring)); - pstring_sub(user_list,"%S",lp_servicename(snum)); + pstring_sub(user_list,"%S",lp_servicename(snum), True); for (auser=strtok(user_list,LIST_SEP); auser && !ok; diff -Nru samba-2.0.10-ja-1.0/source/smbd/reply.c samba-2.0.10-ja-1.1alpha1/source/smbd/reply.c --- samba-2.0.10-ja-1.0/source/smbd/reply.c Sat Jul 7 15:55:57 2001 +++ samba-2.0.10-ja-1.1alpha1/source/smbd/reply.c Tue Jul 17 01:56:38 2001 @@ -498,11 +498,11 @@ static int smb_create_user(char *unix_user) { - pstring s, add_script; + pstring add_script; int ret; pstrcpy(add_script, lp_adduser_script()); - pstring_sub(add_script, "%u", dos_to_unix(s, unix_user)); + pstring_sub(add_script, "%u", unix_user, True); ret = smbrun(add_script,NULL,False); DEBUG(3,("smb_create_user: Running the command `%s' gave %d\n",add_script,ret)); return ret; @@ -514,11 +514,11 @@ static int smb_delete_user(char *unix_user) { - pstring s, del_script; + pstring del_script; int ret; pstrcpy(del_script, lp_deluser_script()); - pstring_sub(del_script, "%u", dos_to_unix(s, unix_user)); + pstring_sub(del_script, "%u", unix_user, True); ret = smbrun(del_script,NULL,False); DEBUG(3,("smb_delete_user: Running the command `%s' gave %d\n",del_script,ret)); return ret; diff -Nru samba-2.0.10-ja-1.0/source/smbd/service.c samba-2.0.10-ja-1.1alpha1/source/smbd/service.c --- samba-2.0.10-ja-1.0/source/smbd/service.c Sat Jul 7 15:55:57 2001 +++ samba-2.0.10-ja-1.1alpha1/source/smbd/service.c Tue Jul 17 01:56:38 2001 @@ -302,13 +302,13 @@ { pstring list; StrnCpy(list,lp_readlist(snum),sizeof(pstring)-1); - pstring_sub(list,"%S",service); + pstring_sub(list,"%S",service, True); if (user_in_list(user,list)) conn->read_only = True; StrnCpy(list,lp_writelist(snum),sizeof(pstring)-1); - pstring_sub(list,"%S",service); + pstring_sub(list,"%S",service, True); if (user_in_list(user,list)) conn->read_only = False; @@ -361,7 +361,7 @@ pstrcpy(fuser,lp_force_user(snum)); /* Allow %S to be used by force user. */ - pstring_sub(fuser,"%S",service); + pstring_sub(fuser,"%S",service, True); pass2 = (struct passwd *)Get_Pwnam(fuser,True); if (pass2) { @@ -397,7 +397,7 @@ StrnCpy(gname,tmp_gname,sizeof(pstring)-1); } /* default service may be a group name */ - pstring_sub(gname,"%S",service); + pstring_sub(gname,"%S",service, True); gptr = (struct group *)getgrnam(gname); if (gptr) { diff -Nru samba-2.0.10-ja-1.0/source/smbd/trans2.c samba-2.0.10-ja-1.1alpha1/source/smbd/trans2.c --- samba-2.0.10-ja-1.0/source/smbd/trans2.c Sat Jul 7 15:55:57 2001 +++ samba-2.0.10-ja-1.1alpha1/source/smbd/trans2.c Tue Jul 17 03:11:52 2001 @@ -585,7 +585,7 @@ #if defined(KANJI_WIN95_COMPATIBILITY) else if(lp_client_code_page() == KANJI_CODEPAGE) { for (i = 0; fname[i]; i++) { - if (is_shift_jis(fname[i])) { + if (is_shift_jis_str(&(fname[i]))) { if (is_sj_ru_lower(fname[i], fname[i+1])) { break; } @@ -595,7 +595,7 @@ if (fname[i]) { pstrcpy(p+2,fname); for (; (p+2)[i]; i++) { - if (is_shift_jis((p+2)[i])) { + if (is_shift_jis_str(&((p+2)[i]))) { if (is_sj_ru_lower((p+2)[i], (p+2)[i+1])) { (p+2)[i+1] = sj_ru_toupper((p+2)[i+1]); } diff -Nru samba-2.0.10-ja-1.0/source/smbwrapper/smbw.c samba-2.0.10-ja-1.1alpha1/source/smbwrapper/smbw.c --- samba-2.0.10-ja-1.0/source/smbwrapper/smbw.c Fri May 4 04:11:44 2001 +++ samba-2.0.10-ja-1.1alpha1/source/smbwrapper/smbw.c Tue Jul 17 03:00:24 2001 @@ -285,6 +285,7 @@ strncpy(server, p, len); server[len] = 0; + unix_to_dos(server, server); p = p2; if (!p) { @@ -311,6 +312,7 @@ strncpy(share, p, len); share[len] = 0; + unix_to_dos(share, share); p = p2; if (!p) { @@ -318,7 +320,7 @@ goto ok; } - pstrcpy(path,p); + unix_to_dos(path,p); all_string_sub(path, "/", "\\", 0); @@ -406,19 +408,30 @@ pstring ipenv; struct in_addr ip; extern struct in_addr ipzero; + pstring envuser, envpass; ip = ipzero; ZERO_STRUCT(c); + *envpass = '\0'; username = smbw_getshared("USER"); - if (!username) username = getenv("USER"); - if (!username) username = "guest"; + if (!username && getenv("USER")) { + unix_to_dos(envuser,getenv("USER")); + if ((p=strchr(envuser,'%'))) { + *p = 0; + pstrcpy(envpass,p+1); + memset(strchr(getenv("USER"),'%')+1,'X',strlen(envpass)); + } + strupper(envuser); + username = envuser; + } + if (!username) username = "GUEST"; workgroup = smbw_getshared("WORKGROUP"); if (!workgroup) workgroup = lp_workgroup(); password = smbw_getshared("PASSWORD"); - if (!password) password = ""; + if (!password) password = envpass; /* try to use an existing connection */ for (srv=smbw_srvs;srv;srv=srv->next) { diff -Nru samba-2.0.10-ja-1.0/source/smbwrapper/smbw_dir.c samba-2.0.10-ja-1.1alpha1/source/smbwrapper/smbw_dir.c --- samba-2.0.10-ja-1.0/source/smbwrapper/smbw_dir.c Fri May 4 04:11:44 2001 +++ samba-2.0.10-ja-1.1alpha1/source/smbwrapper/smbw_dir.c Tue Jul 17 03:00:24 2001 @@ -334,7 +334,7 @@ dirp->d_off = (dir->offset+1)*DIRP_SIZE; #endif dirp->d_reclen = DIRP_SIZE; - fstrcpy(&dirp->d_name[0], dir->list[dir->offset].name); + dos_to_unix(&dirp->d_name[0], dir->list[dir->offset].name); dirp->d_ino = smbw_inode(dir->list[dir->offset].name); dir->offset++; count -= dirp->d_reclen; diff -Nru samba-2.0.10-ja-1.0/source/utils/masktest.c samba-2.0.10-ja-1.1alpha1/source/utils/masktest.c --- samba-2.0.10-ja-1.0/source/utils/masktest.c Fri May 4 04:11:44 2001 +++ samba-2.0.10-ja-1.1alpha1/source/utils/masktest.c Tue Jul 17 03:00:26 2001 @@ -27,7 +27,7 @@ static fstring password; static fstring username; static fstring workgroup; -static int got_pass; +static BOOL got_pass; static BOOL showall = False; @@ -154,7 +154,7 @@ if (!got_pass) { char *pass = getpass("Password: "); if (pass) { - pstrcpy(password, pass); + unix_to_dos(password, pass); } } @@ -216,6 +216,8 @@ count++; + unix_to_dos(mask, mask); + unix_to_dos(file, file); fstrcpy(res1, "---"); fstrcpy(res2, "---"); @@ -372,8 +374,28 @@ TimeInit(); charset_initialise(); + pstrcpy(workgroup,lp_workgroup()); + if (getenv("USER")) { - pstrcpy(username,getenv("USER")); + unix_to_dos(username,getenv("USER")); + + if ((p=strchr(username,'%'))) { + *p = 0; + pstrcpy(password,p+1); + got_pass = True; + memset(strchr(getenv("USER"),'%')+1,'X',strlen(password)); + } + strupper(username); + } + + if (getenv("PASSWD")) { + unix_to_dos(password,getenv("PASSWD")); + got_pass = True; + } + + if (*username == 0 && getenv("LOGNAME")) { + unix_to_dos(username,getenv("LOGNAME")); + strupper(username); } seed = time(NULL); @@ -381,13 +403,15 @@ while ((opt = getopt(argc, argv, "U:s:hm:f:a")) != EOF) { switch (opt) { case 'U': - pstrcpy(username,optarg); + unix_to_dos(username,optarg); p = strchr(username,'%'); if (p) { *p = 0; pstrcpy(password, p+1); - got_pass = 1; + got_pass = True; + memset(strchr(optarg,'%')+1,'X',strlen(password)); } + strupper(username); break; case 's': seed = atoi(optarg); diff -Nru samba-2.0.10-ja-1.0/source/utils/rpctorture.c samba-2.0.10-ja-1.1alpha1/source/utils/rpctorture.c --- samba-2.0.10-ja-1.0/source/utils/rpctorture.c Sat Jul 7 15:56:00 2001 +++ samba-2.0.10-ja-1.1alpha1/source/utils/rpctorture.c Tue Jul 17 03:00:26 2001 @@ -397,7 +397,7 @@ case 'U': { char *lp; - pstrcpy(smb_cli->user_name,optarg); + unix_to_dos(smb_cli->user_name,optarg); if ((lp=strchr(smb_cli->user_name,'%'))) { *lp = 0; @@ -405,6 +405,7 @@ got_pass = True; memset(strchr(optarg,'%')+1,'X',strlen(password)); } + strupper(smb_cli->user_name); break; } diff -Nru samba-2.0.10-ja-1.0/source/utils/smbpasswd.c samba-2.0.10-ja-1.1alpha1/source/utils/smbpasswd.c --- samba-2.0.10-ja-1.0/source/utils/smbpasswd.c Fri May 4 04:11:44 2001 +++ samba-2.0.10-ja-1.1alpha1/source/utils/smbpasswd.c Tue Jul 17 03:00:26 2001 @@ -188,12 +188,15 @@ static char *get_pass( char *prompt, BOOL stdin_get) { char *p; + pstring pass; + if (stdin_get) { p = stdin_new_passwd(); } else { p = getpass(prompt); } - return xstrdup(p); + unix_to_dos(pass, p); + return xstrdup(pass); } /************************************************************* @@ -274,6 +277,7 @@ char *new_passwd = NULL; char *old_passwd = NULL; char *remote_machine = NULL; + pstring uname, pass; while ((ch = getopt(argc, argv, "ax:d:e:mnj:r:sR:D:U:")) != EOF) { switch(ch) { @@ -282,17 +286,17 @@ break; case 'x': local_flags |= LOCAL_DELETE_USER; - user_name = optarg; + user_name = unix_to_dos(uname, optarg); new_passwd = "XXXXXX"; break; case 'd': local_flags |= LOCAL_DISABLE_USER; - user_name = optarg; + user_name = unix_to_dos(uname, optarg); new_passwd = "XXXXXX"; break; case 'e': local_flags |= LOCAL_ENABLE_USER; - user_name = optarg; + user_name = unix_to_dos(uname, optarg); break; case 'm': local_flags |= LOCAL_TRUST_ACCOUNT; @@ -322,7 +326,7 @@ DEBUGLEVEL = atoi(optarg); break; case 'U': - user_name = optarg; + user_name = unix_to_dos(uname, optarg); break; default: usage(); @@ -354,18 +358,18 @@ case 0: break; case 1: - user_name = argv[0]; + user_name = unix_to_dos(uname, argv[0]); break; case 2: - user_name = argv[0]; - new_passwd = argv[1]; + user_name = unix_to_dos(uname, argv[0]); + new_passwd = unix_to_dos(pass, argv[1]); break; default: usage(); } if (!user_name && (pwd = sys_getpwuid(0))) { - user_name = xstrdup(pwd->pw_name); + user_name = unix_to_dos(uname, pwd->pw_name); } if (!user_name) { @@ -461,6 +465,7 @@ char *remote_machine = NULL; char *user_name = NULL; char *new_passwd = NULL; + pstring uname, pass; while ((ch = getopt(argc, argv, "hD:r:sU:")) != EOF) { switch(ch) { @@ -477,7 +482,7 @@ stdin_passwd_get = True; break; case 'U': - user_name = optarg; + user_name = unix_to_dos(uname, optarg); break; default: usage(); @@ -492,13 +497,13 @@ } if (argc == 1) { - new_passwd = argv[0]; + new_passwd = unix_to_dos(pass, argv[0]); } if (!user_name) { pwd = sys_getpwuid(getuid()); if (pwd) { - user_name = xstrdup(pwd->pw_name); + user_name = unix_to_dos(uname, pwd->pw_name); } else { fprintf(stderr,"you don't exist - go away\n"); exit(1); diff -Nru samba-2.0.10-ja-1.0/source/utils/torture.c samba-2.0.10-ja-1.1alpha1/source/utils/torture.c --- samba-2.0.10-ja-1.0/source/utils/torture.c Fri May 4 04:11:44 2001 +++ samba-2.0.10-ja-1.1alpha1/source/utils/torture.c Tue Jul 17 03:45:33 2001 @@ -89,6 +89,7 @@ struct nmb_name called, calling; struct in_addr ip; extern struct in_addr ipzero; + pstring uhost; ZERO_STRUCTP(c); @@ -97,21 +98,22 @@ ip = ipzero; + dos_to_unix(uhost, host); if (!cli_initialise(c) || !cli_connect(c, host, &ip)) { - printf("Failed to connect with %s\n", host); + printf("Failed to connect with %s\n", uhost); return False; } c->timeout = 120000; /* set a really long timeout (2 minutes) */ if (!cli_session_request(c, &calling, &called)) { - printf("%s rejected the session\n",host); + printf("%s rejected the session\n", uhost); cli_shutdown(c); return False; } if (!cli_negprot(c)) { - printf("%s rejected the negprot (%s)\n",host, cli_errstr(c)); + printf("%s rejected the negprot (%s)\n", uhost, cli_errstr(c)); cli_shutdown(c); return False; } @@ -120,14 +122,14 @@ password, strlen(password), password, strlen(password), workgroup)) { - printf("%s rejected the sessionsetup (%s)\n", host, cli_errstr(c)); + printf("%s rejected the sessionsetup (%s)\n", uhost, cli_errstr(c)); cli_shutdown(c); return False; } if (!cli_send_tconX(c, share, "?????", password, strlen(password)+1)) { - printf("%s refused tree connect (%s)\n", host, cli_errstr(c)); + printf("%s refused tree connect (%s)\n", uhost, cli_errstr(c)); cli_shutdown(c); return False; } @@ -303,6 +305,7 @@ /* printf("[%d] %s\n", line_count, line); */ + unix_to_dos(line, line); all_string_sub(line,"CLIENT1", cname, sizeof(line)); for (i=0;i<20;i++) params[i] = ""; @@ -1238,7 +1241,12 @@ static void browse_callback(const char *sname, uint32 stype, const char *comment) { - printf("\t%20.20s %08x %s\n", sname, stype, comment); + pstring uname; + pstring ucomment; + + dos_to_unix(uname, strncpy_fill(uname, sname, 20)); + dos_to_unix(ucomment, comment); + printf("\t%s %08x %s\n", uname, stype, ucomment); } @@ -1709,6 +1717,7 @@ extern int optind; extern FILE *dbf; static pstring servicesf = CONFIGFILE; + pstring s; dbf = stdout; @@ -1731,7 +1740,7 @@ usage(); } - fstrcpy(host, &argv[1][2]); + unix_to_dos(host, &argv[1][2]); p = strchr(&host[2],'/'); if (!p) { usage(); @@ -1742,7 +1751,8 @@ get_myname(myname); if (*username == 0 && getenv("LOGNAME")) { - pstrcpy(username,getenv("LOGNAME")); + unix_to_dos(username,getenv("LOGNAME")); + strupper(username); } argc--; @@ -1754,7 +1764,7 @@ while ((opt = getopt(argc, argv, "hW:U:n:N:O:o:m:")) != EOF) { switch (opt) { case 'W': - fstrcpy(workgroup,optarg); + unix_to_dos(workgroup,optarg); break; case 'm': max_protocol = interpret_protocol(optarg, max_protocol); @@ -1769,16 +1779,17 @@ sockops = optarg; break; case 'n': - fstrcpy(myname, optarg); + unix_to_dos(myname, optarg); break; case 'U': - pstrcpy(username,optarg); + unix_to_dos(username,optarg); p = strchr(username,'%'); if (p) { *p = 0; pstrcpy(password, p+1); gotpass = 1; } + strupper(username); break; default: printf("Unknown option %c (%d)\n", (char)opt, opt); @@ -1790,13 +1801,15 @@ while (!gotpass) { p = getpass("Password:"); if (p) { - pstrcpy(password, p); + unix_to_dos(password, p); gotpass = 1; } } - printf("host=%s share=%s user=%s myname=%s\n", - host, share, username, myname); + printf("host=%s ", dos_to_unix(s, host)); + printf("share=%s ", dos_to_unix(s, share)); + printf("user=%s ", dos_to_unix(s, username)); + printf("myname=%s\n", dos_to_unix(s, myname)); if (argc == 1) { run_test("ALL"); diff -Nru samba-2.0.10-ja-1.0/source/web/cgi.c samba-2.0.10-ja-1.1alpha1/source/web/cgi.c --- samba-2.0.10-ja-1.0/source/web/cgi.c Fri May 4 04:11:44 2001 +++ samba-2.0.10-ja-1.1alpha1/source/web/cgi.c Tue Jul 17 01:56:41 2001 @@ -583,7 +583,7 @@ *p = 0; } - string_sub(url, "/swat/", "", 0); + string_sub(url, "/swat/", "", 0, False); if (url[0] != '/' && strstr(url,"..")==0 && file_exist(url, NULL)) { cgi_download(url); diff -Nru samba-2.0.10-ja-1.0/swat/ja/help/welcome.html samba-2.0.10-ja-1.1alpha1/swat/ja/help/welcome.html --- samba-2.0.10-ja-1.0/swat/ja/help/welcome.html Fri May 4 04:11:44 2001 +++ samba-2.0.10-ja-1.1alpha1/swat/ja/help/welcome.html Tue Jul 17 01:13:18 2001 @@ -6,15 +6,14 @@