irungoldstein
Goto Top

Kryptische Dateinamen bei Zugriff über SMB

Hallo Leute,

eventuell übersehe ich ja etwas.

Habe auf einem Pi3 einen cups-pdf Netzwerk Drucker installiert.

Zugriff und "ausdruck" der PDF ins Verzeichnis

/home/osmc/PDF

erfolgreich egal ob annonymous oder angemeldeter User zum Drucker.

Der Drucker legt alle Dateien als job-(zahl)-filename ab.

Um eine ordentliche Verarbeitung für mich zu gewährleisten habe ich einen posthook script in cups conf angegelt:

#PDFVer 1.4

### Key: PostProcessing
##  postprocessing script that will be called after the creation of the PDF
##  as arguments the filename of the PDF, the username as determined by
##  CUPS-PDF and the one as given to CUPS-PDF will be passed
##  the script will be called with user privileges
##  set this to an empty value to use no postprocessing
### Default: <empty>

PostProcessing /usr/local/bin/cups-pdf-renamer

In dem PostProcessing script steht folgendes:

#!/bin/bash
FILENAME=`basename $1`
DATE=`date +"%Y-%m-%d_%H:%M:%S"`  
mv $1 /home/osmc/PDF/$DATE.pdf

Im zielordner landet auch sauber die umbenannten Dateien.

$ ls /PDF
2018-05-20_12:24:53.pdf
2018-05-20_12:39:36.pdf
2018-05-20_13:30:38.pdf
2018-05-20_13:34:03.pdf
2018-05-20_13:38:40.pdf
2018-05-20_13:43:37.pdf
2018-05-20_13:51:38.pdf
2018-05-20_14:04:26.pdf
2018-05-20_14:10:11.pdf
2018-05-20_14:13:28.pdf
2018-05-20_14:20:27.pdf
2018-05-20_14:42:17.pdf
2018-05-20_15:44:29.pdf
2018-05-21_15:29:48.pdf
2018-05-21_15:35:07.pdf
2018-05-22_09:40:59.pdf
2018-05-22_09:45:04.pdf
2018-05-22_10:39:08.pdf

$ ls -la
drwx------  3 osmc osmc    4096 Mai 22 12:33 .
drwxr-xr-x 15 osmc osmc    4096 Mai 20 13:38 ..
-rw-rw-rw-  1 osmc osmc   56846 Mai 20 12:24 2018-05-20_12:24:53.pdf
-rw-rw-rw-  1 osmc osmc  983799 Mai 20 12:39 2018-05-20_12:39:36.pdf
-rw-rw-rw-  1 osmc osmc    9718 Mai 20 13:30 2018-05-20_13:30:38.pdf
-rw-rw-rw-  1 osmc osmc   91447 Mai 20 13:34 2018-05-20_13:34:03.pdf
-rw-rw-rw-  1 osmc osmc   91447 Mai 20 13:38 2018-05-20_13:38:40.pdf
-rw-rw-rw-  1 osmc osmc 2411681 Mai 20 13:43 2018-05-20_13:43:37.pdf
-rw-rw-rw-  1 osmc osmc   34847 Mai 20 13:51 2018-05-20_13:51:38.pdf
-rw-rw-rw-  1 osmc osmc  407820 Mai 20 14:04 2018-05-20_14:04:26.pdf
-rw-rw-rw-  1 osmc osmc  692656 Mai 20 14:10 2018-05-20_14:10:11.pdf
-rw-rw-rw-  1 osmc osmc  364227 Mai 20 14:13 2018-05-20_14:13:28.pdf
-rw-rw-rw-  1 osmc osmc   84288 Mai 20 14:20 2018-05-20_14:20:27.pdf
-rw-rw-rw-  1 osmc osmc 2158203 Mai 20 14:42 2018-05-20_14:42:17.pdf
-rw-rw-rw-  1 osmc osmc  695018 Mai 20 15:44 2018-05-20_15:44:29.pdf
-rw-rw-rw-  1 osmc osmc  901463 Mai 21 15:29 2018-05-21_15:29:48.pdf
-rw-------  1 osmc osmc  131816 Mai 21 15:35 2018-05-21_15:35:07.pdf
-rw-rw-rw-  1 osmc osmc   84333 Mai 20 12:29 2018-05-22_09:40:59.pdf
-rw-rw-rw-  1 osmc osmc   84336 Mai 20 12:35 2018-05-22_09:45:04.pdf
-rw-rw-rw-  1 osmc osmc 3599501 Mai 22 10:39 2018-05-22_10:39:08.pdf

Greife ich aber nun per SMB auf das Verzeichnis zu sehe ich ganz andere Dateinamen als auf der SSH Verbindung.

screenshot_20180522-123127

smb.conf:

[global]

# If you require a fully custom smb.conf create smb-local.conf instead of editing smb.conf so your
# configuration will not be overwritten by samba upgrades. You can use smb.conf as a template by
# copying it to smb-local.conf then removing the config file line below in the new file. If you only
# need to add some additional shares see smb-shares.conf below for a simpler way to do this.

    config file = /etc/samba/smb-local.conf

    workgroup = WORKGROUP
    security=user
    follow symlinks = yes
    wide links = no
    unix extensions = no
    lock directory = /var/cache/samba
    load printers = no
    printing = bsd
    printcap name = /dev/null
    disable spoolss = yes
    log level = 1
    map to guest = bad user
#   usershare template share = automount template

# Automount template disabled to work around a samba bug causing crashes accessing external drives.

    read raw = Yes
    write raw = Yes
    strict locking = no
    min receivefile size = 16384
    use sendfile = true
    aio read size = 2048
    aio write size = 2048
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=131072

[osmc]
    browsable = yes
    read only = no
    valid users = osmc
    path = /home/osmc
    comment = OSMC Home Directory

[automount template]
    browseable = yes
    -valid = no
    valid users = osmc
    path = %P
    hide files = /$RECYCLE.BIN/System Volume Information/desktop.ini/thumbs.db/

# Add custom shares in smb-shares.conf instead of editing smb.conf so they will not be
# overwritten by samba updates. You can only add new shares to smb-shares.conf, not change
# the default shares or global options. If you need full control see smb-local.conf above.

include = /etc/samba/smb-shares.conf

Eventuell fällt jemandem ein an welcher stellschraube noch gedreht werden muss.


Grüße

Content-Key: 374661

Url: https://administrator.de/contentid/374661

Printed on: April 19, 2024 at 18:04 o'clock

Member: Pjordorf
Solution Pjordorf May 22, 2018 updated at 11:15:00 (UTC)
Goto Top
Hallo,

Zitat von @IrunGoldstein:
2018-05-20_12:24:53.pdf
-rw-rw-rw- 1 osmc osmc 56846 Mai 20 12:24 2018-05-20_12:24:53.pdf
Greife ich aber nun per SMB auf das Verzeichnis zu sehe ich ganz andere Dateinamen als auf der SSH Verbindung.
Und auch aus deinem Screenshot sind die Namen gleich, nur in der 8.3 Schreibweise. Anscheined kann dein Windows OS keine langen Dateinamen darstellen oder dein Samba kann keine face-smile Also nichts Kryptisches hier.

https://www.samba.org/samba/docs/using_samba/ch08.html
https://serverfault.com/questions/843458/samba-how-to-actually-disable-m ...

Gruß,
Peter
Member: AndreasHoster
Solution AndreasHoster May 22, 2018 at 11:22:35 (UTC)
Goto Top
Versuch mal einen solchen Namen im Windows Explorer einzugeben (z.B. beim Umbenennen einer Datei).
Dann wird Dir klar, warum Du die Namen so nicht siehst ...

Kleiner Tipp: Windows hat andere nicht erlaubten Zeichen für Dateinamen als Linux.
Member: IrunGoldstein
IrunGoldstein May 22, 2018 at 11:37:23 (UTC)
Goto Top
Danke für den hint ;)

Das war die stellschraube, aus Doppelpunkten Bindestriche gemacht und schon fluppt das wieder.

Ich muss mich wohl doch ab und an an ein Windows System setzten um solches im Hinterkopf zu behalten. face-smile

Danke & Grüße